cpp-hocon 0.3.0
Loading...
Searching...
No Matches
config_parse_options.hpp
1#pragma once
2
3#include "types.hpp"
4#include "config_syntax.hpp"
5#include "export.h"
6
7namespace 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
A set of options related to parsing.
shared_string const & get_origin_description() const
Gets the current origin description, which may be null for "automatic".
shared_includer const & get_includer() const
Gets the current includer (will be null for the default includer).
config_parse_options set_origin_description(shared_string origin_description) const
Set a description for the thing being parsed.
config_parse_options()
Gets an instance of config_parse_options with all fields set to the default values.
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.
static config_parse_options defaults()
Gets an instance of ConfigParseOptions with all fields set to the default values.
config_syntax const & get_syntax() const
Gets the current syntax option.
config_parse_options append_includer(shared_includer includer) const
Appends a config_includer which customizes how includes are handled.
config_parse_options set_includer(shared_includer includer) const
Set a config_includer which customizes how includes are handled.
bool get_allow_missing() const
Gets the current "allow missing" flag.
config_parse_options prepend_includer(shared_includer includer) const
Prepends a config_includer which customizes how includes are handled.
config_parse_options set_syntax(config_syntax syntax) const
Set the file format.
Factory for creating config_document instances.
Definition: config.hpp:18