cee::ug::Error Class Reference

Error object for simple error management More...

Public Types

enum  Code {
  ERR_NOT_SET, ERR_ABORTED_BY_USER, ERR_INCONSISTENT_DATA, ERR_USER_DEFINED_MESSAGE,
  ERR_FILE_NOT_FOUND, ERR_FILE_OPEN, ERR_FILE_READ, ERR_FILE_UNSUPPORTED_FILE_TYPE,
  ERR_FILE_INVALID_FORMAT, ERR_VTFX_WRONG_PASSWORD
}
 Available error codes. More...
 

Public Member Functions

 Error ()
 Constructs an empty error object. More...
 
Code errorCode () const
 Returns the error code. More...
 
void setErrorCode (Code errorCode)
 Sets the error code. More...
 
Str userDefinedErrorMessage () const
 Returns the user defined error message. More...
 
void setUserDefinedError (const Str &errorMessage)
 Sets the a user defined message and sets the error code to ERR_USER_DEFINED_MESSAGE. More...
 

Static Public Member Functions

static void safeSetErrorCode (Error *errorObj, Code errorCode)
 Safely sets the error code by first checking if errorObj is NULL. More...
 
static void safeSetUserDefinedError (Error *errorObj, const Str &errorMessage)
 Safely sets the user defined error message by first checking if errorObj is NULL. More...
 

Detailed Description

Error object for simple error management

Member Enumeration Documentation

Available error codes.

Enumerator
ERR_NOT_SET 

Error not set

ERR_ABORTED_BY_USER 

Aborted by user.

ERR_INCONSISTENT_DATA 

Inconsistent data.

ERR_USER_DEFINED_MESSAGE 

A user defined message.

ERR_FILE_NOT_FOUND 

File not found.

ERR_FILE_OPEN 

Error opening file

ERR_FILE_READ 

Error reading file

ERR_FILE_UNSUPPORTED_FILE_TYPE 

Unsupported file type. E.g. Not a VTF file.

ERR_FILE_INVALID_FORMAT 

Internal errors in the file. File does not comply to the file specification.

ERR_VTFX_WRONG_PASSWORD 

Wrong password for VTFx file.

Constructor & Destructor Documentation

cee::ug::Error::Error ( )

Constructs an empty error object.

Member Function Documentation

Error::Code cee::ug::Error::errorCode ( ) const

Returns the error code.

void cee::ug::Error::safeSetErrorCode ( Error errorObj,
Code  errorCode 
)
static

Safely sets the error code by first checking if errorObj is NULL.

void cee::ug::Error::safeSetUserDefinedError ( Error errorObj,
const Str errorMessage 
)
static

Safely sets the user defined error message by first checking if errorObj is NULL.

void cee::ug::Error::setErrorCode ( Code  errorCode)

Sets the error code.

void cee::ug::Error::setUserDefinedError ( const Str errorMessage)

Sets the a user defined message and sets the error code to ERR_USER_DEFINED_MESSAGE.

Str cee::ug::Error::userDefinedErrorMessage ( ) const

Returns the user defined error message.