1 //
2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
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_DETAIL_STRING_HPP
11 #define BOOST_BEAST_DETAIL_STRING_HPP
12 
13 #include <boost/beast/core/string_type.hpp>
14 
15 namespace boost {
16 namespace beast {
17 
18 namespace detail {
19 
20 // Pulling in the UDL directly breaks in some places on MSVC,
21 // so introduce a namespace for this purprose.
22 namespace string_literals {
23 
24 inline
25 string_view
operator ""_sv(char const * p,std::size_t n)26 operator"" _sv(char const* p, std::size_t n)
27 {
28     return string_view{p, n};
29 }
30 
31 } // string_literals
32 
33 inline
34 char
ascii_tolower(char c)35 ascii_tolower(char c)
36 {
37     return ((static_cast<unsigned>(c) - 65U) < 26) ?
38         c + 'a' - 'A' : c;
39 }
40 } // detail
41 } // beast
42 } // boost
43 
44 #endif
45