Deepsolver
|
The exception class for config file syntax errors. More...
Public Member Functions | |
ConfigFileException (int code, const std::string &fileName, size_t lineNumber, std::string::size_type pos, const std::string &line) | |
The constructor. | |
int | getCode () const |
Returns the type of encountered error. | |
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 the single-line description of the error. | |
std::string::size_type | getPos () const |
Returns the invalid character position. | |
std::string | getType () const |
Returns the error type. | |
virtual | ~ConfigFileException () |
The destructor. |
This class instance is thrown when configuration file syntax error is encountered. The client application can access various information with it about the problem like file name, line number, character position, line content and error code. Be careful, character position is given in unibyte string representation and in case of using UTF-8 sequences it require additional processing. Note, that this class does not provide any text descriptions.
ConfigFileException::ConfigFileException | ( | int | code, |
const std::string & | fileName, | ||
size_t | lineNumber, | ||
std::string::size_type | pos, | ||
const std::string & | line | ||
) | [inline] |
[in] | code | The error code describing the type of error |
[in] | fileName | Name of a file being processed |
[in] | lineNumber | The number of a line with encountered error |
[in] | pos | The problem character position with unibyte coding |
[in] | line | The text of an invalid line |
int ConfigFileException::getCode | ( | ) | const [inline] |
Use this method to get type of error.
const std::string& ConfigFileException::getFileName | ( | ) | const [inline] |
Use this method to get name of a file with an invalid line.
const std::string& ConfigFileException::getLine | ( | ) | const [inline] |
Use this method to get text of the invalid line.
size_t ConfigFileException::getLineNumber | ( | ) | const [inline] |
Use this method to get number of line with the syntax problem.
std::string ConfigFileException::getMessage | ( | ) | const [inline, virtual] |
Use this method to get single-line description (recommended only for debug purposes).
Implements DeepsolverException.
std::string::size_type ConfigFileException::getPos | ( | ) | const [inline] |
Use this method to get the invalid character position in unibyte character coding.
std::string ConfigFileException::getType | ( | ) | const [inline, virtual] |
This method always returns "config syntax" string.
Implements DeepsolverException.