From 909c48a297d7f68b107fce7ad444c2165f749f42 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 10 Aug 2012 13:44:17 +0200 Subject: libpqxx > 4.0 fix. --- server/src/admin_export.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'server/src') 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 +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; -- cgit v1.2.3