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

Loading...
Searching...
No Matches
FastCharStream.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 FASTCHARSTREAM_H
8#define FASTCHARSTREAM_H
9
10#include "QueryParserCharStream.h"
11
12 namespace Lucene {
13
18 class LPPAPI FastCharStream : public QueryParserCharStream, public LuceneObject {
19 public:
21 FastCharStream(const ReaderPtr& reader);
22 virtual ~FastCharStream();
23
24 LUCENE_CLASS(FastCharStream);
25
26 public:
27 CharArray buffer;
28
29 int32_t bufferLength; // end of valid chars
30 int32_t bufferPosition; // next char to read
31
32 int32_t tokenStart; // offset in buffer
33 int32_t bufferStart; // position in file of buffer
34
35 ReaderPtr input; // source of chars
36
37 public:
38 virtual wchar_t readChar();
39 virtual wchar_t BeginToken();
40 virtual void backup(int32_t amount);
41 virtual String GetImage();
42 virtual CharArray GetSuffix(int32_t length);
43 virtual void Done();
44 virtual int32_t getColumn();
45 virtual int32_t getLine();
46 virtual int32_t getEndColumn();
47 virtual int32_t getEndLine();
48 virtual int32_t getBeginColumn();
49 virtual int32_t getBeginLine();
50
51 protected:
52 void refill();
53};
54
55}
56
57#endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
QueryParserCharStream.h
Lucene::FastCharStream
An efficient implementation of QueryParserCharStream interface.
Definition FastCharStream.h:18
Lucene::FastCharStream::bufferLength
int32_t bufferLength
Definition FastCharStream.h:29
Lucene::FastCharStream::backup
virtual void backup(int32_t amount)
Backs up the input stream by amount steps. Lexer calls this method if it had already read some charac...
Lucene::FastCharStream::BeginToken
virtual wchar_t BeginToken()
Returns the next character that marks the beginning of the next token. All characters must remain in ...
Lucene::FastCharStream::~FastCharStream
virtual ~FastCharStream()
Lucene::FastCharStream::bufferPosition
int32_t bufferPosition
Definition FastCharStream.h:30
Lucene::FastCharStream::tokenStart
int32_t tokenStart
Definition FastCharStream.h:32
Lucene::FastCharStream::refill
void refill()
Lucene::FastCharStream::GetImage
virtual String GetImage()
Returns a string made up of characters from the marked token beginning to the current buffer position...
Lucene::FastCharStream::input
ReaderPtr input
Definition FastCharStream.h:35
Lucene::FastCharStream::getEndColumn
virtual int32_t getEndColumn()
Returns the column number of the last character for current token (being matched after the last call ...
Lucene::FastCharStream::getLine
virtual int32_t getLine()
Returns the line number of the character last read.
Lucene::FastCharStream::buffer
CharArray buffer
Definition FastCharStream.h:27
Lucene::FastCharStream::getBeginLine
virtual int32_t getBeginLine()
Returns the line number of the first character for current token (being matched after the last call t...
Lucene::FastCharStream::FastCharStream
FastCharStream(const ReaderPtr &reader)
Constructs from a Reader.
Lucene::FastCharStream::getBeginColumn
virtual int32_t getBeginColumn()
Returns the column number of the first character for current token (being matched after the last call...
Lucene::FastCharStream::getEndLine
virtual int32_t getEndLine()
Returns the line number of the last character for current token (being matched after the last call to...
Lucene::FastCharStream::readChar
virtual wchar_t readChar()
Returns the next character from the selected input. The method of selecting the input is the responsi...
Lucene::FastCharStream::Done
virtual void Done()
The lexer calls this function to indicate that it is done with the stream and hence implementations c...
Lucene::FastCharStream::getColumn
virtual int32_t getColumn()
Returns the column position of the character last read.
Lucene::FastCharStream::GetSuffix
virtual CharArray GetSuffix(int32_t length)
Returns an array of characters that make up the suffix of length for the currently matched token....
Lucene::FastCharStream::bufferStart
int32_t bufferStart
Definition FastCharStream.h:33
Lucene::LuceneObject
Base class for all Lucene classes.
Definition LuceneObject.h:31
Lucene::QueryParserCharStream
This interface describes a character stream that maintains line and column number positions of the ch...
Definition QueryParserCharStream.h:22
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::ReaderPtr
boost::shared_ptr< Reader > ReaderPtr
Definition LuceneTypes.h:547

clucene.sourceforge.net