SaX::SaXException Class Reference

SaX2 - Exception class. More...

#include <exception.h>

Inheritance diagram for SaX::SaXException:

Inheritance graph
[legend]
List of all members.

Signals

void saxProcessFailed (void)
void saxImportSectionFailed (void)
void saxExportSectionFailed (void)
void saxFileOpenFailed (int)
void saxNoStorage (int)
void saxCDBFileFailed (void)
void saxPermissionDenied (void)
void saxProfileNotFound (void)
void saxProfileUndefined (int)
void saxImportAlreadyAdded (int)
void saxUnknownImport (SaXImport *)
void saxNoAPIFileFound (void)
void saxNullPointerArgument (void)
void saxDesktopImportBindFailed (int)
void saxCardImportBindFailed (int)
void saxPointerImportBindFailed (int)
void saxKeyboardImportBindFailed (int)
void saxPathImportBindFailed (int)
void saxExtensionsImportBindFailed (int)
void saxLayoutImportBindFailed (int)
void saxXKBLoadRulesFailed (void)
void saxCDBRecordNotFound (const char *)
void saxWrongInputFashion (const char *)
void saxPointerFashionTypeFailed (const char *)
void saxSetStorageIDFailed (int)
void saxInvalidArgument (int)
void saxInvalidArgument (const char *)
void saxLockSetFailed (int)
void saxLockUnsetFailed (int)
void saxGetScreenLayoutFailed (int)
void saxEmptyCDBGroup (const char *)
void saxGetInputLayoutFailed (void)
void saxNvidiaDriverMissing (void)
void saxNvidiaDriverInstalled (void)
void saxXKBLayoutUndefined (const char *)
void saxDriverMismatch (const char *, const char *)
void saxGlobalException (const char *)

Public Member Functions

void setDebug (bool=true)
int errorCode (void)
void errorReset (void)
bool havePrivileges (void)
QString errorString (void)
QString errorValue (void)
void excProcessFailed (void)
 process did not start
void excImportSectionFailed (void)
 import cannot initialize section option
void excExportSectionFailed (void)
 export cannot initialize section file
void excFileOpenFailed (int)
 file open failed
void excNoStorage (int)
 there is no data in the storage for ID X
void excCDBFileFailed (void)
 CDB file does not exist.
void excPermissionDenied (void)
 root privileges required
void excProfileNotFound (void)
 profile file not found
void excProfileUndefined (int)
 profile does not include the requested section
void excImportAlreadyAdded (int)
 a SaXImport object of this type was already added
void excUnknownImport (SaXImport *)
 the section ID of this SaXImport object is unknown
void excNoAPIFileFound (void)
 the /var/lib/sax/apidata file does not exist
void excNullPointerArgument (void)
 a NULL pointer was used as argument
void excXKBLoadRulesFailed (void)
 the /usr/X11R6/lib/X11/xkb/rules/(rule) file couldn't be opened
void excCDBRecordNotFound (const char *)
 the group search for a CDB data record has failed
void excWrongInputFashion (const char *)
 the given InputFashion type is invalid refering to pointers.h
void excSetStorageIDFailed (int)
 setID could not find a record with ID (id)
void excInvalidArgument (int)
 wrong argument set for member call
void excInvalidArgument (const char *)
 wrong argument set for member call
void excDesktopImportBindFailed (int)
 the wrong import object was used for this manipulator (desktop)
void excCardImportBindFailed (int)
 the wrong import object was used for this manipulator (card)
void excPointerImportBindFailed (int)
 the wrong import object was used for this manipulator (pointers)
void excKeyboardImportBindFailed (int)
 the wrong import object was used for this manipulator (keyboard)
void excPathImportBindFailed (int)
 the wrong import object was used for this manipulator (path)
void excLayoutImportBindFailed (int)
 the wrong import object was used for this manipulator (layout)
void excExtensionsImportBindFailed (int)
 the wrong import object was used for this manipulator (extensions)
void excPointerFashionTypeFailed (const char *)
 wrong input fashion type, expected SAX_INPUT_PEN or SAX_INPUT_ERASER
void excLockSetFailed (int)
 the call to flock LOCK_EX failed
void excLockUnsetFailed (int)
 the call to flock LOCK_UN failed
void excGetScreenLayoutFailed (int)
 empty screen definition in layout section for screen ID (id)
void excEmptyCDBGroup (const char *)
 No CDB record found for cardName.
void excGetInputLayoutFailed (void)
 empty InputDevice definition in layout section
void excNvidiaDriverMissing (void)
 The binary NVIDIA driver is missing.
void excNvidiaDriverInstalled (void)
 The binary NVIDIA driver is installed.
void excXKBLayoutUndefined (const char *)
 layout not defined/used -> variant cannot be set
void excDriverMismatch (const char *, const char *)
 2D/3D driver from CDB doesn't match current driver
 SaXException (void)

Protected Member Functions

bool setLock (void)
bool unsetLock (void)

Detailed Description

SaX2 - Exception class.

The SaXException class is a container for all exceptions of the library. It provides methods to set and retrieve error codes and error strings. Within the library each class which may run into an error inherits from SaXException and therefore each SaX* class stores their errors inside the object instance. The programmer is able to use the methods obj->errorCode() and obj->errorString() to obtain possible errors or the programmer can create its own exception class which needs to inherit from SaXException. While constructing an object of this exception class the programmer needs to pass the SaX* object which should be watched to the constructor of its own class. If an error occurs the appropriate exception method is called. The following example will show how to make use of the libsax exception handling:

my_excpetion.h

 class myException : public SaXException {
    Q_OBJECT

     public:
     myException (SaXException*);

     private slots:
     void processFailed ( void );
     void permissionDenied ( void );
 };

my_exception.cpp

 #include "my_exception.h"

 myException::myException (SaXException* mException)  {
     connect (
         mException, SIGNAL (saxProcessFailed (void)),
         this      , SLOT   (processFailed (void))
     );
     connect (
         mException, SIGNAL (saxPermissionDenied (void)),
         this      , SLOT   (permissionDenied (void))
     );
 }
 
 void myException::processFailed (void) {
     printf ("Process failed...\n");
 }
 
 void myException::permissionDenied (void) {
     printf ("Permission denied...\n");
 }

sample.cpp

 int main (void) {
     SaXException::setDebug();
 
     SaXInit* init = new SaXInit;
     myException* e = new myException ( init );
     ...
 }

Definition at line 269 of file exception.h.


Constructor & Destructor Documentation

SaX::SaXException::SaXException void   ) 
 

An object of this type is used to create a container for handling and providing error messages

Definition at line 55 of file exception.cpp.


Member Function Documentation

int SaX::SaXException::errorCode void   )  [virtual]
 

obtain currently set error code, on success 0 is returned

Implements SaX::SaXExceptionIF.

Definition at line 145 of file exception.cpp.

void SaX::SaXException::errorReset void   )  [virtual]
 

reset all error items including the error code the error message and the error value

Implements SaX::SaXExceptionIF.

Definition at line 132 of file exception.cpp.

QString SaX::SaXException::errorString void   )  [virtual]
 

obtain currently set error message, on success the string "Success" is returned

Implements SaX::SaXExceptionIF.

Definition at line 156 of file exception.cpp.

Referenced by SaX::SaXConfig::addImport(), SaX::SaXManipulateDevices::addInputDevice(), SaX::SaXManipulateTablets::addPen(), SaX::SaXManipulateDesktop::disable3D(), SaX::SaXExport::doExport(), SaX::SaXInit::doInit(), SaX::SaXManipulateDesktop::enable3D(), SaX::SaXManipulateCard::getCardOptions(), SaX::SaXImportProfile::getImport(), SaX::SaXManipulateLayout::getInputLayout(), SaX::SaXManipulateTablets::getTabletOptions(), SaX::SaXManipulateKeyboard::getXKBVariant(), SaX::SaXManipulateDesktop::is3DCard(), SaX::SaXKeyRules::loadRules(), SaX::SaXManipulateDevices::removeDesktopDevice(), SaX::SaXManipulateDevices::removeInputDevice(), SaX::SaXManipulateTablets::removePen(), SaX::SaXExport::SaXExport(), SaX::SaXImport::SaXImport(), SaX::SaXImportProfile::SaXImportProfile(), SaX::SaXImportSysp::SaXImportSysp(), SaX::SaXManipulateCard::SaXManipulateCard(), SaX::SaXManipulateDesktop::SaXManipulateDesktop(), SaX::SaXManipulateDevices::SaXManipulateDevices(), SaX::SaXManipulateExtensions::SaXManipulateExtensions(), SaX::SaXManipulateKeyboard::SaXManipulateKeyboard(), SaX::SaXManipulateLayout::SaXManipulateLayout(), SaX::SaXManipulatePath::SaXManipulatePath(), SaX::SaXManipulatePointers::SaXManipulatePointers(), SaX::SaXManipulateVNC::SaXManipulateVNC(), SaX::SaXManipulateDesktop::setCDBMonitor(), SaX::SaXStorage::setID(), setLock(), SaX::SaXManipulateKeyboard::setMapping(), SaX::SaXManipulateVNC::setPassword(), SaX::SaXManipulateTouchscreens::setTouchPanel(), SaX::SaXManipulateKeyboard::setXKBVariant(), SaX::SaXManipulateLayout::setXOrgMultiheadMode(), SaX::SaXConfig::testConfiguration(), and unsetLock().

QString SaX::SaXException::errorValue void   )  [virtual]
 

obtain currently set error value, if no value was defined the string "(null)" is returned

Implements SaX::SaXExceptionIF.

Definition at line 167 of file exception.cpp.

bool SaX::SaXException::havePrivileges void   )  [virtual]
 

check for root privileges, on success true is returned

Implements SaX::SaXExceptionIF.

Definition at line 181 of file exception.cpp.

Referenced by SaX::SaXExport::doExport(), and SaX::SaXInit::doInit().

void SaX::SaXException::setDebug bool  enable = true  )  [virtual]
 

Enable debugging for internal libsax messages

Implements SaX::SaXExceptionIF.

Definition at line 68 of file exception.cpp.

References SaX::DEBUG.

Referenced by LML::SaXPluglib::setDebug().

bool SaX::SaXException::setLock void   )  [protected]
 

Apply an advisory lock on the open file specified by mFD for this call /dev/zero is used as file reference

Definition at line 195 of file exception.cpp.

References errorString(), and excLockSetFailed().

Referenced by SaX::SaXConfig::createConfiguration(), SaX::SaXInit::needInit(), SaX::SaXConfig::SaXConfig(), and SaX::SaXManipulateVNC::setPassword().

Here is the call graph for this function:

bool SaX::SaXException::unsetLock void   )  [protected]
 

Remove an advisory lock on the open file specified by mFD for this call /dev/zero is used as file reference

Definition at line 212 of file exception.cpp.

References errorString(), and excLockUnsetFailed().

Referenced by SaX::SaXConfig::createConfiguration(), SaX::SaXInit::needInit(), SaX::SaXConfig::SaXConfig(), and SaX::SaXManipulateVNC::setPassword().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Jun 19 12:42:59 2006 for libsax by  doxygen 1.4.6