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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FSDirectory.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 FSDIRECTORY_H
8 #define FSDIRECTORY_H
9
10 #include "Directory.h"
11
12 namespace Lucene
13 {
29 class LPPAPI FSDirectory : public Directory
30 {
31 protected:
35 FSDirectory(const String& path, LockFactoryPtr lockFactory);
36
37 public:
38 virtual ~FSDirectory();
39
40 LUCENE_CLASS(FSDirectory);
41
42 public:
45 static const int32_t DEFAULT_READ_CHUNK_SIZE;
46
47 protected:
48 bool checked;
49
51 String directory;
52
54 int32_t chunkSize;
55
56 public:
58 static FSDirectoryPtr open(const String& path);
59
61 static FSDirectoryPtr open(const String& path, LockFactoryPtr lockFactory);
62
65 static HashSet<String> listAll(const String& dir);
66
68 static uint64_t fileModified(const String& directory, const String& name);
69
71 void createDir();
72
74 String getFile();
75
80 void setReadChunkSize(int32_t chunkSize);
81
84 int32_t getReadChunkSize();
85
88 virtual HashSet<String> listAll();
89
91 virtual bool fileExists(const String& name);
92
94 virtual uint64_t fileModified(const String& name);
95
97 virtual void touchFile(const String& name);
98
100 virtual void deleteFile(const String& name);
101
103 virtual int64_t fileLength(const String& name);
104
107 virtual void sync(const String& name);
108
111 virtual IndexInputPtr openInput(const String& name);
112
116 virtual IndexInputPtr openInput(const String& name, int32_t bufferSize);
117
119 virtual String getLockID();
120
122 virtual void close();
123
125 virtual String toString();
126
127 protected:
129 void initOutput(const String& name);
130 };
131 }
132
133 #endif

clucene.sourceforge.net