#include <CmdLineOptionParser.hh>
Models an option that has an unsigned integer value.
Definition at line 147 of file CmdLineOptionParser.hh.
◆ UnsignedIntegerCmdLineOptionParser() [1/2]
UnsignedIntegerCmdLineOptionParser::UnsignedIntegerCmdLineOptionParser |
( |
std::string |
name, |
|
|
std::string |
desc, |
|
|
std::string |
alias = "" |
|
) |
| |
Constructor.
- Parameters
-
name | The name of the option. |
desc | The description of the option. |
alias | The short name of the option. |
Definition at line 269 of file CmdLineOptionParser.cc.
◆ ~UnsignedIntegerCmdLineOptionParser()
UnsignedIntegerCmdLineOptionParser::~UnsignedIntegerCmdLineOptionParser |
( |
| ) |
|
|
virtual |
◆ UnsignedIntegerCmdLineOptionParser() [2/2]
◆ copy()
OptionValue * UnsignedIntegerCmdLineOptionParser::copy |
( |
| ) |
const |
|
virtual |
◆ operator=()
◆ parseValue()
bool UnsignedIntegerCmdLineOptionParser::parseValue |
( |
std::string |
arguments, |
|
|
std::string |
prefix |
|
) |
| |
|
virtual |
Parses the unsigned integer option value.
- Parameters
-
arguments | The arguments of option. |
prefix | The prefix of option. |
- Returns
- True when parsing is ready.
- Exceptions
-
Implements CmdLineOptionParser.
Definition at line 297 of file CmdLineOptionParser.cc.
300 string msg =
"Illegal prefix for unsigned integer option";
301 string method =
"UnsignedIntegerCmdLineOptionParser::parseValue()";
305 if (arguments ==
"") {
306 string msg =
"Missing value for unsigned integer option.";
307 string method =
"UnsignedIntegerCmdLineOptionParser::parseValue()";
311 istringstream istream(arguments);
312 if((!(istream >>
value_)) || istream.peek() != EOF) {
313 string msg =
"Format of " +
longName() +
" option value was wrong: "
315 string method =
"unsignedIntegerCmdLineOptionParser::parseValue()";
References CmdLineOptionParser::longName(), CmdLineOptionParser::setDefined(), and value_.
◆ unsignedInteger()
unsigned UnsignedIntegerCmdLineOptionParser::unsignedInteger |
( |
int |
index = 0 | ) |
const |
|
virtual |
Returns the value of the unsigned integer option.
- Parameters
-
index | This must be zero for usigned integer option. |
- Returns
- The value of usigned integer option.
- Exceptions
-
Reimplemented from CmdLineOptionParser.
Definition at line 331 of file CmdLineOptionParser.cc.
References assert, and value_.
◆ value_
unsigned UnsignedIntegerCmdLineOptionParser::value_ |
|
private |
The documentation for this class was generated from the following files: