creaImageIO_lib
CppSQLite3Exception Class Reference

#include <CppSQLite3.h>

Public Member Functions

 CppSQLite3Exception (const int nErrCode, char *szErrMess, bool bDeleteMsg=true)
 
 CppSQLite3Exception (const int nErrCode, const char *szErrMess, bool bDeleteMsg=true)
 
 CppSQLite3Exception (const CppSQLite3Exception &e)
 
virtual ~CppSQLite3Exception ()
 
const int errorCode ()
 
const char * errorMessage ()
 

Static Public Member Functions

static const char * errorCodeAsString (int nErrCode)
 

Private Attributes

int mnErrCode
 
char * mpszErrMess
 

Detailed Description

Definition at line 73 of file CppSQLite3.h.

Constructor & Destructor Documentation

CppSQLite3Exception::CppSQLite3Exception ( const int  nErrCode,
char *  szErrMess,
bool  bDeleteMsg = true 
)

Definition at line 127 of file CppSQLite3.cpp.

References errorCodeAsString(), and mpszErrMess.

132  :
133 
134  mnErrCode(nErrCode)
135 
136 {
137 
138  mpszErrMess = sqlite3_mprintf("%s[%d]: %s",
139 
140  errorCodeAsString(nErrCode),
141 
142  nErrCode,
143 
144  szErrMess ? szErrMess : "");
145 
146 
147 
148  if (bDeleteMsg && szErrMess)
149 
150  {
151 
152  sqlite3_free(szErrMess);
153 
154  }
155 
}

Here is the call graph for this function:

CppSQLite3Exception::CppSQLite3Exception ( const int  nErrCode,
const char *  szErrMess,
bool  bDeleteMsg = true 
)

Definition at line 93 of file CppSQLite3.cpp.

References errorCodeAsString(), and mpszErrMess.

98  :
99 
100  mnErrCode(nErrCode)
101 
102 {
103 
104  mpszErrMess = sqlite3_mprintf("%s[%d]: %s",
105 
106  errorCodeAsString(nErrCode),
107 
108  nErrCode,
109 
110  szErrMess ? szErrMess : "");
111 
112  /*
113 
114  if (bDeleteMsg && szErrMess)
115 
116  {
117 
118  sqlite3_free(szErrMess);
119 
120  }
121 
122  */
123 
}

Here is the call graph for this function:

CppSQLite3Exception::CppSQLite3Exception ( const CppSQLite3Exception e)

Definition at line 159 of file CppSQLite3.cpp.

References mpszErrMess.

160  :
161 
163 
164 {
165 
166  mpszErrMess = 0;
167 
168  if (e.mpszErrMess)
169 
170  {
171 
172  mpszErrMess = sqlite3_mprintf("%s", e.mpszErrMess);
173 
174  }
175 
}
CppSQLite3Exception::~CppSQLite3Exception ( )
virtual

Definition at line 257 of file CppSQLite3.cpp.

References mpszErrMess.

259 {
260 
261  if (mpszErrMess)
262 
263  {
264 
265  sqlite3_free(mpszErrMess);
266 
267  mpszErrMess = 0;
268 
269  }
270 
271 }

Member Function Documentation

const int CppSQLite3Exception::errorCode ( )
inline

Definition at line 103 of file CppSQLite3.h.

References mnErrCode.

Referenced by creaImageIO::TimestampDatabaseHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::TimestampDatabaseHandler::DBOpen(), creaImageIO::SQLiteTreeHandler::DBOpen(), and creaImageIO::Synchronizer::Initialize().

103 { return mnErrCode; }

Here is the caller graph for this function:

const char * CppSQLite3Exception::errorCodeAsString ( int  nErrCode)
static

Definition at line 181 of file CppSQLite3.cpp.

References CPPSQLITE_ERROR.

Referenced by CppSQLite3Exception().

183 {
184 
185  switch (nErrCode)
186 
187  {
188 
189  case SQLITE_OK : return "SQLITE_OK";
190 
191  case SQLITE_ERROR : return "SQLITE_ERROR";
192 
193  case SQLITE_INTERNAL : return "SQLITE_INTERNAL";
194 
195  case SQLITE_PERM : return "SQLITE_PERM";
196 
197  case SQLITE_ABORT : return "SQLITE_ABORT";
198 
199  case SQLITE_BUSY : return "SQLITE_BUSY";
200 
201  case SQLITE_LOCKED : return "SQLITE_LOCKED";
202 
203  case SQLITE_NOMEM : return "SQLITE_NOMEM";
204 
205  case SQLITE_READONLY : return "SQLITE_READONLY";
206 
207  case SQLITE_INTERRUPT : return "SQLITE_INTERRUPT";
208 
209  case SQLITE_IOERR : return "SQLITE_IOERR";
210 
211  case SQLITE_CORRUPT : return "SQLITE_CORRUPT";
212 
213  case SQLITE_NOTFOUND : return "SQLITE_NOTFOUND";
214 
215  case SQLITE_FULL : return "SQLITE_FULL";
216 
217  case SQLITE_CANTOPEN : return "SQLITE_CANTOPEN";
218 
219  case SQLITE_PROTOCOL : return "SQLITE_PROTOCOL";
220 
221  case SQLITE_EMPTY : return "SQLITE_EMPTY";
222 
223  case SQLITE_SCHEMA : return "SQLITE_SCHEMA";
224 
225  case SQLITE_TOOBIG : return "SQLITE_TOOBIG";
226 
227  case SQLITE_CONSTRAINT : return "SQLITE_CONSTRAINT";
228 
229  case SQLITE_MISMATCH : return "SQLITE_MISMATCH";
230 
231  case SQLITE_MISUSE : return "SQLITE_MISUSE";
232 
233  case SQLITE_NOLFS : return "SQLITE_NOLFS";
234 
235  case SQLITE_AUTH : return "SQLITE_AUTH";
236 
237  case SQLITE_FORMAT : return "SQLITE_FORMAT";
238 
239  case SQLITE_RANGE : return "SQLITE_RANGE";
240 
241  case SQLITE_ROW : return "SQLITE_ROW";
242 
243  case SQLITE_DONE : return "SQLITE_DONE";
244 
245  case CPPSQLITE_ERROR : return "CPPSQLITE_ERROR";
246 
247  default: return "UNKNOWN_ERROR";
248 
249  }
250 
251 }

Here is the caller graph for this function:

const char* CppSQLite3Exception::errorMessage ( )
inline

Definition at line 107 of file CppSQLite3.h.

References mpszErrMess.

Referenced by creaImageIO::TimestampDatabaseHandler::DBCreate(), creaImageIO::SQLiteTreeHandler::DBCreate(), creaImageIO::TimestampDatabaseHandler::DBOpen(), creaImageIO::SQLiteTreeHandler::DBOpen(), and creaImageIO::Synchronizer::Initialize().

107 { return mpszErrMess; }

Here is the caller graph for this function:

Member Data Documentation

int CppSQLite3Exception::mnErrCode
private

Definition at line 119 of file CppSQLite3.h.

Referenced by errorCode().

char* CppSQLite3Exception::mpszErrMess
private

Definition at line 121 of file CppSQLite3.h.

Referenced by CppSQLite3Exception(), errorMessage(), and ~CppSQLite3Exception().


The documentation for this class was generated from the following files: