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 
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_VIDMODE,       
00044     ZERR_LOAD_IMAGE,    
00045     ZERR_LOAD_SOUND,    
00046     ZERR_LOAD_MUSIC,    
00047     ZERR_LOAD_FONT,     
00048     ZERR_NOIMAGE,       
00049     ZERR_NOSOUND,       
00050     ZERR_NOMUSIC,       
00051     ZERR_NOFONT,        
00052     ZERR_LAST           
00053 };
00054 
00061 class ZError
00062 {
00063     protected:
00065         static std::string sErrorDesc[ZERR_LAST];
00067         ZErrorCode rCode;
00069         std::string rDescription;
00071         std::string rFilename;
00073         unsigned int rLine;
00074 
00075     public:
00081         static void CreateStringTable();
00082 
00092         ZError(ZErrorCode code=ZERR_NONE, std::string desc="", std::string file="", int line=0);
00093 
00103         void Create(ZErrorCode code, std::string desc="", std::string file="", int line=0);
00104 
00106         //Accessors//
00108 
00115         ZErrorCode Code() const;
00116 
00122         std::string LogString() const;
00123 };
00124 
00125 }
00126 
00127 #endif //__ze_zerror_h__

Generated on Sun Oct 5 19:34:45 2003 for ZEngine by doxygen1.3