cpp-hocon  0.3.0
simple_config_document.hpp
1 #pragma once
2 
3 #include <hocon/parser/config_document.hpp>
4 #include <internal/nodes/config_node_root.hpp>
5 #include <hocon/config_parse_options.hpp>
6 #include <memory>
7 
8 namespace hocon {
9 
11  public:
12  simple_config_document(std::shared_ptr<const config_node_root> root,
14 
15  std::unique_ptr<config_document> with_value_text(std::string path, std::string new_value) const override;
16  std::unique_ptr<config_document> with_value(std::string path,
17  std::shared_ptr<config_value> new_value) const override;
18  std::unique_ptr<config_document> without_path(std::string path) const override;
19 
20  bool has_path(std::string const& path) const override;
21 
22  std::string render() const override;
23 
24  private:
25  std::shared_ptr<const config_node_root> _config_node_tree;
26  config_parse_options _parse_options;
27  };
28 }
hocon::simple_config_document::with_value_text
std::unique_ptr< config_document > with_value_text(std::string path, std::string new_value) const override
Returns a new config_document that is a copy of the current config_document, but with the desired val...
hocon
Factory for creating config_document instances.
Definition: config.hpp:18
hocon::config_document
Represents an individual HOCON or JSON file, preserving all formatting and syntax details.
Definition: config_document.hpp:26
hocon::config_parse_options
A set of options related to parsing.
Definition: config_parse_options.hpp:25
hocon::path
Definition: path.hpp:13
hocon::simple_config_document::with_value
std::unique_ptr< config_document > with_value(std::string path, std::shared_ptr< config_value > new_value) const override
Returns a new config_document that is a copy of the current config_document, but with the desired val...
hocon::simple_config_document
Definition: simple_config_document.hpp:10
hocon::simple_config_document::has_path
bool has_path(std::string const &path) const override
Returns a boolean indicating whether or not a config_document has a value at the desired path.
hocon::simple_config_document::render
std::string render() const override
The original text of the input, modified if necessary with any replaced or added values.
hocon::simple_config_document::without_path
std::unique_ptr< config_document > without_path(std::string path) const override
Returns a new config_document that is a copy of the current config_document, but with all values at t...