Deepsolver
|
Indicates the error in configuration data. More...
Public Member Functions | |
ConfigException (int code, const std::string &arg, const ConfigFilePosInfo &pos) | |
The constructor. | |
ConfigException (int code, const std::string &arg) | |
The constructor with no configuration file line info. | |
std::string | getArg () const |
Returns the optional string argument of the error. | |
int | getCode () const |
Returns the error code. | |
std::string | getFileName () const |
Returns the name of the file associated with error position. | |
std::string | getLine () const |
Returns the line caused the configuration problem. | |
size_t | getLineNumber () const |
Returns number of the invalid line. | |
std::string | getMessage () const |
Returns the single-line configuration error description. | |
std::string | getType () const |
Returns the string type of exception. |
This class instance indicates any problem in Deepsolver configuration structures. Be careful, it must not be confused with ConfigFileException used to notify about configuration file syntax errors.
The objects of ConfigException provide the error code, optional string argument which meaning depends on error code and error location in configuration files if there is any. Some kind of problems are actual without any reference to configuration file. For example, if some parameter is not set at all but its value is required.
ConfigException::ConfigException | ( | int | code, |
const std::string & | arg, | ||
const ConfigFilePosInfo & | pos | ||
) | [inline] |
[in] | code | The error code |
[in] | arg | Optional string error argument with meaning depending on error code |
[in] | pos | The information about configuration file line the error is associated |
ConfigException::ConfigException | ( | int | code, |
const std::string & | arg | ||
) | [inline] |
[in] | code | The error code |
[in] | arg | Optional argument with meaning depending on error code |
std::string ConfigException::getArg | ( | ) | const [inline] |
Use this method to get string argument of the error. The meaning of this argument depends on error code and can be empty.
int ConfigException::getCode | ( | ) | const [inline] |
Use this method to get the error code
std::string ConfigException::getFileName | ( | ) | const [inline] |
Use this method to get name of the file with invalid line. string returned by this method can be empty because not all of the possible errors have associated place in configuration files. Before using the value returned by this method check the line number is greater than zero since in case of error without associated place the line number is always zero.
std::string ConfigException::getLine | ( | ) | const [inline] |
Use this method to get content of the line caused the configuration problem.
size_t ConfigException::getLineNumber | ( | ) | const [inline] |
Use this method to get 1-based number of the line caused the configuration problem. If this method returns zero it means there is no line associated with the problem.
std::string ConfigException::getMessage | ( | ) | const [inline, virtual] |
Using of these method is recommended only for debug purposes.
Implements DeepsolverException.
std::string ConfigException::getType | ( | ) | const [inline, virtual] |
This method always returns "configuration" string.
Implements DeepsolverException.