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;
00020 unsigned len;
00021 unsigned offset;
00022 int cache;
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);
00032
00033
00034
00035 unsigned tell();
00036 unsigned read(void *buff,int blen);
00037 unsigned write(const void *buff,int blen);
00038 void trunc(unsigned new_len);
00039 void loadFromBFile(BFile &bfile,unsigned int amount,unsigned int dst_offset,unsigned int src_offset);
00040 void setCacheMode(int mode);
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