From f634bafc38bb948e41f829b16f03e2f0b8ee8f93 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 30 Apr 2015 00:27:27 +0100 Subject: Adds support for SQLite, SQLite mocking and some basic tests --- libsqlitepp/error.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 libsqlitepp/error.cpp (limited to 'libsqlitepp/error.cpp') 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 + +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"; +} + -- cgit v1.2.3