summaryrefslogtreecommitdiff
path: root/libsqlitepp/error.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-04-30 00:27:27 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-04-30 00:27:27 +0100
commitf634bafc38bb948e41f829b16f03e2f0b8ee8f93 (patch)
treec4f8ff17614b68531355e8047d81e96719101d10 /libsqlitepp/error.cpp
parentIgnore Vim swap files (diff)
downloadlibdbpp-sqlite-f634bafc38bb948e41f829b16f03e2f0b8ee8f93.tar.bz2
libdbpp-sqlite-f634bafc38bb948e41f829b16f03e2f0b8ee8f93.tar.xz
libdbpp-sqlite-f634bafc38bb948e41f829b16f03e2f0b8ee8f93.zip
Adds support for SQLite, SQLite mocking and some basic tests
Diffstat (limited to 'libsqlitepp/error.cpp')
-rw-r--r--libsqlitepp/error.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/libsqlitepp/error.cpp b/libsqlitepp/error.cpp
new file mode 100644
index 0000000..9bdf80b
--- /dev/null
+++ b/libsqlitepp/error.cpp
@@ -0,0 +1,29 @@
+#include "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";
+}
+