/** * CRXException.h */ #ifndef __CRXEXCEPTION_H__ #define __CRXEXCEPTION_H__ #include #ifdef _WIN32 # define __func__ __FUNCTION__ #endif #define CRX_ERROR(__CODE,__FMT,...) \ do { \ SetErrorCode (__CODE); \ SetErrorMessage (__FILE__,__func__,__LINE__,__FMT,__VA_ARGS__); \ } while (0) class CRXException { private: std::string mMessage; int mCode; public: CRXException (void); public: /* get */ int GetErrorCode (void) const; std::string GetErrorMessage (void) const; int GetSystemErrorCode (void) const; /* set */ void SetErrorCode (const int aCode); void SetErrorMessage (const char * aFile, const char * aFunction, const int aLine, const char * aFormat, ...); std::string MakeErrorMessage (const char * aFile, const char * aFunction, const int aLine, const char * aFormat, va_list aVaList); }; #endif // #ifndef __CRXEXCEPTION_H__