cpp-hocon 0.3.0
Loading...
Searching...
No Matches
config_document.hpp
1#pragma once
2
3#include <string>
4#include <memory>
5#include <hocon/config_value.hpp>
6#include "../export.h"
7
8namespace hocon {
26 class LIBCPP_HOCON_EXPORT config_document {
27 public:
46 virtual std::unique_ptr<config_document> with_value_text(std::string path, std::string newValue) const = 0;
47
60 virtual std::unique_ptr<config_document> with_value(std::string path,
61 std::shared_ptr<config_value> new_value) const = 0;
62
72 virtual std::unique_ptr<config_document> without_path(std::string path) const = 0;
73
80 virtual bool has_path(std::string const& path) const = 0;
81
87 virtual std::string render() const = 0;
88 };
89
93 bool operator==(config_document const& lhs, config_document const& rhs);
94
95} // namespace hocon
Represents an individual HOCON or JSON file, preserving all formatting and syntax details.
virtual std::unique_ptr< config_document > without_path(std::string path) const =0
Returns a new config_document that is a copy of the current config_document, but with all values at t...
virtual std::string render() const =0
The original text of the input, modified if necessary with any replaced or added values.
virtual bool has_path(std::string const &path) const =0
Returns a boolean indicating whether or not a config_document has a value at the desired path.
virtual std::unique_ptr< config_document > with_value_text(std::string path, std::string newValue) const =0
Returns a new config_document that is a copy of the current config_document, but with the desired val...
virtual std::unique_ptr< config_document > with_value(std::string path, std::shared_ptr< config_value > new_value) const =0
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
bool operator==(config_document const &lhs, config_document const &rhs)
Config documents compare via rendered strings.