cpp-hocon 0.3.0
Loading...
Searching...
No Matches
config_reference.hpp
1#pragma once
2
3#include <hocon/config_value.hpp>
4#include <internal/unmergeable.hpp>
5
6namespace hocon {
7
8 class substitution_expression;
9
10 class config_reference : public config_value, public unmergeable {
11 public:
12 config_reference(shared_origin origin, std::shared_ptr<substitution_expression> expr, int prefix_length = 0);
13
19 type value_type() const override;
20 std::vector<shared_value> unmerged_values() const override;
21 resolve_status get_resolve_status() const override;
22 unwrapped_value unwrapped() const override;
23
24 std::shared_ptr<substitution_expression> expression() const;
25
26 bool operator==(config_value const& other) const override;
27
28 protected:
29 shared_value new_copy(shared_origin origin) const override;
30 resolve_result<shared_value> resolve_substitutions(resolve_context const& context, resolve_source const& source) const override;
31 bool ignores_fallbacks() const override { return false; }
32 void render(std::string& s, int indent, bool at_root, config_render_options options) const override;
33
34 private:
35 std::shared_ptr<substitution_expression> _expr;
36 int _prefix_length;
37 };
38}
type value_type() const override
The type of the value; matches the JSON type schema.
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).
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