Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Examples  

Lob.h

00001 #ifndef __LOB_H_
00002 #define __LOB_H_
00003 
00004 #include "BFile.h"
00005 #include "ocicpp.h"
00006 #include "OraError.h"
00007 
00008 #if ( OCILIBVERMAJOR>=8 && OCILIBVERMINOR>=1 ) || DOXYGEN
00009 #include "TLob.h"
00010 #endif
00011 
00012 namespace OCICPP {
00013 
00014 class Lob {
00015 private:
00016     OCILobLocator *lob;
00017     OCIError *errhp;
00018     OCISvcCtx *svchp;
00019     int type; /* CLOB or BLOB or FILE */
00020     unsigned len; /* Overall length */
00021     unsigned offset; /* Current offset default 1 */
00022     int cache; /* CACHE_ON or CACHE_OFF not supported yet */
00023     bool wasBound;
00024 public:
00025     Lob();
00026     Lob(OCISvcCtx *svcctx,OCILobLocator *lob_desc,OCIError *err,int type,int cache_mode);
00027     void init(OCISvcCtx *svcctx,OCILobLocator *lob_desc,OCIError *err,int type,int cache_mode);
00028     void init(OCIEnv *env,OCISvcCtx *svcctx,OCIError *err);
00029     ~Lob();
00030     void drop();
00031     void seek(unsigned offset,int dir); /* Set's the current position
00032                                  dir is SET or CUR or END
00033                                  similair to stdc seek call 
00034                               */
00035     unsigned tell();
00036     unsigned read(void *buff,int blen); /* returns number of bytes or chracters actually read */
00037     unsigned write(const void *buff,int blen);
00038     void trunc(unsigned new_len); /* Truncate lob */
00039     void loadFromBFile(BFile &bfile,unsigned int amount,unsigned int dst_offset,unsigned int src_offset);
00040     void setCacheMode(int mode); /* mode is CACHE_ON or CACHE_OFF */
00041     unsigned getLen() const;
00042     void copyFrom(Lob &src_lob,unsigned amount,unsigned dst_off,unsigned src_off);
00043     void copyFrom(BFile &src_file,unsigned amount,unsigned dst_off,unsigned src_off);       
00044 #if ( OCILIBVERMAJOR>=8 && OCILIBVERMINOR>=1 ) || DOXYGEN
00045     void copyFrom(TLob &src_file,unsigned amount,unsigned dst_off,unsigned src_off);        
00046     friend class TLob;
00047 #endif
00048     friend class Cursor;
00049 
00050 };  
00051     
00052 }
00053 #endif

Generated at Tue Jun 12 10:37:29 2001 for OCI C++ Library by doxygen1.2.4-20010128 written by Dimitri van Heesch, © 1997-2001