Parse command line arguments.
More...
#include <CmdLineArgParser.h>
|
| CmdLineArgParser () |
|
void | set (const std::string &name, double defaultVal, const std::string &help) |
| Parse command line arguments.
|
|
void | set (const std::string &name, int defaultVal, const std::string &help) |
|
void | set (const std::string &name, const std::string &defaultVal, const std::string &help) |
|
void | set (const std::string &name, bool defaultVal, const std::string &help) |
|
bool | parse (int argc, char *argv[]) |
|
void | setPurpose (const std::string &purpose) |
|
void | print () const |
|
void | help () const |
|
void | addFootnote (const std::string ¬e) |
|
template<class T> |
T | get (const std::string &name) const |
|
template<> |
double | get (const std::string &name) const |
|
template<> |
int | get (const std::string &name) const |
|
template<> |
std::string | get (const std::string &name) const |
|
template<> |
bool | get (const std::string &name) const |
|
Parse command line arguments.
- Author
- Alexander Pletzer
This software is provided with the hope that it will be useful. It comes with no warranty whatsoever. Please send bug reports to alexa.nosp@m.nder.nosp@m.@gokl.nosp@m.iya..nosp@m.net.
Simple command line argument parser
◆ CmdLineArgParser()
CmdLineArgParser::CmdLineArgParser |
( |
| ) |
|
|
inline |
◆ addFootnote()
void CmdLineArgParser::addFootnote |
( |
const std::string & | note | ) |
|
|
inline |
Add, optional text to the help message
- Parameters
-
◆ get()
template<class T>
T CmdLineArgParser::get |
( |
const std::string & | name | ) |
const |
Get parameter value by name
- Parameters
-
- Returns
- value
◆ help()
void CmdLineArgParser::help |
( |
| ) |
const |
◆ parse()
bool CmdLineArgParser::parse |
( |
int | argc, |
|
|
char * | argv[] ) |
Parse command line arguments
- Parameters
-
argc | number of arguments |
argv | arguments |
- Returns
- true if all arguments were successfully parsed, false otherwise
◆ print()
void CmdLineArgParser::print |
( |
| ) |
const |
◆ set()
void CmdLineArgParser::set |
( |
const std::string & | name, |
|
|
double | defaultVal, |
|
|
const std::string & | help ) |
Parse command line arguments.
Set command line argument
- Parameters
-
name | |
defaultVal | default value |
help | help string |
- Author
- Alexander Pletzer
This software is provided with the hope that it will be useful. It comes with no warranty whatsoever. Please send bug reports to alexa.nosp@m.nder.nosp@m.@gokl.nosp@m.iya..nosp@m.net.
◆ setPurpose()
void CmdLineArgParser::setPurpose |
( |
const std::string & | purpose | ) |
|
|
inline |
Set purpose of executable
- Parameters
-
The documentation for this class was generated from the following files: