Base class used to parse an individual item. Most methods are implemented in the templated ArgParseConfig<T>
Definition at line 26 of file ArgParser.h.
Public Member Functions | |
ArgParseItem (bool firstPass) | |
virtual | ~ArgParseItem ()=default |
virtual std::string | flag_name () const =0 |
bool | is_present () const |
virtual bool | is_required () const =0 |
virtual bool | matches (const std::string &flag) const =0 |
virtual int | num_arguments () const =0 |
void | parse (const std::string &name, const std::vector< std::string > &arguments, bool firstPass, bool ignore_num_arguments=false) |
virtual void | parse_item (const std::vector< std::string > &arguments)=0 |
virtual std::string | printable (int description_column=-1, int *chars_before_desc=nullptr) const =0 |
Private Attributes | |
bool | fFirstPass |
bool | present_ |
#include <ArgParser.h>
|
inline |
Definition at line 28 of file ArgParser.h.
|
virtualdefault |
|
pure virtual |
Implemented in ArgParseConfig< T >, ArgParseConfig< std::vector< T > >, and ArgParseConfig< bool >.
|
inline |
Definition at line 35 of file ArgParser.h.
References present_.
|
pure virtual |
Implemented in ArgParseConfig< T >, ArgParseConfig< std::vector< T > >, and ArgParseConfig< bool >.
|
pure virtual |
Implemented in ArgParseConfig< T >, ArgParseConfig< std::vector< T > >, and ArgParseConfig< bool >.
|
pure virtual |
Implemented in ArgParseConfigT< bool >, and ArgParseConfigT< T >.
Referenced by ArgParser::handle_long_flag(), ArgParser::handle_short_flag(), parse(), and ArgParseConfig< bool >::printable().
|
inline |
Definition at line 38 of file ArgParser.h.
References fFirstPass, num_arguments(), parse_item(), and present_.
Referenced by ArgParser::handle_default_option(), ArgParser::handle_long_flag(), ArgParser::handle_short_flag(), and ArgParser::parse_file().
|
pure virtual |
Implemented in ArgParseConfigT< bool >, and ArgParseConfigT< T >.
Referenced by parse().
|
pure virtual |
Implemented in ArgParseConfig< T >, ArgParseConfig< std::vector< T > >, and ArgParseConfig< bool >.
Referenced by ArgParser::print().
|
private |
Definition at line 64 of file ArgParser.h.
Referenced by parse().
|
private |
Definition at line 63 of file ArgParser.h.
Referenced by is_present(), and parse().