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