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
BufferedReader.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 BUFFEREDREADER_H
8 #define BUFFEREDREADER_H
9
10 #include "Reader.h"
11
12 namespace Lucene
13 {
16 class LPPAPI BufferedReader : public Reader
17 {
18 public:
20 BufferedReader(ReaderPtr reader, int32_t size = READER_BUFFER);
21 virtual ~BufferedReader();
22
23 LUCENE_CLASS(BufferedReader);
24
25 protected:
26 ReaderPtr reader;
27 int32_t bufferSize;
28 int32_t bufferLength; // end of valid bytes
29 int32_t bufferPosition; // next byte to read
30 CharArray buffer;
31
32 public:
33 static const int32_t READER_BUFFER;
34
35 public:
37 virtual int32_t read();
38
40 virtual int32_t read(wchar_t* b, int32_t offset, int32_t length);
41
43 virtual bool readLine(String& line);
44
46 virtual void close();
47
49 virtual bool markSupported();
50
52 virtual void reset();
53
54 protected:
56 int32_t refill();
57
59 int32_t peek();
60 };
61 }
62
63 #endif

clucene.sourceforge.net