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
RAMDirectory.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 RAMDIRECTORY_H
8 #define RAMDIRECTORY_H
9
10 #include "Directory.h"
11
12 namespace Lucene
13 {
17 class LPPAPI RAMDirectory : public Directory
18 {
19 public:
21 RAMDirectory();
22
32 RAMDirectory(DirectoryPtr dir);
33
34 RAMDirectory(DirectoryPtr dir, bool closeDir);
35
36 virtual ~RAMDirectory();
37
38 LUCENE_CLASS(RAMDirectory);
39
40 INTERNAL:
41 int64_t _sizeInBytes;
42 MapStringRAMFile fileMap;
43
44 protected:
45 DirectoryWeakPtr _dirSource;
46 bool copyDirectory;
47 bool closeDir;
48
49 public:
50 virtual void initialize();
51
53 virtual HashSet<String> listAll();
54
56 virtual bool fileExists(const String& name);
57
59 virtual uint64_t fileModified(const String& name);
60
62 virtual void touchFile(const String& name);
63
65 virtual int64_t fileLength(const String& name);
66
69 int64_t sizeInBytes();
70
72 virtual void deleteFile(const String& name);
73
76 virtual IndexOutputPtr createOutput(const String& name);
77
79 virtual IndexInputPtr openInput(const String& name);
80
82 virtual void close();
83 };
84 }
85
86 #endif

clucene.sourceforge.net