Files
boost_beast/include/boost/beast/core/string.hpp
T
Damian Jarek a0d5baf22a Improve performance of http::string_to_verb
`operator==` performs better than the hand-written comparison routine.

fix #1636

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2019-06-19 17:53:35 +02:00

75 lines
1.7 KiB
C++

//
// 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 BOOST_BEAST_STRING_HPP
#define BOOST_BEAST_STRING_HPP
#include <boost/beast/core/detail/string.hpp>
namespace boost {
namespace beast {
/// The type of string view used by the library
using detail::string_view;
/// The type of basic string view used by the library
template<class CharT, class Traits>
using basic_string_view = detail::basic_string_view<CharT, Traits>;
/** 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
*/
BOOST_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.
*/
struct iless
{
BOOST_BEAST_DECL
bool
operator()(
string_view lhs,
string_view rhs) const;
};
/** A case-insensitive equality predicate for strings.
The case-comparison operation is defined only for low-ASCII characters.
*/
struct iequal
{
bool
operator()(
string_view lhs,
string_view rhs) const
{
return iequals(lhs, rhs);
}
};
} // beast
} // boost
#ifdef BOOST_BEAST_HEADER_ONLY
#include <boost/beast/core/impl/string.ipp>
#endif
#endif