STXXL  1.4.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
stxxl::cmdline_parser::argument Struct Referenceabstract

Detailed Description

base class of all options and parameters

Definition at line 49 of file cmdline.h.

+ Inheritance diagram for stxxl::cmdline_parser::argument:

Public Member Functions

 argument (char key, const std::string &longkey, const std::string &keytype, const std::string &desc, bool required)
 contructor filling most attributes More...
 
virtual ~argument ()
 empty virtual destructor More...
 
std::string option_text () const
 return '-s, –longkey [keytype]' More...
 
std::string param_text () const
 return 'longkey [keytype]' More...
 
virtual void print_value (std::ostream &os) const =0
 format value to ostream More...
 
virtual bool process (int &argc, const char *const *&argv)=0
 process one item from command line for this argument More...
 
virtual const char * type_name () const =0
 return formatted type name to user More...
 

Public Attributes

std::string m_desc
 longer description, which will be wrapped More...
 
bool m_found
 found during processing of command line More...
 
char m_key
 single letter short option, or 0 is none More...
 
std::string m_keytype
 option type description, e.g. "<#>" to indicate numbers More...
 
std::string m_longkey
 long option key or name for parameters More...
 
bool m_repeated
 repeated argument, i.e. std::vector<std::string> More...
 
bool m_required
 required, process() fails if the option/parameter is not found. More...
 

Constructor & Destructor Documentation

stxxl::cmdline_parser::argument::argument ( char  key,
const std::string &  longkey,
const std::string &  keytype,
const std::string &  desc,
bool  required 
)
inline

contructor filling most attributes

Definition at line 67 of file cmdline.h.

virtual stxxl::cmdline_parser::argument::~argument ( )
inlinevirtual

empty virtual destructor

Definition at line 74 of file cmdline.h.

Member Function Documentation

std::string stxxl::cmdline_parser::argument::option_text ( ) const
inline
std::string stxxl::cmdline_parser::argument::param_text ( ) const
inline
virtual bool stxxl::cmdline_parser::argument::process ( int &  argc,
const char *const *&  argv 
)
pure virtual

Member Data Documentation

std::string stxxl::cmdline_parser::argument::m_desc

longer description, which will be wrapped

Definition at line 58 of file cmdline.h.

Referenced by stxxl::cmdline_parser::print_usage().

bool stxxl::cmdline_parser::argument::m_found

found during processing of command line

Definition at line 62 of file cmdline.h.

char stxxl::cmdline_parser::argument::m_key

single letter short option, or 0 is none

Definition at line 52 of file cmdline.h.

std::string stxxl::cmdline_parser::argument::m_keytype

option type description, e.g. "<#>" to indicate numbers

Definition at line 56 of file cmdline.h.

std::string stxxl::cmdline_parser::argument::m_longkey

long option key or name for parameters

Definition at line 54 of file cmdline.h.

Referenced by stxxl::cmdline_parser::print_usage().

bool stxxl::cmdline_parser::argument::m_repeated

repeated argument, i.e. std::vector<std::string>

Definition at line 64 of file cmdline.h.

Referenced by stxxl::cmdline_parser::print_usage().

bool stxxl::cmdline_parser::argument::m_required

required, process() fails if the option/parameter is not found.

Definition at line 60 of file cmdline.h.

Referenced by stxxl::cmdline_parser::print_usage().


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