cpp-hocon  0.3.0
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 
9 namespace hocon {
10 
12  public:
13  config_delayed_merge(shared_origin origin, std::vector<shared_value> stack);
14 
15  config_value::type value_type() const override;
16 
17  shared_value make_replacement(resolve_context const& context, int skipping) const override;
18 
19  // static method also used by config_delayed_merge_object; 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 
hocon::config_value::at_key
shared_config at_key(std::string const &key) const
Places the value inside a config at the given key.
hocon::config_value::origin
virtual shared_origin const & origin() const
The origin of the value (file, line number, etc.), for debugging and error messages.
hocon::config_value::type
type
The type of a configuration value (following the JSON type schema).
Definition: config_value.hpp:56
hocon::replaceable_merge_stack
Definition: replaceable_merge_stack.hpp:9
hocon
Factory for creating config_document instances.
Definition: config.hpp:18
hocon::resolve_context
Definition: resolve_context.hpp:16
hocon::config_value::render
virtual std::string render() const
Renders the config value as a HOCON string.
hocon::config_delayed_merge::replace_child
shared_value replace_child(shared_value const &child, shared_value replacement) const override
Replace a child of this value.
hocon::resolve_result< shared_value >
hocon::config_render_options
Definition: config_render_options.hpp:20
hocon::config_value
An immutable value, following the JSON type schema.
Definition: config_value.hpp:39
hocon::unmergeable
Interface that tags a config_value that is not mergeable until after substitutions are resolved.
Definition: unmergeable.hpp:14
hocon::config_delayed_merge::value_type
config_value::type value_type() const override
The type of the value; matches the JSON type schema.
hocon::resolve_source
Definition: resolve_source.hpp:15
hocon::config_delayed_merge::has_descendant
bool has_descendant(shared_value const &descendant) const override
Super-expensive full traversal to see if descendant is anywhere underneath this container.
hocon::config_delayed_merge
Definition: config_delayed_merge.hpp:11