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 
2 // Copyright (c) 2009-2014 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 public:
20  Directory();
21  virtual ~Directory();
22 
24 
25 protected:
26  bool isOpen;
27 
30 
31 public:
33  virtual HashSet<String> listAll() = 0;
34 
36  virtual bool fileExists(const String& name) = 0;
37 
39  virtual uint64_t fileModified(const String& name) = 0;
40 
42  virtual void touchFile(const String& name) = 0;
43 
45  virtual void deleteFile(const String& name) = 0;
46 
48  virtual int64_t fileLength(const String& name) = 0;
49 
52  virtual IndexOutputPtr createOutput(const String& name) = 0;
53 
55  virtual IndexInputPtr openInput(const String& name) = 0;
56 
58  virtual void close() = 0;
59 
62  virtual void sync(const String& name);
63 
67  virtual IndexInputPtr openInput(const String& name, int32_t bufferSize);
68 
71  virtual LockPtr makeLock(const String& name);
72 
76  void clearLock(const String& name);
77 
82  void setLockFactory(const LockFactoryPtr& lockFactory);
83 
86  LockFactoryPtr getLockFactory();
87 
91  virtual String getLockID();
92 
93  virtual String toString();
94 
101  static void copy(const DirectoryPtr& src, const DirectoryPtr& dest, bool closeDirSrc);
102 
103 protected:
105  void ensureOpen();
106 };
107 
108 }
109 
110 #endif

clucene.sourceforge.net