Go to the documentation of this file.
35 #ifndef TTA_CMD_LINE_PARSER_HH
36 #define TTA_CMD_LINE_PARSER_HH
58 virtual void parse(
char* argv[],
int argc);
63 virtual std::string
argument(
int index)
const;
70 std::string option, std::string& name, std::string& arguments,
71 std::string& prefix,
bool& hasArgument)
const;
75 bool& longOption)
const;
76 bool isPrefix(std::string name)
const;
92 typedef std::map<std::string, CmdLineOptionParser*>::value_type
valType;
94 typedef std::map<std::string, CmdLineOptionParser*>::iterator
mapIter;
97 std::map<std::string, CmdLineOptionParser*>::const_iterator
constMapIter;
bool isPrefix(std::string name) const
virtual int numberOfArguments() const
virtual void storeOptions(Options &options)
static const int LONG_FLAG
Number of characters reserved for printing long version of commandline flag.
std::map< std::string, CmdLineOptionParser * >::const_iterator constMapIter
For traversing const maps.
std::vector< std::string > commandLine_
Command line is stored here.
std::map< std::string, CmdLineOptionParser * > optionLongNames_
Database for holding options with their long names as a key.
std::map< std::string, CmdLineOptionParser * >::value_type valType
For adding new values to maps.
bool parseOption(std::string option, std::string &name, std::string &arguments, std::string &prefix, bool &hasArgument) const
CmdLineParser & operator=(const CmdLineParser &)
Assignment not allowed.
void addOption(CmdLineOptionParser *opt)
std::map< std::string, CmdLineOptionParser * >::iterator mapIter
For traversing non-const maps.
std::vector< std::string > arguments_
Command line arguments are stored here.
bool readPrefix(std::string &option, std::string &prefix, bool &longOption) const
CmdLineParser(std::string description)
std::string description_
The description of usage of program.
std::string progName_
The name of the program.
static MachInfoCmdLineOptions options
std::map< std::string, CmdLineOptionParser * > optionShortNames_
Database for holding options with their short names as a key.
static const int SHORT_FLAG
Number of characters reserved for printing short version of commandline flag.
virtual void parse(char *argv[], int argc)
CmdLineOptionParser * findOption(std::string name) const
std::vector< std::string > prefixes_
Legal prefixes are stored here.
virtual std::string argument(int index) const