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

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

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BufferedIndexOutput.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 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 BUFFEREDINDEXOUTPUT_H
8 #define BUFFEREDINDEXOUTPUT_H
9
10 #include "IndexOutput.h"
11
12 namespace Lucene
13 {
15 class LPPAPI BufferedIndexOutput : public IndexOutput
16 {
17 public:
18 BufferedIndexOutput();
19 virtual ~BufferedIndexOutput();
20
21 LUCENE_CLASS(BufferedIndexOutput);
22
23 public:
24 static const int32_t BUFFER_SIZE;
25
26 protected:
27 int64_t bufferStart; // position in file of buffer
28 int32_t bufferPosition; // position in buffer
29 ByteArray buffer;
30
31 public:
34 virtual void writeByte(uint8_t b);
35
40 virtual void writeBytes(const uint8_t* b, int32_t offset, int32_t length);
41
43 virtual void flush();
44
50 virtual void flushBuffer(const uint8_t* b, int32_t offset, int32_t length);
51
53 virtual void close();
54
57 virtual int64_t getFilePointer();
58
61 virtual void seek(int64_t pos);
62
64 virtual int64_t length() = 0;
65
66 protected:
71 void flushBuffer(const uint8_t* b, int32_t length);
72 };
73 }
74
75 #endif

clucene.sourceforge.net