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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
Lucene::IndexOutput Class Referenceabstract

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>`

Inheritance diagram for Lucene::IndexOutput:

## 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. More...
virtual void | writeBytes (const uint8_t *b, int32_t offset, int32_t length)=0
| Writes an array of bytes. More...
virtual void | flush ()=0
| Forces any buffered output to be written. More...
virtual void | close ()=0
| Closes this stream to further operations. More...
virtual int64_t | getFilePointer ()=0
| Returns the current position in this file, where the next write will occur. More...
virtual void | seek (int64_t pos)=0
| Sets current position in this file, where the next write will occur. More...
virtual int64_t | length ()=0
| The number of bytes in the file. More...
void | writeBytes (const uint8_t *b, int32_t length)
| Writes an array of bytes. More...
void | writeInt (int32_t i)
| Writes an int as four bytes. More...
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. More...
void | writeLong (int64_t i)
| Writes a int64 as eight bytes. More...
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. More...
void | writeString (const String &s)
| Writes a string. More...
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). More...
void | copyBytes (IndexInputPtr input, int64_t numBytes)
| Copy numBytes bytes from input to ourself. More...
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. More...
void | writeStringStringMap (MapStringString map)
| Write string map as a series of key/value pairs. More...
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. More...
virtual LuceneObjectPtr | clone (LuceneObjectPtr other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (LuceneObjectPtr other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (LuceneObjectPtr other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## Static Public Member Functions

static String | _getClassName ()

## Protected Attributes

ByteArray | copyBuffer

## Static Protected Attributes

static const int32_t | COPY_BUFFER_SIZE

## Additional Inherited Members

Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Detailed Description

Abstract base class for output to a file in a Directory. A random-access output stream. Used for all Lucene index output operations.

See Also
  Directory
  IndexInput

## Constructor & Destructor Documentation

virtual Lucene::IndexOutput::~IndexOutput | ( | ) |  |

virtual

## Member Function Documentation

static String Lucene::IndexOutput::_getClassName | ( | ) |  |

inline static

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

pure virtual

Closes this stream to further operations.

Implemented in Lucene::BufferedIndexOutput, Lucene::ChecksumIndexOutput, and Lucene::RAMOutputStream.

void Lucene::IndexOutput::copyBytes | ( | IndexInputPtr | input,
|  | int64_t | numBytes
| ) |  |

Copy numBytes bytes from input to ourself.

virtual void Lucene::IndexOutput::flush | ( | ) |  |

pure virtual

Forces any buffered output to be written.

Implemented in Lucene::RAMOutputStream, Lucene::ChecksumIndexOutput, and Lucene::BufferedIndexOutput.

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

inline virtual

Reimplemented in Lucene::ChecksumIndexOutput, Lucene::RAMOutputStream, and Lucene::BufferedIndexOutput.

virtual int64_t Lucene::IndexOutput::getFilePointer | ( | ) |  |

pure virtual

Returns the current position in this file, where the next write will occur.

Implemented in Lucene::RAMOutputStream, Lucene::BufferedIndexOutput, and Lucene::ChecksumIndexOutput.

virtual int64_t Lucene::IndexOutput::length | ( | ) |  |

pure virtual

The number of bytes in the file.

Implemented in Lucene::ChecksumIndexOutput, Lucene::BufferedIndexOutput, and Lucene::RAMOutputStream.

virtual void Lucene::IndexOutput::seek | ( | int64_t | pos) |  |

pure virtual

Sets current position in this file, where the next write will occur.

See Also
  getFilePointer()

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.

See Also
  FSDirectory) can use this to inform the underlying IO system to pre-allocate the file to the specified size. If the length is longer than the current file length, the bytes added to the file are undefined. Otherwise the file is truncated.

Parameters

  length | file length.

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

inline

virtual void Lucene::IndexOutput::writeByte | ( | uint8_t | b) |  |

pure virtual

Writes a single byte.

See Also
  IndexInput::readByte()

Implemented in Lucene::RAMOutputStream, Lucene::BufferedIndexOutput, and Lucene::ChecksumIndexOutput.

virtual void Lucene::IndexOutput::writeBytes | ( | const uint8_t * | b,
|  | int32_t | offset,
|  | int32_t | length
| ) |  |

pure virtual

Writes an array of bytes.

Parameters

  b | the bytes to write.
  length | the number of bytes to write.

See Also
  IndexInput::readBytes(uint8_t*, int32_t, int32_t)

Implemented in Lucene::RAMOutputStream, Lucene::BufferedIndexOutput, and Lucene::ChecksumIndexOutput.

void Lucene::IndexOutput::writeBytes | ( | const uint8_t * | b,
|  | int32_t | length
| ) |  |

Writes an array of bytes.

Parameters

  b | the bytes to write.
  length | the number of bytes to write.

See Also
  IndexInput::readBytes(uint8_t*, int32_t, int32_t)

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).

Parameters

  s | the source of the characters.
  start | the first character in the sequence.
  length | the number of characters in the sequence.

Deprecated:
  – please use writeString

void Lucene::IndexOutput::writeInt | ( | int32_t | i) |  |

Writes an int as four bytes.

See Also
  IndexInput::readInt()

void Lucene::IndexOutput::writeLong | ( | int64_t | i) |  |

Writes a int64 as eight bytes.

See Also
  IndexInput::readLong()

void Lucene::IndexOutput::writeString | ( | const String & | s) |  |

Writes a string.

See Also
  IndexInput::readString()

void Lucene::IndexOutput::writeStringStringMap | ( | MapStringString | map) |  |

Write string map as a series of key/value pairs.

Parameters

  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.

See Also
  IndexInput::readVInt()

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.

See Also
  IndexInput::readVLong()

## Field Documentation

const int32_t Lucene::IndexOutput::COPY_BUFFER_SIZE

static protected

ByteArray Lucene::IndexOutput::copyBuffer

protected

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

- IndexOutput.h

clucene.sourceforge.net