~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to lib/libTrie/include/TrieCharTransform.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2006-11-11 10:32:06 UTC
  • Revision ID: james.westby@ubuntu.com-20061111103206-f3p0r9g0vq44rp3r
Tags: upstream-3.0.PRE5
ImportĀ upstreamĀ versionĀ 3.0.PRE5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2003 Robert Collins <rbtcollins@hotmail.com>
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 * 
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
 
17
 *
 
18
 */
 
19
 
 
20
#ifndef   LIBTRIE_TRIECHARTRANSFORM_H
 
21
#define   LIBTRIE_TRIECHARTRANSFORM_H
 
22
 
 
23
/* This is an internal header for libTrie.
 
24
 * libTrie provides both limited C and full C++ 
 
25
 * bindings. 
 
26
 * libTrie itself is written in C++.
 
27
 * For C bindings see Trie.h
 
28
 */
 
29
 
 
30
#ifdef HAVE_CONFIG_H
 
31
#include "config.h"
 
32
#endif
 
33
 
 
34
/* C bindings */
 
35
#ifndef   __cplusplus
 
36
 
 
37
/* C++ bindings */
 
38
#else
 
39
#include <sys/types.h>
 
40
#include <utility>
 
41
#include <ctype.h>
 
42
 
 
43
/* TODO: parameterize this to be more generic -
 
44
* i.e. M-ary internal node sizes etc
 
45
*/
 
46
 
 
47
class TrieCharTransform
 
48
{
 
49
 
 
50
public:
 
51
    virtual ~TrieCharTransform() {}
 
52
 
 
53
    virtual char const operator () (char const) = 0;
 
54
};
 
55
 
 
56
class TrieCaseless : public TrieCharTransform
 
57
{
 
58
    virtual char const operator () (char const aChar) {return tolower(aChar);}
 
59
};
 
60
 
 
61
#endif /* __cplusplus */
 
62
 
 
63
#endif /* LIBTRIE_TRIECHARTRANSFORM_H */