diff options
author | Marc G. Fournier <scrappy@hub.org> | 2002-08-22 00:15:14 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 2002-08-22 00:15:14 +0000 |
commit | da4683fbe1cba48cf5b5b29055b66e0bacb00162 (patch) | |
tree | 87834b1b18614313e895dcc8c504f58af9f6b4b2 /src/interfaces/libpq++/pgdatabase.cc | |
parent | b663f3443ba096a06970214c3e83e79f6e570b84 (diff) |
Okay, libpq++ is moved to GBorg, and all traces of it have been removed
from the core repository ... I haven't *moved* the libpq++ files out of the
tree, mainly as we want to keep them in place for past branches ...
Peter, I think I've covered all the files I need, and re-ran autoconf to make
sure the configure file is in place properly ...
Diffstat (limited to 'src/interfaces/libpq++/pgdatabase.cc')
-rw-r--r-- | src/interfaces/libpq++/pgdatabase.cc | 181 |
1 files changed, 0 insertions, 181 deletions
diff --git a/src/interfaces/libpq++/pgdatabase.cc b/src/interfaces/libpq++/pgdatabase.cc deleted file mode 100644 index 6d8cd82c541..00000000000 --- a/src/interfaces/libpq++/pgdatabase.cc +++ /dev/null @@ -1,181 +0,0 @@ -/*------------------------------------------------------------------------- -* -* FILE -* pgdatabase.cpp -* -* DESCRIPTION -* implementation of the PgDatabase class. -* PgDatabase encapsulates some utility routines -* -* Copyright (c) 1994, Regents of the University of California -* -* IDENTIFICATION -* $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/pgdatabase.cc,v 1.13 2002/07/02 16:32:19 momjian Exp $ -* -*------------------------------------------------------------------------- -*/ - -#include "pgdatabase.h" - -#ifdef HAVE_NAMESPACE_STD -using namespace std; -#endif - - -// OBSOLESCENT (uses PQprint(), which is no longer being maintained) -void PgDatabase::DisplayTuples(FILE *out, - bool fillAlign, - const char* fieldSep, - bool printHeader, - bool /* quiet */) const -{ - PQprintOpt po; - - po.header = printHeader; - po.align = fillAlign; - po.standard = po.html3 = po.expanded = po.pager = 0; - po.fieldSep = (char *) (fieldSep); - po.tableOpt = po.caption = 0; - po.fieldName = 0; - - PQprint(out, pgResult, &po); -} - - - -// OBSOLESCENT (uses PQprint(), which is no longer being maintained) -void PgDatabase::PrintTuples(FILE *out, - bool printAttName, - bool terseOutput, - bool fillAlign) const -{ - PQprintOpt po; - - po.header = printAttName; - po.align = fillAlign; - po.standard = po.html3 = po.expanded = po.pager = 0; - po.tableOpt = po.caption = 0; - po.fieldSep = (char *) (terseOutput ? "" : "|"); - po.fieldName = 0; - - PQprint(out, pgResult, &po); -} - - - -int PgDatabase::Tuples() const -{ - return PQntuples(pgResult); -} - - -int PgDatabase::CmdTuples() const -{ - const char *a = PQcmdTuples(pgResult); - return a[0] ? atoi(a) : -1; -} - - -// TODO: Make const? -int PgDatabase::Fields() -{ - return PQnfields(pgResult); -} - - -const char* PgDatabase::FieldName(int field_num) const -{ - return PQfname(pgResult, field_num); -} - - -int PgDatabase::FieldNum(const char* field_name) const -{ - return PQfnumber(pgResult, field_name); -} - - -Oid PgDatabase::FieldType(int field_num) const -{ - return PQftype(pgResult, field_num); -} - - -Oid PgDatabase::FieldType(const char* field_name) const -{ - return PQftype(pgResult, FieldNum(field_name)); -} - - -int PgDatabase::FieldSize(int field_num) const -{ - return PQfsize(pgResult, field_num); -} - - -int PgDatabase::FieldSize(const char* field_name) const -{ - return PQfsize(pgResult, FieldNum(field_name)); -} - - -const char* PgDatabase::GetValue(int tup_num, int field_num) const -{ - return PQgetvalue(pgResult, tup_num, field_num); -} - - -const char* PgDatabase::GetValue(int tup_num, const char* field_name) const -{ - return PQgetvalue(pgResult, tup_num, FieldNum(field_name)); -} - - -bool PgDatabase::GetIsNull(int tup_num, int field_num) const -{ - return PQgetisnull(pgResult, tup_num, field_num); -} - - -bool PgDatabase::GetIsNull(int tup_num, const char* field_name) const -{ - return PQgetisnull(pgResult, tup_num, FieldNum(field_name)); -} - - -int PgDatabase::GetLength(int tup_num, int field_num) const -{ - return PQgetlength(pgResult, tup_num, field_num); -} - - -int PgDatabase::GetLength(int tup_num, const char* field_name) const -{ - return PQgetlength(pgResult, tup_num, FieldNum(field_name)); -} - - -int PgDatabase::GetLine(char str[], int length) -{ - return PQgetline(pgConn, str, length); -} - - -void PgDatabase::PutLine(const char str[]) -{ - PQputline(pgConn, str); -} - - -const char* PgDatabase::OidStatus() const -{ - return PQoidStatus(pgResult); -} - - -int PgDatabase::EndCopy() -{ - return PQendcopy(pgConn); -} - - |