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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RAMDirectory.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 RAMDIRECTORY_H
8 #define RAMDIRECTORY_H
9 
10 #include "Directory.h"
11 
12 namespace Lucene {
13 
17 class LPPAPI RAMDirectory : public Directory {
18 public:
20  RAMDirectory();
21 
31  RAMDirectory(const DirectoryPtr& dir);
32 
33  RAMDirectory(const DirectoryPtr& dir, bool closeDir);
34 
35  virtual ~RAMDirectory();
36 
38 
39 INTERNAL:
40  int64_t _sizeInBytes;
41  MapStringRAMFile fileMap;
42 
43 protected:
46  bool closeDir;
47 
48 public:
49  virtual void initialize();
50 
52  virtual HashSet<String> listAll();
53 
55  virtual bool fileExists(const String& name);
56 
58  virtual uint64_t fileModified(const String& name);
59 
61  virtual void touchFile(const String& name);
62 
64  virtual int64_t fileLength(const String& name);
65 
68  int64_t sizeInBytes();
69 
71  virtual void deleteFile(const String& name);
72 
75  virtual IndexOutputPtr createOutput(const String& name);
76 
78  virtual IndexInputPtr openInput(const String& name);
79 
81  virtual void close();
82 };
83 
84 }
85 
86 #endif

clucene.sourceforge.net