A class to parse command line arguments.
More...
#include <clparser.h>
|
template<typename T > |
T | convert (const QString &value) |
| convert value to type More...
|
|
A class to parse command line arguments.
LangmuirCore::CommandLineParser::CommandLineParser |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
void LangmuirCore::CommandLineParser::add |
( |
QString |
flag, |
|
|
QString |
dest, |
|
|
QString |
help |
|
) |
| |
add a flag that has an argument
- Parameters
-
flag | command line flag |
dest | internal key |
help | help message |
void LangmuirCore::CommandLineParser::addBool |
( |
QString |
flag, |
|
|
QString |
dest, |
|
|
QString |
help |
|
) |
| |
add a flag that has no argument
- Parameters
-
flag | command line flag |
dest | internal key |
help | help message |
void LangmuirCore::CommandLineParser::addPositional |
( |
QString |
dest, |
|
|
QString |
help |
|
) |
| |
add an argument that has no flag
- Parameters
-
dest | internal key |
help | help message |
template<typename T >
T LangmuirCore::CommandLineParser::convert |
( |
const QString & |
value | ) |
|
|
protected |
convert value to type
- Parameters
-
template<typename T >
T LangmuirCore::CommandLineParser::get |
( |
const QString & |
dest, |
|
|
T |
default_value |
|
) |
| |
get value by key and convert to type
- Parameters
-
dest | internal key |
default_value | default value if key not present |
QString LangmuirCore::CommandLineParser::help |
( |
| ) |
|
void LangmuirCore::CommandLineParser::parse |
( |
QStringList & |
args | ) |
|
parse the command line arguments
- Parameters
-
args | arguments as a list of strings |
void LangmuirCore::CommandLineParser::setDescription |
( |
const QString & |
desc | ) |
|
set the program description
- Parameters
-
QStringList LangmuirCore::CommandLineParser::m_args |
|
protected |
list of remaining command line arguments
QString LangmuirCore::CommandLineParser::m_description |
|
protected |
QMap<QString,QString> LangmuirCore::CommandLineParser::m_flags |
|
protected |
QMap<QString,QString> LangmuirCore::CommandLineParser::m_helps |
|
protected |
QMap<QString,bool> LangmuirCore::CommandLineParser::m_isBool |
|
protected |
QMap<QString,int> LangmuirCore::CommandLineParser::m_isPositional |
|
protected |
unsigned int LangmuirCore::CommandLineParser::m_numArguments |
|
protected |
total number of arguments
unsigned int LangmuirCore::CommandLineParser::m_numPositional |
|
protected |
total number of positional arguments
QMap<QString,QString> LangmuirCore::CommandLineParser::m_values |
|
protected |
The documentation for this class was generated from the following file:
- /home/adam/opt/langmuir/src/langmuirCore/include/clparser.h