Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

pqxx::binarystring Class Reference

Reveals "unescaped" version of PostgreSQL bytea string. More...

#include <binarystring.hxx>

Inheritance diagram for pqxx::binarystring:

pqxx::PQAlloc< unsigned char > List of all members.

Public Types

typedef unsigned char char_type
typedef PGSTD::char_traits<
char_type >::char_type 
value_type
typedef size_t size_type
typedef ptrdiff_t difference_type
typedef const value_typeconst_reference
typedef const value_typeconst_pointer
typedef const_pointer const_iterator
typedef PGSTD::reverse_iterator<
const_iterator
const_reverse_iterator

Public Member Functions

 binarystring (const result::field &F)
 Read and unescape bytea field.

size_type size () const throw ()
 Size of converted string in bytes.

size_type length () const throw ()
bool empty () const throw ()
const_iterator begin () const throw ()
const_iterator end () const throw ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
const value_typedata () const throw ()
 Unescaped field contents.

const_reference operator[] (size_type i) const throw ()
const_reference at (size_type n) const
const char * c_ptr () const throw ()
 Character buffer
Warning:
No terminating zero is added!


const PGSTD::string & str () const
 Read as regular C++ string (may include null characters).


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

typedef unsigned char pqxx::binarystring::char_type
 

typedef const_pointer pqxx::binarystring::const_iterator
 

typedef const value_type* pqxx::binarystring::const_pointer
 

typedef const value_type& pqxx::binarystring::const_reference
 

typedef PGSTD::reverse_iterator<const_iterator> pqxx::binarystring::const_reverse_iterator
 

typedef ptrdiff_t pqxx::binarystring::difference_type
 

typedef size_t pqxx::binarystring::size_type
 

typedef PGSTD::char_traits<char_type>::char_type pqxx::binarystring::value_type
 


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

pqxx::binarystring::const_reference pqxx::binarystring::at size_type  n  )  const
 

const_iterator pqxx::binarystring::begin  )  const throw ()
 

const char* pqxx::binarystring::c_ptr  )  const throw ()
 

Character buffer

Warning:
No terminating zero is added!

Reimplemented from pqxx::PQAlloc< unsigned char >.

const value_type* pqxx::binarystring::data  )  const throw ()
 

Unescaped field contents.

bool pqxx::binarystring::empty  )  const throw ()
 

const_iterator pqxx::binarystring::end  )  const throw ()
 

size_type pqxx::binarystring::length  )  const throw ()
 

const_reference pqxx::binarystring::operator[] size_type  i  )  const throw ()
 

const_reverse_iterator pqxx::binarystring::rbegin  )  const
 

const_reverse_iterator pqxx::binarystring::rend  )  const
 

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.


The documentation for this class was generated from the following files:
Generated on Sun Oct 5 05:38:08 2003 for libpqxx by doxygen 1.3.2