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


IndexInput.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef INDEXINPUT_H
8 #define INDEXINPUT_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
17 class LPPAPI IndexInput : public LuceneObject {
18 public:
20  virtual ~IndexInput();
21 
23 
24 protected:
25  bool preUTF8Strings; // true if we are reading old (modified UTF8) string format
26 
27 public:
30  virtual uint8_t readByte() = 0;
31 
37  virtual void readBytes(uint8_t* b, int32_t offset, int32_t length) = 0;
38 
48  virtual void readBytes(uint8_t* b, int32_t offset, int32_t length, bool useBuffer);
49 
52  virtual int32_t readInt();
53 
57  virtual int32_t readVInt();
58 
61  virtual int64_t readLong();
62 
65  virtual int64_t readVLong();
66 
70 
73  virtual String readString();
74 
76  virtual String readModifiedUTF8String();
77 
83  virtual int32_t readChars(wchar_t* buffer, int32_t start, int32_t length);
84 
93  virtual void skipChars(int32_t length);
94 
96  virtual void close() = 0;
97 
100  virtual int64_t getFilePointer() = 0;
101 
104  virtual void seek(int64_t pos) = 0;
105 
107  virtual int64_t length() = 0;
108 
117 
119  virtual MapStringString readStringStringMap();
120 };
121 
122 }
123 
124 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::IndexInput::IndexInput
IndexInput()
Lucene::IndexInput::length
virtual int64_t length()=0
The number of bytes in the file.
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
Lucene::IndexInput::readVLong
virtual int64_t readVLong()
Reads a int64 stored in variable-length format. Reads between one and nine bytes. Smaller values take...
Lucene::IndexInput::readChars
virtual int32_t readChars(wchar_t *buffer, int32_t start, int32_t length)
Reads Lucene's old "modified UTF-8" encoded characters into an array.
Lucene::IndexInput::readVInt
virtual int32_t readVInt()
Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take ...
Lucene::IndexInput
Abstract base class for input from a file in a Directory. A random-access input stream....
Definition: IndexInput.h:17
Lucene::IndexInput::readString
virtual String readString()
Reads a string.
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::IndexInput::~IndexInput
virtual ~IndexInput()
Lucene::IndexInput::preUTF8Strings
bool preUTF8Strings
Definition: IndexInput.h:22
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::IndexInput::seek
virtual void seek(int64_t pos)=0
Sets current position in this file, where the next read will occur.
Lucene::IndexInput::close
virtual void close()=0
Closes the stream to further operations.
Lucene::IndexInput::clone
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this stream.
Lucene::IndexInput::readBytes
virtual void readBytes(uint8_t *b, int32_t offset, int32_t length)=0
Reads a specified number of bytes into an array at the specified offset.
Lucene::IndexInput::readModifiedUTF8String
virtual String readModifiedUTF8String()
Reads a modified UTF8 format string.
Lucene::IndexInput::skipChars
virtual void skipChars(int32_t length)
Similar to readChars(wchar_t*, int32_t, int32_t) but does not do any conversion operations on the byt...
Lucene::IndexInput::readBytes
virtual void readBytes(uint8_t *b, int32_t offset, int32_t length, bool useBuffer)
Reads a specified number of bytes into an array at the specified offset with control over whether the...
Lucene::IndexInput::getFilePointer
virtual int64_t getFilePointer()=0
Returns the current position in this file, where the next read will occur.
Lucene::IndexInput::readByte
virtual uint8_t readByte()=0
Reads and returns a single byte.
Lucene::IndexInput::readInt
virtual int32_t readInt()
Reads four bytes and returns an int.
Lucene::IndexInput::readLong
virtual int64_t readLong()
Reads eight bytes and returns a int64.
Lucene::IndexInput::setModifiedUTF8StringsMode
virtual void setModifiedUTF8StringsMode()
Call this if readString should read characters stored in the old modified UTF8 format....
Lucene::IndexInput::readStringStringMap
virtual MapStringString readStringStringMap()
Read string map as a series of key/value pairs.
LuceneObject.h

clucene.sourceforge.net