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


Loading...
Searching...
No Matches
CharFolder.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 CHARFOLDER_H
8#define CHARFOLDER_H
9
10#include "LuceneObject.h"
11
12namespace Lucene {
13
15class LPPAPI CharFolder : public LuceneObject {
16public:
17 virtual ~CharFolder();
19
20protected:
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
26public:
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
44protected:
45 static bool fillLower();
46 static bool fillUpper();
47};
48
49}
50
51#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Utility class for folding character case.
Definition CharFolder.h:15
static void toLower(ITER first, ITER last)
Definition CharFolder.h:31
static void toUpper(ITER first, ITER last)
Definition CharFolder.h:38
static bool fillUpper()
static bool lowerCache
Definition CharFolder.h:21
static wchar_t toUpper(wchar_t ch)
static bool upperCache
Definition CharFolder.h:22
virtual ~CharFolder()
static bool fillLower()
static wchar_t toLower(wchar_t ch)
Base class for all Lucene classes.
Definition LuceneObject.h:31
Definition AbstractAllTermDocs.h:12

clucene.sourceforge.net