tlx
less_icase.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * tlx/string/less_icase.hpp
3  *
4  * Part of tlx - http://panthema.net/tlx
5  *
6  * Copyright (C) 2007-2019 Timo Bingmann <tb@panthema.net>
7  *
8  * All rights reserved. Published under the Boost Software License, Version 1.0
9  ******************************************************************************/
10 
11 #ifndef TLX_STRING_LESS_ICASE_HEADER
12 #define TLX_STRING_LESS_ICASE_HEADER
13 
14 #include <string>
15 
16 namespace tlx {
17 
18 //! \addtogroup tlx_string
19 //! \{
20 
21 /******************************************************************************/
22 // less_icase()
23 
24 //! returns true if a < b without regard for letter case
25 bool less_icase(const char* a, const char* b);
26 
27 //! returns true if a < b without regard for letter case
28 bool less_icase(const char* a, const std::string& b);
29 
30 //! returns true if a < b without regard for letter case
31 bool less_icase(const std::string& a, const char* b);
32 
33 //! returns true if a < b without regard for letter case
34 bool less_icase(const std::string& a, const std::string& b);
35 
36 /******************************************************************************/
37 // order_less_icase: case-insensitive order relation functional classes
38 
39 //! Case-insensitive less order relation functional class for std::map, etc.
41  inline bool operator () (const std::string& a, const std::string& b) const {
42  return less_icase(a, b);
43  }
44 };
45 
46 //! Descending case-insensitive less order relation functional class for
47 //! std::map, etc.
49  inline bool operator () (const std::string& a, const std::string& b) const {
50  return !less_icase(a, b);
51  }
52 };
53 
54 //! \}
55 
56 } // namespace tlx
57 
58 #endif // !TLX_STRING_LESS_ICASE_HEADER
59 
60 /******************************************************************************/
bool less_icase(const char *a, const char *b)
returns true if a < b without regard for letter case
Definition: less_icase.cpp:18
Descending case-insensitive less order relation functional class for std::map, etc.
Definition: less_icase.hpp:48
bool operator()(const std::string &a, const std::string &b) const
Definition: less_icase.hpp:41
Case-insensitive less order relation functional class for std::map, etc.
Definition: less_icase.hpp:40