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


lucene::store::IndexInput Class Reference

Abstract base class for input from a file in a Directory. More...

#include <IndexInput.h>

Inheritance diagram for lucene::store::IndexInput:
lucene::debug::LuceneBase lucene::store::BufferedIndexInput lucene::store::RAMIndexInput

List of all members.

Public Member Functions

virtual ~IndexInput ()
virtual IndexInputclone () const =0
virtual uint8_t readByte ()=0
 Reads and returns a single byte.
virtual void readBytes (uint8_t *b, const int32_t len)=0
 Reads a specified number of bytes into an array at the specified offset.
int32_t readInt ()
 Reads four bytes and returns an int.
virtual int32_t readVInt ()
 Reads an int stored in variable-length format.
int64_t readLong ()
 Reads eight bytes and returns a long.
int64_t readVLong ()
 Reads a long stored in variable-length format.
int32_t readString (TCHAR *buffer, const int32_t maxlength)
 Reads a string.
TCHAR * readString (const bool unique=true)
 Reads a string.
void readChars (TCHAR *buffer, const int32_t start, const int32_t len)
 Reads UTF-8 encoded characters into an array.
virtual void close ()=0
 Closes the stream to futher operations.
virtual int64_t getFilePointer () const =0
 Returns the current position in this file, where the next read will occur.
virtual void seek (const int64_t pos)=0
 Sets current position in this file, where the next read will occur.
virtual int64_t length ()=0
 The number of bytes in the file.
virtual const char * getDirectoryType () const =0

Protected Member Functions

 IndexInput ()
 IndexInput (const IndexInput &clone)

Detailed Description

Abstract base class for input from a file in a Directory.

A random-access input stream. Used for all Lucene index input operations.

See also:
Directory
IndexOutput

Constructor & Destructor Documentation

lucene::store::IndexInput::IndexInput (  )  [protected]
lucene::store::IndexInput::IndexInput ( const IndexInput clone  )  [protected]
virtual lucene::store::IndexInput::~IndexInput (  )  [inline, virtual]

Member Function Documentation

virtual IndexInput* lucene::store::IndexInput::clone (  )  const [pure virtual]
virtual void lucene::store::IndexInput::close (  )  [pure virtual]

Closes the stream to futher operations.

Implemented in lucene::store::BufferedIndexInput, and lucene::store::RAMIndexInput.

virtual const char* lucene::store::IndexInput::getDirectoryType (  )  const [pure virtual]
virtual int64_t lucene::store::IndexInput::getFilePointer (  )  const [pure virtual]

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

See also:
seek(long)

Implemented in lucene::store::BufferedIndexInput.

virtual int64_t lucene::store::IndexInput::length (  )  [pure virtual]

The number of bytes in the file.

Implemented in lucene::store::RAMIndexInput.

virtual uint8_t lucene::store::IndexInput::readByte (  )  [pure virtual]

Reads and returns a single byte.

See also:
IndexOutput::writeByte(byte)

Implemented in lucene::store::BufferedIndexInput.

virtual void lucene::store::IndexInput::readBytes ( uint8_t *  b,
const int32_t  len 
) [pure virtual]

Reads a specified number of bytes into an array at the specified offset.

Parameters:
b the array to read bytes into
offset the offset in the array to start storing bytes
len the number of bytes to read
See also:
IndexOutput::writeBytes(byte[],int32_t)

Implemented in lucene::store::BufferedIndexInput.

void lucene::store::IndexInput::readChars ( TCHAR *  buffer,
const int32_t  start,
const int32_t  len 
)

Reads UTF-8 encoded characters into an array.

Parameters:
buffer the array to read characters into
start the offset in the array to start storing characters
length the number of characters to read
See also:
IndexOutput::writeChars(String,int32_t,int32_t)
int32_t lucene::store::IndexInput::readInt (  ) 

Reads four bytes and returns an int.

See also:
IndexOutput::writeInt(int32_t)
int64_t lucene::store::IndexInput::readLong (  ) 

Reads eight bytes and returns a long.

See also:
IndexOutput::writeLong(long)
TCHAR* lucene::store::IndexInput::readString ( const bool  unique = true  ) 

Reads a string.

See also:
IndexOutput::writeString(String) If unique is true (default) the string will be duplicated. If false and the length is zero, LUCENE_BLANK_STRING is returned
int32_t lucene::store::IndexInput::readString ( TCHAR *  buffer,
const int32_t  maxlength 
)

Reads a string.

See also:
IndexOutput::writeString(String) maxLength is the amount read into the buffer, the whole string is still read from the stream returns the amount read
virtual int32_t lucene::store::IndexInput::readVInt (  )  [virtual]

Reads an int stored in variable-length format.

Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.

See also:
IndexOutput::writeVInt(int32_t)
int64_t lucene::store::IndexInput::readVLong (  ) 

Reads a long stored in variable-length format.

Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

virtual void lucene::store::IndexInput::seek ( const int64_t  pos  )  [pure virtual]

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

See also:
getFilePointer()

Implemented in lucene::store::BufferedIndexInput.


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

clucene.sourceforge.net