From 49286cb2d2987e4d2f6a07f6b9ed46d4de97d9ac Mon Sep 17 00:00:00 2001 From: randomdan Date: Sun, 18 Nov 2012 19:13:16 +0000 Subject: Add a basic MySQL connector, not fully functional, but will suffice for p2tv --- libmysqlpp/error.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 libmysqlpp/error.cpp (limited to 'libmysqlpp/error.cpp') diff --git a/libmysqlpp/error.cpp b/libmysqlpp/error.cpp new file mode 100644 index 0000000..2b9b418 --- /dev/null +++ b/libmysqlpp/error.cpp @@ -0,0 +1,29 @@ +#include "error.h" +#include + +MySQL::Error::Error() : + msg(NULL) +{ +} + +MySQL::Error::Error(const MySQL::Error & e) : + msg(e.msg ? strdup(e.msg) : NULL) +{ +} + +MySQL::Error::Error(const char * e) : + msg(e ? strdup(e) : NULL) +{ +} + +MySQL::Error::~Error() throw() +{ + free(msg); +} + +const char * +MySQL::Error::what() const throw() +{ + return msg ? msg : "No message"; +} + -- cgit v1.2.3