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 : 2005/12/16 00013 // 00014 #ifndef __FILEREADER_H 00015 #define __FILEREADER_H 00016 00017 #include "../utility/StdHeader.h" 00018 #include "Reader.h" 00019 00020 namespace firtex 00021 { 00022 namespace utility 00023 { 00024 class CFileReader : public CReader 00025 { 00026 public: 00027 CFileReader(); 00028 CFileReader(char* buffer,size_t buffsize); 00029 CFileReader(size_t buffsize); 00030 CFileReader(const tstring& filename); 00031 CFileReader(const tstring& filename,char* buffer,size_t buffsize); 00032 CFileReader(const tstring& filename,size_t buffsize); 00033 virtual ~CFileReader(); 00034 public: 00035 bool open(const tstring& filename,bool bThrowError = false); 00036 void close(); 00037 00038 CReader* clone(char* buffer,size_t buffsize); 00039 CReader* clone(); 00040 00041 const char* getReaderName() const{return "FileReader";} 00042 protected: 00043 void readInternal(char* b, size_t offset, size_t len); 00044 void seekInternal(int64_t position); 00045 protected: 00046 int m_fileHandle; 00047 tstring m_filename; 00048 }; 00049 } 00050 } 00051 00052 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex