00001 #ifndef __TLOB_H_
00002 #define __TLOB_H_
00003
00004 #include "BFile.h"
00005 #include "Lob.h"
00006 #include "ocicpp.h"
00007 #include "OraError.h"
00008
00009 #if ( OCILIBVERMAJOR>=8 && OCILIBVERMINOR>=1 ) || DOXYGEN
00010
00011 namespace OCICPP {
00012
00013 class TLob {
00014 private:
00015 OCILobLocator *lob;
00016 OCIError *errhp;
00017 OCISvcCtx *svchp;
00018 int type;
00019 unsigned len;
00020 unsigned offset;
00021 int cache;
00022 public:
00023 TLob();
00024 OCICPP::TLob::TLob(OCIEnv *env,OCISvcCtx *svcctx,OCIError *err,int lob_type,int cache_mode);
00025 void init(OCIEnv *envhp,OCISvcCtx *svcctx,OCIError *err,int lob_type,int cache_mode);
00026 ~TLob();
00027 void drop();
00028 void seek(unsigned offset,int dir);
00029
00030
00031
00032 unsigned tell();
00033 unsigned read(void *buff,int blen);
00034 unsigned write(const void *buff,int blen);
00035 void trunc(unsigned);
00036 void loadFromBFile(BFile &bfile,unsigned int amount,unsigned int dst_offset,unsigned int src_offset);
00037 void setCacheMode(int mode);
00038 unsigned getLen() const;
00039 void copyFrom(Lob &src_lob,unsigned amount,unsigned dst_off,unsigned src_off);
00040 void copyFrom(TLob &src_lob,unsigned amount,unsigned dst_off,unsigned src_off);
00041 void copyFrom(BFile &src_file,unsigned amount,unsigned dst_off,unsigned src_off);
00042
00043 friend class Lob;
00044 };
00045
00046 }
00047
00048 #endif
00049
00050 #endif