pqxx::binarystring Class Reference
Reveals "unescaped" version of PostgreSQL bytea string.
More...
#include <binarystring.hxx>
Inheritance diagram for pqxx::binarystring:
List of all members.
Detailed Description
Reveals "unescaped" version of PostgreSQL bytea string.
This class represents a postgres-internal buffer containing the original, binary string represented by a field of type bytea. The raw value returned by such a field contains escape sequences for certain characters, which are filtered out by binarystring.
The resulting string is zero-terminated, but may also contain zero bytes (or indeed any other byte value) so don't assume that it can be treated as a C-style string unless you've made sure of this yourself.
The binarystring retains its value even if the result it was obtained from is destroyed, but it cannot be copied or assigned.
Member Typedef Documentation
Constructor & Destructor Documentation
pqxx::binarystring::binarystring |
( |
const result::field & |
F |
) |
[explicit] |
|
|
Read and unescape bytea field.
The field will be zero-terminated, even if the original bytea field isn't. - Parameters:
-
| F | the field to read; must be a bytea field |
|
Member Function Documentation
|
Index contained string, checking for valid index.
|
const char* pqxx::binarystring::c_ptr |
( |
|
) |
const throw () |
|
|
Raw character buffer (no terminating zero is added).
- Warning:
- No terminating zero is added! If the binary data did not end in a null character, you will not find one here.
Reimplemented from pqxx::internal::PQAlloc< unsigned char >. |
const value_type* pqxx::binarystring::data |
( |
|
) |
const throw () |
|
|
Unescaped field contents.
|
bool pqxx::binarystring::empty |
( |
|
) |
const throw () |
|
size_type pqxx::binarystring::length |
( |
|
) |
const throw () |
|
|
Size of converted string in bytes.
|
bool pqxx::binarystring::operator!= |
( |
const binarystring & |
rhs |
) |
const throw () |
|
bool pqxx::binarystring::operator== |
( |
const binarystring & |
|
) |
const throw () |
|
size_type pqxx::binarystring::size |
( |
|
) |
const throw () |
|
|
Size of converted string in bytes.
|
const string & pqxx::binarystring::str |
( |
|
) |
const |
|
|
Read as regular C++ string (may include null characters).
Caches string buffer to speed up repeated reads. |
|
Swap contents with other binarystring.
|
The documentation for this class was generated from the following files:
Generated on Mon Nov 15 11:28:02 2004 for libpqxx by
1.3.9.1