#include <swcdb/core/config/PropertiesParser.h>
Classes | |
struct | ParserOpt |
Public Member Functions | |
SWC_SHOULD_NOT_INLINE | ParserConfig (bool own) noexcept |
ParserConfig (ParserConfig &&)=delete | |
ParserConfig (const ParserConfig &)=delete | |
ParserConfig & | operator= (ParserConfig &&)=delete |
ParserConfig & | operator= (const ParserConfig &)=delete |
~ParserConfig () noexcept | |
void | free () noexcept |
ParserConfig & | definition (const char *u) |
ParserConfig & | definition (std::string &&u) |
ParserConfig & | add (const ParserConfig &other_cfg) |
ParserConfig & | add (const char *names, Property::Value::Ptr vptr, const char *description) |
ParserConfig & | operator() (const char *name, Property::Value::Ptr vptr, const char *description) |
ParserConfig &SWC_CONST_FUNC | add_options () |
ParserConfig & | add_options (const char *name, Property::Value::Ptr vptr, const char *description) |
ParserConfig & | add (const char *name, const char *description) |
ParserConfig & | operator() (const char *name, const char *description) |
ParserConfig & | add_pos (const char *s, int pos) |
ParserConfig & | operator() (const char *s, int pos) |
std::string | position_name (int n) |
bool SWC_PURE_FUNC | has (const std::string &name) const noexcept |
bool | has (const std::string &name, std::string &alias_to) const noexcept |
Property::Value::Ptr | get_default (const std::string &name) |
void | remove (const std::string &name) |
void | print (std::ostream &os) const |
Public Attributes | |
std::string | usage |
Positions | positions |
Map | options |
bool | own |
Private Types | |
typedef std::map< std::string, ParserOpt > | Map |
typedef Core::Vector< std::pair< int, std::string > > | Positions |
Definition at line 64 of file PropertiesParser.h.
|
private |
Definition at line 99 of file PropertiesParser.h.
|
private |
Definition at line 100 of file PropertiesParser.h.
|
explicitnoexcept |
Definition at line 146 of file PropertiesParser.cc.
|
delete |
|
delete |
|
noexcept |
Definition at line 151 of file PropertiesParser.cc.
References free().
ParserConfig & SWC::Config::ParserConfig::add | ( | const char * | name, |
const char * | description | ||
) |
Definition at line 233 of file PropertiesParser.cc.
References add(), and SWC::Config::boo().
SWC_SHOULD_NOT_INLINE ParserConfig & SWC::Config::ParserConfig::add | ( | const char * | names, |
Property::Value::Ptr | vptr, | ||
const char * | description | ||
) |
Definition at line 189 of file PropertiesParser.cc.
References SWC::Config::ParserConfig::ParserOpt::aliases, SWC::Config::ParserConfig::ParserOpt::desc, SWC::Core::Vector< T, SizeT, GROW_SZ >::emplace_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Core::Vector< T, SizeT, GROW_SZ >::front(), options, SWC::Core::Vector< T, SizeT, GROW_SZ >::resize(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), and SWC::Config::ParserConfig::ParserOpt::value.
SWC_SHOULD_NOT_INLINE ParserConfig & SWC::Config::ParserConfig::add | ( | const ParserConfig & | other_cfg | ) |
Definition at line 175 of file PropertiesParser.cc.
References add_pos(), options, positions, and usage.
Referenced by add(), add_options(), SWC::Config::Properties::load(), operator()(), and SWC::Config::Settings::parse_args().
ParserConfig & SWC::Config::ParserConfig::add_options | ( | ) |
Definition at line 223 of file PropertiesParser.cc.
Referenced by SWC::Config::init_app_options(), SWC::Config::init_client_options(), SWC::Config::init_comm_options(), SWC::Config::init_fs_options(), and SWC::Config::Settings::init_options().
ParserConfig & SWC::Config::ParserConfig::add_options | ( | const char * | name, |
Property::Value::Ptr | vptr, | ||
const char * | description | ||
) |
Definition at line 227 of file PropertiesParser.cc.
References add().
ParserConfig & SWC::Config::ParserConfig::add_pos | ( | const char * | s, |
int | pos | ||
) |
Definition at line 243 of file PropertiesParser.cc.
References SWC::Core::Vector< T, SizeT, GROW_SZ >::emplace_back(), and positions.
Referenced by add(), and operator()().
ParserConfig & SWC::Config::ParserConfig::definition | ( | const char * | u | ) |
Definition at line 163 of file PropertiesParser.cc.
References usage.
Referenced by SWC::Config::init_app_options(), and SWC::Config::Settings::Settings().
ParserConfig & SWC::Config::ParserConfig::definition | ( | std::string && | u | ) |
Definition at line 168 of file PropertiesParser.cc.
References usage.
|
noexcept |
Definition at line 155 of file PropertiesParser.cc.
Referenced by SWC::Config::Parser::free(), and ~ParserConfig().
SWC_SHOULD_NOT_INLINE Property::Value::Ptr SWC::Config::ParserConfig::get_default | ( | const std::string & | name | ) |
Definition at line 290 of file PropertiesParser.cc.
References SWC::Error::CONFIG_GET_ERROR, options, SWC::Condition::str_eq(), and SWC_THROWF.
Referenced by SWC::Config::init_app_options(), SWC::Config::Parser::make_options(), and SWC::Config::Parser::parse_cmdline().
|
noexcept |
Definition at line 261 of file PropertiesParser.cc.
References SWC::Condition::str_eq().
Referenced by SWC::Config::Parser::make_options(), SWC::Config::Parser::parse_cmdline(), and SWC::Config::Parser::parse_opt().
|
noexcept |
Definition at line 274 of file PropertiesParser.cc.
References SWC::Condition::str_eq().
ParserConfig & SWC::Config::ParserConfig::operator() | ( | const char * | name, |
const char * | description | ||
) |
Definition at line 237 of file PropertiesParser.cc.
References add().
ParserConfig & SWC::Config::ParserConfig::operator() | ( | const char * | name, |
Property::Value::Ptr | vptr, | ||
const char * | description | ||
) |
Definition at line 217 of file PropertiesParser.cc.
References add().
ParserConfig & SWC::Config::ParserConfig::operator() | ( | const char * | s, |
int | pos | ||
) |
Definition at line 248 of file PropertiesParser.cc.
References add_pos().
|
delete |
|
delete |
std::string SWC::Config::ParserConfig::position_name | ( | int | n | ) |
Definition at line 252 of file PropertiesParser.cc.
References positions.
Referenced by SWC::Config::Parser::parse_cmdline().
void SWC::Config::ParserConfig::print | ( | std::ostream & | os | ) | const |
Definition at line 312 of file PropertiesParser.cc.
References SWC::format(), SWC::format_list(), options, and usage.
Referenced by SWC::Config::operator<<().
void SWC::Config::ParserConfig::remove | ( | const std::string & | name | ) |
Definition at line 303 of file PropertiesParser.cc.
Map SWC::Config::ParserConfig::options |
Definition at line 106 of file PropertiesParser.h.
Referenced by add(), free(), get_default(), SWC::Config::Parser::make_options(), print(), and remove().
bool SWC::Config::ParserConfig::own |
Definition at line 107 of file PropertiesParser.h.
Positions SWC::Config::ParserConfig::positions |
Definition at line 105 of file PropertiesParser.h.
Referenced by add(), add_pos(), and position_name().
std::string SWC::Config::ParserConfig::usage |
Definition at line 104 of file PropertiesParser.h.
Referenced by add(), definition(), and print().