projects
/
gnucomo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Overloaded gnucomo_database::Field() to include the Result
[gnucomo.git]
/
src
/
include
/
database.h
diff --git
a/src/include/database.h
b/src/include/database.h
index
051adb8
..
2060cb5
100644
(file)
--- a/
src/include/database.h
+++ b/
src/include/database.h
@@
-8,7
+8,7
@@
***********************
** FILE NAME : database.h
** SYSTEM NAME :
***********************
** 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.
**
** 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
********************************
** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
** CREATION DATE : Sep 10, 2002
-** LAST UPDATE : Aug
1
7, 2003
+** LAST UPDATE : Aug
2
7, 2003
** MODIFICATIONS :
**************************************************************************/
/*****************************
$Log: database.h,v $
** 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
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 <pqxx/transaction.h>
#include "gnucomo_config.h"
#include <pqxx/transaction.h>
#include "gnucomo_config.h"
@@
-73,7
+77,7
@@
//
// RELATIONS :
// SEE ALSO :
//
// RELATIONS :
// SEE ALSO :
-// LAST MODIFIED : Aug
1
7, 2003
+// LAST MODIFIED : Aug
2
7, 2003
///////////////////////////////////////////////////////////////////////////
*/
///////////////////////////////////////////////////////////////////////////
*/
@@
-132,6
+136,15
@@
public:
return last_result;
}
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());
String Field(int tuple, const char *fieldname)
{
return String(last_result[tuple][fieldname].c_str());