gramods
|
Simple parser for consuming command line arguments. More...
#include <CommandLineParser.hh>
Public Member Functions | |
CommandLineParser (int &argc, char **&argv) | |
Creates a new command line parser reading off arguments from the specified command line variables. More... | |
std::string | getNextArgument () |
Returns the next argument and increments the argument pointer. More... | |
bool | hasMoreArguments () |
Returns true if there are more arguments to extract, false otherwise. More... | |
bool | consumeLast (int count) |
Removes the last arguments from the associnated command line variables. More... | |
Simple parser for consuming command line arguments.
For example, the command line "-abc file.xml --config file.xml" will be parsed as "-abc", "file.xml", "--config", "file.xml".
gramods::gmCore::CommandLineParser::CommandLineParser | ( | int & | argc, |
char **& | argv | ||
) |
Creates a new command line parser reading off arguments from the specified command line variables.
bool gramods::gmCore::CommandLineParser::consumeLast | ( | int | count | ) |
Removes the last arguments from the associnated command line variables.
std::string gramods::gmCore::CommandLineParser::getNextArgument | ( | ) |
Returns the next argument and increments the argument pointer.
Throws exception if there are no more arguments.
bool gramods::gmCore::CommandLineParser::hasMoreArguments | ( | ) |
Returns true if there are more arguments to extract, false otherwise.