summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2012-08-10 13:44:17 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2012-08-10 13:44:17 +0200
commit909c48a297d7f68b107fce7ad444c2165f749f42 (patch)
tree3cd66fcbc52de1cf67e0174ba0d132869d4583a8 /server/src
parent05182c2214c5983c8ce7376c42805ad9802c75e5 (diff)
libpqxx > 4.0 fix.
Diffstat (limited to 'server/src')
-rw-r--r--server/src/admin_export.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/server/src/admin_export.cc b/server/src/admin_export.cc
index 0aa290c..3bdfcf6 100644
--- a/server/src/admin_export.cc
+++ b/server/src/admin_export.cc
@@ -41,6 +41,13 @@
#define SEP "\t"
+#ifdef USE_NEW_PQXX
+#include <pqxx/tuple.hxx>
+typedef pqxx::tuple tuple_t;
+#else
+typedef pqxx::result::tuple tuple_t;
+#endif
+
static std::string escape(std::string &str)
{
std::string out = "\"";
@@ -91,7 +98,7 @@ public:
" WHERE extract='true';");
pqxx::result::const_iterator ri = result.begin();
for(unsigned int r = 0; r < result.size(); r++) {
- pqxx::result::tuple tuple = result.at(r);
+ tuple_t tuple = result.at(r);
std::string name = tuple.at(0).c_str();
std::string caption = tuple.at(1).c_str();
addcell(name, caption);
@@ -166,7 +173,7 @@ static std::string do_export(Environment &env, std::string templ, bool *ok,
" WHERE extract='true';");
pqxx::result::const_iterator ri = result.begin();
for(unsigned int r = 0; r < result.size(); r++) {
- pqxx::result::tuple tuple = result.at(r);
+ tuple_t tuple = result.at(r);
std::string name = tuple.at(0).c_str();
filter.insert(name);
//printf("filter: '%s'\n", name.c_str());
@@ -209,7 +216,7 @@ static std::string do_export(Environment &env, std::string templ, bool *ok,
pqxx::result result = work.exec(q);
pqxx::result::const_iterator ri = result.begin();
for(unsigned int r = 0; r < result.size(); r++) {
- pqxx::result::tuple tuple = result.at(r);
+ tuple_t tuple = result.at(r);
std::string patientid = tuple.at(0).c_str();
std::string templ = tuple.at(1).c_str();
std::string version = tuple.at(2).c_str();
@@ -239,7 +246,7 @@ static std::string do_export(Environment &env, std::string templ, bool *ok,
" ORDER BY t.timestamp;");
pqxx::result::const_iterator ri = result.begin();
for(unsigned int r = 0; r < result.size(); r++) {
- pqxx::result::tuple tuple = result.at(r);
+ tuple_t tuple = result.at(r);
std::string name = tuple.at(0).c_str();
std::string value = tuple.at(1).c_str();
@@ -269,9 +276,9 @@ std::string admin_export(Environment &env, std::string templ, bool *ok,
}
#ifdef TEST_ADMIN_EXPORT
-//deps: environment.cc connectionpool.cc mutex.cc semaphore.cc configuration.cc entitylist.cc artefact.cc database.cc pracrodao.cc pracrodaotest.cc pracrodaopgsql.cc templatelist.cc macrolist.cc debug.cc macroheaderparser.cc exception.cc log.cc saxparser.cc templateheaderparser.cc versionstr.cc inotify.cc session.cc sessionserialiser.cc journal.cc journal_uploadserver.cc journal_commit.cc xml_encode_decode.cc sessionparser.cc fieldnamescanner.cc util.cc macroparser.cc templateparser.cc
-//cflags: -I.. -DWITHOUT_ARTEFACT $(PQXX_CFLAGS) $(EXPAT_CFLAGS)
-//libs: $(PQXX_LIBS) $(EXPAT_LIBS)
+//deps: environment.cc connectionpool.cc mutex.cc semaphore.cc configuration.cc entitylist.cc artefact.cc database.cc pracrodao.cc pracrodaotest.cc pracrodaopgsql.cc templatelist.cc macrolist.cc debug.cc macroheaderparser.cc exception.cc log.cc saxparser.cc templateheaderparser.cc versionstr.cc inotify.cc session.cc sessionserialiser.cc journal.cc journal_uploadserver.cc journal_commit.cc xml_encode_decode.cc sessionparser.cc fieldnamescanner.cc util.cc macroparser.cc templateparser.cc courselist.cc luascript.cc sessionheaderparser.cc courseparser.cc luautil.cc luapraxisd.cc praxisd.cc
+//cflags: -I.. -DWITHOUT_ARTEFACT $(PQXX_CFLAGS) $(EXPAT_CFLAGS) $(PTHREAD_CFLAGS) $(LUA_CFLAGS) $(CURL_CFLAGS)
+//libs: $(PQXX_LIBS) $(EXPAT_LIBS) $(PTHREAD_LIBS) $(LUA_LIBS) $(CURL_LIBS)
#include "test.h"
TEST_BEGIN;