]>
Commit | Line | Data |
---|---|---|
b32b8144 | 1 | // |
92f5a8d4 | 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) |
b32b8144 FG |
3 | // |
4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | // | |
7 | // Official repository: https://github.com/boostorg/beast | |
8 | // | |
9 | ||
10 | #ifndef BOOST_BEAST_STRING_HPP | |
11 | #define BOOST_BEAST_STRING_HPP | |
12 | ||
13 | #include <boost/beast/core/detail/config.hpp> | |
92f5a8d4 | 14 | #include <boost/beast/core/string_type.hpp> |
b32b8144 FG |
15 | |
16 | namespace boost { | |
17 | namespace beast { | |
18 | ||
b32b8144 FG |
19 | /** Returns `true` if two strings are equal, using a case-insensitive comparison. |
20 | ||
21 | The case-comparison operation is defined only for low-ASCII characters. | |
22 | ||
23 | @param lhs The string on the left side of the equality | |
24 | ||
25 | @param rhs The string on the right side of the equality | |
26 | */ | |
92f5a8d4 | 27 | BOOST_BEAST_DECL |
b32b8144 FG |
28 | bool |
29 | iequals( | |
30 | beast::string_view lhs, | |
92f5a8d4 | 31 | beast::string_view rhs); |
b32b8144 FG |
32 | |
33 | /** A case-insensitive less predicate for strings. | |
34 | ||
35 | The case-comparison operation is defined only for low-ASCII characters. | |
20effc67 TL |
36 | |
37 | As of C++14, containers using this class as the `Compare` type will take part | |
38 | in heterogeneous lookup if the search term is implicitly convertible to | |
39 | @ref string_view. | |
b32b8144 FG |
40 | */ |
41 | struct iless | |
42 | { | |
92f5a8d4 | 43 | BOOST_BEAST_DECL |
b32b8144 FG |
44 | bool |
45 | operator()( | |
46 | string_view lhs, | |
92f5a8d4 | 47 | string_view rhs) const; |
20effc67 TL |
48 | |
49 | using is_transparent = void; | |
b32b8144 FG |
50 | }; |
51 | ||
52 | /** A case-insensitive equality predicate for strings. | |
53 | ||
54 | The case-comparison operation is defined only for low-ASCII characters. | |
20effc67 TL |
55 | |
56 | As of C++14, containers using this class as the `Compare` type will take part | |
57 | in heterogeneous lookup if the search term is implicitly convertible to | |
58 | @ref string_view. | |
b32b8144 FG |
59 | */ |
60 | struct iequal | |
61 | { | |
62 | bool | |
63 | operator()( | |
64 | string_view lhs, | |
65 | string_view rhs) const | |
66 | { | |
67 | return iequals(lhs, rhs); | |
68 | } | |
20effc67 TL |
69 | |
70 | using is_transparent = void; | |
b32b8144 FG |
71 | }; |
72 | ||
73 | } // beast | |
74 | } // boost | |
75 | ||
92f5a8d4 TL |
76 | #ifdef BOOST_BEAST_HEADER_ONLY |
77 | #include <boost/beast/core/impl/string.ipp> | |
78 | #endif | |
79 | ||
b32b8144 | 80 | #endif |