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


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

clucene.sourceforge.net