***********************
** 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.
********************************
** 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
*****************************/
-/* 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 <pqxx/transaction.h>
#include "gnucomo_config.h"
//
// RELATIONS :
// SEE ALSO :
-// LAST MODIFIED : Aug 17, 2003
+// LAST MODIFIED : Aug 27, 2003
///////////////////////////////////////////////////////////////////////////
*/
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());