Main Page   Namespace List   Class Hierarchy   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_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         //Accessors//
00105 
00112         ZErrorCode Code() const;
00113 
00119         string LogString() const;
00120 };
00121 
00122 }
00123 
00124 #endif //__ze_zerror_h__

Generated on Sat Jan 18 17:14:22 2003 for ZEngine by doxygen1.3-rc2