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