Command line parameter.
More...
#include <cppassist/include/cppassist/cmdline/CommandLineParameter.h>
Command line parameter.
A command line parameter is a stand-alone value that is specified on the command line. For example, a filename at the end of the command line can be required as a parameter.
Example: myapp <input> [<output>]
◆ OptionalState
State whether or not a parameter is optional.
Enumerator |
---|
NonOptional | |
Optional | |
◆ CommandLineParameter()
cppassist::CommandLineParameter::CommandLineParameter |
( |
const std::string & |
name, |
|
|
OptionalState |
optional = Optional |
|
) |
| |
Constructor.
- Parameters
-
[in] | name | Parameter name (e.g., "filename") |
[in] | optional | Optional-state |
◆ ~CommandLineParameter()
cppassist::CommandLineParameter::~CommandLineParameter |
( |
| ) |
|
◆ name()
const std::string& cppassist::CommandLineParameter::name |
( |
| ) |
const |
Get parameter name.
- Returns
- Parameter name (e.g., "filename")
◆ setName()
void cppassist::CommandLineParameter::setName |
( |
const std::string & |
name | ) |
|
Set parameter name.
- Parameters
-
[in] | name | Parameter name (e.g., "filename") |
◆ isOptional()
bool cppassist::CommandLineParameter::isOptional |
( |
| ) |
const |
Check optional-flag.
- Returns
true
if optional, else false
◆ optional()
OptionalState cppassist::CommandLineParameter::optional |
( |
| ) |
const |
Check optional-flag.
- Returns
- Optional-state
◆ setOptional()
void cppassist::CommandLineParameter::setOptional |
( |
OptionalState |
optional | ) |
|
Set optional-flag.
- Parameters
-
[in] | optional | Optional-state |
◆ value()
const std::string& cppassist::CommandLineParameter::value |
( |
| ) |
const |
Get value.
- Returns
- Parameter value
◆ setValue()
void cppassist::CommandLineParameter::setValue |
( |
const std::string & |
value | ) |
|
◆ m_name
std::string cppassist::CommandLineParameter::m_name |
|
protected |
Parameter name (e.g., "filename")
◆ m_optional
◆ m_value
std::string cppassist::CommandLineParameter::m_value |
|
protected |
The documentation for this class was generated from the following file: