CLucene - a full-featured, c++ search engine
API Documentation
#include <RAMDirectory.h>

Public Member Functions | |
| DEFINE_MUTABLE_MUTEX(files_mutex) void list(std | RAMDirectory () |
| Returns a null terminated array of strings, one for each file in the 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. | |
| IndexInput * | openInput (const char *name) |
| Returns a stream reading an existing file. | |
| virtual void | close () |
| TCHAR * | toString () const |
| const char * | getDirectoryType () |
Static Public Member Functions | |
| static const char * | DirectoryType () |
Data Fields | |
| int64_t | sizeInBytes |
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 |
Locking implementation is by default the SingleInstanceLockFactory but can be changed with setLockFactory.
| DEFINE_MUTABLE_MUTEX (files_mutex) void list(std lucene::store::RAMDirectory::RAMDirectory | ( | ) |
Returns a null terminated array of strings, one for each file in the directory.
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 |
| virtual bool lucene::store::RAMDirectory::doDeleteFile | ( | const char * | name | ) | [protected, virtual] |
| 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 |
| bool lucene::store::RAMDirectory::fileExists | ( | const char * | name | ) | const [virtual] |
| int64_t lucene::store::RAMDirectory::fileModified | ( | const char * | name | ) | const [virtual] |
| int64_t lucene::store::RAMDirectory::fileLength | ( | const char * | name | ) | const [virtual] |
| virtual void lucene::store::RAMDirectory::renameFile | ( | const char * | from, | |
| const char * | to | |||
| ) | [virtual] |
| void lucene::store::RAMDirectory::touchFile | ( | const char * | name | ) | [virtual] |
| 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.
| IndexInput* lucene::store::RAMDirectory::openInput | ( | const char * | name | ) | [virtual] |
| virtual void lucene::store::RAMDirectory::close | ( | ) | [virtual] |
Implements lucene::store::Directory.
| TCHAR* lucene::store::RAMDirectory::toString | ( | ) | const [virtual] |
Implements lucene::store::Directory.
| static const char* lucene::store::RAMDirectory::DirectoryType | ( | ) | [static] |
| const char* lucene::store::RAMDirectory::getDirectoryType | ( | ) |
FileMap* lucene::store::RAMDirectory::files [protected] |