cpp-hocon 0.3.0
Loading...
Searching...
No Matches
config_delayed_merge.hpp
1#include <hocon/config_value.hpp>
2#include <internal/config_util.hpp>
3#include <internal/unmergeable.hpp>
4#include <internal/replaceable_merge_stack.hpp>
5#include <vector>
6
7#pragma once
8
9namespace hocon {
10
12 public:
13 config_delayed_merge(shared_origin origin, std::vector<shared_value> stack);
14
16
17 shared_value make_replacement(resolve_context const& context, int skipping) const override;
18
19 // static method also used by ConfigDelayedMergeObject; end may be null
20 static shared_value make_replacement(resolve_context const& context,
21 std::vector<shared_value> stack,
22 int skipping);
23
24 std::vector<shared_value> unmerged_values() const override;
25
26 unwrapped_value unwrapped() const override;
27
28 resolve_result<shared_value> resolve_substitutions(resolve_context const& context, resolve_source const& source) const override;
29 static resolve_result<shared_value> resolve_substitutions(std::shared_ptr<const replaceable_merge_stack> replaceable, const std::vector<shared_value>& _stack, resolve_context const& context, resolve_source const& source);
30 resolve_status get_resolve_status() const override { return resolve_status::UNRESOLVED; }
31
32 bool operator==(config_value const& other) const override;
33
34 shared_value replace_child(shared_value const& child, shared_value replacement) const override;
35 bool has_descendant(shared_value const& descendant) const override;
36
37 static void render(std::vector<shared_value> const& stack, std::string& s, int indent_value, bool at_root, std::string const& at_key, config_render_options options);
38
39
40 protected:
41 shared_value new_copy(shared_origin) const override;
42
43 bool ignores_fallbacks() const override;
44
45 virtual void render(std::string& result, int indent, bool at_root, std::string const& at_key, config_render_options options) const override;
46 virtual void render(std::string& result, int indent, bool at_root, config_render_options options) const override;
47
48 private:
49 std::vector<shared_value> _stack;
50 };
51
52} // namespace hocon::config_delayed_merge
53
bool has_descendant(shared_value const &descendant) const override
Super-expensive full traversal to see if descendant is anywhere underneath this container.
config_value::type value_type() const override
The type of the value; matches the JSON type schema.
shared_value replace_child(shared_value const &child, shared_value replacement) const override
Replace a child of this value.
An immutable value, following the JSON type schema.
virtual shared_origin const & origin() const
The origin of the value (file, line number, etc.), for debugging and error messages.
type
The type of a configuration value (following the JSON type schema).
shared_config at_key(std::string const &key) const
Places the value inside a config at the given key.
virtual std::string render() const
Renders the config value as a HOCON string.
Interface that tags a ConfigValue that is not mergeable until after substitutions are resolved.
Definition: unmergeable.hpp:14
Factory for creating config_document instances.
Definition: config.hpp:18