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

pqxx::LargeObjectAccess Class Reference

Accessor for large object's contents. More...

#include <largeobject.h>

Inheritance diagram for pqxx::LargeObjectAccess:

pqxx::LargeObject List of all members.

Public Types

typedef long size_type

Public Member Functions

 LargeObjectAccess (TransactionItf &T, PGSTD::ios_base::openmode mode=PGSTD::ios_base::in|PGSTD::ios_base::out)
 Create new large object and open it.

 LargeObjectAccess (TransactionItf &T, Oid O, PGSTD::ios_base::openmode mode=PGSTD::ios_base::in|PGSTD::ios_base::out)
 Open large object with given Oid.

 LargeObjectAccess (TransactionItf &T, LargeObject O, PGSTD::ios_base::openmode mode=PGSTD::ios_base::in|PGSTD::ios_base::out)
 Open given large object.

 LargeObjectAccess (TransactionItf &T, const PGSTD::string &File, PGSTD::ios_base::openmode mode=PGSTD::ios_base::in|PGSTD::ios_base::out)
 Import large object from a local file and open it.

 ~LargeObjectAccess ()
void to_file (const PGSTD::string &File) const
 Export large object's contents to a local file.

void write (const char Buf[], size_type Len)
 Write data to large object.

void write (const PGSTD::string &Buf)
 Write string to large object.

size_type read (char Buf[], size_type Len)
 Read data from large object.

size_type seek (size_type dest, PGSTD::ios_base::seekdir dir)
 Seek in large object's data stream.

long cseek (long dest, PGSTD::ios_base::seekdir dir) throw ()
 Seek in large object's data stream.

long cwrite (const char Buf[], size_type Len) throw ()
 Write to large object's data stream.

long cread (char Buf[], size_type Len) throw ()
 Read from large object's data stream.

Oid id () const throw ()
 Object identifier.


Detailed Description

Accessor for large object's contents.


Member Typedef Documentation

typedef long pqxx::LargeObject::size_type
 


Constructor & Destructor Documentation

pqxx::LargeObjectAccess::LargeObjectAccess TransactionItf   T,
PGSTD::ios_base::openmode    mode = PGSTD::ios_base::in|PGSTD::ios_base::out
[explicit]
 

Create new large object and open it.

Parameters:
T backend transaction in which the object is to be created
mode access mode, defaults to ios_base::in | ios_base::out

pqxx::LargeObjectAccess::LargeObjectAccess TransactionItf   T,
Oid    O,
PGSTD::ios_base::openmode    mode = PGSTD::ios_base::in|PGSTD::ios_base::out
 

Open large object with given Oid.

Convert combination of a transaction and object identifier into a large object identity. Does not affect the database.

Parameters:
T the transaction in which the object is to be accessed
O object identifier for the given object
mode access mode, defaults to ios_base::in | ios_base::out

pqxx::LargeObjectAccess::LargeObjectAccess TransactionItf   T,
LargeObject    O,
PGSTD::ios_base::openmode    mode = PGSTD::ios_base::in|PGSTD::ios_base::out
 

Open given large object.

Open a large object with the given identity for reading and/or writing

Parameters:
T the transaction in which the object is to be accessed
O identity for the large object to be accessed
mode access mode, defaults to ios_base::in | ios_base::out

pqxx::LargeObjectAccess::LargeObjectAccess TransactionItf   T,
const PGSTD::string &    File,
PGSTD::ios_base::openmode    mode = PGSTD::ios_base::in|PGSTD::ios_base::out
 

Import large object from a local file and open it.

Creates a large object containing the data found in the given file.

Parameters:
T the backend transaction in which the large object is to be created
File a filename on the client program's filesystem
mode access mode, defaults to ios_base::in | ios_base::out

pqxx::LargeObjectAccess::~LargeObjectAccess  
 


Member Function Documentation

long pqxx::LargeObjectAccess::cread char    Buf[],
size_type    Len
throw ()
 

Read from large object's data stream.

Does not throw exception in case of error; inspect return value and errno instead. Returns number of bytes actually read, or -1 if an error occurred.

Parameters:
Buf area where bytes should be stored
Len number of bytes to read

long pqxx::LargeObjectAccess::cseek long    dest,
PGSTD::ios_base::seekdir    dir
throw ()
 

Seek in large object's data stream.

Does not throw exception in case of error; inspect return value and errno instead. Returns new position in large object, or -1 if an error occurred.

Parameters:
dest offset to go to
dir origin to which dest is relative: ios_base::beg (from beginning of the object), ios_base::cur (from current access position), or ios_base;:end (from end of object)

long pqxx::LargeObjectAccess::cwrite const char    Buf[],
size_type    Len
throw ()
 

Write to large object's data stream.

Does not throw exception in case of error; inspect return value and errno instead. Returns number of bytes actually written, or -1 if an error occurred.

Parameters:
Buf bytes to write
Len number of bytes to write

Oid pqxx::LargeObject::id   const throw ()
 

Object identifier.

The number returned by this function identifies the large object in the database we're connected to.

pqxx::LargeObjectAccess::size_type pqxx::LargeObjectAccess::read char    Buf[],
size_type    Len
 

Read data from large object.

Returns the number of bytes read, which may be less than the number of bytes requested if the end of the large object is reached. Throws an exception if an error occurs while reading.

Parameters:
Buf the location to store the read data in
Len the number of bytes to try and read

pqxx::LargeObjectAccess::size_type pqxx::LargeObjectAccess::seek size_type    dest,
PGSTD::ios_base::seekdir    dir
 

Seek in large object's data stream.

Returns the new position in the large object. Throws an exception if an error occurs.

void pqxx::LargeObjectAccess::to_file const PGSTD::string &    File const
 

Export large object's contents to a local file.

Writes the data stored in the large object to the given file.

Parameters:
File a filename on the client's filesystem

void pqxx::LargeObjectAccess::write const PGSTD::string &    Buf
 

Write string to large object.

If not all bytes could be written, an exception is thrown.

Parameters:
Buf the data to write; no terminating zero is written

void pqxx::LargeObjectAccess::write const char    Buf[],
size_type    Len
 

Write data to large object.

If not all bytes could be written, an exception is thrown.

Parameters:
Buf the data to write
Len the number of bytes from Buf to write


The documentation for this class was generated from the following files:
Generated on Mon Mar 31 11:29:46 2003 for libpqxx by doxygen1.3-rc3