cli11
Loading...
Searching...
No Matches
cli::config_ini_t Class Referenceexport
module cli11

A configuration converter producing standard INI output. More...

Inheritance diagram for cli::config_ini_t:
cli::config_base_t cli::config_t

Public Member Functions

 config_ini_t ()
 Presets the punctuation for INI files.
Public Member Functions inherited from cli::config_base_t
auto to_config (const app_t *app, config_output_mode_t mode, bool write_description, std::string prefix) const -> std::string override
 Writes an application out as configuration text.
auto to_config (const app_t *app, bool default_also, bool write_description, std::string prefix) const -> std::string override
 Writes an application out as configuration text.
auto from_config (std::istream &input) const -> std::vector< config_item_t > override
 Reads configuration text into a list of entries.
auto comment (char cchar) -> config_base_t *
 Sets the character introducing a comment.
auto array_bounds (char a_start, char a_end) -> config_base_t *
 Sets the characters delimiting an array.
auto array_delimiter (char a_sep) -> config_base_t *
 Sets the character separating array elements.
auto value_separator (char v_sep) -> config_base_t *
 Sets the character separating a name from its value.
auto quote_character (char q_string, char literal_char) -> config_base_t *
 Sets the quote characters.
auto max_layers (std::uint8_t layers) -> config_base_t *
 Sets how many nested sections to descend into.
auto parent_separator (char sep) -> config_base_t *
 Sets the character separating nested section names.
auto comment_defaults (bool com_def=true) -> config_base_t *
 Sets whether default values are written out commented.
auto section_ref () -> std::string &
 Returns a mutable reference to the selected section name.
auto section () const -> const std::string &
 Returns the selected section name.
auto section (const std::string &section_name) -> config_base_t *
 Selects a particular section of the file.
auto index_ref () -> std::int16_t &
 Returns a mutable reference to the selected section index.
auto index () const -> std::int16_t
 Returns the selected section index.
auto index (std::int16_t section_index) -> config_base_t *
 Selects a particular index within an arrayed section.
auto allow_duplicate_fields (bool value=true) -> config_base_t *
 Sets whether non-sequential duplicate fields are merged.
Public Member Functions inherited from cli::config_t
 config_t (const config_t &)=default
 config_t (config_t &&)=default
auto operator= (const config_t &) -> config_t &=default
auto operator= (config_t &&) -> config_t &=default
virtual auto to_flag (const config_item_t &item) const -> std::string
 Reduces an entry to a single flag value.
auto from_file (const std::string &name) const -> std::vector< config_item_t >
 Reads a configuration file into a list of entries.

Additional Inherited Members

Protected Attributes inherited from cli::config_base_t
char comment_char_ {'#'}
 The character introducing a comment.
char array_start_ {'['}
 The character opening an array; '\0' disables arrays.
char array_end_ {']'}
 The character closing an array; '\0' disables arrays.
char array_separator_ {','}
 The character separating elements within an array.
char value_delimiter_ {'='}
 The character separating a name from its value.
char string_quote_ {'"'}
 The character quoting escaped strings.
char literal_quote_ {'\''}
 The character quoting literal strings and single characters.
std::uint8_t maximum_layers_ {255}
 The maximum number of nested sections to descend into.
char parent_separator_char_ {'.'}
 The character separating nested section names.
bool comment_defaults_bool_ {false}
 Whether default values are written out commented.
bool allow_multiple_duplicate_fields_ {false}
 Whether repeated field names collapse into a single vector.
std::int16_t config_index_ {-1}
 Which index of an arrayed section to use; -1 means all.
std::string config_section_ {}
 Which section of the file to use; empty means the whole file.
Protected Attributes inherited from cli::config_t
std::vector< config_item_titems {}
 Entries accumulated while reading.

Detailed Description

A configuration converter producing standard INI output.


The documentation for this class was generated from the following file: