From 9e9100fc77976e709b0c51ceb80ec03759198e9d Mon Sep 17 00:00:00 2001 From: arjen Date: Tue, 2 Sep 2003 12:54:10 +0000 Subject: [PATCH] Overloaded gnucomo_database::Field() to include the Result from a query as an argument. --- src/include/database.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/include/database.h b/src/include/database.h index 051adb8..2060cb5 100644 --- a/src/include/database.h +++ b/src/include/database.h @@ -8,7 +8,7 @@ *********************** ** FILE NAME : database.h ** SYSTEM NAME : -** VERSION NUMBER : $Revision: 1.8 $ +** VERSION NUMBER : $Revision: 1.9 $ ** ** DESCRIPTION : Classes to provide an abstract layer on the Gnucomo ** database. @@ -21,13 +21,17 @@ ******************************** ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl ** CREATION DATE : Sep 10, 2002 -** LAST UPDATE : Aug 17, 2003 +** LAST UPDATE : Aug 27, 2003 ** MODIFICATIONS : **************************************************************************/ /***************************** $Log: database.h,v $ - Revision 1.8 2003-08-17 11:39:33 arjen + Revision 1.9 2003-09-02 12:54:10 arjen + Overloaded gnucomo_database::Field() to include the Result + from a query as an argument. + + Revision 1.8 2003/08/17 11:39:33 arjen Changed the gnucomo_database class to the new PostgreSQL library, libpqxx @@ -56,7 +60,7 @@ *****************************/ -/* static const char *RCSID = "$Id: database.h,v 1.8 2003-08-17 11:39:33 arjen Exp $"; */ +/* static const char *RCSID = "$Id: database.h,v 1.9 2003-09-02 12:54:10 arjen Exp $"; */ #include #include "gnucomo_config.h" @@ -73,7 +77,7 @@ // // RELATIONS : // SEE ALSO : -// LAST MODIFIED : Aug 17, 2003 +// LAST MODIFIED : Aug 27, 2003 /////////////////////////////////////////////////////////////////////////// */ @@ -132,6 +136,15 @@ public: return last_result; } + // The field value of a specific result. + + String Field(pqxx::Result res, int tuple, const char *fieldname) + { + return String(res[tuple][fieldname].c_str()); + } + + // Use the result of the last query by default + String Field(int tuple, const char *fieldname) { return String(last_result[tuple][fieldname].c_str()); -- 2.11.0