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


CharFolder.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 CHARFOLDER_H
8 #define CHARFOLDER_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
15 class LPPAPI CharFolder : public LuceneObject {
16 public:
17  virtual ~CharFolder();
19 
20 protected:
21  static bool lowerCache;
22  static bool upperCache;
23  static wchar_t lowerChars[CHAR_MAX - CHAR_MIN + 1];
24  static wchar_t upperChars[CHAR_MAX - CHAR_MIN + 1];
25 
26 public:
27  static wchar_t toLower(wchar_t ch);
28  static wchar_t toUpper(wchar_t ch);
29 
30  template <class ITER>
31  static void toLower(ITER first, ITER last) {
32  for (; first != last; ++first) {
33  *first = toLower(*first);
34  }
35  }
36 
37  template <class ITER>
38  static void toUpper(ITER first, ITER last) {
39  for (; first != last; ++first) {
40  *first = toUpper(*first);
41  }
42  }
43 
44 protected:
45  static bool fillLower();
46  static bool fillUpper();
47 };
48 
49 }
50 
51 #endif
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::CharFolder
Utility class for folding character case.
Definition: CharFolder.h:15
Lucene::CharFolder::upperCache
static bool upperCache
Definition: CharFolder.h:22
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::CharFolder::toLower
static void toLower(ITER first, ITER last)
Definition: CharFolder.h:31
Lucene::CharFolder::toUpper
static void toUpper(ITER first, ITER last)
Definition: CharFolder.h:38
LuceneObject.h

clucene.sourceforge.net