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

Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
Lucene::CompoundFileReader Class Reference

Class for accessing a compound stream. This class implements a directory, but is limited to only read operations. Directory methods that would normally modify data throw an exception. More...

`#include <CompoundFileReader.h>`

Inheritance diagram for Lucene::CompoundFileReader:

## Data Structures

struct | FileEntry

## Public Member Functions

| CompoundFileReader (const DirectoryPtr &dir, const String &name)
| CompoundFileReader (const DirectoryPtr &dir, const String &name, int32_t readBufferSize)
virtual | ~CompoundFileReader ()
virtual String | getClassName ()
boost::shared_ptr< CompoundFileReader > | shared_from_this ()
DirectoryPtr | getDirectory ()
String | getName ()
virtual void | close ()
| Closes the store.
virtual IndexInputPtr | openInput (const String &name)
| Returns a stream reading an existing file.
virtual IndexInputPtr | openInput (const String &name, int32_t bufferSize)
| Returns a stream reading an existing file, with the specified read buffer size. The particular Directory implementation may ignore the buffer size. Currently the only Directory implementations that respect this parameter are `FSDirectory` and `CompoundFileReader`.
virtual HashSet< String > | listAll ()
| Returns an array of strings, one for each file in the directory.
virtual bool | fileExists (const String &name)
| Returns true if a file with the given name exists.
virtual uint64_t | fileModified (const String &name)
| Returns the time the compound file was last modified.
virtual void | touchFile (const String &name)
| Set the modified time of the compound file to now.
virtual void | deleteFile (const String &name)
| Not implemented.
virtual void | renameFile (const String &from, const String &to)
| Not implemented.
virtual int64_t | fileLength (const String &name)
| Returns the length of a file in the directory.
virtual IndexOutputPtr | createOutput (const String &name)
| Not implemented.
virtual LockPtr | makeLock (const String &name)
| Not implemented.
Public Member Functions inherited from Lucene::Directory
| Directory ()
virtual | ~Directory ()
boost::shared_ptr< Directory > | shared_from_this ()
virtual void | sync (const String &name)
| Ensure that any writes to this file are moved to stable storage. Lucene uses this to properly commit changes to the index, to prevent a machine/OS crash from corrupting the index.
void | clearLock (const String &name)
| Attempt to clear (forcefully unlock and remove) the specified lock. Only call this at a time when you are certain this lock is no longer in use.
void | setLockFactory (const LockFactoryPtr &lockFactory)
| Set the LockFactory that this Directory instance should use for its locking implementation. Each * instance of LockFactory should only be used for one directory (ie, do not share a single instance across multiple Directories).
LockFactoryPtr | getLockFactory ()
| Get the LockFactory that this Directory instance is using for its locking implementation. Note that this may be null for Directory implementations that provide their own locking implementation.
virtual String | getLockID ()
| Return a string identifier that uniquely differentiates this Directory instance from other Directory instances. This ID should be the same if two Directory instances are considered "the same index". This is how locking "scopes" to the right index.
virtual String | toString ()
| Returns a string representation of the object.
Public Member Functions inherited from Lucene::LuceneObject
virtual | ~LuceneObject ()
virtual void | initialize ()
| Called directly after instantiation to create objects that depend on this object being fully constructed.
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object.
virtual int32_t | hashCode ()
| Return hash code for this object.
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal.
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects.
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock.
virtual LuceneSignalPtr | getSignal ()
| Return this object signal.
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout.
virtual void | unlock ()
| Unlock this object.
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread.
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout.
virtual void | notifyAll ()
| Notify all threads waiting for signal.

## Static Public Member Functions

static String | _getClassName ()
Static Public Member Functions inherited from Lucene::Directory
static String | _getClassName ()
static void | copy (const DirectoryPtr &src, const DirectoryPtr &dest, bool closeDirSrc)
| Copy contents of a directory src to a directory dest. If a file in src already exists in dest then the one in dest will be blindly overwritten. NOTE: the source directory cannot change while this method is running. Otherwise the results are undefined.

## Protected Types

typedef boost::shared_ptr< FileEntry > | FileEntryPtr
typedef HashMap< String, FileEntryPtr > | MapStringFileEntryPtr

## Protected Member Functions

void | ConstructReader (const DirectoryPtr &dir, const String &name, int32_t readBufferSize)
Protected Member Functions inherited from Lucene::Directory
void | ensureOpen ()
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Protected Attributes

DirectoryPtr | directory
String | fileName
int32_t | readBufferSize
IndexInputPtr | stream
MapStringFileEntryPtr | entries
Protected Attributes inherited from Lucene::Directory
bool | isOpen
LockFactoryPtr | lockFactory
| Holds the LockFactory instance (implements locking for this Directory instance).
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Detailed Description

Class for accessing a compound stream. This class implements a directory, but is limited to only read operations. Directory methods that would normally modify data throw an exception.

## Member Typedef Documentation

## ◆ FileEntryPtr

typedef boost::shared_ptr<FileEntry> Lucene::CompoundFileReader::FileEntryPtr

protected

## ◆ MapStringFileEntryPtr

typedef HashMap<String, FileEntryPtr> Lucene::CompoundFileReader::MapStringFileEntryPtr

protected

## Constructor & Destructor Documentation

## ◆ CompoundFileReader() [1/2]

Lucene::CompoundFileReader::CompoundFileReader | ( | const DirectoryPtr & | dir,
|  | const String & | name )

Referenced by _getClassName().

## ◆ CompoundFileReader() [2/2]

Lucene::CompoundFileReader::CompoundFileReader | ( | const DirectoryPtr & | dir,
|  | const String & | name,
|  | int32_t | readBufferSize )

References readBufferSize.

## ◆ ~CompoundFileReader()

virtual Lucene::CompoundFileReader::~CompoundFileReader | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

String Lucene::CompoundFileReader::_getClassName | ( |  | ) |

inline static

References CompoundFileReader().

## ◆ close()

virtual void Lucene::CompoundFileReader::close | ( |  | ) |

virtual

Closes the store.

Implements Lucene::Directory.

## ◆ ConstructReader()

void Lucene::CompoundFileReader::ConstructReader | ( | const DirectoryPtr & | dir,
|  | const String & | name,
|  | int32_t | readBufferSize )

protected

References readBufferSize.

## ◆ createOutput()

virtual IndexOutputPtr Lucene::CompoundFileReader::createOutput | ( | const String & | name | ) |

virtual

Not implemented.

Implements Lucene::Directory.

## ◆ deleteFile()

virtual void Lucene::CompoundFileReader::deleteFile | ( | const String & | name | ) |

virtual

Not implemented.

Implements Lucene::Directory.

## ◆ fileExists()

virtual bool Lucene::CompoundFileReader::fileExists | ( | const String & | name | ) |

virtual

Returns true if a file with the given name exists.

Implements Lucene::Directory.

## ◆ fileLength()

virtual int64_t Lucene::CompoundFileReader::fileLength | ( | const String & | name | ) |

virtual

Returns the length of a file in the directory.

Implements Lucene::Directory.

## ◆ fileModified()

virtual uint64_t Lucene::CompoundFileReader::fileModified | ( | const String & | name | ) |

virtual

Returns the time the compound file was last modified.

Implements Lucene::Directory.

## ◆ getClassName()

virtual String Lucene::CompoundFileReader::getClassName | ( |  | ) |

inline virtual

Reimplemented from Lucene::Directory.

## ◆ getDirectory()

DirectoryPtr Lucene::CompoundFileReader::getDirectory | ( |  | ) |

## ◆ getName()

String Lucene::CompoundFileReader::getName | ( |  | ) |

## ◆ listAll()

virtual HashSet< String > Lucene::CompoundFileReader::listAll | ( |  | ) |

virtual

Returns an array of strings, one for each file in the directory.

Implements Lucene::Directory.

## ◆ makeLock()

virtual LockPtr Lucene::CompoundFileReader::makeLock | ( | const String & | name | ) |

virtual

Not implemented.

Reimplemented from Lucene::Directory.

## ◆ openInput() [1/2]

virtual IndexInputPtr Lucene::CompoundFileReader::openInput | ( | const String & | name | ) |

virtual

Returns a stream reading an existing file.

Implements Lucene::Directory.

## ◆ openInput() [2/2]

virtual IndexInputPtr Lucene::CompoundFileReader::openInput | ( | const String & | name,
|  | int32_t | bufferSize )

virtual

Returns a stream reading an existing file, with the specified read buffer size. The particular Directory implementation may ignore the buffer size. Currently the only Directory implementations that respect this parameter are `FSDirectory` and `CompoundFileReader`.

Reimplemented from Lucene::Directory.

## ◆ renameFile()

virtual void Lucene::CompoundFileReader::renameFile | ( | const String & | from,
|  | const String & | to )

virtual

Not implemented.

## ◆ shared_from_this()

boost::shared_ptr< CompoundFileReader > Lucene::CompoundFileReader::shared_from_this | ( |  | ) |

inline

## ◆ touchFile()

virtual void Lucene::CompoundFileReader::touchFile | ( | const String & | name | ) |

virtual

Set the modified time of the compound file to now.

Implements Lucene::Directory.

## Field Documentation

## ◆ directory

DirectoryPtr Lucene::CompoundFileReader::directory

protected

## ◆ entries

MapStringFileEntryPtr Lucene::CompoundFileReader::entries

protected

## ◆ fileName

String Lucene::CompoundFileReader::fileName

protected

## ◆ readBufferSize

int32_t Lucene::CompoundFileReader::readBufferSize

protected

Referenced by CompoundFileReader(), and ConstructReader().

## ◆ stream

IndexInputPtr Lucene::CompoundFileReader::stream

protected

The documentation for this class was generated from the following file:

- CompoundFileReader.h

clucene.sourceforge.net