Public Member Functions | Protected Attributes | Friends

OCIPL::OciLob Struct Reference

base class for the BLOB/CLOB data holders OCIPL::OciLob and OCIPL::OciClob More...

#include <ocipl.h>

Inheritance diagram for OCIPL::OciLob:
Inheritance graph
[legend]
Collaboration diagram for OCIPL::OciLob:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 OciLob (OciConnection &conn)
 OciLob (OciConnection &conn, OCILobLocator *loc)
 OciLob (const OciLob &other)
 ~OciLob ()
boolean operator== (const OciLob &other) const
void clear ()
void * get_ref ()
const void * get_ptr () const
ub4 get_chunk_size ()
void copy (const OciLob &src, ub4 amount, ub4 dst_offset, ub4 src_offset)
void append (const OciLob &src)
void trim (ub4 newlen=0)
ub4 erase (ub4 offset, ub4 amount)
void enable_buffering ()
void disable_buffering ()
void flush (ub4 flag=OCI_LOB_BUFFER_NOFREE)
bool is_null () const
bool is_not_null () const
const SqlIndind () const
SqlIndind ()

Protected Attributes

OciConnection_conn
OCILobLocator * _loc
SqlInd _ind

Friends

struct OciOpenLob

Detailed Description

base class for the BLOB/CLOB data holders OCIPL::OciLob and OCIPL::OciClob

Definition at line 1959 of file ocipl.h.


Constructor & Destructor Documentation

OCIPL::OciLob::OciLob ( OciConnection conn ) [inline]

Definition at line 1963 of file ocipl.h.

References OCIPL::OciConnection::_env, and OCIPL::oci_check_error().

     :  _conn(conn)
    {
        sword res = OCIDescriptorAlloc(conn._env, (dvoid**)&_loc, OCI_DTYPE_LOB, 0, NULL);
        oci_check_error(conn._env, res);
    }

Here is the call graph for this function:

OCIPL::OciLob::OciLob ( OciConnection conn,
OCILobLocator *  loc 
) [inline]

Definition at line 1970 of file ocipl.h.

     :  _conn(conn),
        _loc(loc)
    {
    }
OCIPL::OciLob::OciLob ( const OciLob other ) [inline]

Definition at line 1976 of file ocipl.h.

References _loc, and OCIPL::oci_check_error().

     :  _conn(other._conn)
    {
        sword res = OCIDescriptorAlloc(_conn._env, (dvoid**)&_loc, OCI_DTYPE_LOB, 0, NULL);
        oci_check_error(_conn._env._errh, res);

#if ORACLE_VERSION>=81
        res = OCILobLocatorAssign(_conn._ctx, _conn._env._errh, other._loc, &_loc);
#else
        res = OCILobAssign(_conn._env, _conn._env._errh, other._loc, &_loc);    // no support for temporary LOBs
#endif
        oci_check_error(_conn._env._errh, res);

        clear();
    }

Here is the call graph for this function:

OCIPL::OciLob::~OciLob (  ) [inline]

Definition at line 1992 of file ocipl.h.

References OCIPL::oci_check_error().

    {
#if ORACLE_VERSION>=81
         // According to the Oracle 10g documentation we should try to free
         // implicit created temporary LOBs as soon as possible.
        if (is_temporary()) {
            sword res = OCILobFreeTemporary(_conn._ctx, _conn._env._errh, _loc);
            oci_check_error(_conn._env._errh, res);
        }
#endif

        sword res = OCIDescriptorFree(_loc, OCI_DTYPE_LOB);
        oci_check_error(_conn._env._errh, res);
    }

Here is the call graph for this function:


Member Function Documentation

void OCIPL::OciLob::append ( const OciLob src ) [inline]

Definition at line 2080 of file ocipl.h.

References _loc, and OCIPL::oci_check_error().

    {
        sword res = OCILobAppend(_conn._ctx, _conn._env._errh, _loc, src._loc);
        oci_check_error(_conn._env._errh, res);
    }

Here is the call graph for this function:

void OCIPL::OciLob::clear (  ) [inline]

Definition at line 2018 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        ub4 lobEmpty = 0;
        sword res = OCIAttrSet(_loc, OCI_DTYPE_LOB, &lobEmpty, 0, OCI_ATTR_LOBEMPTY, _conn._env._errh);
        oci_check_error(_conn._env._errh, res);
    }

Here is the call graph for this function:

void OCIPL::OciLob::copy ( const OciLob src,
ub4  amount,
ub4  dst_offset,
ub4  src_offset 
) [inline]

Definition at line 2074 of file ocipl.h.

References _loc, and OCIPL::oci_check_error().

    {
        sword res = OCILobCopy(_conn._ctx, _conn._env._errh, _loc, src._loc, amount, dst_offset, src_offset);
        oci_check_error(_conn._env._errh, res);
    }

Here is the call graph for this function:

void OCIPL::OciLob::disable_buffering (  ) [inline]

Definition at line 2107 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCILobDisableBuffering(_conn._ctx, _conn._env._errh, _loc);
        oci_check_error(_conn._env._errh, res);
    }

Here is the call graph for this function:

void OCIPL::OciLob::enable_buffering (  ) [inline]

Definition at line 2101 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCILobEnableBuffering(_conn._ctx, _conn._env._errh, _loc);
        oci_check_error(_conn._env._errh, res);
    }

Here is the call graph for this function:

ub4 OCIPL::OciLob::erase ( ub4  offset,
ub4  amount 
) [inline]

Definition at line 2092 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCILobErase(_conn._ctx, _conn._env._errh, _loc, &amount, offset);
        oci_check_error(_conn._env._errh, res);

        return amount;
    }

Here is the call graph for this function:

void OCIPL::OciLob::flush ( ub4  flag = OCI_LOB_BUFFER_NOFREE ) [inline]

Definition at line 2113 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCILobFlushBuffer(_conn._ctx, _conn._env._errh, _loc, flag);
        oci_check_error(_conn._env._errh, res);
    }

Here is the call graph for this function:

ub4 OCIPL::OciLob::get_chunk_size (  ) [inline]

Definition at line 2031 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        ub4 len;

        sword res = OCILobGetLength(_conn._ctx, _conn._env._errh, _loc, &len);
        oci_check_error(_conn._env._errh, res);

        return len;
    }

Here is the call graph for this function:

const void* OCIPL::OciLob::get_ptr (  ) const [inline]

Definition at line 2026 of file ocipl.h.

{return &_loc;}
void* OCIPL::OciLob::get_ref (  ) [inline]

Definition at line 2025 of file ocipl.h.

{return &_loc;}
SqlInd& OCIPL::SqlValue::ind (  ) [inline, inherited]

Definition at line 1245 of file ocipl.h.

{return _ind;}
const SqlInd& OCIPL::SqlValue::ind (  ) const [inline, inherited]
bool OCIPL::SqlValue::is_not_null (  ) const [inline, inherited]

Definition at line 1242 of file ocipl.h.

Referenced by OCIPL::SqlInt::operator int().

{return _ind.is_not_null();}

Here is the caller graph for this function:

bool OCIPL::SqlValue::is_null (  ) const [inline, inherited]

Definition at line 1241 of file ocipl.h.

{return _ind.is_null();}
boolean OCIPL::OciLob::operator== ( const OciLob other ) const [inline]

Definition at line 2007 of file ocipl.h.

References _loc, and OCIPL::oci_check_error().

    {
        boolean is_equal;

        sword res = OCILobIsEqual(_conn._env, _loc, other._loc, &is_equal);

        oci_check_error(_conn._env._errh, res);

        return is_equal;
    }

Here is the call graph for this function:

void OCIPL::OciLob::trim ( ub4  newlen = 0 ) [inline]

Definition at line 2086 of file ocipl.h.

References OCIPL::oci_check_error().

    {
        sword res = OCILobTrim(_conn._ctx, _conn._env._errh, _loc, newlen);
        oci_check_error(_conn._env._errh, res);
    }

Here is the call graph for this function:


Friends And Related Function Documentation

friend struct OciOpenLob [friend]

Definition at line 2123 of file ocipl.h.


Member Data Documentation

Definition at line 2120 of file ocipl.h.

SqlInd OCIPL::SqlValue::_ind [protected, inherited]
OCILobLocator* OCIPL::OciLob::_loc [protected]

Definition at line 2121 of file ocipl.h.

Referenced by append(), copy(), OciLob(), and operator==().


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