cpp-hocon 0.3.0
Loading...
Searching...
No Matches
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
8namespace 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}
Represents an individual HOCON or JSON file, preserving all formatting and syntax details.
A set of options related to parsing.
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...
std::string render() const override
The original text of the input, modified if necessary with any replaced or added values.
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...
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.
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...
Factory for creating config_document instances.
Definition: config.hpp:18