FirteX-高性能全文索引和检索平台API Documentation |
00001 // 00002 // Copyright(C) 2005--2006 Institute of Computing Tech, Chinese Academy of Sciences. 00003 // All rights reserved. 00004 // This file is part of FirteX (www.firtex.org) 00005 // 00006 // Use of the FirteX is subject to the terms of the software license set forth in 00007 // the LICENSE file included with this software, and also available at 00008 // http://www.firtex.org/license.html 00009 // 00010 // Author : 郭瑞杰(GuoRuijie) 00011 // Email : ruijieguo@software.ict.ac.cn,ruijieguo@gmail.com 00012 // Created : 2006/7/9 00013 // 00014 #ifndef __COMREADER_H 00015 #define __COMREADER_H 00016 00017 #include "FirteXCOM.h" 00018 #include "ComObject.h" 00019 #include "../utility/Reader.h" 00020 00021 #if _MSC_VER > 1000 00022 #pragma once 00023 #endif // _MSC_VER > 1000 00024 00025 namespace firtex 00026 { 00027 namespace plugin 00028 { 00029 class CComReader : public CComObject 00030 { 00031 public: 00032 CComReader(firtex::utility::CReader* pReader); 00033 virtual ~CComReader(void); 00034 public: 00035 static IReader* wrap(firtex::utility::CReader* pReader); 00036 static CReader* unwrap(IReader* pInterface); 00037 public: 00038 BEGIN_INTERFACE_PART(Reader, IReader) 00039 FX_STDMETHOD(read)(/* [in] [retval] */byte* data,/* [in] */int32_t length); 00040 FX_STDMETHOD(readWithNoCopy)(/* [out] [retval] */byte** data,/* [out] [retval] */int32_t* length); 00041 FX_STDMETHOD(close)(); 00042 FX_STDMETHOD(getFilePointer)(/* [out] [retval] */int64_t* position); 00043 FX_STDMETHOD(seek)(/* [in] */int64_t position); 00044 FX_STDMETHOD(isEof)(/* [out] [retval] */firtex::com::bool_t* bEof); 00045 FX_STDMETHOD(length)(/* [out] [retval] */int64_t* len); 00046 END_INTERFACE_PART(Reader) 00047 00048 private: 00049 firtex::utility::CReader* m_pReader; 00050 }; 00051 } 00052 } 00053 00054 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex