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

Loading...
Searching...
No Matches
BufferedReader.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 BUFFEREDREADER_H
8#define BUFFEREDREADER_H
9
10#include "Reader.h"
11
12 namespace Lucene {
13
16 class LPPAPI BufferedReader : public Reader {
17 public:
19 BufferedReader(const ReaderPtr& reader, int32_t size = READER_BUFFER);
20 virtual ~BufferedReader();
21
22 LUCENE_CLASS(BufferedReader);
23
24 protected:
25 ReaderPtr reader;
26 int32_t bufferSize;
27 int32_t bufferLength; // end of valid bytes
28 int32_t bufferPosition; // next byte to read
29 CharArray buffer;
30
31 public:
32 static const int32_t READER_BUFFER;
33
34 public:
36 virtual int32_t read();
37
39 virtual int32_t read(wchar_t* b, int32_t offset, int32_t length);
40
42 virtual bool readLine(String& line);
43
45 virtual void close();
46
48 virtual bool markSupported();
49
51 virtual void reset();
52
53 protected:
55 int32_t refill();
56
58 int32_t peek();
59};
60
61}
62
63#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Reader.h
Lucene::BufferedReader::bufferPosition
int32_t bufferPosition
Definition BufferedReader.h:28
Lucene::BufferedReader::peek
int32_t peek()
Read a single character without moving position.
Lucene::BufferedReader::refill
int32_t refill()
Refill buffer in preparation for reading.
Lucene::BufferedReader::reader
ReaderPtr reader
Definition BufferedReader.h:25
Lucene::BufferedReader::buffer
CharArray buffer
Definition BufferedReader.h:29
Lucene::BufferedReader::close
virtual void close()
Close the stream.
Lucene::BufferedReader::markSupported
virtual bool markSupported()
Tell whether this stream supports the mark() operation.
Lucene::BufferedReader::bufferLength
int32_t bufferLength
Definition BufferedReader.h:27
Lucene::BufferedReader::READER_BUFFER
static const int32_t READER_BUFFER
Definition BufferedReader.h:32
Lucene::BufferedReader::reset
virtual void reset()
Reset the stream.
Lucene::BufferedReader::read
virtual int32_t read()
Read a single character.
Lucene::BufferedReader::BufferedReader
BufferedReader(const ReaderPtr &reader, int32_t size=READER_BUFFER)
Create a buffering character-input stream.
Lucene::BufferedReader::readLine
virtual bool readLine(String &line)
Read a line of text.
Lucene::BufferedReader::bufferSize
int32_t bufferSize
Definition BufferedReader.h:26
Lucene::BufferedReader::~BufferedReader
virtual ~BufferedReader()
Lucene::BufferedReader::read
virtual int32_t read(wchar_t *b, int32_t offset, int32_t length)
Read characters into a portion of an array.
Lucene::Reader::length
virtual int64_t length()
The number of bytes in the stream.
Lucene::Reader::Reader
Reader()
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::ReaderPtr
boost::shared_ptr< Reader > ReaderPtr
Definition LuceneTypes.h:547

clucene.sourceforge.net