]>
Commit | Line | Data |
---|---|---|
924f73bc | 1 | /* |
dc4eb86a | 2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
924f73bc | 3 | * |
dc4eb86a AJ |
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. | |
924f73bc | 7 | */ |
8 | ||
9 | #ifndef LIBTRIE_TRIECHARTRANSFORM_H | |
10 | #define LIBTRIE_TRIECHARTRANSFORM_H | |
11 | ||
12 | /* This is an internal header for libTrie. | |
26ac0430 AJ |
13 | * libTrie provides both limited C and full C++ |
14 | * bindings. | |
924f73bc | 15 | * libTrie itself is written in C++. |
16 | * For C bindings see Trie.h | |
17 | */ | |
18 | ||
924f73bc | 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 | ||
871899ca | 38 | virtual char operator () (char const) const = 0; |
924f73bc | 39 | }; |
40 | ||
41 | class TrieCaseless : public TrieCharTransform | |
42 | { | |
871899ca | 43 | virtual char operator () (char const aChar) const {return tolower(aChar);} |
924f73bc | 44 | }; |
45 | ||
46 | #endif /* __cplusplus */ | |
47 | ||
48 | #endif /* LIBTRIE_TRIECHARTRANSFORM_H */ | |
f53969cc | 49 |