libpqxx  v4.0-1
C++ library for PostgreSQL
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pqxx::largeobject_streambuf< CHAR, TRAITS > Class Template Reference

Streambuf to use large objects in standard I/O streams. More...

#include <largeobject.hxx>

Inheritance diagram for pqxx::largeobject_streambuf< CHAR, TRAITS >:
Collaboration diagram for pqxx::largeobject_streambuf< CHAR, TRAITS >:

Public Types

typedef CHAR char_type
 
typedef traits_type::int_type int_type
 
typedef streamoff off_type
 
typedef largeobjectaccess::openmode openmode
 
typedef streampos pos_type
 
typedef largeobjectaccess::seekdir seekdir
 
typedef TRAITS traits_type
 

Public Member Functions

 largeobject_streambuf (dbtransaction &T, largeobject O, openmode mode=PGSTD::ios::in|PGSTD::ios::out, size_type BufSize=512)
 
 largeobject_streambuf (dbtransaction &T, oid O, openmode mode=PGSTD::ios::in|PGSTD::ios::out, size_type BufSize=512)
 
virtual ~largeobject_streambuf () throw ()
 
void process_notice (const PGSTD::string &s)
 For use by large object stream classes. More...
 
virtual int sync ()
 

Protected Member Functions

virtual int_type overflow (int_type ch=EoF())
 
virtual pos_type seekoff (off_type offset, seekdir dir, openmode)
 
virtual pos_type seekpos (pos_type pos, openmode)
 
virtual int_type underflow ()
 

Private Types

typedef long size_type
 

Private Member Functions

void initialize (openmode mode)
 

Static Private Member Functions

template<typename INTYPE >
static PGSTD::streampos AdjustEOF (INTYPE pos)
 Helper: change error position of -1 to EOF (probably a no-op) More...
 
static int_type EoF ()
 Shortcut for traits_type::eof() More...
 

Private Attributes

const size_type m_BufSize
 
char_typem_G
 
largeobjectaccess m_Obj
 
char_typem_P
 

Detailed Description

template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
class pqxx::largeobject_streambuf< CHAR, TRAITS >

Streambuf to use large objects in standard I/O streams.

The standard streambuf classes provide uniform access to data storage such as files or string buffers, so they can be accessed using standard input or output streams. This streambuf implementation provides similar access to large objects, so they can be read and written using the same stream classes.

Warning
This class may not work properly in compiler environments that don't fully support Standard-compliant streambufs, such as g++ 2.95 or older.

Member Typedef Documentation

template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
typedef CHAR pqxx::largeobject_streambuf< CHAR, TRAITS >::char_type
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
typedef traits_type::int_type pqxx::largeobject_streambuf< CHAR, TRAITS >::int_type
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
typedef streamoff pqxx::largeobject_streambuf< CHAR, TRAITS >::off_type
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
typedef largeobjectaccess::openmode pqxx::largeobject_streambuf< CHAR, TRAITS >::openmode
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
typedef streampos pqxx::largeobject_streambuf< CHAR, TRAITS >::pos_type
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
typedef largeobjectaccess::seekdir pqxx::largeobject_streambuf< CHAR, TRAITS >::seekdir
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
typedef long pqxx::largeobject_streambuf< CHAR, TRAITS >::size_type
private
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
typedef TRAITS pqxx::largeobject_streambuf< CHAR, TRAITS >::traits_type

Constructor & Destructor Documentation

template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
pqxx::largeobject_streambuf< CHAR, TRAITS >::largeobject_streambuf ( dbtransaction T,
largeobject  O,
openmode  mode = PGSTD::ios::in | PGSTD::ios::out,
size_type  BufSize = 512 
)
inline
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
pqxx::largeobject_streambuf< CHAR, TRAITS >::largeobject_streambuf ( dbtransaction T,
oid  O,
openmode  mode = PGSTD::ios::in | PGSTD::ios::out,
size_type  BufSize = 512 
)
inline
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
virtual pqxx::largeobject_streambuf< CHAR, TRAITS >::~largeobject_streambuf ( ) throw ()
inlinevirtual

Member Function Documentation

template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
template<typename INTYPE >
static PGSTD::streampos pqxx::largeobject_streambuf< CHAR, TRAITS >::AdjustEOF ( INTYPE  pos)
inlinestaticprivate

Helper: change error position of -1 to EOF (probably a no-op)

template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
static int_type pqxx::largeobject_streambuf< CHAR, TRAITS >::EoF ( )
inlinestaticprivate

Shortcut for traits_type::eof()

template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
void pqxx::largeobject_streambuf< CHAR, TRAITS >::initialize ( openmode  mode)
inlineprivate
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
virtual int_type pqxx::largeobject_streambuf< CHAR, TRAITS >::overflow ( int_type  ch = EoF())
inlineprotectedvirtual
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
void pqxx::largeobject_streambuf< CHAR, TRAITS >::process_notice ( const PGSTD::string &  s)
inline

For use by large object stream classes.

template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
virtual pos_type pqxx::largeobject_streambuf< CHAR, TRAITS >::seekoff ( off_type  offset,
seekdir  dir,
openmode   
)
inlineprotectedvirtual
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
virtual pos_type pqxx::largeobject_streambuf< CHAR, TRAITS >::seekpos ( pos_type  pos,
openmode   
)
inlineprotectedvirtual
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
virtual int pqxx::largeobject_streambuf< CHAR, TRAITS >::sync ( )
inlinevirtual
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
virtual int_type pqxx::largeobject_streambuf< CHAR, TRAITS >::underflow ( )
inlineprotectedvirtual

Member Data Documentation

template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
const size_type pqxx::largeobject_streambuf< CHAR, TRAITS >::m_BufSize
private
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
char_type* pqxx::largeobject_streambuf< CHAR, TRAITS >::m_G
private
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
largeobjectaccess pqxx::largeobject_streambuf< CHAR, TRAITS >::m_Obj
private
template<typename CHAR = char, typename TRAITS = PGSTD::char_traits<CHAR>>
char_type * pqxx::largeobject_streambuf< CHAR, TRAITS >::m_P
private

The documentation for this class was generated from the following file: