HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pxr_CLI::CLI::ConfigBase Class Reference

This converter works with INI/TOML files; to write INI files use ConfigINI. More...

#include <CLI11.h>

+ Inheritance diagram for pxr_CLI::CLI::ConfigBase:

Public Member Functions

std::string to_config (const App *, bool default_also, bool write_description, std::string prefix) const override
 Convert an app into a configuration. More...
 
std::vector< ConfigItemfrom_config (std::istream &input) const override
 Convert a configuration into an app. More...
 
ConfigBasecomment (char cchar)
 Specify the configuration for comment characters. More...
 
ConfigBasearrayBounds (char aStart, char aEnd)
 Specify the start and end characters for an array. More...
 
ConfigBasearrayDelimiter (char aSep)
 Specify the delimiter character for an array. More...
 
ConfigBasevalueSeparator (char vSep)
 Specify the delimiter between a name and value. More...
 
ConfigBasequoteCharacter (char qString, char qChar)
 Specify the quote characters used around strings and characters. More...
 
ConfigBasemaxLayers (uint8_t layers)
 Specify the maximum number of parents. More...
 
ConfigBaseparentSeparator (char sep)
 Specify the separator to use for parent layers. More...
 
std::stringsectionRef ()
 get a reference to the configuration section More...
 
CLI11_NODISCARD const std::stringsection () const
 get the section More...
 
ConfigBasesection (const std::string &sectionName)
 specify a particular section of the configuration file to use More...
 
int16_t & indexRef ()
 get a reference to the configuration index More...
 
CLI11_NODISCARD int16_t index () const
 get the section index More...
 
ConfigBaseindex (int16_t sectionIndex)
 specify a particular index in the section to use (-1) for all sections to use More...
 
- Public Member Functions inherited from pxr_CLI::CLI::Config
virtual CLI11_NODISCARD std::string to_flag (const ConfigItem &item) const
 Get a flag value. More...
 
CLI11_NODISCARD std::vector
< ConfigItem
from_file (const std::string &name) const
 Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure. More...
 
virtual ~Config ()=default
 Virtual destructor. More...
 

Protected Attributes

char commentChar = '#'
 the character used for comments More...
 
char arrayStart = '['
 the character used to start an array '\0' is a default to not use More...
 
char arrayEnd = ']'
 the character used to end an array '\0' is a default to not use More...
 
char arraySeparator = ','
 the character used to separate elements in an array More...
 
char valueDelimiter = '='
 the character used separate the name from the value More...
 
char stringQuote = '"'
 the character to use around strings More...
 
char characterQuote = '\''
 the character to use around single characters More...
 
uint8_t maximumLayers {255}
 the maximum number of layers to allow More...
 
char parentSeparatorChar {'.'}
 the separator used to separator parent layers More...
 
int16_t configIndex {-1}
 Specify the configuration index to use for arrayed sections. More...
 
std::string configSection {}
 Specify the configuration section that should be used. More...
 
- Protected Attributes inherited from pxr_CLI::CLI::Config
std::vector< ConfigItemitems {}
 

Detailed Description

This converter works with INI/TOML files; to write INI files use ConfigINI.

Definition at line 2712 of file CLI11.h.

Member Function Documentation

ConfigBase* pxr_CLI::CLI::ConfigBase::arrayBounds ( char  aStart,
char  aEnd 
)
inline

Specify the start and end characters for an array.

Definition at line 2748 of file CLI11.h.

ConfigBase* pxr_CLI::CLI::ConfigBase::arrayDelimiter ( char  aSep)
inline

Specify the delimiter character for an array.

Definition at line 2754 of file CLI11.h.

ConfigBase* pxr_CLI::CLI::ConfigBase::comment ( char  cchar)
inline

Specify the configuration for comment characters.

Definition at line 2743 of file CLI11.h.

std::vector< ConfigItem > pxr_CLI::CLI::ConfigBase::from_config ( std::istream &  ) const
inlineoverridevirtual

Convert a configuration into an app.

Implements pxr_CLI::CLI::Config.

Definition at line 9156 of file CLI11.h.

CLI11_NODISCARD int16_t pxr_CLI::CLI::ConfigBase::index ( ) const
inline

get the section index

Definition at line 2792 of file CLI11.h.

ConfigBase* pxr_CLI::CLI::ConfigBase::index ( int16_t  sectionIndex)
inline

specify a particular index in the section to use (-1) for all sections to use

Definition at line 2794 of file CLI11.h.

int16_t& pxr_CLI::CLI::ConfigBase::indexRef ( )
inline

get a reference to the configuration index

Definition at line 2790 of file CLI11.h.

ConfigBase* pxr_CLI::CLI::ConfigBase::maxLayers ( uint8_t  layers)
inline

Specify the maximum number of parents.

Definition at line 2770 of file CLI11.h.

ConfigBase* pxr_CLI::CLI::ConfigBase::parentSeparator ( char  sep)
inline

Specify the separator to use for parent layers.

Definition at line 2775 of file CLI11.h.

ConfigBase* pxr_CLI::CLI::ConfigBase::quoteCharacter ( char  qString,
char  qChar 
)
inline

Specify the quote characters used around strings and characters.

Definition at line 2764 of file CLI11.h.

CLI11_NODISCARD const std::string& pxr_CLI::CLI::ConfigBase::section ( ) const
inline

get the section

Definition at line 2782 of file CLI11.h.

ConfigBase* pxr_CLI::CLI::ConfigBase::section ( const std::string sectionName)
inline

specify a particular section of the configuration file to use

Definition at line 2784 of file CLI11.h.

std::string& pxr_CLI::CLI::ConfigBase::sectionRef ( )
inline

get a reference to the configuration section

Definition at line 2780 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::ConfigBase::to_config ( const App ,
bool  ,
bool  ,
std::string   
) const
overridevirtual

Convert an app into a configuration.

Implements pxr_CLI::CLI::Config.

Definition at line 9289 of file CLI11.h.

ConfigBase* pxr_CLI::CLI::ConfigBase::valueSeparator ( char  vSep)
inline

Specify the delimiter between a name and value.

Definition at line 2759 of file CLI11.h.

Member Data Documentation

char pxr_CLI::CLI::ConfigBase::arrayEnd = ']'
protected

the character used to end an array '\0' is a default to not use

Definition at line 2719 of file CLI11.h.

char pxr_CLI::CLI::ConfigBase::arraySeparator = ','
protected

the character used to separate elements in an array

Definition at line 2721 of file CLI11.h.

char pxr_CLI::CLI::ConfigBase::arrayStart = '['
protected

the character used to start an array '\0' is a default to not use

Definition at line 2717 of file CLI11.h.

char pxr_CLI::CLI::ConfigBase::characterQuote = '\''
protected

the character to use around single characters

Definition at line 2727 of file CLI11.h.

char pxr_CLI::CLI::ConfigBase::commentChar = '#'
protected

the character used for comments

Definition at line 2715 of file CLI11.h.

int16_t pxr_CLI::CLI::ConfigBase::configIndex {-1}
protected

Specify the configuration index to use for arrayed sections.

Definition at line 2733 of file CLI11.h.

std::string pxr_CLI::CLI::ConfigBase::configSection {}
protected

Specify the configuration section that should be used.

Definition at line 2735 of file CLI11.h.

uint8_t pxr_CLI::CLI::ConfigBase::maximumLayers {255}
protected

the maximum number of layers to allow

Definition at line 2729 of file CLI11.h.

char pxr_CLI::CLI::ConfigBase::parentSeparatorChar {'.'}
protected

the separator used to separator parent layers

Definition at line 2731 of file CLI11.h.

char pxr_CLI::CLI::ConfigBase::stringQuote = '"'
protected

the character to use around strings

Definition at line 2725 of file CLI11.h.

char pxr_CLI::CLI::ConfigBase::valueDelimiter = '='
protected

the character used separate the name from the value

Definition at line 2723 of file CLI11.h.


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