cpp-hocon  0.3.0
config_parse_options.hpp
1 #pragma once
2 
3 #include "types.hpp"
4 #include "config_syntax.hpp"
5 #include "export.h"
6 
7 namespace hocon {
25  class LIBCPP_HOCON_EXPORT config_parse_options {
26  public:
34 
42 
51  config_parse_options set_syntax(config_syntax syntax) const;
52 
56  config_syntax const& get_syntax() const;
57 
68  config_parse_options set_origin_description(shared_string origin_description) const;
69 
74  shared_string const& get_origin_description() const;
75 
84  config_parse_options set_allow_missing(bool allow_missing) const;
85 
90  bool get_allow_missing() const;
91 
99  config_parse_options set_includer(shared_includer includer) const;
100 
110  config_parse_options prepend_includer(shared_includer includer) const;
111 
120  config_parse_options append_includer(shared_includer includer) const;
121 
126  shared_includer const& get_includer() const;
127 
128  private:
129  config_parse_options(shared_string origin_desc,
130  bool allow_missing, shared_includer includer,
131  config_syntax syntax = config_syntax::UNSPECIFIED);
132  config_parse_options with_fallback_origin_description(shared_string origin_description) const;
133 
134  config_syntax _syntax;
135  shared_string _origin_description;
136  bool _allow_missing;
137  shared_includer _includer;
138  };
139 } // namespace hocon
hocon::config_parse_options::config_parse_options
config_parse_options()
Gets an instance of config_parse_options with all fields set to the default values.
hocon::config_parse_options::prepend_includer
config_parse_options prepend_includer(shared_includer includer) const
Prepends a config_includer which customizes how includes are handled.
hocon
Factory for creating config_document instances.
Definition: config.hpp:18
hocon::config_parse_options::set_allow_missing
config_parse_options set_allow_missing(bool allow_missing) const
Set to false to throw an exception if the item being parsed (for example a file) is missing.
hocon::config_parse_options::set_origin_description
config_parse_options set_origin_description(shared_string origin_description) const
Set a description for the thing being parsed.
hocon::config_parse_options::get_syntax
config_syntax const & get_syntax() const
Gets the current syntax option.
hocon::config_parse_options
A set of options related to parsing.
Definition: config_parse_options.hpp:25
hocon::config_parse_options::get_includer
shared_includer const & get_includer() const
Gets the current includer (will be null for the default includer).
hocon::config_parse_options::set_syntax
config_parse_options set_syntax(config_syntax syntax) const
Set the file format.
hocon::config_parse_options::get_origin_description
shared_string const & get_origin_description() const
Gets the current origin description, which may be null for "automatic".
hocon::config_parse_options::defaults
static config_parse_options defaults()
Gets an instance of config_parse_options with all fields set to the default values.
hocon::config_parse_options::append_includer
config_parse_options append_includer(shared_includer includer) const
Appends a config_includer which customizes how includes are handled.
hocon::config_parse_options::set_includer
config_parse_options set_includer(shared_includer includer) const
Set a config_includer which customizes how includes are handled.
hocon::config_parse_options::get_allow_missing
bool get_allow_missing() const
Gets the current "allow missing" flag.