Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

/include/ZE_ZError.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002         This file is Part of the ZEngine Library for 2D game development.
00003                    Copyright (C) 2002, 2003 James Turk
00004 
00005                      Licensed under a BSD-style license.
00006 
00007     The maintainer of this library is James Turk (james@conceptofzero.net) 
00008      and the home of this Library is http://www.zengine.sourceforge.net
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_NET_INIT,      
00048     ZERR_VIDMODE,       
00049     ZERR_LOAD_IMAGE,    
00050     ZERR_LOAD_SOUND,    
00051     ZERR_LOAD_MUSIC,    
00052     ZERR_LOAD_FONT,     
00053     ZERR_NOIMAGE,       
00054     ZERR_NOSOUND,       
00055     ZERR_NOMUSIC,       
00056     ZERR_NOFONT,        
00057     ZERR_NOSOCKET,      
00058     ZERR_NET_CLIENT,    
00059     ZERR_NET_SERVER,    
00060     ZERR_LAST           
00061 };
00062 
00069 class ZError
00070 {
00071     protected:
00073         static string *sErrorDesc;
00075         ZErrorCode rCode;
00077         string rDescription;
00079         string rFilename;
00081         unsigned int rLine;
00082 
00083     public:
00089         static void CreateStringTable();
00090 
00096         static void DestroyStringTable();
00097 
00107         ZError(ZErrorCode code=ZERR_NONE, string desc="", string file="", int line=0);
00108 
00114         virtual ~ZError();
00115 
00125         void Create(ZErrorCode code, string desc="", string file="", int line=0);
00126 
00128         //Accessors//
00130 
00137         ZErrorCode Code() const;
00138 
00144         string LogString() const;
00145 };
00146 
00147 }
00148 
00149 #endif //__ze_zerror_h__

Generated on Sun Apr 27 18:16:26 2003 for ZEngine by doxygen1.3-rc2