Deepsolver
Public Types | Public Member Functions
Deepsolver::ConfigException Class Reference

Indicates an error in configuration data. More...

Inheritance diagram for Deepsolver::ConfigException:
Deepsolver::DeepsolverException

List of all members.

Public Types

enum  {
  UnknownOption, ValueCannotBeEmpty, AddingNotPermitted, InvalidBooleanValue,
  InvalidIntValue, InvalidUIntValue, InvalidUrl
}

Public Member Functions

 ConfigException (int code, const StringVector &path, const std::string &sectArg, 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.

Detailed Description

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.

See also:
ConfigFileException ConfigCenter ConfigAdapter

Constructor & Destructor Documentation

Deepsolver::ConfigException::ConfigException ( int  code,
const StringVector &  path,
const std::string &  sectArg,
const std::string &  line,
const std::string &  fileName,
size_t  lineNumber 
) [inline]
Parameters:
[in]codeA error code
[inpath A value path
[in]sectArgAn argument for first-level section
[in]lineAn invalid line value
[in]fileNameThe name of A config file with the invalid line
[in]lineNumberA number of the invalid line

Member Function Documentation

int Deepsolver::ConfigException::getCode ( ) const [inline]

Use this method to get a error code

Returns:
A error code
std::string Deepsolver::ConfigException::getFileName ( ) const [inline]

Use this method to get a name of the file with invalid line.

Returns:
TA file name with the invalid line
std::string Deepsolver::ConfigException::getLine ( ) const [inline]

Use this method to get an invalid line value.

Returns:
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.

Returns:
A number of the line caused the problem or zero if there is no any
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.

Returns:
A string designation of a configuration problem location
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.

Returns:
A single line error description

Implements Deepsolver::DeepsolverException.

std::string Deepsolver::ConfigException::getOptionDesignation ( ) const [inline]

This method constructs global configuration option designation using its path and optional section argument.

Returns:
A gloabl configuration option designation
const StringVector& Deepsolver::ConfigException::getPath ( ) const [inline]

use this method to get a configuration option path.

Returns:
A configuration option path
std::string Deepsolver::ConfigException::getSectArg ( ) const [inline]

Use this method to get a first-level section argument.

Returns:
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.

Returns:
A short string with error type description

Implements Deepsolver::DeepsolverException.