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


IndexOutput.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 INDEXOUTPUT_H
8 #define INDEXOUTPUT_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
18 class LPPAPI IndexOutput : public LuceneObject {
19 public:
20  virtual ~IndexOutput();
21 
23 
24 protected:
25  static const int32_t COPY_BUFFER_SIZE;
26  ByteArray copyBuffer;
27 
28 public:
31  virtual void writeByte(uint8_t b) = 0;
32 
37  virtual void writeBytes(const uint8_t* b, int32_t offset, int32_t length) = 0;
38 
40  virtual void flush() = 0;
41 
43  virtual void close() = 0;
44 
46  virtual int64_t getFilePointer() = 0;
47 
50  virtual void seek(int64_t pos) = 0;
51 
53  virtual int64_t length() = 0;
54 
55 public:
60  void writeBytes(const uint8_t* b, int32_t length);
61 
64  void writeInt(int32_t i);
65 
69  void writeVInt(int32_t i);
70 
73  void writeLong(int64_t i);
74 
78  void writeVLong(int64_t i);
79 
82  void writeString(const String& s);
83 
89  void writeChars(const String& s, int32_t start, int32_t length);
90 
92  void copyBytes(const IndexInputPtr& input, int64_t numBytes);
93 
99  void setLength(int64_t length);
100 
103  void writeStringStringMap(MapStringString map);
104 };
105 
106 }
107 
108 #endif
Lucene::IndexOutput::getFilePointer
virtual int64_t getFilePointer()=0
Returns the current position in this file, where the next write will occur.
Lucene::IndexOutput::seek
virtual void seek(int64_t pos)=0
Sets current position in this file, where the next write will occur.
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::IndexOutput::writeInt
void writeInt(int32_t i)
Writes an int as four bytes.
Lucene::IndexOutput::writeChars
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).
Lucene::IndexOutput::writeBytes
virtual void writeBytes(const uint8_t *b, int32_t offset, int32_t length)=0
Writes an array of bytes.
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::IndexOutput::COPY_BUFFER_SIZE
static const int32_t COPY_BUFFER_SIZE
Definition: IndexOutput.h:22
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::IndexOutput::writeVInt
void writeVInt(int32_t i)
Writes an int in a variable-length format. Writes between one and five bytes. Smaller values take few...
Lucene::IndexInputPtr
boost::shared_ptr< IndexInput > IndexInputPtr
Definition: LuceneTypes.h:493
Lucene::IndexOutput::copyBytes
void copyBytes(const IndexInputPtr &input, int64_t numBytes)
Copy numBytes bytes from input to ourself.
Lucene::IndexOutput::copyBuffer
ByteArray copyBuffer
Definition: IndexOutput.h:26
Lucene::IndexOutput::flush
virtual void flush()=0
Forces any buffered output to be written.
Lucene::IndexOutput::close
virtual void close()=0
Closes this stream to further operations.
Lucene::IndexOutput::writeString
void writeString(const String &s)
Writes a string.
Lucene::IndexOutput::~IndexOutput
virtual ~IndexOutput()
Lucene::IndexOutput::length
virtual int64_t length()=0
The number of bytes in the file.
Lucene::IndexOutput::writeBytes
void writeBytes(const uint8_t *b, int32_t length)
Writes an array of bytes.
Lucene::IndexOutput
Abstract base class for output to a file in a Directory. A random-access output stream....
Definition: IndexOutput.h:18
Lucene::IndexOutput::writeStringStringMap
void writeStringStringMap(MapStringString map)
Write string map as a series of key/value pairs.
Lucene::IndexOutput::writeLong
void writeLong(int64_t i)
Writes a int64 as eight bytes.
Lucene::IndexOutput::writeVLong
void writeVLong(int64_t i)
Writes an int64 in a variable-length format. Writes between one and five bytes. Smaller values take f...
Lucene::IndexOutput::setLength
void setLength(int64_t length)
Set the file length. By default, this method does nothing (it's optional for a Directory to implement...
Lucene::IndexOutput::writeByte
virtual void writeByte(uint8_t b)=0
Writes a single byte.
LuceneObject.h

clucene.sourceforge.net