ConfigFileException Class Reference

The exception object to indicate the configuration file reading error.

Inheritance diagram for ConfigFileException:

VoicemanException

List of all members.

Public Types

enum  {
  INVALID_SECTION_HEADER = 1, EMPTY_SECTION_NAME = 2, PARAMETER_WITHOUT_SECTION = 3, INVALID_UNQUOTED_VALUE = 4,
  INVALID_LINE_BEGINNING = 5, INVALID_PARAMETER_NAME = 6, INVALID_CHAR_AFTER_EQUALS = 7, UNEXPECTED_LINE_END = 8
}
 Codes of various errors during configuration file reading process. More...

Public Member Functions

 ConfigFileException (int code, const std::string &fileName, size_t line)
 The constructor with error code, file name and line number specification.
 ConfigFileException (int code)
 The constructor only with error code specification.
int getCode () const
 Returns error code.
std::string getDescr () const
 Returns the string with error description.
std::string getFileName () const
 Returns name of a file with error.
size_t getLine () const
 Returns line number.
std::string getMessage () const
 Prepares complete error description with file name and line number if there are any.
void makeLogReport (int level) const
 Sends error description to logging system.
virtual ~ConfigFileException ()


Member Enumeration Documentation

anonymous enum

Enumerator:
INVALID_SECTION_HEADER  Section header line has invalid format.
EMPTY_SECTION_NAME  Section name omitted.
PARAMETER_WITHOUT_SECTION  Parameter placed before first section beginning.
INVALID_UNQUOTED_VALUE  Value contains illegal characters and is not quoted.
INVALID_LINE_BEGINNING  Configuration file line has an invalid beginning.
INVALID_PARAMETER_NAME  Parameter name contains invalid characters.
INVALID_CHAR_AFTER_EQUALS  There is an invalid character after equal sign.
UNEXPECTED_LINE_END  Line has an invalid ending or incomplete.


Constructor & Destructor Documentation

ConfigFileException::ConfigFileException ( int  code  )  [inline]

Parameters:
[in] code The error code for new exception object

ConfigFileException::ConfigFileException ( int  code,
const std::string &  fileName,
size_t  line 
) [inline]

Parameters:
[in] code The error code for new exception object
[in] fileName Name of a file with error
[in] line The line number with error (must not be zero)

virtual ConfigFileException::~ConfigFileException (  )  [inline, virtual]

The destructor


Member Function Documentation

size_t ConfigFileException::getLine (  )  const [inline]

This method has assert() to check current object was created through the constructor with line number specification.


Generated on Thu May 6 16:10:58 2010 for VoiceMan by  doxygen 1.5.9