Lucene++ - a full-featured, c++ search engine
API Documentation


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Directory.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef DIRECTORY_H
8 #define DIRECTORY_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene
13 {
18  class LPPAPI Directory : public LuceneObject
19  {
20  public:
21  Directory();
22  virtual ~Directory();
23 
25 
26  protected:
27  bool isOpen;
28 
31 
32  public:
34  virtual HashSet<String> listAll() = 0;
35 
37  virtual bool fileExists(const String& name) = 0;
38 
40  virtual uint64_t fileModified(const String& name) = 0;
41 
43  virtual void touchFile(const String& name) = 0;
44 
46  virtual void deleteFile(const String& name) = 0;
47 
49  virtual int64_t fileLength(const String& name) = 0;
50 
53  virtual IndexOutputPtr createOutput(const String& name) = 0;
54 
56  virtual IndexInputPtr openInput(const String& name) = 0;
57 
59  virtual void close() = 0;
60 
63  virtual void sync(const String& name);
64 
68  virtual IndexInputPtr openInput(const String& name, int32_t bufferSize);
69 
72  virtual LockPtr makeLock(const String& name);
73 
77  void clearLock(const String& name);
78 
83  void setLockFactory(LockFactoryPtr lockFactory);
84 
87  LockFactoryPtr getLockFactory();
88 
92  virtual String getLockID();
93 
94  virtual String toString();
95 
102  static void copy(DirectoryPtr src, DirectoryPtr dest, bool closeDirSrc);
103 
104  protected:
106  void ensureOpen();
107  };
108 }
109 
110 #endif

clucene.sourceforge.net