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


Loading...
Searching...
No Matches
IndexInput.h
Go to the documentation of this file.
1
2// 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
12namespace Lucene {
13
17class LPPAPI IndexInput : public LuceneObject {
18public:
20 virtual ~IndexInput();
21
23
24protected:
25 bool preUTF8Strings; // true if we are reading old (modified UTF8) string format
26
27public:
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
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Abstract base class for input from a file in a Directory. A random-access input stream....
Definition IndexInput.h:17
virtual String readModifiedUTF8String()
Reads a modified UTF8 format string.
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this stream.
virtual int64_t getFilePointer()=0
Returns the current position in this file, where the next read will occur.
virtual int64_t readVLong()
Reads a int64 stored in variable-length format. Reads between one and nine bytes. Smaller values take...
bool preUTF8Strings
Definition IndexInput.h:25
virtual MapStringString readStringStringMap()
Read string map as a series of key/value pairs.
virtual int32_t readVInt()
Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take ...
virtual String readString()
Reads a string.
virtual int32_t readInt()
Reads four bytes and returns an int.
virtual void close()=0
Closes the stream to further operations.
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.
virtual uint8_t readByte()=0
Reads and returns a single byte.
virtual int64_t length()=0
The number of bytes in the file.
virtual ~IndexInput()
virtual int64_t readLong()
Reads eight bytes and returns a int64.
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...
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...
virtual void setModifiedUTF8StringsMode()
Call this if readString should read characters stored in the old modified UTF8 format....
virtual void seek(int64_t pos)=0
Sets current position in this file, where the next read will occur.
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.
Base class for all Lucene classes.
Definition LuceneObject.h:31
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539

clucene.sourceforge.net