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


TermBuffer.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 TERMBUFFER_H
8 #define TERMBUFFER_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
14 class TermBuffer : public LuceneObject {
15 public:
16  TermBuffer();
17  virtual ~TermBuffer();
18 
20 
21 protected:
22  String field;
23  TermPtr term; // cached
24  bool preUTF8Strings; // true if strings are stored in modified UTF8 encoding
25 
28 
29 public:
30  virtual int32_t compareTo(const LuceneObjectPtr& other);
31 
33  void setPreUTF8Strings();
34 
35  void read(const IndexInputPtr& input, const FieldInfosPtr& fieldInfos);
36 
37  void set(const TermPtr& term);
38  void set(const TermBufferPtr& other);
39  void reset();
40 
41  TermPtr toTerm();
42 
43  virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
44 
45 protected:
46  int32_t compareChars(wchar_t* chars1, int32_t len1, wchar_t* chars2, int32_t len2);
47 };
48 
49 }
50 
51 #endif
boost::shared_ptr< TermBuffer > TermBufferPtr
Definition: LuceneTypes.h:234
boost::shared_ptr< UTF8Result > UTF8ResultPtr
Definition: LuceneTypes.h:559
String field
Definition: TermBuffer.h:19
boost::shared_ptr< Term > TermPtr
Definition: LuceneTypes.h:233
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
void setPreUTF8Strings()
Call this if the IndexInput passed to read stores terms in the "modified UTF8" format.
boost::shared_ptr< UnicodeResult > UnicodeResultPtr
Definition: LuceneTypes.h:554
virtual int32_t compareTo(const LuceneObjectPtr &other)
Compare two objects.
UnicodeResultPtr text
Definition: TermBuffer.h:26
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Return clone of this object.
Base class for all Lucene classes.
Definition: LuceneObject.h:31
boost::shared_ptr< IndexInput > IndexInputPtr
Definition: LuceneTypes.h:493
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Definition: AbstractAllTermDocs.h:12
UTF8ResultPtr bytes
Definition: TermBuffer.h:27
void read(const IndexInputPtr &input, const FieldInfosPtr &fieldInfos)
int32_t compareChars(wchar_t *chars1, int32_t len1, wchar_t *chars2, int32_t len2)
Definition: TermBuffer.h:14
void set(const TermPtr &term)
virtual ~TermBuffer()
TermPtr term
Definition: TermBuffer.h:23
bool preUTF8Strings
Definition: TermBuffer.h:24
boost::shared_ptr< FieldInfos > FieldInfosPtr
Definition: LuceneTypes.h:127

clucene.sourceforge.net