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 
00021 #ifndef __ze_zerror_h__
00022 #define __ze_zerror_h__
00023 
00024 #include "ZE_Utility.h"
00025 #include <string>
00026 
00027 namespace ZE
00028 {
00029 
00036 enum ZErrorCode 
00037 {
00038     ZERR_NONE,          
00039     ZERR_SDL_INTERNAL,  
00040     ZERR_SDL_INIT,      
00041     ZERR_MIX_INIT,      
00042     ZERR_TTF_INIT,      
00043     ZERR_NET_INIT,      
00044     ZERR_VIDMODE,       
00045     ZERR_LOAD_IMAGE,    
00046     ZERR_LOAD_SOUND,    
00047     ZERR_LOAD_MUSIC,    
00048     ZERR_LOAD_FONT,     
00049     ZERR_NOIMAGE,       
00050     ZERR_NOSOUND,       
00051     ZERR_NOMUSIC,       
00052     ZERR_NOFONT,        
00053     ZERR_NOSOCKET,      
00054     ZERR_NET_CLIENT,    
00055     ZERR_NET_SERVER,    
00056     ZERR_LAST           
00057 };
00058 
00065 class ZError
00066 {
00067     protected:
00069         static std::string sErrorDesc[ZERR_LAST];
00071         ZErrorCode rCode;
00073         std::string rDescription;
00075         std::string rFilename;
00077         unsigned int rLine;
00078 
00079     public:
00085         static void CreateStringTable();
00086 
00096         ZError(ZErrorCode code=ZERR_NONE, std::string desc="", std::string file="", int line=0);
00097 
00107         void Create(ZErrorCode code, std::string desc="", std::string file="", int line=0);
00108 
00110         //Accessors//
00112 
00119         ZErrorCode Code() const;
00120 
00126         std::string LogString() const;
00127 };
00128 
00129 }
00130 
00131 #endif //__ze_zerror_h__

Generated on Sun Jun 29 14:13:51 2003 for ZEngine by doxygen1.3