#include <swcdb/core/config/PropertiesParser.h>
Classes | |
class | Options |
Public Member Functions | |
SWC_SHOULD_NOT_INLINE | Parser (bool unregistered=false) noexcept |
Parser (Parser &&)=delete | |
Parser (const Parser &)=delete | |
Parser & | operator= (Parser &&)=delete |
Parser & | operator= (const Parser &)=delete |
~Parser () noexcept | |
void | free () noexcept |
void | parse_filedata (std::ifstream &in) |
void | parse_cmdline (int argc, char *argv[]) |
void | parse_cmdline (const Strings &raw_strings) |
void | parse_line (const std::string &line) |
void | set_pos_parse (const std::string &name, const std::string &value) |
bool | parse_opt (const std::string &s) |
void | make_options () |
void | add_opt (const std::string &name, Property::Value::Ptr p, const Strings &raw_opt) |
void | own_options (Options &opts) |
const Options &SWC_CONST_FUNC | get_options () const noexcept |
void | print (std::ostream &os) const |
void | print_options (std::ostream &os) const |
Static Public Member Functions | |
static Strings | args_to_strings (int argc, char *argv[]) |
Public Attributes | |
ParserConfig | config |
Private Types | |
typedef std::pair< std::string, Strings > | Pair |
typedef std::map< std::string, Strings > | Map |
Private Attributes | |
Map | raw_opts |
bool | m_unregistered |
Options | m_opts |
Definition at line 168 of file PropertiesParser.h.
|
private |
Definition at line 231 of file PropertiesParser.h.
|
private |
Definition at line 230 of file PropertiesParser.h.
|
explicitnoexcept |
Definition at line 371 of file PropertiesParser.cc.
|
delete |
|
delete |
|
noexcept |
Definition at line 378 of file PropertiesParser.cc.
SWC_SHOULD_NOT_INLINE void SWC::Config::Parser::add_opt | ( | const std::string & | name, |
Property::Value::Ptr | p, | ||
const Strings & | raw_opt | ||
) |
Definition at line 566 of file PropertiesParser.cc.
References SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), m_opts, SWC::Config::Parser::Options::map, and SWC::Config::str().
Referenced by make_options().
|
static |
Definition at line 349 of file PropertiesParser.cc.
References SWC::Comm::Protocol::FsBroker::Handler::append(), and SWC::Core::Vector< T, SizeT, GROW_SZ >::resize().
Referenced by parse_cmdline().
|
noexcept |
Definition at line 380 of file PropertiesParser.cc.
References config, and SWC::Config::ParserConfig::free().
|
noexcept |
Definition at line 581 of file PropertiesParser.cc.
References m_opts.
Referenced by SWC::Config::Properties::load().
SWC_SHOULD_NOT_INLINE void SWC::Config::Parser::make_options | ( | ) |
Definition at line 549 of file PropertiesParser.cc.
References add_opt(), config, SWC::Config::ParserConfig::get_default(), SWC::Config::ParserConfig::has(), m_unregistered, SWC::Config::ParserConfig::options, and raw_opts.
Referenced by parse_cmdline(), and parse_filedata().
void SWC::Config::Parser::own_options | ( | Parser::Options & | opts | ) |
Definition at line 577 of file PropertiesParser.cc.
References m_opts.
Referenced by SWC::Config::Settings::parse_args().
SWC_SHOULD_NOT_INLINE void SWC::Config::Parser::parse_cmdline | ( | const Strings & | raw_strings | ) |
Definition at line 421 of file PropertiesParser.cc.
References config, SWC::Error::CONFIG_GET_ERROR, SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Config::ParserConfig::get_default(), SWC::Config::ParserConfig::has(), SWC::Config::Property::Value::is_zero_token(), m_unregistered, make_options(), parse_opt(), SWC::Config::ParserConfig::position_name(), set_pos_parse(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), and SWC_THROWF.
void SWC::Config::Parser::parse_cmdline | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 416 of file PropertiesParser.cc.
References args_to_strings().
Referenced by SWC::Config::Settings::parse_args().
SWC_SHOULD_NOT_INLINE void SWC::Config::Parser::parse_filedata | ( | std::ifstream & | in | ) |
Definition at line 385 of file PropertiesParser.cc.
References make_options(), parse_line(), and SWC::Condition::str_eq().
Referenced by SWC::Config::Properties::load().
SWC_SHOULD_NOT_INLINE void SWC::Config::Parser::parse_line | ( | const std::string & | line | ) |
Definition at line 486 of file PropertiesParser.cc.
References parse_opt().
Referenced by parse_filedata().
SWC_SHOULD_NOT_INLINE bool SWC::Config::Parser::parse_opt | ( | const std::string & | s | ) |
Definition at line 531 of file PropertiesParser.cc.
References config, SWC::Config::ParserConfig::has(), m_unregistered, and raw_opts.
Referenced by parse_cmdline(), and parse_line().
void SWC::Config::Parser::print | ( | std::ostream & | os | ) | const |
Definition at line 585 of file PropertiesParser.cc.
References SWC::format_list(), and raw_opts.
Referenced by SWC::Config::operator<<().
void SWC::Config::Parser::print_options | ( | std::ostream & | os | ) | const |
Definition at line 591 of file PropertiesParser.cc.
References m_opts, and SWC::Config::Parser::Options::map.
void SWC::Config::Parser::set_pos_parse | ( | const std::string & | name, |
const std::string & | value | ||
) |
Definition at line 526 of file PropertiesParser.cc.
References raw_opts.
Referenced by parse_cmdline().
ParserConfig SWC::Config::Parser::config |
Definition at line 171 of file PropertiesParser.h.
Referenced by free(), SWC::Config::Properties::load(), make_options(), SWC::Config::Settings::parse_args(), parse_cmdline(), and parse_opt().
|
private |
Definition at line 235 of file PropertiesParser.h.
Referenced by add_opt(), get_options(), own_options(), and print_options().
|
private |
Definition at line 234 of file PropertiesParser.h.
Referenced by make_options(), parse_cmdline(), and parse_opt().
|
private |
Definition at line 233 of file PropertiesParser.h.
Referenced by make_options(), parse_opt(), print(), and set_pos_parse().