dtUtil::Exception Class Reference

#include <exception.h>

List of all members.

Public Member Functions

 Exception (Enumeration &type, const std::string &message, const std::string &filename, unsigned int linenum)
 Constructor - Initializes the exception and logs it.
 Exception (const std::string &message, const std::string &filename, unsigned int linenum)
 Constructor - Initializes the exception and logs it.
virtual ~Exception ()
const std::string & What () const
const std::string & File () const
unsigned int Line () const
 
Returns:
the line number associated with this exception.

const EnumerationTypeEnum () const
 
Returns:
the enumerated type of the exception.

std::string ToString () const
 Converts this exception to a string.
void Print ()
 Prints the exception to the console.
void LogException (dtUtil::Log::LogMessageType level) const
 logs the exception to the default logger.
void LogException (dtUtil::Log::LogMessageType level, const std::string &loggerName) const
 logs the exception to the following log level using the logger.
void LogException (dtUtil::Log::LogMessageType level, dtUtil::Log &logger) const
 logs the exception to the following log level using the given logger.

Protected Attributes

EnumerationmType
std::string mMessage
std::string mFileName
unsigned int mLineNum


Constructor & Destructor Documentation

dtUtil::Exception::Exception ( Enumeration type,
const std::string &  message,
const std::string &  filename,
unsigned int  linenum 
)

Constructor - Initializes the exception and logs it.

Parameters:
type - the type of exception being thrown.
message - Message to display about the exception.
filename - File the exception was thrown from.
linenum - Line number in the file from which the exception was thrown.

dtUtil::Exception::Exception ( const std::string &  message,
const std::string &  filename,
unsigned int  linenum 
)

Constructor - Initializes the exception and logs it.

Parameters:
message - Message to display about the exception.
filename - File the exception was thrown from.
linenum - Line number in the file from which the exception was thrown.

virtual dtUtil::Exception::~Exception (  )  [inline, virtual]


Member Function Documentation

const std::string& dtUtil::Exception::What (  )  const [inline]

const std::string& dtUtil::Exception::File (  )  const [inline]

unsigned int dtUtil::Exception::Line (  )  const [inline]

Returns:
the line number associated with this exception.

const Enumeration& dtUtil::Exception::TypeEnum (  )  const [inline]

Returns:
the enumerated type of the exception.

std::string dtUtil::Exception::ToString (  )  const

Converts this exception to a string.

The string contains the reason, line number and file the exception was thrown from.

Returns:
The string version of this exception.

void dtUtil::Exception::Print (  ) 

Prints the exception to the console.

void dtUtil::Exception::LogException ( dtUtil::Log::LogMessageType  level  )  const

logs the exception to the default logger.

Parameters:
level The level/type of logging

void dtUtil::Exception::LogException ( dtUtil::Log::LogMessageType  level,
const std::string &  loggerName 
) const

logs the exception to the following log level using the logger.

Parameters:
level The level/type of logging
loggerName the name passed to "getInstance" of the Logger.

void dtUtil::Exception::LogException ( dtUtil::Log::LogMessageType  level,
dtUtil::Log logger 
) const

logs the exception to the following log level using the given logger.

Parameters:
level The level/type of logging
logger the actual log instance used to log.


Member Data Documentation

Enumeration& dtUtil::Exception::mType [protected]

std::string dtUtil::Exception::mMessage [protected]

std::string dtUtil::Exception::mFileName [protected]

unsigned int dtUtil::Exception::mLineNum [protected]


http://www.delta3d.org
2.0.0 generated 14 Feb 2008