1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:57 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.29 2001/05/09 17:29:09 momjian Exp $
3
3
-->
4
4
5
5
<chapter id="libpqplusplus">
@@ -227,9 +227,9 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
227
227
returns whether or not the connection to the backend server succeeded or
228
228
failed.
229
229
<synopsis>
230
- int PgConnection::ConnectionBad()
230
+ bool PgConnection::ConnectionBad() const
231
231
</synopsis>
232
- Returns TRUE if the connection failed.
232
+ Returns true if the connection failed.
233
233
</para>
234
234
</listitem>
235
235
<listitem>
@@ -368,7 +368,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
368
368
<function>Tuples</function>
369
369
Returns the number of tuples (rows) in the query result.
370
370
<synopsis>
371
- int PgDatabase::Tuples()
371
+ int PgDatabase::Tuples() const
372
372
</synopsis>
373
373
</para>
374
374
</listitem>
@@ -387,7 +387,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
387
387
Returns the field (attribute) name associated with the given field index.
388
388
Field indices start at 0.
389
389
<synopsis>
390
- const char *PgDatabase::FieldName(int field_num)
390
+ const char *PgDatabase::FieldName(int field_num) const
391
391
</synopsis>
392
392
</para>
393
393
</listitem>
@@ -397,7 +397,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
397
397
PQfnumber Returns the field (attribute) index associated with
398
398
the given field name.
399
399
<synopsis>
400
- int PgDatabase::FieldNum(const char* field_name)
400
+ int PgDatabase::FieldNum(const char* field_name) const
401
401
</synopsis>
402
402
-1 is returned if the given name does not match any field.
403
403
</para>
@@ -409,7 +409,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
409
409
integer returned is an internal coding of the type. Field indices
410
410
start at 0.
411
411
<synopsis>
412
- Oid PgDatabase::FieldType(int field_num)
412
+ Oid PgDatabase::FieldType(int field_num) const
413
413
</synopsis>
414
414
</para>
415
415
</listitem>
@@ -420,7 +420,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
420
420
integer returned is an internal coding of the type. Field indices
421
421
start at 0.
422
422
<synopsis>
423
- Oid PgDatabase::FieldType(const char* field_name)
423
+ Oid PgDatabase::FieldType(const char* field_name) const
424
424
</synopsis>
425
425
</para>
426
426
</listitem>
@@ -430,7 +430,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
430
430
Returns the size in bytes of the field associated with the given
431
431
field index. Field indices start at 0.
432
432
<synopsis>
433
- short PgDatabase::FieldSize(int field_num)
433
+ short PgDatabase::FieldSize(int field_num) const
434
434
</synopsis>
435
435
Returns the space allocated for this field in a database tuple given
436
436
the field number. In other words the size of the server's binary
@@ -444,7 +444,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
444
444
Returns the size in bytes of the field associated with the given
445
445
field index. Field indices start at 0.
446
446
<synopsis>
447
- short PgDatabase::FieldSize(const char *field_name)
447
+ short PgDatabase::FieldSize(const char *field_name) const
448
448
</synopsis>
449
449
Returns the space allocated for this field in a database tuple given
450
450
the field name. In other words the size of the server's binary
@@ -466,7 +466,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
466
466
Returns a single field (attribute) value of one tuple of a PGresult.
467
467
Tuple and field indices start at 0.
468
468
<synopsis>
469
- const char *PgDatabase::GetValue(int tup_num, int field_num)
469
+ const char *PgDatabase::GetValue(int tup_num, int field_num) const
470
470
</synopsis>
471
471
For most queries, the value returned by GetValue is a null-terminated
472
472
ASCII string representation of the attribute value. But if BinaryTuples()
@@ -486,7 +486,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
486
486
Returns a single field (attribute) value of one tuple of a PGresult.
487
487
Tuple and field indices start at 0.
488
488
<synopsis>
489
- const char *PgDatabase::GetValue(int tup_num, const char *field_name)
489
+ const char *PgDatabase::GetValue(int tup_num, const char *field_name) const
490
490
</synopsis>
491
491
For most queries, the value returned by GetValue is a null-terminated
492
492
ASCII string representation of the attribute value. But if BinaryTuples()
@@ -506,7 +506,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
506
506
Returns the length of a field (attribute) in bytes. Tuple and field
507
507
indices start at 0.
508
508
<synopsis>
509
- int PgDatabase::GetLength(int tup_num, int field_num)
509
+ int PgDatabase::GetLength(int tup_num, int field_num) const
510
510
</synopsis>
511
511
This is the actual data length for the particular data value, that
512
512
is the size of the object pointed to by GetValue. Note that for
@@ -520,33 +520,55 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
520
520
Returns the length of a field (attribute) in bytes. Tuple and field
521
521
indices start at 0.
522
522
<synopsis>
523
- int PgDatabase::GetLength(int tup_num, const char* field_name)
523
+ int PgDatabase::GetLength(int tup_num, const char* field_name) const
524
524
</synopsis>
525
525
This is the actual data length for the particular data value, that
526
526
is the size of the object pointed to by GetValue. Note that for
527
527
ASCII-represented values, this size has little to do with the binary
528
528
size reported by PQfsize.
529
529
</para>
530
530
</listitem>
531
+ <listitem>
532
+ <para>
533
+ <function>GetIsNull</function>
534
+ Returns whether a field has the null value.
535
+ <synopsis>
536
+ bool GetIsNull(int tup_num, int field_num) const
537
+ </synopsis>
538
+ Note that GetValue will return the empty string for null fields, not
539
+ the NULL pointer.
540
+ </para>
541
+ </listitem>
542
+ <listitem>
543
+ <para>
544
+ <function>GetIsNull</function>
545
+ Returns whether a field has the null value.
546
+ <synopsis>
547
+ bool GetIsNull(int tup_num, const char *field_name) const
548
+ </synopsis>
549
+ Note that GetValue will return the empty string for null fields, not
550
+ the NULL pointer.
551
+ </para>
552
+ </listitem>
531
553
<listitem>
532
554
<para>
533
555
<function>DisplayTuples</function>
534
- Prints out all the tuples and, optionally, the attribute names to the
556
+ OBSOLESCENT: Prints out all the tuples and, optionally, the attribute names to the
535
557
specified output stream.
536
558
<synopsis>
537
- void PgDatabase::DisplayTuples(FILE *out = 0, int fillAlign = 1 ,
538
- const char* fieldSep = "|",int printHeader = 1, int quiet = 0)
559
+ void PgDatabase::DisplayTuples(FILE *out = 0, bool fillAlign = true ,
560
+ const char* fieldSep = "|",bool printHeader = true, bool quiet = false) const
539
561
</synopsis>
540
562
</para>
541
563
</listitem>
542
564
<listitem>
543
565
<para>
544
566
<function>PrintTuples</function>
545
- Prints out all the tuples and, optionally, the attribute names to the
567
+ OBSOLESCENT: Prints out all the tuples and, optionally, the attribute names to the
546
568
specified output stream.
547
569
<synopsis>
548
- void PgDatabase::PrintTuples(FILE *out = 0, int printAttName = 1 ,
549
- int terseOutput = 0, int width = 0)
570
+ void PgDatabase::PrintTuples(FILE *out = 0, bool printAttName = true ,
571
+ bool terseOutput = false, bool fillAlign = false) const
550
572
</synopsis>
551
573
</para>
552
574
</listitem>
@@ -563,7 +585,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
563
585
Returns the number of rows affected after an INSERT, UPDATE or DELETE.
564
586
If the command was anything else, it returns -1.
565
587
<synopsis>
566
- int PgDatabase::CmdTuples()
588
+ int PgDatabase::CmdTuples() const
567
589
</synopsis>
568
590
</para>
569
591
</listitem>
@@ -572,7 +594,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
572
594
<para>
573
595
<function>OidStatus</function>
574
596
<synopsis>
575
- const char *PgDatabase::OidStatus()
597
+ const char *PgDatabase::OidStatus() const
576
598
</synopsis>
577
599
</para>
578
600
</listitem>
@@ -650,8 +672,8 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/libpq++.sgml,v 1.28 2001/05/01 10:48:
650
672
to see if any notification data is currently available from the backend.
651
673
<function>PgDatabase::Notifies</function>
652
674
returns the notification from a list of unhandled notifications from the
653
- backend. The function eturns NULL if there is no pending notifications from the
654
- backend.
675
+ backend. The function returns NULL if there are no pending notifications
676
+ from the backend.
655
677
<function>PgDatabase::Notifies</function>
656
678
behaves like the popping of a stack. Once a notification is returned
657
679
from <function>PgDatabase::Notifies</function>,
0 commit comments