]> git.ipfire.org Git - thirdparty/squid.git/blob - lib/libTrie/TrieCharTransform.h
SourceFormat Enforcement
[thirdparty/squid.git] / lib / libTrie / TrieCharTransform.h
1 /*
2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9 #ifndef LIBTRIE_TRIECHARTRANSFORM_H
10 #define LIBTRIE_TRIECHARTRANSFORM_H
11
12 /* This is an internal header for libTrie.
13 * libTrie provides both limited C and full C++
14 * bindings.
15 * libTrie itself is written in C++.
16 * For C bindings see Trie.h
17 */
18
19 /* C bindings */
20 #ifndef __cplusplus
21
22 /* C++ bindings */
23 #else
24 #include <sys/types.h>
25 #include <utility>
26 #include <ctype.h>
27
28 /* TODO: parameterize this to be more generic -
29 * i.e. M-ary internal node sizes etc
30 */
31
32 class TrieCharTransform
33 {
34
35 public:
36 virtual ~TrieCharTransform() {}
37
38 virtual char operator () (char const) const = 0;
39 };
40
41 class TrieCaseless : public TrieCharTransform
42 {
43 virtual char operator () (char const aChar) const {return tolower(aChar);}
44 };
45
46 #endif /* __cplusplus */
47
48 #endif /* LIBTRIE_TRIECHARTRANSFORM_H */
49