19 #ifndef KompexSQLiteException_H
20 #define KompexSQLiteException_H
35 SQLiteException(
const std::string &filename,
unsigned int lineNumber, std::string errDescription =
"",
int internalSqliteResultCode = -1):
36 mErrorDescription(errDescription),
38 mLineNumber(lineNumber),
39 mInternalSqliteResultCode(internalSqliteResultCode)
44 SQLiteException(
const std::string &filename,
unsigned int lineNumber,
const char *errDescription =
"",
int internalSqliteResultCode = -1):
45 mErrorDescription(std::string(errDescription)),
47 mLineNumber(lineNumber),
48 mInternalSqliteResultCode(internalSqliteResultCode)
54 inline void Show()
const {std::cerr <<
"file: " << mFilename <<
"\nline number: " << mLineNumber <<
"\nerror: " << mErrorDescription << std::endl;}
59 std::stringstream strStream;
60 strStream <<
"file: " << mFilename <<
"\nline number: " << mLineNumber <<
"\nerror: " << std::string(mErrorDescription) <<
"\n";
61 return strStream.str();
92 #endif // KompexSQLiteException_H
95 #define KOMPEX_EXCEPT(errorString, internalSqliteResultCode) throw SQLiteException(__FILE__, __LINE__, errorString, internalSqliteResultCode)
SQLiteException(const std::string &filename, unsigned int lineNumber, std::string errDescription="", int internalSqliteResultCode=-1)
Overloaded constructor.
Definition: KompexSQLiteException.h:35
std::string mErrorDescription
Error description.
Definition: KompexSQLiteException.h:82
unsigned int mLineNumber
Line number in which the error occured.
Definition: KompexSQLiteException.h:86
SQLiteException(const std::string &filename, unsigned int lineNumber, const char *errDescription="", int internalSqliteResultCode=-1)
Overloaded constructor.
Definition: KompexSQLiteException.h:44
std::string GetString() const
Get all error information (filename, line, error message) as std::string.
Definition: KompexSQLiteException.h:57
std::string mFilename
Filename in which the error occured.
Definition: KompexSQLiteException.h:84
void Show() const
Definition: KompexSQLiteException.h:54
#define _SQLiteWrapperExport
Definition: KompexSQLitePrerequisites.h:32
std::string GetFilename() const
Returns the filename in which the error occured.
Definition: KompexSQLiteException.h:68
Exception class for sqlite and KompexSQLiteWrapper errors.
Definition: KompexSQLiteException.h:31
int mInternalSqliteResultCode
Internal SQLite result code.
Definition: KompexSQLiteException.h:88
int GetSqliteResultCode() const
Definition: KompexSQLiteException.h:78
std::string GetErrorDescription() const
Returns an error description.
Definition: KompexSQLiteException.h:65
Definition: KompexSQLiteBlob.h:26
unsigned int GetLineNumber() const
Returns the line number in which the error occured.
Definition: KompexSQLiteException.h:71