~ubuntu-branches/ubuntu/wily/gargoyle-free/wily-proposed

« back to all changes in this revision

Viewing changes to terps/geas/istring.hh

  • Committer: Bazaar Package Importer
  • Author(s): Sylvain Beucler
  • Date: 2009-09-11 20:09:43 UTC
  • Revision ID: james.westby@ubuntu.com-20090911200943-idgzoyupq6650zpn
Tags: upstream-2009-08-25
ImportĀ upstreamĀ versionĀ 2009-08-25

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* istring.hh
 
2
 * 
 
3
 * Case-insensitive string
 
4
 */
 
5
 
 
6
#ifndef __istring_hh
 
7
#define __istring_hh
 
8
 
 
9
#include <string>
 
10
#include <cctype>
 
11
 
 
12
//bool   ci_equal    (char ch1, char ch2);
 
13
//bool   ci_less_eq  (char ch1, char ch2);
 
14
//bool   ci_less     (char ch1, char ch2);
 
15
//size_t ci_find     (const std::string &str1, const std::string &str2);
 
16
//size_t ci_diff     (const std::string &str1, const std::string &str2);
 
17
//bool   cis_equal   (const std::string &str1, const std::string &str2);
 
18
//bool   cis_less_eq (const std::string &str1, const std::string &str2);
 
19
//bool   cis_less    (const std::string &str1, const std::string &str2);
 
20
  
 
21
bool c_equal_i (char ch1, char ch2);
 
22
size_t ci_find      (const std::string &str1, const std::string &str2);
 
23
bool   ci_equal    (const std::string &str1, const std::string &str2);
 
24
bool   ci_less_eq  (const std::string &str1, const std::string &str2);
 
25
bool   ci_less     (const std::string &str1, const std::string &str2);
 
26
bool   ci_notequal (const std::string &str1, const std::string &str2);
 
27
bool   ci_gt_eq    (const std::string &str1, const std::string &str2);
 
28
bool   ci_gt       (const std::string &str1, const std::string &str2);
 
29
 
 
30
class CI_EQUAL {
 
31
public:
 
32
  bool operator() (const std::string &str1, const std::string &str2)
 
33
  { return ci_equal (str1, str2); }
 
34
};
 
35
 
 
36
class CI_LESS_EQ {
 
37
public:
 
38
  bool operator() (const std::string &str1, const std::string &str2)
 
39
  { return ci_less_eq (str1, str2); }
 
40
};
 
41
 
 
42
class CI_LESS {
 
43
public:
 
44
  bool operator() (const std::string &str1, const std::string &str2)
 
45
  { 
 
46
    return ci_less (str1, str2);
 
47
  }
 
48
};
 
49
 
 
50
extern CI_EQUAL   ci_equal_obj;
 
51
extern CI_LESS    ci_less_obj;
 
52
extern CI_LESS_EQ ci_less_eq_obj;
 
53
 
 
54
#endif