00001 /* libzz 00002 * 00003 * This program is distributed under the GNU General Public License, version 2. 00004 * A copy of this license is included with this source. 00005 * 00006 * Copyright 2000-2006, Toni Thomsson <toni@tonjac.org> 00007 */ 00008 00009 #ifndef zz_error_h 00010 #define zz_error_h 00011 00012 #include <zz_string.h> 00013 #include <deque> 00014 #include <map> 00015 #include <zz_export.h> 00016 00017 /* 00018 Description: 00019 Felmeddelande 00020 00021 Author: 00022 Toni Thomsson, toni@tonjac.org 00023 00024 Library: 00025 libzz.a (HPUX) libzz.lib (win32) 00026 00027 Platform: 00028 HPUX, win32 00029 */ 00030 class ZZ_API CzzErrorMessage 00031 { 00032 00033 public: 00034 00035 /* 00036 Description: 00037 Skapar ett felmeddelande 00038 00039 Remarks: 00040 Default konstruktor 00041 */ 00042 CzzErrorMessage( void ); 00043 00044 /* 00045 Remarks: 00046 Kopierings kontruktor 00047 */ 00048 CzzErrorMessage( const CzzErrorMessage& messageSrc // IN, objekt som skall kopieras 00049 ); 00050 00051 // Description: Destruktor 00052 ~CzzErrorMessage(); 00053 00054 // Description: Sätter meddelande text 00055 void SetMessage( const CzzString message // IN, meddelande 00056 ); 00057 00058 // Description: Meddelande text 00059 CzzString GetMessage(void) const; 00060 00061 // Description: Sätter felkod 00062 void SetCode(int code // IN, felkod 00063 ); 00064 00065 // Description: Felkod 00066 int GetCode(void) const; 00067 00068 private: 00069 CzzString m_Message; 00070 int m_Code; 00071 }; 00072 00073 /* 00074 Description: 00075 Felstack 00076 00077 Author: 00078 Staffan Nöteberg, staffan@sndk.se 00079 Anders Jonsson, anders@tankebolaget.se 00080 00081 Library: 00082 libzz.a (HPUX) libzz.lib (win32) 00083 00084 Platform: 00085 HPUX, win32 00086 */ 00087 class CzzErrorStack : public deque<CzzErrorMessage* > 00088 { 00089 public: 00090 00091 // Description: Skapar felstack 00092 CzzErrorStack( void ); 00093 00094 // Description: Destruktor 00095 ~CzzErrorStack(); 00096 00097 // Description: Antal objekt som använder stacken 00098 int GetUsageCount(void); 00099 00100 // Description: Räknar upp antalet objekt som använder stacken 00101 void IncreaseUsageCount( void ); 00102 00103 // Description: Räknar ner antalet objekt som använder stacken 00104 void DecreaseUsageCount( void ); 00105 00106 private: 00107 int m_UsageCount; 00108 }; 00109 00110 /* 00111 Description: 00112 Felhistorik 00113 00114 Author: 00115 Staffan Nöteberg, staffan@sndk.se 00116 Anders Jonsson, anders@tankebolaget.se 00117 00118 Library: 00119 libzz.a (HPUX) libzz.lib (win32) 00120 00121 Platform: 00122 HPUX, win32 00123 */ 00124 class CzzErrorHistory : public CzzErrorStack 00125 { 00126 public: 00127 00128 // Description: Default konstruktor 00129 CzzErrorHistory( void ); 00130 00131 // Description: Destruktor 00132 ~CzzErrorHistory( void ); 00133 00134 // Description: Antal meddelanden 00135 int GetNumberOfMessages(void) const; 00136 00137 // Description: Tom ? 00138 bool IsEmpty(void); 00139 00140 // Description: Lägg till ett felmeddelande 00141 void PushMessage( const CzzString message, // IN, meddelande text 00142 const int code // IN, felkod 00143 ); 00144 // Description: Lägg till ett felmeddelande 00145 void PushMessage( CzzErrorMessage* pMessage // IN, meddelande 00146 ); 00147 00148 // Description: Hämta sista meddelandet 00149 void GetTopMessage( CzzString& message, // IN, meddelande text 00150 int& code // IN, felkod 00151 ); 00152 00153 // Description: Hämta sista meddelandet 00154 void GetTopMessage( CzzErrorMessage*& pMessage // IN, meddelande 00155 ); 00156 00157 // Description: Ta bort sista meddelandet 00158 void PopTopMessage( void ); 00159 00160 // Description: Hämta första meddelandet 00161 void GetBottomMessage( CzzString& message, // IN, meddelandetext 00162 int& code // IN, felkod 00163 ); 00164 00165 // Description: Hämta första meddelandet 00166 void GetBottomMessage( CzzErrorMessage*& pMessage // IN, meddelande 00167 ); 00168 00169 // Description: Ta bort första meddelandet 00170 void PopBottomMessage( void ); 00171 }; 00172 00173 #endif
1.4.6-NO