cpp-hocon
0.3.0
|
Public Member Functions | |
config_render_options (bool origin_comments=true, bool comments=true, bool formatted=true, bool json=true) | |
Leaving the default arguments will result in a verbose rendering, which contains comments and therefore is not valid JSON. More... | |
config_render_options | set_comments (bool value) |
Returns options with comments toggled. More... | |
bool | get_comments () const |
Returns whether the options enable comments. More... | |
config_render_options | set_origin_comments (bool value) |
Returns options with origin comments toggled. More... | |
bool | get_origin_comments () const |
Returns whether the options enable automated origin comments. More... | |
config_render_options | set_formatted (bool value) |
Returns options with formatting toggled. More... | |
bool | get_formatted () const |
Returns whether the options enable formatting. More... | |
config_render_options | set_json (bool value) |
Returns options with JSON toggled. More... | |
bool | get_json () const |
Returns whether the options enable JSON. More... | |
Static Public Member Functions | |
static config_render_options | concise () |
Returns concise render options (no whitespace or comments). More... | |
A set of options related to rendering a config_value. Passed to config_value#render(config_render_options).
Here is an example of creating a
:
config_render_options options = config_render_options().set_comments(false)
Definition at line 20 of file config_render_options.hpp.
hocon::config_render_options::config_render_options | ( | bool | origin_comments = true , |
bool | comments = true , |
||
bool | formatted = true , |
||
bool | json = true |
||
) |
Leaving the default arguments will result in a verbose rendering, which contains comments and therefore is not valid JSON.
See config_render_options#concise for stripped-down options.
|
static |
Returns concise render options (no whitespace or comments).
For a resolved config, the concise rendering will be valid JSON.
bool hocon::config_render_options::get_comments | ( | ) | const |
Returns whether the options enable comments.
This method is mostly used by the config lib internally, not by applications.
bool hocon::config_render_options::get_formatted | ( | ) | const |
Returns whether the options enable formatting.
This method is mostly used by the config lib internally, not by applications.
bool hocon::config_render_options::get_json | ( | ) | const |
Returns whether the options enable JSON.
This method is mostly used by the config lib internally, not by applications.
bool hocon::config_render_options::get_origin_comments | ( | ) | const |
Returns whether the options enable automated origin comments.
This method is mostly used by the config lib internally, not by applications.
config_render_options hocon::config_render_options::set_comments | ( | bool | value | ) |
Returns options with comments toggled.
This controls human-written comments but not the autogenerated "origin of this setting" comments, which are controlled by config_render_options#set_origin_comments.
value | true to include comments in the render |
config_render_options hocon::config_render_options::set_formatted | ( | bool | value | ) |
Returns options with formatting toggled.
Formatting means indentation and whitespace, enabling formatting makes things prettier but larger.
value | true to enable formatting |
config_render_options hocon::config_render_options::set_json | ( | bool | value | ) |
Returns options with JSON toggled.
JSON means that HOCON extensions (omitting commas, quotes for example) won't be used. However, whether to use comments is controlled by the separate set_comments(boolean) and set_origin_comments(boolean) options. So if you enable comments you will get invalid JSON despite setting this to true.
value | true to include non-JSON extensions in the render |
config_render_options hocon::config_render_options::set_origin_comments | ( | bool | value | ) |
Returns options with origin comments toggled.
If this is enabled, the library generates comments for each setting based on the config_value#origin of that setting's value. For example these comments might tell you which file a setting comes from.
controls only these autogenerated "origin of this setting" comments, to toggle regular comments use config_render_options#set_comments.
value | true to include autogenerated setting-origin comments in the render |