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/11/9 00013 // 00014 #ifndef _DIRECTORY_H 00015 #define _DIRECTORY_H 00016 00017 #include "../utility/StdHeader.h" 00018 #include <vector> 00019 using namespace std; 00020 00021 namespace firtex 00022 { 00023 namespace store 00024 { 00025 class CIndexInput; 00026 class CIndexOutput; 00027 typedef vector<tstring>FileList; 00028 class CDirectory 00029 { 00030 public: 00031 CDirectory(void) 00032 { 00033 } 00034 virtual ~CDirectory(void) 00035 { 00036 } 00037 public: 00042 virtual bool fileExists(const tstring& name) const = 0; 00043 00048 virtual int64_t fileModified(const tstring& name) const = 0; 00049 00054 virtual int64_t fileLength(const tstring& name) const = 0; 00055 00061 virtual FileList* list() = 0; 00062 00067 virtual CIndexInput* openInput(const tstring& name) = 0; 00068 00075 virtual CIndexInput* openInput(const tstring& name,char* buf,size_t bufsize) = 0; 00076 00082 virtual void deleteFile(const tstring& filename,bool throwError = true) = 0; 00083 00089 virtual void renameFile(const tstring& from, const tstring& to) = 0; 00090 00096 virtual void batDeleteFiles(const tstring& filename,bool throwError = true) = 0; 00097 00103 virtual void copyFile(const tstring& filename,CIndexInput* pSrcFile,bool throwError = true) = 0; 00104 00112 virtual void batCopyFiles(CDirectory*pFromDir,const tstring& from,const tstring& to,bool throwError = true) = 0; 00113 00119 virtual void batRenameFiles(const tstring& from, const tstring& to) = 0; 00120 00125 virtual CIndexOutput* createOutput(const tstring& name) = 0; 00126 00131 virtual void touchFile(const tstring& name) = 0; 00132 00138 virtual CDirectory* clone() = 0; 00139 00143 virtual void close() = 0; 00144 }; 00145 } 00146 } 00147 00148 #endif
http://www.firtex.org http://www.sourceforge.net/projects/firtex