winchecksec
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
argh::parser Class Reference

#include <argh.h>

Public Types

enum  Mode { PREFER_FLAG_FOR_UNREG_OPTION = 1 << 0 , PREFER_PARAM_FOR_UNREG_OPTION = 1 << 1 , NO_SPLIT_ON_EQUALSIGN = 1 << 2 , SINGLE_DASH_IS_MULTIFLAG = 1 << 3 }
 

Public Member Functions

 parser ()=default
 
 parser (std::initializer_list< char const *const > pre_reg_names)
 
 parser (const char *const argv[], int mode=PREFER_FLAG_FOR_UNREG_OPTION)
 
 parser (int argc, const char *const argv[], int mode=PREFER_FLAG_FOR_UNREG_OPTION)
 
void add_param (std::string const &name)
 
void add_params (std::initializer_list< char const *const > init_list)
 
void parse (const char *const argv[], int mode=PREFER_FLAG_FOR_UNREG_OPTION)
 
void parse (int argc, const char *const argv[], int mode=PREFER_FLAG_FOR_UNREG_OPTION)
 
std::multiset< std::string > const & flags () const
 
std::map< std::string, std::string > const & params () const
 
std::vector< std::string > const & pos_args () const
 
std::vector< std::string >::const_iterator begin () const
 
std::vector< std::string >::const_iterator end () const
 
size_t size () const
 
bool operator[] (std::string const &name) const
 
bool operator[] (std::initializer_list< char const *const > init_list) const
 
std::string const & operator[] (size_t ind) const
 
string_stream operator() (size_t ind) const
 
template<typename T >
string_stream operator() (size_t ind, T &&def_val) const
 
string_stream operator() (std::string const &name) const
 
string_stream operator() (std::initializer_list< char const *const > init_list) const
 
template<typename T >
string_stream operator() (std::string const &name, T &&def_val) const
 
template<typename T >
string_stream operator() (std::initializer_list< char const *const > init_list, T &&def_val) const
 

Member Enumeration Documentation

◆ Mode

Enumerator
PREFER_FLAG_FOR_UNREG_OPTION 
PREFER_PARAM_FOR_UNREG_OPTION 
NO_SPLIT_ON_EQUALSIGN 
SINGLE_DASH_IS_MULTIFLAG 

Constructor & Destructor Documentation

◆ parser() [1/4]

argh::parser::parser ( )
default

◆ parser() [2/4]

argh::parser::parser ( std::initializer_list< char const *const >  pre_reg_names)
inline

◆ parser() [3/4]

argh::parser::parser ( const char *const  argv[],
int  mode = PREFER_FLAG_FOR_UNREG_OPTION 
)
inline

◆ parser() [4/4]

argh::parser::parser ( int  argc,
const char *const  argv[],
int  mode = PREFER_FLAG_FOR_UNREG_OPTION 
)
inline

Member Function Documentation

◆ add_param()

void argh::parser::add_param ( std::string const &  name)
inline

◆ add_params()

void argh::parser::add_params ( std::initializer_list< char const *const >  init_list)
inline

◆ begin()

std::vector< std::string >::const_iterator argh::parser::begin ( ) const
inline

◆ end()

std::vector< std::string >::const_iterator argh::parser::end ( ) const
inline

◆ flags()

std::multiset< std::string > const & argh::parser::flags ( ) const
inline

◆ operator()() [1/6]

string_stream argh::parser::operator() ( size_t  ind) const
inline

◆ operator()() [2/6]

template<typename T >
string_stream argh::parser::operator() ( size_t  ind,
T &&  def_val 
) const

◆ operator()() [3/6]

string_stream argh::parser::operator() ( std::initializer_list< char const *const >  init_list) const
inline

◆ operator()() [4/6]

template<typename T >
string_stream argh::parser::operator() ( std::initializer_list< char const *const >  init_list,
T &&  def_val 
) const

◆ operator()() [5/6]

string_stream argh::parser::operator() ( std::string const &  name) const
inline

◆ operator()() [6/6]

template<typename T >
string_stream argh::parser::operator() ( std::string const &  name,
T &&  def_val 
) const

◆ operator[]() [1/3]

std::string const & argh::parser::operator[] ( size_t  ind) const
inline

◆ operator[]() [2/3]

bool argh::parser::operator[] ( std::initializer_list< char const *const >  init_list) const
inline

◆ operator[]() [3/3]

bool argh::parser::operator[] ( std::string const &  name) const
inline

◆ params()

std::map< std::string, std::string > const & argh::parser::params ( ) const
inline

◆ parse() [1/2]

void argh::parser::parse ( const char *const  argv[],
int  mode = PREFER_FLAG_FOR_UNREG_OPTION 
)
inline

◆ parse() [2/2]

void argh::parser::parse ( int  argc,
const char *const  argv[],
int  mode = PREFER_FLAG_FOR_UNREG_OPTION 
)
inline

◆ pos_args()

std::vector< std::string > const & argh::parser::pos_args ( ) const
inline

◆ size()

size_t argh::parser::size ( ) const
inline

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