00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00025 #ifndef __ze_zerror_h__
00026 #define __ze_zerror_h__
00027 
00028 #include "ZE_Utility.h"
00029 #include <string>
00030 using namespace std;
00031 
00032 namespace ZE
00033 {
00034 
00036 
00040 enum ZErrorCode 
00041 {
00042     ZERR_NONE,          
00043     ZERR_SDL_INTERNAL,  
00044     ZERR_SDL_INIT,      
00045     ZERR_MIX_INIT,      
00046     ZERR_TTF_INIT,      
00047     ZERR_VIDMODE,       
00048     ZERR_LOAD_IMAGE,    
00049     ZERR_LOAD_SOUND,    
00050     ZERR_LOAD_MUSIC,    
00051     ZERR_LOAD_FONT,     
00052     ZERR_NOIMAGE,       
00053     ZERR_NOSOUND,       
00054     ZERR_NOMUSIC,       
00055     ZERR_NOFONT,        
00056     ZERR_LAST           
00057 };
00058 
00065 class ZError
00066 {
00067     protected:
00069         static string sErrorDesc[ZERR_LAST];
00071         ZErrorCode rCode;
00073         string rDescription;
00075         string rFilename;
00077         unsigned int rLine;
00078 
00079     public:
00089         ZError(ZErrorCode code=ZERR_NONE, string desc="", string file="", int line=0);
00090 
00100         void Create(ZErrorCode code, string desc="", string file="", int line=0);
00101 
00103         
00105 
00112         ZErrorCode Code() const;
00113 
00119         string LogString() const;
00120 };
00121 
00122 }
00123 
00124 #endif //__ze_zerror_h__