Lucene++ - a full-featured, c++ search engine
API Documentation
Abstract base class for output to a file in a Directory. A random-access output stream. Used for all Lucene index output operations. More...
#include <IndexOutput.h>
Public Member Functions | |
virtual | ~IndexOutput () |
virtual String | getClassName () |
boost::shared_ptr< IndexOutput > | shared_from_this () |
virtual void | writeByte (uint8_t b)=0 |
Writes a single byte. | |
virtual void | writeBytes (const uint8_t *b, int32_t offset, int32_t length)=0 |
Writes an array of bytes. | |
virtual void | flush ()=0 |
Forces any buffered output to be written. | |
virtual void | close ()=0 |
Closes this stream to further operations. | |
virtual int64_t | getFilePointer ()=0 |
Returns the current position in this file, where the next write will occur. | |
virtual void | seek (int64_t pos)=0 |
Sets current position in this file, where the next write will occur. | |
virtual int64_t | length ()=0 |
The number of bytes in the file. | |
void | writeBytes (const uint8_t *b, int32_t length) |
Writes an array of bytes. | |
void | writeInt (int32_t i) |
Writes an int as four bytes. | |
void | writeVInt (int32_t i) |
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported. | |
void | writeLong (int64_t i) |
Writes a int64 as eight bytes. | |
void | writeVLong (int64_t i) |
Writes an int64 in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported. | |
void | writeString (const String &s) |
Writes a string. | |
void | writeChars (const String &s, int32_t start, int32_t length) |
Writes a sub sequence of characters from s as the old format (modified UTF-8 encoded bytes). | |
void | copyBytes (const IndexInputPtr &input, int64_t numBytes) |
Copy numBytes bytes from input to ourself. | |
void | setLength (int64_t length) |
Set the file length. By default, this method does nothing (it's optional for a Directory to implement it). But, certain Directory implementations (for example. | |
void | writeStringStringMap (MapStringString map) |
Write string map as a series of key/value pairs. | |
![]() | |
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. | |
virtual String | toString () |
Returns a string representation of the object. | |
![]() | |
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 () |
Protected Attributes | |
ByteArray | copyBuffer |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Static Protected Attributes | |
static const int32_t | COPY_BUFFER_SIZE |
Additional Inherited Members | |
![]() | |
LuceneObject () | |
Abstract base class for output to a file in a Directory. A random-access output stream. Used for all Lucene index output operations.
|
virtual |
|
inlinestatic |
|
pure virtual |
Closes this stream to further operations.
Implemented in Lucene::BufferedIndexOutput, Lucene::ChecksumIndexOutput, and Lucene::RAMOutputStream.
void Lucene::IndexOutput::copyBytes | ( | const IndexInputPtr & | input, |
int64_t | numBytes | ||
) |
Copy numBytes bytes from input to ourself.
|
pure virtual |
Forces any buffered output to be written.
Implemented in Lucene::BufferedIndexOutput, Lucene::ChecksumIndexOutput, and Lucene::RAMOutputStream.
|
inlinevirtual |
Reimplemented in Lucene::BufferedIndexOutput, Lucene::ChecksumIndexOutput, and Lucene::RAMOutputStream.
|
pure virtual |
Returns the current position in this file, where the next write will occur.
Implemented in Lucene::BufferedIndexOutput, Lucene::ChecksumIndexOutput, and Lucene::RAMOutputStream.
|
pure virtual |
The number of bytes in the file.
Implemented in Lucene::ChecksumIndexOutput, Lucene::RAMOutputStream, and Lucene::BufferedIndexOutput.
|
pure virtual |
Sets current position in this file, where the next write will occur.
Implemented in Lucene::BufferedIndexOutput, Lucene::ChecksumIndexOutput, and Lucene::RAMOutputStream.
void Lucene::IndexOutput::setLength | ( | int64_t | length | ) |
Set the file length. By default, this method does nothing (it's optional for a Directory to implement it). But, certain Directory implementations (for example.
length | file length. |
|
inline |
|
pure virtual |
Writes a single byte.
Implemented in Lucene::BufferedIndexOutput, Lucene::ChecksumIndexOutput, and Lucene::RAMOutputStream.
void Lucene::IndexOutput::writeBytes | ( | const uint8_t * | b, |
int32_t | length | ||
) |
Writes an array of bytes.
b | the bytes to write. |
length | the number of bytes to write. |
|
pure virtual |
Writes an array of bytes.
b | the bytes to write. |
length | the number of bytes to write. |
Implemented in Lucene::BufferedIndexOutput, Lucene::ChecksumIndexOutput, and Lucene::RAMOutputStream.
void Lucene::IndexOutput::writeChars | ( | const String & | s, |
int32_t | start, | ||
int32_t | length | ||
) |
Writes a sub sequence of characters from s as the old format (modified UTF-8 encoded bytes).
s | the source of the characters. |
start | the first character in the sequence. |
length | the number of characters in the sequence. |
writeString
void Lucene::IndexOutput::writeInt | ( | int32_t | i | ) |
Writes an int as four bytes.
void Lucene::IndexOutput::writeLong | ( | int64_t | i | ) |
Writes a int64 as eight bytes.
void Lucene::IndexOutput::writeString | ( | const String & | s | ) |
Writes a string.
void Lucene::IndexOutput::writeStringStringMap | ( | MapStringString | map | ) |
Write string map as a series of key/value pairs.
map | map of string-string key-values. |
void Lucene::IndexOutput::writeVInt | ( | int32_t | i | ) |
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.
void Lucene::IndexOutput::writeVLong | ( | int64_t | i | ) |
Writes an int64 in a variable-length format. Writes between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.
|
staticprotected |
|
protected |