cpp-hocon  0.3.0
config_document.hpp
1 #pragma once
2 
3 #include <string>
4 #include <memory>
5 #include <hocon/config_value.hpp>
6 #include "../export.h"
7 
8 namespace 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
hocon::config_document::without_path
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...
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::operator==
bool operator==(config_document const &lhs, config_document const &rhs)
Config documents compare via rendered strings.
hocon::path
Definition: path.hpp:13
hocon::config_document::has_path
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.
hocon::config_document::render
virtual std::string render() const =0
The original text of the input, modified if necessary with any replaced or added values.
hocon::config_document::with_value_text
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...
hocon::config_document::with_value
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...