cpp-hocon  0.3.0
config_string.hpp
1 #pragma once
2 
3 #include <hocon/config_value.hpp>
4 #include <internal/config_util.hpp>
5 
6 namespace 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 
14  config_value::type value_type() const override;
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
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
Factory for creating config_document instances.
Definition: config.hpp:18
hocon::config_value::render
virtual std::string render() const
Renders the config value as a HOCON string.
hocon::config_string
Definition: config_string.hpp:10
hocon::config_render_options
Definition: config_render_options.hpp:20
hocon::config_string::value_type
config_value::type value_type() const override
The type of the value; matches the JSON type schema.
hocon::config_value
An immutable value, following the JSON type schema.
Definition: config_value.hpp:39