Deepsolver
|
The exception for command line parser errors. More...
Public Types | |
enum | { NoPrgName, MissedArgument } |
Public Member Functions | |
void | accept (ExceptionVisitor &visitor) const |
Calls appropriate visitor method. | |
CliParserException (int code) | |
The constructor with error code specification. | |
CliParserException (int code, const std::string ¶m) | |
The constructor with error code and string parameter specification. | |
int | getCode () const |
Returns the error code. | |
std::string | getMessage () const |
Returns a single line error description. | |
const std::string & | getParam () const |
Returns the string parameter. | |
std::string | getType () const |
Returns a string with short error type designation. | |
virtual | ~CliParserException () |
The destructor. |
The instances of this class are thrown by methods of the CliParser class during parsing the command line. Through the methods of this exception you can obtain various information about the problem and construct corresponding message to user.
Deepsolver::CliParserException::CliParserException | ( | int | code | ) | [inline] |
[in] | code | The error code |
Deepsolver::CliParserException::CliParserException | ( | int | code, |
const std::string & | param | ||
) | [inline] |
[in] | code | The error code |
[in] | param | The string parameter |
void Deepsolver::CliParserException::accept | ( | ExceptionVisitor & | visitor | ) | const [inline, virtual] |
This method performs invocation of corresponding visit() method of the visitor, provided by the reference. You should use it each time, when you want to make particular handling action for various exception types, as it suggested by design pattern "visitor".
[in] | visitor | The reference to the visitor |
Implements Deepsolver::AbstractException.
int Deepsolver::CliParserException::getCode | ( | ) | const [inline] |
std::string Deepsolver::CliParserException::getMessage | ( | ) | const [virtual] |
This method returns a single line string value with error description. Usually it is the value printed to user in the error message. The value should not include error type, since it can be obtained through getType() method.
Implements Deepsolver::AbstractException.
const std::string& Deepsolver::CliParserException::getParam | ( | ) | const [inline] |
std::string Deepsolver::CliParserException::getType | ( | ) | const [inline, virtual] |
This method returns a short string with one or two words describing the error type. For example, this method can return values like "system", "back-end" etc. A value returned by this method usually is used for error message construction.
Implements Deepsolver::AbstractException.