From: Steinar H. Gunderson Date: Sat, 11 Feb 2012 15:12:26 +0000 (+0100) Subject: Port to pqxx3, where we need the widestring traits available at parse time. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=f94b331787d71fbf9fa1b1084a52a2b1c79903d9 Port to pqxx3, where we need the widestring traits available at parse time. --- diff --git a/bigscreen/widestring.cpp b/bigscreen/widestring.cpp index a0d781a..2411836 100644 --- a/bigscreen/widestring.cpp +++ b/bigscreen/widestring.cpp @@ -66,14 +66,3 @@ void widestring::operator= (const char *from) free(from_buf); delete[] to_buf; } - -namespace pqxx -{ - -template<> -void from_string(const char *from, widestring &to) -{ - to = from; -} - -} diff --git a/bigscreen/widestring.h b/bigscreen/widestring.h index 67ffdbb..86113ff 100644 --- a/bigscreen/widestring.h +++ b/bigscreen/widestring.h @@ -2,6 +2,7 @@ #define _WIDESTRING_H 1 #include +#include "pqxx/util.hxx" // UCS-4 string with support for getting from UTF-8 class widestring : public std::wstring @@ -14,4 +15,15 @@ public: void operator= (const char *from); }; +namespace pqxx +{ + +template<> +inline void from_string(const char *from, widestring &to) +{ + to = from; +} + +} + #endif /* !defined(_WIDESTRING_H) */