00001 #ifndef CLASSLIB_SYSTEM_ERROR_H 00002 # define CLASSLIB_SYSTEM_ERROR_H 00003 00004 //<<<<<< INCLUDES >>>>>> 00005 00006 # include "classlib/sysapi/system.h" 00007 # include "classlib/utils/Error.h" 00008 # include "classlib/utils/SysErr.h" 00009 # include <string> 00010 00011 namespace lat { 00012 //<<<<<< PUBLIC DEFINES >>>>>> 00013 //<<<<<< PUBLIC CONSTANTS >>>>>> 00014 //<<<<<< PUBLIC TYPES >>>>>> 00015 //<<<<<< PUBLIC VARIABLES >>>>>> 00016 //<<<<<< PUBLIC FUNCTIONS >>>>>> 00017 //<<<<<< CLASS DECLARATIONS >>>>>> 00018 00020 class SystemError : public Error 00021 { 00022 public: 00023 SystemError (int syserror, SysErr::Code portable = SysErr::ErrNone); 00024 SystemError (Error *next, int syserror, SysErr::Code portable = SysErr::ErrNone); 00025 // default destructor 00026 // default copy constructor 00027 // default assignment operator 00028 00029 virtual std::string explainSelf (void) const; 00030 virtual Error * clone (void) const; 00031 virtual void rethrow (void); 00032 00033 int errornum (void) const; 00034 SysErr::Code portable (void) const; 00035 00036 static std::string errorString (int error); 00037 static SysErr::Code translateFromErrno (int syserr); 00038 static SysErr::Code translateFromHErrno (int syserr); 00039 00040 private: 00041 int m_error; 00042 SysErr::Code m_portable; 00043 }; 00044 00045 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>> 00046 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>> 00047 00048 inline int 00049 SystemError::errornum (void) const 00050 { return m_error; } 00051 00052 inline SysErr::Code 00053 SystemError::portable (void) const 00054 { return m_portable; } 00055 00056 } // namespace lat 00057 #endif // CLASSLIB_SYSTEM_ERROR_H