cpp-hocon
0.3.0
|
A set of options related to parsing. More...
Public Member Functions | |
config_parse_options () | |
Gets an instance of config_parse_options with all fields set to the default values. More... | |
config_parse_options | set_syntax (config_syntax syntax) const |
Set the file format. More... | |
config_syntax const & | get_syntax () const |
Gets the current syntax option. More... | |
config_parse_options | set_origin_description (shared_string origin_description) const |
Set a description for the thing being parsed. More... | |
shared_string const & | get_origin_description () const |
Gets the current origin description, which may be null for "automatic". More... | |
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. More... | |
bool | get_allow_missing () const |
Gets the current "allow missing" flag. More... | |
config_parse_options | set_includer (shared_includer includer) const |
Set a config_includer which customizes how includes are handled. More... | |
config_parse_options | prepend_includer (shared_includer includer) const |
Prepends a config_includer which customizes how includes are handled. More... | |
config_parse_options | append_includer (shared_includer includer) const |
Appends a config_includer which customizes how includes are handled. More... | |
shared_includer const & | get_includer () const |
Gets the current includer (will be null for the default includer). More... | |
Static Public Member Functions | |
static config_parse_options | defaults () |
Gets an instance of config_parse_options with all fields set to the default values. More... | |
A set of options related to parsing.
This object is immutable, so the "setters" return a new object.
Here is an example of creating a custom
:
config_parse_options options = config_parse_options() .set_syntax(config_syntax.JSON) .set_allow_missing(false)
ClassLoader is Java-specific, so it was not ported to C++.
Definition at line 25 of file config_parse_options.hpp.
hocon::config_parse_options::config_parse_options | ( | ) |
Gets an instance of config_parse_options
with all fields set to the default values.
Start with this instance and make any changes you need.
config_parse_options hocon::config_parse_options::append_includer | ( | shared_includer | includer | ) | const |
Appends a config_includer which customizes how includes are handled.
To append, the library calls {} on the existing includer. includer the includer to append (may not be null) new version of the parse options with different includer
|
static |
Gets an instance of config_parse_options
with all fields set to the default values.
Start with this instance and make any changes you need.
bool hocon::config_parse_options::get_allow_missing | ( | ) | const |
Gets the current "allow missing" flag.
shared_includer const& hocon::config_parse_options::get_includer | ( | ) | const |
Gets the current includer (will be null for the default includer).
shared_string const& hocon::config_parse_options::get_origin_description | ( | ) | const |
Gets the current origin description, which may be null for "automatic".
config_syntax const& hocon::config_parse_options::get_syntax | ( | ) | const |
Gets the current syntax option.
config_parse_options hocon::config_parse_options::prepend_includer | ( | shared_includer | includer | ) | const |
Prepends a config_includer which customizes how includes are handled.
To prepend your includer, the library calls config_includer#with_fallback on your includer to append the existing includer to it.
includer | the includer to prepend (may not be null) |
config_parse_options hocon::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.
Set to true to just return an empty document in that case.
allow_missing | true to silently ignore missing item |
config_parse_options hocon::config_parse_options::set_includer | ( | shared_includer | includer | ) | const |
Set a config_includer which customizes how includes are handled.
null means to use the default includer.
includer | the includer to use or null for default |
config_parse_options hocon::config_parse_options::set_origin_description | ( | shared_string | origin_description | ) | const |
Set a description for the thing being parsed.
In most cases this will be set up for you to something like the filename, but if you provide just an input stream you might want to improve on it. Set to null to allow the library to come up with something automatically. This description is the basis for the config_origin of the parsed values.
origin_description | description to put in the config_origin |
config_parse_options hocon::config_parse_options::set_syntax | ( | config_syntax | syntax | ) | const |
Set the file format.
If set to null, try to guess from any available filename extension; if guessing fails, assume config_syntax#CONF.
syntax | a syntax or nullptr
|