20 #ifndef _ARGUMENTPARSER_H_
21 #define _ARGUMENTPARSER_H_
24 #include <boost/program_options.hpp>
52 void parse(
const std::vector< std::string >& args);
103 boost::program_options::options_description spec;
104 boost::program_options::variables_map opts;
A general purpose command-line argument parser.
Definition: ArgumentParser.h:34
void addOptionalFlag(const std::string &name, const std::string &description)
Specify a boolean flag that can be given on the command line.
std::string getUsage() const
Gets a string that describes the current set of options we expect.
void addOptionalFloatArgument(const std::string &name, const std::string &description, double defaultValue)
Specify a floating-point argument that can be given on the command line.
void addOptionalStringArgument(const std::string &name, const std::string &description, const std::string &defaultValue)
Specify a string argument that can be given on the command line.
void addOptionalIntArgument(const std::string &name, const std::string &description, int defaultValue)
Specify an integer argument that can be given on the command line.
double getFloatArgument(const std::string &name) const
Retrieves the value of a named floating-point argument.
std::string getStringArgument(const std::string &name) const
Retrieves the value of a named string argument.
int getIntArgument(const std::string &name) const
Retrieves the value of a named integer argument.
ArgumentParser(const std::string &title)
Construct an argument parser.
void parseArgs(int argc, const char **argv)
Parses a list of strings given in the C style. Throws std::exception if parsing fails.
bool receivedArgument(const std::string &name) const
Gets whether a named argument was parsed on the command-line arguments.
void parse(const std::vector< std::string > &args)
Parses a list of strings.