cpp-hocon 0.3.0
Loading...
Searching...
No Matches
config_string.hpp
1#pragma once
2
3#include <hocon/config_value.hpp>
4#include <internal/config_util.hpp>
5
6namespace hocon {
7
8 enum class config_string_type { QUOTED, UNQUOTED };
9
10 class config_string : public config_value {
11 public:
12 config_string(shared_origin origin, std::string text, config_string_type quoted);
13
15 std::string transform_to_string() const override;
16
17 unwrapped_value unwrapped() const override;
18
19 bool was_quoted() const;
20 bool operator==(config_value const& other) const override;
21
22 protected:
23 shared_value new_copy(shared_origin) const override;
24
25 void render(std::string& s, int indent, bool at_root, config_render_options options) const override;
26
27 private:
28 std::string _text;
29 config_string_type _quoted;
30 };
31
32} // namespace hocon
config_value::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.
Factory for creating config_document instances.
Definition: config.hpp:18