diff options
Diffstat (limited to 'libsqlitepp/sqlite-error.cpp')
-rw-r--r-- | libsqlitepp/sqlite-error.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libsqlitepp/sqlite-error.cpp b/libsqlitepp/sqlite-error.cpp new file mode 100644 index 0000000..a0758ef --- /dev/null +++ b/libsqlitepp/sqlite-error.cpp @@ -0,0 +1,29 @@ +#include "sqlite-error.h" +#include <string.h> + +SQLite::Error::Error() : + msg(NULL) +{ +} + +SQLite::Error::Error(const SQLite::Error & e) : + msg(e.msg ? strdup(e.msg) : NULL) +{ +} + +SQLite::Error::Error(const char * e) : + msg(e ? strdup(e) : NULL) +{ +} + +SQLite::Error::~Error() throw() +{ + free(msg); +} + +const char * +SQLite::Error::what() const throw() +{ + return msg ? msg : "No message"; +} + |