| 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_STRING_TYPE_HPP |
| 11 | #define BOOST_BEAST_STRING_TYPE_HPP |
| 12 | |
| 13 | #include <boost/beast/core/detail/config.hpp> |
| 14 | #include <boost/core/detail/string_view.hpp> |
| 15 | |
| 16 | namespace boost { |
| 17 | namespace beast { |
| 18 | |
| 19 | /// The type of string view used by the library |
| 20 | using string_view = boost::core::string_view; |
| 21 | |
| 22 | /// The type of `basic_string_view` used by the library |
| 23 | template<class CharT> |
| 24 | using basic_string_view = |
| 25 | boost::core::basic_string_view<CharT>; |
| 26 | |
| 27 | template<class S> |
| 28 | inline string_view |
| 29 | to_string_view(const S& s) |
| 30 | { |
| 31 | return string_view(s.data(), s.size()); |
| 32 | } |
| 33 | |
| 34 | } // beast |
| 35 | } // boost |
| 36 | |
| 37 | #endif |
| 38 |
