tlob.h

来自「在动态库中实现异步导出大数据量的oracle数据」· C头文件 代码 · 共 51 行

H
51
字号
#ifndef __TLOB_H_
#define __TLOB_H_

#include "BFile.h"
#include "Lob.h"
#include "ocicpp.h"
#include "OraError.h"

#if ( OCILIBVERMAJOR>=8 && OCILIBVERMINOR>=1 ) || DOXYGEN

namespace OCICPP {

class TLob {
private:
	OCILobLocator *lob;
	OCIError *errhp;
	OCISvcCtx *svchp;
	LobType type; /* CLOB or BLOB */
	unsigned len; /* Overall length */
	unsigned offset; /* Current offset default 1 */
	CacheMode cache; /* CACHE_ON or CACHE_OFF not supported yet */
public:
	TLob();
	TLob(OCIEnv *env,OCISvcCtx *svcctx,OCIError *err,LobType lob_type,CacheMode cache_mode);
	void init(OCIEnv *envhp,OCISvcCtx *svcctx,OCIError *err,LobType lob_type,CacheMode cache_mode);
	~TLob();
	void drop();
	void seek(unsigned offset,LobDirection dir); /* Set's the current position
								 dir is LOB_SET or LOB_CUR or LOB_END
								 similair to stdc seek call 
							  */
	unsigned tell();
	unsigned read(void *buff,int blen); /* returns number of bytes or chracters actually read */
	unsigned write(const void *buff,int blen);
	void trunc(unsigned); /* Truncate lob */
	void loadFromBFile(BFile &bfile,unsigned int amount,unsigned int dst_offset,unsigned int src_offset);
	void setCacheMode(CacheMode mode); /* mode is CACHE_ON or CACHE_OFF */
	unsigned getLen() const;
//	void copyFrom(Lob &src_lob,unsigned amount,unsigned dst_off,unsigned src_off);
	void copyFrom(TLob &src_lob,unsigned amount,unsigned dst_off,unsigned src_off);
	void copyFrom(BFile &src_file,unsigned amount,unsigned dst_off,unsigned src_off);		
	
	friend class Lob;
};	
	
}

#endif

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?