KError Class Reference

#include <kerror.h>

List of all members.


Detailed Description

Error class.

Definition at line 48 of file kerror.h.

Public Member Functions

 KError (char *pStringArray[], int pErrorCount)
 Constructor.
 ~KError ()
 Destructor.
int GetErrorCount () const
 Get the size of the error string table.
char * GetErrorString (int pIndex) const
 Get the error message string.
void SetLastError (int pIndex, char *pString)
 Set the last error ID and the last error string.
void SetLastErrorID (int pIndex)
 Set the last error index.
int GetLastErrorID () const
 Return the last error index.
char * GetLastErrorString () const
 Get the message string associated with the last error.
void SetLastErrorString (char const *pString)
 Set the message string associated with the last error.
void ClearLastError ()
 Reset the last error.


Constructor & Destructor Documentation

KError ( char *  pStringArray[],
int  pErrorCount 
)

Constructor.

Parameters:
pStringArray The error string table in use.
pErrorCount Number of elements in the error string table.

~KError (  ) 

Destructor.


Member Function Documentation

int GetErrorCount (  )  const

Get the size of the error string table.

Returns:
Number of elements in the error string table.

char* GetErrorString ( int  pIndex  )  const

Get the error message string.

Parameters:
pIndex Error index.
Returns:
Error string.

void SetLastError ( int  pIndex,
char *  pString 
)

Set the last error ID and the last error string.

Parameters:
pIndex Error index.
pString Error string.
Remarks:
This method will also set the last error string to the default string value contained in the error string table for this error ID.

void SetLastErrorID ( int  pIndex  ) 

Set the last error index.

Parameters:
pIndex Error index.
Remarks:
This method will also set the last error string to the default string value contained in the error string table for this error index.

int GetLastErrorID (  )  const

Return the last error index.

Returns:
The last error index or -1 if none is set.

char* GetLastErrorString (  )  const

Get the message string associated with the last error.

Returns:
Error string or empty string if none is set.

void SetLastErrorString ( char const *  pString  ) 

Set the message string associated with the last error.

Parameters:
pString Error string. This method should be called after KError::SetLastErrorID() in order to customize the error string.

void ClearLastError (  ) 

Reset the last error.