SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Config::Parser Class Referencefinal

#include <swcdb/core/config/PropertiesParser.h>

+ Collaboration diagram for SWC::Config::Parser:

Classes

class  Options
 

Public Member Functions

SWC_SHOULD_NOT_INLINE Parser (bool unregistered=false) noexcept
 
 Parser (Parser &&)=delete
 
 Parser (const Parser &)=delete
 
Parseroperator= (Parser &&)=delete
 
Parseroperator= (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, StringsPair
 
typedef std::map< std::string, StringsMap
 

Private Attributes

Map raw_opts
 
bool m_unregistered
 
Options m_opts
 

Detailed Description

Definition at line 168 of file PropertiesParser.h.

Member Typedef Documentation

◆ Map

typedef std::map<std::string, Strings> SWC::Config::Parser::Map
private

Definition at line 231 of file PropertiesParser.h.

◆ Pair

typedef std::pair<std::string, Strings> SWC::Config::Parser::Pair
private

Definition at line 230 of file PropertiesParser.h.

Constructor & Destructor Documentation

◆ Parser() [1/3]

SWC::Config::Parser::Parser ( bool  unregistered = false)
explicitnoexcept

Definition at line 371 of file PropertiesParser.cc.

◆ Parser() [2/3]

SWC::Config::Parser::Parser ( Parser &&  )
delete

◆ Parser() [3/3]

SWC::Config::Parser::Parser ( const Parser )
delete

◆ ~Parser()

SWC::Config::Parser::~Parser ( )
noexcept

Definition at line 378 of file PropertiesParser.cc.

Member Function Documentation

◆ add_opt()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ args_to_strings()

Strings SWC::Config::Parser::args_to_strings ( int  argc,
char *  argv[] 
)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ free()

void SWC::Config::Parser::free ( )
noexcept

Definition at line 380 of file PropertiesParser.cc.

References config, and SWC::Config::ParserConfig::free().

+ Here is the call graph for this function:

◆ get_options()

const Parser::Options & SWC::Config::Parser::get_options ( ) const
noexcept

Definition at line 581 of file PropertiesParser.cc.

References m_opts.

Referenced by SWC::Config::Properties::load().

+ Here is the caller graph for this function:

◆ make_options()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

Parser& SWC::Config::Parser::operator= ( const Parser )
delete

◆ operator=() [2/2]

Parser& SWC::Config::Parser::operator= ( Parser &&  )
delete

◆ own_options()

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().

+ Here is the caller graph for this function:

◆ parse_cmdline() [1/2]

SWC_SHOULD_NOT_INLINE void SWC::Config::Parser::parse_cmdline ( const Strings raw_strings)

◆ parse_cmdline() [2/2]

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_filedata()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_line()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_opt()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print()

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<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_options()

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.

◆ set_pos_parse()

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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ config

◆ m_opts

Options SWC::Config::Parser::m_opts
private

Definition at line 235 of file PropertiesParser.h.

Referenced by add_opt(), get_options(), own_options(), and print_options().

◆ m_unregistered

bool SWC::Config::Parser::m_unregistered
private

Definition at line 234 of file PropertiesParser.h.

Referenced by make_options(), parse_cmdline(), and parse_opt().

◆ raw_opts

Map SWC::Config::Parser::raw_opts
private

Definition at line 233 of file PropertiesParser.h.

Referenced by make_options(), parse_opt(), print(), and set_pos_parse().


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