Deepsolver
|
The exception class for md5file syntax errors. More...
Public Types | |
enum | { TooShortLine, InvalidChecksumFormat } |
Public Member Functions | |
void | accept (ExceptionVisitor &visitor) const |
Calls appropriate visitor method. | |
int | getCode () const |
Returns the error code. | |
const std::string & | getFileName () const |
Returns the name of a file with invalid line. | |
const std::string & | getLine () const |
Returns the text of the invalid line. | |
size_t | getLineNumber () const |
Returns number of an invalid line. | |
std::string | getMessage () const |
Returns a single line error description. | |
std::string | getType () const |
Returns a string with short error type designation. | |
Md5FileException (int code, const std::string &fileName, size_t lineNumber, const std::string &line) | |
The constructor. | |
virtual | ~Md5FileException () |
The destructor. |
This class instance is thrown each time when md5file syntax error is encountered. The client application can access various information through it about the problem, like file name, line number, line content and error code.
Deepsolver::Md5FileException::Md5FileException | ( | int | code, |
const std::string & | fileName, | ||
size_t | lineNumber, | ||
const std::string & | line | ||
) | [inline] |
[in] | code | The error code |
[in] | fileName | Name of a file being processed |
[in] | lineNumber | The number of a line with encountered error |
[in] | line | The text of an invalid line |
void Deepsolver::Md5FileException::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::Md5FileException::getCode | ( | ) | const [inline] |
const std::string& Deepsolver::Md5FileException::getFileName | ( | ) | const [inline] |
const std::string& Deepsolver::Md5FileException::getLine | ( | ) | const [inline] |
size_t Deepsolver::Md5FileException::getLineNumber | ( | ) | const [inline] |
std::string Deepsolver::Md5FileException::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.
std::string Deepsolver::Md5FileException::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.