]> git.ipfire.org Git - thirdparty/squid.git/blame - lib/libTrie/TrieCharTransform.h
Maintenance: Consistent use of C++11 "override" specifier (#1224)
[thirdparty/squid.git] / lib / libTrie / TrieCharTransform.h
CommitLineData
924f73bc 1/*
bf95c10a 2 * Copyright (C) 1996-2022 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
32class TrieCharTransform
33{
34
35public:
36 virtual ~TrieCharTransform() {}
37
871899ca 38 virtual char operator () (char const) const = 0;
924f73bc 39};
40
41class TrieCaseless : public TrieCharTransform
42{
337b9aa4 43 char operator () (char const aChar) const override {return tolower(aChar);}
924f73bc 44};
45
46#endif /* __cplusplus */
47
48#endif /* LIBTRIE_TRIECHARTRANSFORM_H */
f53969cc 49