Deepsolver
|
Indicates an error in configuration data. More...
Public Types | |
enum | { UnknownOption, ValueCannotBeEmpty, AddingNotPermitted, InvalidBooleanValue, InvalidIntValue, InvalidUIntValue, InvalidUrl } |
Public Member Functions | |
ConfigException (int code, const StringVector &path, const std::string §Arg, const std::string &line, const std::string &fileName, size_t lineNumber) | |
The constructor. | |
int | getCode () const |
Returns ta error code. | |
std::string | getFileName () const |
Returns a file name with an invalid line. | |
std::string | getLine () const |
Returns an invalid line value. | |
size_t | getLineNumber () const |
Returns number of a invalid line. | |
std::string | getLocationDesignation () const |
Returns full designation of configuration problem location. | |
std::string | getMessage () const |
Returns a single line error description. | |
std::string | getOptionDesignation () const |
Returns a string designation of a configuration option with an invalid value. | |
const StringVector & | getPath () const |
Returns a configuration options path. | |
std::string | getSectArg () const |
Returns a first-level section argument. | |
std::string | getType () const |
Returns a string with error type. | |
virtual | ~ConfigException () |
The destructor. |
This class instance indicates any problem in Deepsolver configuration structures. Be careful, it must be not confused with ConfigFileException used to notify about configuration file syntax errors.
The objects of ConfigException provide the error code, option path and section argument if needed and error location in configuration files if there is any. Some kind of problems are actual without any reference to location in a configuration file.
Deepsolver::ConfigException::ConfigException | ( | int | code, |
const StringVector & | path, | ||
const std::string & | sectArg, | ||
const std::string & | line, | ||
const std::string & | fileName, | ||
size_t | lineNumber | ||
) | [inline] |
[in] | code | A error code |
[in | path A value path | |
[in] | sectArg | An argument for first-level section |
[in] | line | An invalid line value |
[in] | fileName | The name of A config file with the invalid line |
[in] | lineNumber | A number of the invalid line |
int Deepsolver::ConfigException::getCode | ( | ) | const [inline] |
Use this method to get a error code
std::string Deepsolver::ConfigException::getFileName | ( | ) | const [inline] |
Use this method to get a name of the file with invalid line.
std::string Deepsolver::ConfigException::getLine | ( | ) | const [inline] |
Use this method to get an invalid line value.
size_t Deepsolver::ConfigException::getLineNumber | ( | ) | const [inline] |
Use this method to get 1-based number of an invalid line. If this method returns 0 that means an exception instance has no information about invalid line location.
std::string Deepsolver::ConfigException::getLocationDesignation | ( | ) | const [inline] |
This method constructs string with global designation of a place causing configuration problem. This information usually includes file name and line number.
std::string Deepsolver::ConfigException::getMessage | ( | ) | const [inline, virtual] |
This method returns a single line string value with error description. Usually it is the value printed to user in error message. The value may not include error type since it can be obtained with getType() method.
Implements Deepsolver::DeepsolverException.
std::string Deepsolver::ConfigException::getOptionDesignation | ( | ) | const [inline] |
This method constructs global configuration option designation using its path and optional section argument.
const StringVector& Deepsolver::ConfigException::getPath | ( | ) | const [inline] |
use this method to get a configuration option path.
std::string Deepsolver::ConfigException::getSectArg | ( | ) | const [inline] |
Use this method to get a first-level section argument.
std::string Deepsolver::ConfigException::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::DeepsolverException.