NException Class Reference

NException is the base class for throwable exceptions. More...

Inheritance diagram for NException:

NIOException NMemException NNetworkException NXmlException

List of all members.

Public Types

enum  Module {
  NOT_SET, OS, BASE, BASEIO,
  OUTPUT, NETWORK, XML, SECURITY,
  DBAL, TOOLS, USERAPP, USERLIB
}
 Available modules. More...

Public Member Functions

 NException (void)
 Constructs a NException object.
 NException (const NString &desc, Module module, Flag flag=EX_NONE)
 Constructs a NException object.
virtual ~NException (void)
 Destroys a NException object.
void setDescription (const NString &desc)
 Sets the description of a NException object.
NString getDescription (void) const
 Gets the description of a NException object.
void setModule (Module module)
 Sets the module in which the exception was thrown.
NException::Module getModule (void) const
 Returns the module in which the exception was thrown.
NExceptionoperator= (const NException &other)
 Sets the description of a NException object.
void setFlag (Flag flag)
 Sets the error flag associated with the object.
Flag getFlag (void) const
 Gets the error flag associated with the object.

Static Public Attributes

static const Flag EX_NONE = 0
 Non-error flag for the exception:.
static const Flag EX_OUT_OF_BOUNDS = 1
 Out of bounds erro flag for the exception:.

Protected Member Functions

void setErrorId (nint16 error_id)
 Sets the error identification for a given exception.


Detailed Description

NException is the base class for throwable exceptions.
Examples:

ex_ndatastream.cpp, ex_ndir.cpp, ex_nfileinfo.cpp, ex_ngetopt.cpp, ex_nregex.cpp, ex_nxmlreader.cpp, ex_nxmlwrite.cpp, hashapp.cpp, and nsqlapp.cpp.

Definition at line 39 of file nexception.h.


Member Enumeration Documentation

enum Module

Available modules.

Enumerator:
NOT_SET  Unknown/not set
OS  Operating system
BASE  Nus' base module
BASEIO  Nus' base io module
OUTPUT  Nus' output module
NETWORK  Nus' network module
XML  Nus' xml module
SECURITY  Nus' security module
DBAL  Nus' database access module
TOOLS  Nus' support tools
USERAPP  User application
USERLIB  User library

Definition at line 44 of file nexception.h.


Constructor & Destructor Documentation

NException ( const NString desc,
Module  module,
Flag  flag = EX_NONE 
)

Constructs a NException object.

Parameters:
desc Exception description
module The module in which the exception occurred
flag An unique id that identifies the error that occurred

Definition at line 34 of file nexception.cpp.


Member Function Documentation

void setDescription ( const NString desc  ) 

Sets the description of a NException object.

Parameters:
desc Exception description

Definition at line 46 of file nexception.cpp.

Referenced by NXmlError::getLastError(), and operator=().

NString getDescription ( void   )  const

Gets the description of a NException object.

Returns:
Returns the description of a NException object
Examples:
ex_ndatastream.cpp, ex_ndir.cpp, ex_nfile.cpp, ex_nfileinfo.cpp, ex_ngetopt.cpp, ex_nregex.cpp, ex_nxmlreader.cpp, ex_nxmlwrite.cpp, hashapp.cpp, and nsqlapp.cpp.

Definition at line 51 of file nexception.cpp.

Referenced by operator=().

void setModule ( NException::Module  module  ) 

Sets the module in which the exception was thrown.

Parameters:
module The module in which the exception was thrown as defined by the enum Module.

Definition at line 56 of file nexception.cpp.

Referenced by NXmlError::getLastError(), and operator=().

NException::Module getModule ( void   )  const

Returns the module in which the exception was thrown.

Returns:
The module as defined by enum Module

Definition at line 61 of file nexception.cpp.

Referenced by operator=().

NException & operator= ( const NException other  ) 

Sets the description of a NException object.

Parameters:
other NException object to be copied

Definition at line 76 of file nexception.cpp.

References getDescription(), getModule(), setDescription(), and setModule().

void setFlag ( Flag  flag  ) 

Sets the error flag associated with the object.

Parameters:
flag The value of the flag associated with the object

Definition at line 66 of file nexception.cpp.

Referenced by NXmlError::getLastError().

Flag getFlag ( void   )  const

Gets the error flag associated with the object.

Returns:
The error flag of the object
Examples:
ex_nfile.cpp.

Definition at line 71 of file nexception.cpp.

void setErrorId ( nint16  error_id  )  [protected]

Sets the error identification for a given exception.

Parameters:
error_id The identification for the error.


The documentation for this class was generated from the following files:
Generated on Wed Mar 5 23:10:36 2008 for NemesisUtilitiesSystem by  doxygen 1.5.4