CLucene - a full-featured, c++ search engine
API Documentation
A memory-resident Directory implementation. More...
#include <RAMDirectory.h>
Classes | |
| class | RAMLock |
Public Member Functions | |
| DEFINE_MUTEX (files_mutex) void list(vector< string > *names) const | |
| Returns a null terminated array of strings, one for each file in the directory. | |
| RAMDirectory () | |
| Constructs an empty Directory. | |
| virtual | ~RAMDirectory () |
| Destructor - only call this if you are sure the directory is not being used anymore. | |
| RAMDirectory (Directory *dir) | |
| RAMDirectory (const char *dir) | |
Creates a new RAMDirectory instance from the FSDirectory. | |
| bool | fileExists (const char *name) const |
| Returns true iff the named file exists in this directory. | |
| int64_t | fileModified (const char *name) const |
| Returns the time the named file was last modified. | |
| int64_t | fileLength (const char *name) const |
| Returns the length in bytes of a file in the directory. | |
| virtual void | renameFile (const char *from, const char *to) |
| Removes an existing file in the directory. | |
| void | touchFile (const char *name) |
| Set the modified time of an existing file to now. | |
| virtual IndexOutput * | createOutput (const char *name) |
| Creates a new, empty file in the directory with the given name. | |
| LuceneLock * | makeLock (const char *name) |
| Construct a Lock. | |
| IndexInput * | openInput (const char *name) |
| Returns a stream reading an existing file. | |
| virtual void | close () |
| TCHAR * | toString () const |
| const char * | getDirectoryType () const |
Static Public Member Functions | |
| static const char * | DirectoryType () |
Protected Member Functions | |
| virtual bool | doDeleteFile (const char *name) |
| Removes an existing file in the directory. | |
| void | _copyFromDir (Directory *dir, bool closeDir) |
Creates a new RAMDirectory instance from a different Directory implementation. | |
Protected Attributes | |
| FileMap | files |
A memory-resident Directory implementation.
| lucene::store::RAMDirectory::RAMDirectory | ( | ) |
Constructs an empty Directory.
| virtual lucene::store::RAMDirectory::~RAMDirectory | ( | ) | [virtual] |
Destructor - only call this if you are sure the directory is not being used anymore.
Otherwise use the ref-counting facilities of dir->close
| lucene::store::RAMDirectory::RAMDirectory | ( | Directory * | dir | ) |
| lucene::store::RAMDirectory::RAMDirectory | ( | const char * | dir | ) |
Creates a new RAMDirectory instance from the FSDirectory.
| dir | a String specifying the full index directory path |
| void lucene::store::RAMDirectory::_copyFromDir | ( | Directory * | dir, | |
| bool | closeDir | |||
| ) | [protected] |
Creates a new RAMDirectory instance from a different Directory implementation.
This can be used to load a disk-based index into memory.
This should be used only with indices that can fit into memory.
| dir | a Directory value |
| IOException | if an error occurs |
| virtual void lucene::store::RAMDirectory::close | ( | ) | [virtual] |
Implements lucene::store::Directory.
Reimplemented in lucene::store::TransactionalRAMDirectory.
| virtual IndexOutput* lucene::store::RAMDirectory::createOutput | ( | const char * | name | ) | [virtual] |
Creates a new, empty file in the directory with the given name.
Returns a stream writing this file.
Implements lucene::store::Directory.
Reimplemented in lucene::store::TransactionalRAMDirectory.
| lucene::store::RAMDirectory::DEFINE_MUTEX | ( | files_mutex | ) | const [mutable] |
Returns a null terminated array of strings, one for each file in the directory.
| static const char* lucene::store::RAMDirectory::DirectoryType | ( | ) | [inline, static] |
| virtual bool lucene::store::RAMDirectory::doDeleteFile | ( | const char * | name | ) | [protected, virtual] |
Removes an existing file in the directory.
Implements lucene::store::Directory.
Reimplemented in lucene::store::TransactionalRAMDirectory.
| bool lucene::store::RAMDirectory::fileExists | ( | const char * | name | ) | const [virtual] |
Returns true iff the named file exists in this directory.
Implements lucene::store::Directory.
| int64_t lucene::store::RAMDirectory::fileLength | ( | const char * | name | ) | const [virtual] |
Returns the length in bytes of a file in the directory.
Implements lucene::store::Directory.
| int64_t lucene::store::RAMDirectory::fileModified | ( | const char * | name | ) | const [virtual] |
Returns the time the named file was last modified.
Implements lucene::store::Directory.
| const char* lucene::store::RAMDirectory::getDirectoryType | ( | ) | const [inline, virtual] |
Implements lucene::store::Directory.
| LuceneLock* lucene::store::RAMDirectory::makeLock | ( | const char * | name | ) | [virtual] |
| IndexInput* lucene::store::RAMDirectory::openInput | ( | const char * | name | ) | [virtual] |
Returns a stream reading an existing file.
Implements lucene::store::Directory.
| virtual void lucene::store::RAMDirectory::renameFile | ( | const char * | from, | |
| const char * | to | |||
| ) | [virtual] |
Removes an existing file in the directory.
Implements lucene::store::Directory.
Reimplemented in lucene::store::TransactionalRAMDirectory.
| TCHAR* lucene::store::RAMDirectory::toString | ( | ) | const [virtual] |
Implements lucene::store::Directory.
| void lucene::store::RAMDirectory::touchFile | ( | const char * | name | ) | [virtual] |
Set the modified time of an existing file to now.
Implements lucene::store::Directory.
FileMap lucene::store::RAMDirectory::files [protected] |