mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
Use beast::string_view alias
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
1.0.0-b39
|
||||
|
||||
* Use beast::string_view alias
|
||||
|
||||
WebSocket:
|
||||
|
||||
* Add websocket async echo ssl server test:
|
||||
|
@ -168,6 +168,7 @@
|
||||
<member><link linkend="beast.ref.static_buffer">static_buffer</link></member>
|
||||
<member><link linkend="beast.ref.static_buffer_n">static_buffer_n</link></member>
|
||||
<member><link linkend="beast.ref.static_string">static_string</link></member>
|
||||
<member><link linkend="beast.ref.string_view">string_view</link></member>
|
||||
<member><link linkend="beast.ref.system_error">system_error</link></member>
|
||||
</simplelist>
|
||||
</entry>
|
||||
|
@ -8,8 +8,8 @@
|
||||
#ifndef BEAST_DETAIL_CI_CHAR_TRAITS_HPP
|
||||
#define BEAST_DETAIL_CI_CHAR_TRAITS_HPP
|
||||
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <boost/range/algorithm/equal.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
|
||||
namespace beast {
|
||||
namespace detail {
|
||||
@ -42,10 +42,10 @@ tolower(signed char c)
|
||||
|
||||
template<std::size_t N>
|
||||
inline
|
||||
boost::string_ref
|
||||
string_view
|
||||
string_helper(const char (&s)[N])
|
||||
{
|
||||
return boost::string_ref{s, N-1};
|
||||
return string_view{s, N-1};
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef BEAST_DETAIL_STATIC_STRING_HPP
|
||||
#define BEAST_DETAIL_STATIC_STRING_HPP
|
||||
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <iterator>
|
||||
#include <type_traits>
|
||||
|
||||
|
@ -95,7 +95,7 @@ static_string(std::initializer_list<CharT> init)
|
||||
|
||||
template<std::size_t N, class CharT, class Traits>
|
||||
static_string<N, CharT, Traits>::
|
||||
static_string(boost::basic_string_ref<CharT, Traits> sv)
|
||||
static_string(string_view_type sv)
|
||||
{
|
||||
assign(sv);
|
||||
}
|
||||
@ -188,12 +188,10 @@ template<class T>
|
||||
auto
|
||||
static_string<N, CharT, Traits>::
|
||||
assign(T const& t, size_type pos, size_type count) ->
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, boost::basic_string_ref<
|
||||
CharT, Traits>>::value, static_string&>::type
|
||||
typename std::enable_if<std::is_convertible<T,
|
||||
string_view_type>::value, static_string&>::type
|
||||
{
|
||||
auto const sv = boost::basic_string_ref<
|
||||
CharT, Traits>(t).substr(pos, count);
|
||||
auto const sv = string_view_type(t).substr(pos, count);
|
||||
if(sv.size() > max_size())
|
||||
throw detail::make_exception<std::length_error>(
|
||||
"sv.size() > max_size()", __FILE__, __LINE__);
|
||||
@ -352,14 +350,13 @@ auto
|
||||
static_string<N, CharT, Traits>::
|
||||
insert(size_type index, const T& t,
|
||||
size_type index_str, size_type count) ->
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T const&,
|
||||
boost::basic_string_ref<CharT, Traits>>::value &&
|
||||
typename std::enable_if<std::is_convertible<
|
||||
T const&, string_view_type>::value &&
|
||||
! std::is_convertible<T const&, CharT const*>::value,
|
||||
static_string&>::type
|
||||
{
|
||||
auto const str = boost::basic_string_ref<
|
||||
CharT, Traits>(t).substr(index_str, count);
|
||||
auto const str =
|
||||
string_view_type(t).substr(index_str, count);
|
||||
return insert(index, str.data(), str.size());
|
||||
}
|
||||
|
||||
@ -424,16 +421,17 @@ append(static_string<M, CharT, Traits> const& str,
|
||||
if(pos >= str.size())
|
||||
throw detail::make_exception<std::out_of_range>(
|
||||
"pos > str.size()", __FILE__, __LINE__);
|
||||
boost::basic_string_ref<CharT, Traits> const ss{
|
||||
&str.s_[pos], (std::min)(count, str.size() - pos)};
|
||||
string_view_type const ss{&str.s_[pos],
|
||||
(std::min)(count, str.size() - pos)};
|
||||
insert(size(), ss.data(), ss.size());
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<std::size_t N, class CharT, class Traits>
|
||||
boost::basic_string_ref<CharT, Traits>
|
||||
auto
|
||||
static_string<N, CharT, Traits>::
|
||||
substr(size_type pos, size_type count) const
|
||||
substr(size_type pos, size_type count) const ->
|
||||
string_view_type
|
||||
{
|
||||
if(pos > size())
|
||||
throw detail::make_exception<std::out_of_range>(
|
||||
|
@ -9,8 +9,8 @@
|
||||
#define BEAST_STATIC_STRING_HPP
|
||||
|
||||
#include <beast/config.hpp>
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/core/detail/static_string.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <initializer_list>
|
||||
@ -70,6 +70,10 @@ public:
|
||||
using const_reverse_iterator =
|
||||
std::reverse_iterator<const_iterator>;
|
||||
|
||||
/// The type of `string_view` returned by the interface
|
||||
using string_view_type =
|
||||
beast::basic_string_view<CharT, Traits>;
|
||||
|
||||
//
|
||||
// Constants
|
||||
//
|
||||
@ -123,23 +127,21 @@ public:
|
||||
/// Construct from an initializer list
|
||||
static_string(std::initializer_list<CharT> init);
|
||||
|
||||
/// Construct from a `basic_string_ref`
|
||||
/// Construct from a `string_view`
|
||||
explicit
|
||||
static_string(boost::basic_string_ref<CharT, Traits> sv);
|
||||
static_string(string_view_type sv);
|
||||
|
||||
/** Construct from any object convertible to `basic_string_ref`.
|
||||
/** Construct from any object convertible to `string_view_type`.
|
||||
|
||||
The range (pos, n) is extracted from the value
|
||||
obtained by converting `t` to `basic_string_ref`,
|
||||
obtained by converting `t` to `string_view_type`,
|
||||
and used to construct the string.
|
||||
*/
|
||||
#if BEAST_DOXYGEN
|
||||
template<class T>
|
||||
#else
|
||||
template<class T,
|
||||
class = typename std::enable_if<
|
||||
std::is_convertible<T, boost::basic_string_ref<
|
||||
CharT, Traits>> ::value>::type>
|
||||
template<class T, class = typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value>::type>
|
||||
#endif
|
||||
static_string(T const& t, size_type pos, size_type n);
|
||||
|
||||
@ -184,9 +186,9 @@ public:
|
||||
return assign(init);
|
||||
}
|
||||
|
||||
/// Assign from `basic_string_ref`.
|
||||
/// Assign from `string_view_type`.
|
||||
static_string&
|
||||
operator=(boost::basic_string_ref<CharT, Traits> sv)
|
||||
operator=(string_view_type sv)
|
||||
{
|
||||
return assign(sv);
|
||||
}
|
||||
@ -240,26 +242,25 @@ public:
|
||||
return assign(init.begin(), init.end());
|
||||
}
|
||||
|
||||
/// Assign from `basic_string_ref`.
|
||||
/// Assign from `string_view_type`.
|
||||
static_string&
|
||||
assign(boost::basic_string_ref<CharT, Traits> str)
|
||||
assign(string_view_type str)
|
||||
{
|
||||
return assign(str.data(), str.size());
|
||||
}
|
||||
|
||||
/** Assign from any object convertible to `basic_string_ref`.
|
||||
/** Assign from any object convertible to `string_view_type`.
|
||||
|
||||
The range (pos, n) is extracted from the value
|
||||
obtained by converting `t` to `basic_string_ref`,
|
||||
obtained by converting `t` to `string_view_type`,
|
||||
and used to assign the string.
|
||||
*/
|
||||
template<class T>
|
||||
#if BEAST_DOXYGEN
|
||||
static_string&
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, boost::basic_string_ref<
|
||||
CharT, Traits>>::value, static_string&>::type
|
||||
typename std::enable_if<std::is_convertible<T,
|
||||
string_view_type>::value, static_string&>::type
|
||||
#endif
|
||||
assign(T const& t,
|
||||
size_type pos, size_type count = npos);
|
||||
@ -339,10 +340,8 @@ public:
|
||||
return data();
|
||||
}
|
||||
|
||||
// VFALCO What about boost::string_view?
|
||||
//
|
||||
/// Convert a static string to a `static_string_ref`
|
||||
operator boost::basic_string_ref<CharT, Traits>() const
|
||||
/// Convert a static string to a `string_view_type`
|
||||
operator string_view_type() const
|
||||
{
|
||||
return boost::basic_string_ref<
|
||||
CharT, Traits>{data(), size()};
|
||||
@ -552,8 +551,7 @@ public:
|
||||
}
|
||||
|
||||
static_string&
|
||||
insert(size_type index,
|
||||
boost::basic_string_ref<CharT, Traits> str)
|
||||
insert(size_type index, string_view_type str)
|
||||
{
|
||||
return insert(index, str.data(), str.size());
|
||||
}
|
||||
@ -563,8 +561,7 @@ public:
|
||||
static_string&
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T const&,
|
||||
boost::basic_string_ref<CharT, Traits>>::value &&
|
||||
std::is_convertible<T const&, string_view_type>::value &&
|
||||
! std::is_convertible<T const&, CharT const*>::value,
|
||||
static_string&>::type
|
||||
#endif
|
||||
@ -645,7 +642,7 @@ public:
|
||||
}
|
||||
|
||||
static_string&
|
||||
append(boost::basic_string_ref<CharT, Traits> sv)
|
||||
append(string_view_type sv)
|
||||
{
|
||||
insert(size(), sv);
|
||||
return *this;
|
||||
@ -653,8 +650,7 @@ public:
|
||||
|
||||
template<class T>
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T const&,
|
||||
boost::basic_string_ref<CharT, Traits>>::value &&
|
||||
std::is_convertible<T const&, string_view_type>::value &&
|
||||
! std::is_convertible<T const&, CharT const*>::value,
|
||||
static_string&>::type
|
||||
append(T const& t, size_type pos, size_type count = npos)
|
||||
@ -690,7 +686,7 @@ public:
|
||||
}
|
||||
|
||||
static_string&
|
||||
operator+=(boost::basic_string_ref<CharT, Traits> const& str)
|
||||
operator+=(string_view_type const& str)
|
||||
{
|
||||
return append(str);
|
||||
}
|
||||
@ -746,7 +742,7 @@ public:
|
||||
}
|
||||
|
||||
int
|
||||
compare(boost::basic_string_ref<CharT, Traits> str) const
|
||||
compare(string_view_type str) const
|
||||
{
|
||||
return detail::lexicographical_compare<CharT, Traits>(
|
||||
&s_[0], n_, str.data(), str.size());
|
||||
@ -754,7 +750,7 @@ public:
|
||||
|
||||
int
|
||||
compare(size_type pos1, size_type count1,
|
||||
boost::basic_string_ref<CharT, Traits> str) const
|
||||
string_view_type str) const
|
||||
{
|
||||
return detail::lexicographical_compare<CharT, Traits>(
|
||||
substr(pos1, count1), str);
|
||||
@ -765,8 +761,7 @@ public:
|
||||
int
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T const&,
|
||||
boost::basic_string_ref<CharT, Traits>>::value &&
|
||||
std::is_convertible<T const&, string_view_type>::value &&
|
||||
! std::is_convertible<T const&, CharT const*>::value,
|
||||
int>::type
|
||||
#endif
|
||||
@ -775,11 +770,10 @@ public:
|
||||
size_type count2 = npos) const
|
||||
{
|
||||
return compare(pos1, count1,
|
||||
boost::basic_string_ref<
|
||||
CharT, Traits>(t).substr(pos2, count2));
|
||||
string_view_type(t).substr(pos2, count2));
|
||||
}
|
||||
|
||||
boost::basic_string_ref<CharT, Traits>
|
||||
string_view_type
|
||||
substr(size_type pos = 0, size_type count = npos) const;
|
||||
|
||||
/// Copy a substring (pos, pos+count) to character string pointed to by `dest`.
|
||||
@ -1101,7 +1095,7 @@ operator<<(std::basic_ostream<CharT, Traits>& os,
|
||||
static_string<N, CharT, Traits> const& str)
|
||||
{
|
||||
return os << static_cast<
|
||||
boost::basic_string_ref<CharT, Traits>>(str);
|
||||
beast::basic_string_view<CharT, Traits>>(str);
|
||||
}
|
||||
|
||||
} // beast
|
||||
|
25
include/beast/core/string_view.hpp
Normal file
25
include/beast/core/string_view.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// Copyright (c) 2013-2017 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)
|
||||
//
|
||||
|
||||
#ifndef BEAST_STRING_VIEW_HPP
|
||||
#define BEAST_STRING_VIEW_HPP
|
||||
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
|
||||
namespace beast {
|
||||
|
||||
/// The type of string_view used by the library
|
||||
using string_view = boost::string_ref;
|
||||
|
||||
/// The type of basic_string_view used by the library
|
||||
template<class CharT, class Traits>
|
||||
using basic_string_view =
|
||||
boost::basic_string_ref<CharT, Traits>;
|
||||
|
||||
} // beast
|
||||
|
||||
#endif
|
@ -10,11 +10,11 @@
|
||||
|
||||
#include <beast/config.hpp>
|
||||
#include <beast/core/error.hpp>
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/http/detail/basic_parser.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
@ -93,8 +93,8 @@ enum class parse_state
|
||||
//
|
||||
void
|
||||
on_request(
|
||||
boost::string_ref const& method,
|
||||
boost::string_ref const& target,
|
||||
string_view const& method,
|
||||
string_view const& target,
|
||||
int version,
|
||||
error_code& ec);
|
||||
|
||||
@ -104,7 +104,7 @@ enum class parse_state
|
||||
void
|
||||
on_response(
|
||||
int status,
|
||||
boost::string_ref const& reason,
|
||||
string_view const& reason,
|
||||
int version,
|
||||
error_code& ec);
|
||||
|
||||
@ -112,8 +112,8 @@ enum class parse_state
|
||||
//
|
||||
void
|
||||
on_field(
|
||||
boost::string_ref const& name,
|
||||
boost::string_ref const& value,
|
||||
string_view const& name,
|
||||
string_view const& value,
|
||||
error_code& ec);
|
||||
|
||||
// Called after the header is complete.
|
||||
@ -136,7 +136,7 @@ enum class parse_state
|
||||
//
|
||||
void
|
||||
on_data(
|
||||
boost::string_ref const& s,
|
||||
string_view const& s,
|
||||
error_code& ec);
|
||||
|
||||
// Called zero or more times to retrieve a mutable
|
||||
@ -165,7 +165,7 @@ enum class parse_state
|
||||
void
|
||||
on_chunk(
|
||||
std::uint64_t length, // Length of this chunk
|
||||
boost::string_ref const& ext, // The chunk extensions, if any
|
||||
string_view const& ext, // The chunk extensions, if any
|
||||
error_code& ec);
|
||||
|
||||
// Called once when the message is complete.
|
||||
@ -250,8 +250,8 @@ class basic_parser
|
||||
std::size_t x_; // scratch variable
|
||||
unsigned f_ = 0; // flags
|
||||
parse_state state_ = parse_state::header;
|
||||
boost::string_ref ext_;
|
||||
boost::string_ref body_;
|
||||
string_view ext_;
|
||||
string_view body_;
|
||||
|
||||
public:
|
||||
/// Copy constructor (disallowed)
|
||||
@ -454,7 +454,7 @@ public:
|
||||
buffer's `consume` function may invalidate this return
|
||||
value.
|
||||
*/
|
||||
boost::string_ref const&
|
||||
string_view const&
|
||||
body() const
|
||||
{
|
||||
// This function not available when isDirect==true
|
||||
@ -472,7 +472,7 @@ public:
|
||||
buffer's `consume` function may invalidate this return
|
||||
value.
|
||||
*/
|
||||
boost::string_ref const&
|
||||
string_view const&
|
||||
chunk_extension() const
|
||||
{
|
||||
// This function not available when isDirect==true
|
||||
@ -567,7 +567,7 @@ private:
|
||||
}
|
||||
|
||||
template<class ConstBufferSequence>
|
||||
boost::string_ref
|
||||
string_view
|
||||
maybe_flatten(
|
||||
ConstBufferSequence const& buffers);
|
||||
|
||||
@ -595,8 +595,8 @@ private:
|
||||
|
||||
void
|
||||
do_field(
|
||||
boost::string_ref const& name,
|
||||
boost::string_ref const& value,
|
||||
string_view const& name,
|
||||
string_view const& value,
|
||||
error_code& ec);
|
||||
|
||||
std::size_t
|
||||
|
@ -8,8 +8,8 @@
|
||||
#ifndef BEAST_HTTP_DETAIL_BASIC_PARSED_LIST_HPP
|
||||
#define BEAST_HTTP_DETAIL_BASIC_PARSED_LIST_HPP
|
||||
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/core/detail/empty_base_optimization.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <cstddef>
|
||||
#include <iterator>
|
||||
|
||||
@ -22,7 +22,7 @@ namespace detail {
|
||||
template<class Policy>
|
||||
class basic_parsed_list
|
||||
{
|
||||
boost::string_ref s_;
|
||||
string_view s_;
|
||||
|
||||
public:
|
||||
/// The type of policy this list uses for parsing.
|
||||
@ -128,7 +128,7 @@ public:
|
||||
|
||||
/// Construct a list from a string
|
||||
explicit
|
||||
basic_parsed_list(boost::string_ref const& s)
|
||||
basic_parsed_list(string_view const& s)
|
||||
: s_(s)
|
||||
{
|
||||
}
|
||||
|
@ -8,10 +8,10 @@
|
||||
#ifndef BEAST_HTTP_DETAIL_BASIC_PARSER_HPP
|
||||
#define BEAST_HTTP_DETAIL_BASIC_PARSER_HPP
|
||||
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/core/detail/ci_char_traits.hpp>
|
||||
#include <beast/http/error.hpp>
|
||||
#include <beast/http/detail/rfc7230.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
@ -187,7 +187,7 @@ protected:
|
||||
}
|
||||
|
||||
static
|
||||
boost::string_ref
|
||||
string_view
|
||||
make_string(char const* first, char const* last)
|
||||
{
|
||||
return {first, static_cast<
|
||||
@ -197,8 +197,8 @@ protected:
|
||||
template<class = void>
|
||||
static
|
||||
bool
|
||||
strieq(boost::string_ref const& s1,
|
||||
boost::string_ref const& s2)
|
||||
strieq(string_view const& s1,
|
||||
string_view const& s2)
|
||||
{
|
||||
if(s1.size() != s2.size())
|
||||
return false;
|
||||
@ -213,7 +213,7 @@ protected:
|
||||
template<std::size_t N>
|
||||
bool
|
||||
strieq(const char (&s1)[N],
|
||||
boost::string_ref const& s2)
|
||||
string_view const& s2)
|
||||
{
|
||||
return strieq({s1, N-1}, s2);
|
||||
}
|
||||
@ -272,19 +272,19 @@ protected:
|
||||
}
|
||||
|
||||
static
|
||||
boost::string_ref
|
||||
string_view
|
||||
parse_method(char const*& it)
|
||||
{
|
||||
auto const first = it;
|
||||
while(detail::is_tchar(*it))
|
||||
++it;
|
||||
return {first, static_cast<
|
||||
boost::string_ref::size_type>(
|
||||
string_view::size_type>(
|
||||
it - first)};
|
||||
}
|
||||
|
||||
static
|
||||
boost::string_ref
|
||||
string_view
|
||||
parse_target(char const*& it)
|
||||
{
|
||||
auto const first = it;
|
||||
@ -293,19 +293,19 @@ protected:
|
||||
if(*it != ' ')
|
||||
return {};
|
||||
return {first, static_cast<
|
||||
boost::string_ref::size_type>(
|
||||
string_view::size_type>(
|
||||
it - first)};
|
||||
}
|
||||
|
||||
static
|
||||
boost::string_ref
|
||||
string_view
|
||||
parse_name(char const*& it)
|
||||
{
|
||||
auto const first = it;
|
||||
while(to_field_char(*it))
|
||||
++it;
|
||||
return {first, static_cast<
|
||||
boost::string_ref::size_type>(
|
||||
string_view::size_type>(
|
||||
it - first)};
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ protected:
|
||||
}
|
||||
|
||||
static
|
||||
boost::string_ref
|
||||
string_view
|
||||
parse_reason(char const*& it)
|
||||
{
|
||||
auto const first = it;
|
||||
|
@ -8,10 +8,10 @@
|
||||
#ifndef BEAST_HTTP_DETAIL_FIELDS_HPP
|
||||
#define BEAST_HTTP_DETAIL_FIELDS_HPP
|
||||
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/core/detail/ci_char_traits.hpp>
|
||||
#include <boost/intrusive/list.hpp>
|
||||
#include <boost/intrusive/set.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
|
||||
namespace beast {
|
||||
namespace http {
|
||||
@ -29,20 +29,20 @@ public:
|
||||
std::string first;
|
||||
std::string second;
|
||||
|
||||
value_type(boost::string_ref const& name_,
|
||||
boost::string_ref const& value_)
|
||||
value_type(string_view const& name_,
|
||||
string_view const& value_)
|
||||
: first(name_)
|
||||
, second(value_)
|
||||
{
|
||||
}
|
||||
|
||||
boost::string_ref
|
||||
string_view
|
||||
name() const
|
||||
{
|
||||
return first;
|
||||
}
|
||||
|
||||
boost::string_ref
|
||||
string_view
|
||||
value() const
|
||||
{
|
||||
return second;
|
||||
@ -63,8 +63,8 @@ protected:
|
||||
{
|
||||
value_type data;
|
||||
|
||||
element(boost::string_ref const& name,
|
||||
boost::string_ref const& value)
|
||||
element(string_view const& name,
|
||||
string_view const& value)
|
||||
: data(name, value)
|
||||
{
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef BEAST_HTTP_DETAIL_RFC7230_HPP
|
||||
#define BEAST_HTTP_DETAIL_RFC7230_HPP
|
||||
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <iterator>
|
||||
#include <utility>
|
||||
|
||||
@ -328,8 +328,8 @@ skip_token(FwdIt& it, FwdIt const& last)
|
||||
}
|
||||
|
||||
inline
|
||||
boost::string_ref
|
||||
trim(boost::string_ref const& s)
|
||||
string_view
|
||||
trim(string_view const& s)
|
||||
{
|
||||
auto first = s.begin();
|
||||
auto last = s.end();
|
||||
@ -349,12 +349,12 @@ trim(boost::string_ref const& s)
|
||||
|
||||
struct param_iter
|
||||
{
|
||||
using iter_type = boost::string_ref::const_iterator;
|
||||
using iter_type = string_view::const_iterator;
|
||||
|
||||
iter_type it;
|
||||
iter_type first;
|
||||
iter_type last;
|
||||
std::pair<boost::string_ref, boost::string_ref> v;
|
||||
std::pair<string_view, string_view> v;
|
||||
|
||||
bool
|
||||
empty() const
|
||||
@ -455,11 +455,11 @@ increment()
|
||||
*/
|
||||
struct opt_token_list_policy
|
||||
{
|
||||
using value_type = boost::string_ref;
|
||||
using value_type = string_view;
|
||||
|
||||
bool
|
||||
operator()(value_type& v,
|
||||
char const*& it, boost::string_ref const& s) const
|
||||
char const*& it, string_view const& s) const
|
||||
{
|
||||
v = {};
|
||||
auto need_comma = it != s.begin();
|
||||
@ -485,7 +485,7 @@ struct opt_token_list_policy
|
||||
if(! detail::is_tchar(*it))
|
||||
break;
|
||||
}
|
||||
v = boost::string_ref{&*p0,
|
||||
v = string_view{&*p0,
|
||||
static_cast<std::size_t>(it - p0)};
|
||||
return true;
|
||||
}
|
||||
|
@ -9,10 +9,10 @@
|
||||
#define BEAST_HTTP_FIELDS_HPP
|
||||
|
||||
#include <beast/config.hpp>
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/core/detail/empty_base_optimization.hpp>
|
||||
#include <beast/http/detail/fields.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <memory>
|
||||
@ -195,14 +195,14 @@ public:
|
||||
|
||||
/// Returns `true` if the specified field exists.
|
||||
bool
|
||||
exists(boost::string_ref const& name) const
|
||||
exists(string_view const& name) const
|
||||
{
|
||||
return set_.find(name, less{}) != set_.end();
|
||||
}
|
||||
|
||||
/// Returns the number of values for the specified field.
|
||||
std::size_t
|
||||
count(boost::string_ref const& name) const;
|
||||
count(string_view const& name) const;
|
||||
|
||||
/** Returns an iterator to the case-insensitive matching field name.
|
||||
|
||||
@ -210,15 +210,15 @@ public:
|
||||
first field defined by insertion order is returned.
|
||||
*/
|
||||
iterator
|
||||
find(boost::string_ref const& name) const;
|
||||
find(string_view const& name) const;
|
||||
|
||||
/** Returns the value for a case-insensitive matching header, or `""`.
|
||||
|
||||
If more than one field with the specified name exists, the
|
||||
first field defined by insertion order is returned.
|
||||
*/
|
||||
boost::string_ref const
|
||||
operator[](boost::string_ref const& name) const;
|
||||
string_view const
|
||||
operator[](string_view const& name) const;
|
||||
|
||||
/// Clear the contents of the basic_fields.
|
||||
void
|
||||
@ -234,7 +234,7 @@ public:
|
||||
@return The number of fields removed.
|
||||
*/
|
||||
std::size_t
|
||||
erase(boost::string_ref const& name);
|
||||
erase(string_view const& name);
|
||||
|
||||
/** Insert a field value.
|
||||
|
||||
@ -247,7 +247,7 @@ public:
|
||||
@param value A string holding the value of the field.
|
||||
*/
|
||||
void
|
||||
insert(boost::string_ref const& name, boost::string_ref value);
|
||||
insert(string_view const& name, string_view value);
|
||||
|
||||
/** Insert a field value.
|
||||
|
||||
@ -262,8 +262,8 @@ public:
|
||||
*/
|
||||
template<class T>
|
||||
typename std::enable_if<
|
||||
! std::is_constructible<boost::string_ref, T>::value>::type
|
||||
insert(boost::string_ref name, T const& value)
|
||||
! std::is_constructible<string_view, T>::value>::type
|
||||
insert(string_view name, T const& value)
|
||||
{
|
||||
insert(name, boost::lexical_cast<std::string>(value));
|
||||
}
|
||||
@ -278,7 +278,7 @@ public:
|
||||
@param value A string holding the value of the field.
|
||||
*/
|
||||
void
|
||||
replace(boost::string_ref const& name, boost::string_ref value);
|
||||
replace(string_view const& name, string_view value);
|
||||
|
||||
/** Replace a field value.
|
||||
|
||||
@ -292,8 +292,8 @@ public:
|
||||
*/
|
||||
template<class T>
|
||||
typename std::enable_if<
|
||||
! std::is_constructible<boost::string_ref, T>::value>::type
|
||||
replace(boost::string_ref const& name, T const& value)
|
||||
! std::is_constructible<string_view, T>::value>::type
|
||||
replace(string_view const& name, T const& value)
|
||||
{
|
||||
replace(name,
|
||||
boost::lexical_cast<std::string>(value));
|
||||
@ -303,38 +303,38 @@ public:
|
||||
private:
|
||||
#endif
|
||||
|
||||
boost::string_ref
|
||||
string_view
|
||||
method() const
|
||||
{
|
||||
return (*this)[":method"];
|
||||
}
|
||||
|
||||
void
|
||||
method(boost::string_ref const& s)
|
||||
method(string_view const& s)
|
||||
{
|
||||
return this->replace(":method", s);
|
||||
}
|
||||
|
||||
boost::string_ref
|
||||
string_view
|
||||
target() const
|
||||
{
|
||||
return (*this)[":target"];
|
||||
}
|
||||
|
||||
void
|
||||
target(boost::string_ref const& s)
|
||||
target(string_view const& s)
|
||||
{
|
||||
return this->replace(":target", s);
|
||||
}
|
||||
|
||||
boost::string_ref
|
||||
string_view
|
||||
reason() const
|
||||
{
|
||||
return (*this)[":reason"];
|
||||
}
|
||||
|
||||
void
|
||||
reason(boost::string_ref const& s)
|
||||
reason(string_view const& s)
|
||||
{
|
||||
return this->replace(":reason", s);
|
||||
}
|
||||
|
@ -108,8 +108,8 @@ private:
|
||||
|
||||
void
|
||||
on_request(
|
||||
boost::string_ref const& method,
|
||||
boost::string_ref const& path,
|
||||
string_view const& method,
|
||||
string_view const& path,
|
||||
int version, error_code&)
|
||||
{
|
||||
h_.target(path);
|
||||
@ -119,7 +119,7 @@ private:
|
||||
|
||||
void
|
||||
on_response(int status,
|
||||
boost::string_ref const& reason,
|
||||
string_view const& reason,
|
||||
int version, error_code&)
|
||||
{
|
||||
h_.status = status;
|
||||
@ -128,8 +128,8 @@ private:
|
||||
}
|
||||
|
||||
void
|
||||
on_field(boost::string_ref const& name,
|
||||
boost::string_ref const& value,
|
||||
on_field(string_view const& name,
|
||||
string_view const& value,
|
||||
error_code&)
|
||||
{
|
||||
h_.fields.insert(name, value);
|
||||
@ -152,7 +152,7 @@ private:
|
||||
}
|
||||
|
||||
void
|
||||
on_data(boost::string_ref const& s,
|
||||
on_data(string_view const& s,
|
||||
error_code& ec)
|
||||
{
|
||||
}
|
||||
@ -168,7 +168,7 @@ private:
|
||||
|
||||
void
|
||||
on_chunk(std::uint64_t n,
|
||||
boost::string_ref const& ext,
|
||||
string_view const& ext,
|
||||
error_code& ec)
|
||||
{
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ consume_body(error_code& ec)
|
||||
template<bool isRequest, bool isDirect, class Derived>
|
||||
template<class ConstBufferSequence>
|
||||
inline
|
||||
boost::string_ref
|
||||
string_view
|
||||
basic_parser<isRequest, isDirect, Derived>::
|
||||
maybe_flatten(
|
||||
ConstBufferSequence const& buffers)
|
||||
@ -552,7 +552,7 @@ parse_fields(char const*& it,
|
||||
it = term;
|
||||
}
|
||||
}
|
||||
boost::string_ref value{
|
||||
string_view value{
|
||||
s.data(), s.size()};
|
||||
do_field(name, value, ec);
|
||||
if(ec)
|
||||
@ -568,8 +568,8 @@ template<bool isRequest, bool isDirect, class Derived>
|
||||
void
|
||||
basic_parser<isRequest, isDirect, Derived>::
|
||||
do_field(
|
||||
boost::string_ref const& name,
|
||||
boost::string_ref const& value,
|
||||
string_view const& name,
|
||||
string_view const& value,
|
||||
error_code& ec)
|
||||
{
|
||||
// Connection
|
||||
@ -996,7 +996,7 @@ parse_body(char const* p,
|
||||
std::size_t n, error_code& ec)
|
||||
{
|
||||
n = beast::detail::clamp(len_, n);
|
||||
body_ = boost::string_ref{p, n};
|
||||
body_ = string_view{p, n};
|
||||
impl().on_data(body_, ec);
|
||||
if(ec)
|
||||
return 0;
|
||||
@ -1017,7 +1017,7 @@ basic_parser<isRequest, isDirect, Derived>::
|
||||
parse_body_to_eof(char const* p,
|
||||
std::size_t n, error_code& ec)
|
||||
{
|
||||
body_ = boost::string_ref{p, n};
|
||||
body_ = string_view{p, n};
|
||||
impl().on_data(body_, ec);
|
||||
if(ec)
|
||||
return 0;
|
||||
@ -1032,7 +1032,7 @@ parse_chunk_body(char const* p,
|
||||
std::size_t n, error_code& ec)
|
||||
{
|
||||
n = beast::detail::clamp(len_, n);
|
||||
body_ = boost::string_ref{p, n};
|
||||
body_ = string_view{p, n};
|
||||
impl().on_data(body_, ec);
|
||||
if(ec)
|
||||
return 0;
|
||||
|
@ -170,7 +170,7 @@ basic_fields(FwdIt first, FwdIt last)
|
||||
template<class Allocator>
|
||||
std::size_t
|
||||
basic_fields<Allocator>::
|
||||
count(boost::string_ref const& name) const
|
||||
count(string_view const& name) const
|
||||
{
|
||||
auto const it = set_.find(name, less{});
|
||||
if(it == set_.end())
|
||||
@ -182,7 +182,7 @@ count(boost::string_ref const& name) const
|
||||
template<class Allocator>
|
||||
auto
|
||||
basic_fields<Allocator>::
|
||||
find(boost::string_ref const& name) const ->
|
||||
find(string_view const& name) const ->
|
||||
iterator
|
||||
{
|
||||
auto const it = set_.find(name, less{});
|
||||
@ -192,9 +192,9 @@ find(boost::string_ref const& name) const ->
|
||||
}
|
||||
|
||||
template<class Allocator>
|
||||
boost::string_ref const
|
||||
string_view const
|
||||
basic_fields<Allocator>::
|
||||
operator[](boost::string_ref const& name) const
|
||||
operator[](string_view const& name) const
|
||||
{
|
||||
auto const it = find(name);
|
||||
if(it == end())
|
||||
@ -215,7 +215,7 @@ clear() noexcept
|
||||
template<class Allocator>
|
||||
std::size_t
|
||||
basic_fields<Allocator>::
|
||||
erase(boost::string_ref const& name)
|
||||
erase(string_view const& name)
|
||||
{
|
||||
auto it = set_.find(name, less{});
|
||||
if(it == set_.end())
|
||||
@ -239,8 +239,8 @@ erase(boost::string_ref const& name)
|
||||
template<class Allocator>
|
||||
void
|
||||
basic_fields<Allocator>::
|
||||
insert(boost::string_ref const& name,
|
||||
boost::string_ref value)
|
||||
insert(string_view const& name,
|
||||
string_view value)
|
||||
{
|
||||
value = detail::trim(value);
|
||||
auto const p = alloc_traits::allocate(this->member(), 1);
|
||||
@ -252,8 +252,8 @@ insert(boost::string_ref const& name,
|
||||
template<class Allocator>
|
||||
void
|
||||
basic_fields<Allocator>::
|
||||
replace(boost::string_ref const& name,
|
||||
boost::string_ref value)
|
||||
replace(string_view const& name,
|
||||
string_view value)
|
||||
{
|
||||
value = detail::trim(value);
|
||||
erase(name);
|
||||
|
@ -17,7 +17,7 @@ namespace http {
|
||||
|
||||
class param_list::const_iterator
|
||||
{
|
||||
using iter_type = boost::string_ref::const_iterator;
|
||||
using iter_type = string_view::const_iterator;
|
||||
|
||||
std::string s_;
|
||||
detail::param_iter pi_;
|
||||
@ -87,7 +87,7 @@ private:
|
||||
template<class = void>
|
||||
static
|
||||
std::string
|
||||
unquote(boost::string_ref const& sr);
|
||||
unquote(string_view const& sr);
|
||||
|
||||
template<class = void>
|
||||
void
|
||||
@ -133,7 +133,7 @@ cend() const ->
|
||||
template<class>
|
||||
std::string
|
||||
param_list::const_iterator::
|
||||
unquote(boost::string_ref const& sr)
|
||||
unquote(string_view const& sr)
|
||||
{
|
||||
std::string s;
|
||||
s.reserve(sr.size());
|
||||
@ -165,7 +165,7 @@ increment()
|
||||
pi_.v.second.front() == '"')
|
||||
{
|
||||
s_ = unquote(pi_.v.second);
|
||||
pi_.v.second = boost::string_ref{
|
||||
pi_.v.second = string_view{
|
||||
s_.data(), s_.size()};
|
||||
}
|
||||
}
|
||||
@ -346,7 +346,7 @@ increment()
|
||||
if(! detail::is_tchar(*it_))
|
||||
break;
|
||||
}
|
||||
v_.first = boost::string_ref{&*p0,
|
||||
v_.first = string_view{&*p0,
|
||||
static_cast<std::size_t>(it_ - p0)};
|
||||
detail::param_iter pi;
|
||||
pi.it = it_;
|
||||
@ -358,7 +358,7 @@ increment()
|
||||
if(pi.empty())
|
||||
break;
|
||||
}
|
||||
v_.second = param_list{boost::string_ref{&*it_,
|
||||
v_.second = param_list{string_view{&*it_,
|
||||
static_cast<std::size_t>(pi.it - it_)}};
|
||||
it_ = pi.it;
|
||||
return;
|
||||
@ -518,7 +518,7 @@ increment()
|
||||
if(! detail::is_tchar(*it_))
|
||||
break;
|
||||
}
|
||||
v_ = boost::string_ref{&*p0,
|
||||
v_ = string_view{&*p0,
|
||||
static_cast<std::size_t>(it_ - p0)};
|
||||
return;
|
||||
}
|
||||
|
@ -10,8 +10,8 @@
|
||||
|
||||
#include <beast/config.hpp>
|
||||
#include <beast/http/fields.hpp>
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/core/detail/integer_sequence.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
@ -157,8 +157,8 @@ private:
|
||||
|
||||
void
|
||||
on_request(
|
||||
boost::string_ref const& method,
|
||||
boost::string_ref const& target,
|
||||
string_view const& method,
|
||||
string_view const& target,
|
||||
int version, error_code&)
|
||||
{
|
||||
m_.target(target);
|
||||
@ -168,7 +168,7 @@ private:
|
||||
|
||||
void
|
||||
on_response(int status,
|
||||
boost::string_ref const& reason,
|
||||
string_view const& reason,
|
||||
int version, error_code&)
|
||||
{
|
||||
m_.status = status;
|
||||
@ -177,8 +177,8 @@ private:
|
||||
}
|
||||
|
||||
void
|
||||
on_field(boost::string_ref const& name,
|
||||
boost::string_ref const& value,
|
||||
on_field(string_view const& name,
|
||||
string_view const& value,
|
||||
error_code&)
|
||||
{
|
||||
m_.fields.insert(name, value);
|
||||
@ -223,7 +223,7 @@ private:
|
||||
}
|
||||
|
||||
void
|
||||
on_data(boost::string_ref const& s,
|
||||
on_data(string_view const& s,
|
||||
error_code& ec)
|
||||
{
|
||||
static_assert(! Body::reader::is_direct, "");
|
||||
@ -244,7 +244,7 @@ private:
|
||||
|
||||
void
|
||||
on_chunk(std::uint64_t,
|
||||
boost::string_ref const&,
|
||||
string_view const&,
|
||||
error_code&)
|
||||
{
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ namespace http {
|
||||
*/
|
||||
class param_list
|
||||
{
|
||||
boost::string_ref s_;
|
||||
string_view s_;
|
||||
|
||||
public:
|
||||
/** The type of each element in the list.
|
||||
@ -59,7 +59,7 @@ public:
|
||||
be empty).
|
||||
*/
|
||||
using value_type =
|
||||
std::pair<boost::string_ref, boost::string_ref>;
|
||||
std::pair<string_view, string_view>;
|
||||
|
||||
/// A constant iterator to the list
|
||||
#if BEAST_DOXYGEN
|
||||
@ -77,7 +77,7 @@ public:
|
||||
must remain valid for the lifetime of the container.
|
||||
*/
|
||||
explicit
|
||||
param_list(boost::string_ref const& s)
|
||||
param_list(string_view const& s)
|
||||
: s_(s)
|
||||
{
|
||||
}
|
||||
@ -137,9 +137,9 @@ public:
|
||||
*/
|
||||
class ext_list
|
||||
{
|
||||
using iter_type = boost::string_ref::const_iterator;
|
||||
using iter_type = string_view::const_iterator;
|
||||
|
||||
boost::string_ref s_;
|
||||
string_view s_;
|
||||
|
||||
public:
|
||||
/** The type of each element in the list.
|
||||
@ -148,7 +148,7 @@ public:
|
||||
second element of the pair is an iterable container holding the
|
||||
extension's name/value parameters.
|
||||
*/
|
||||
using value_type = std::pair<boost::string_ref, param_list>;
|
||||
using value_type = std::pair<string_view, param_list>;
|
||||
|
||||
/// A constant iterator to the list
|
||||
#if BEAST_DOXYGEN
|
||||
@ -163,7 +163,7 @@ public:
|
||||
must remain valid for the lifetime of the container.
|
||||
*/
|
||||
explicit
|
||||
ext_list(boost::string_ref const& s)
|
||||
ext_list(string_view const& s)
|
||||
: s_(s)
|
||||
{
|
||||
}
|
||||
@ -230,13 +230,13 @@ public:
|
||||
*/
|
||||
class token_list
|
||||
{
|
||||
using iter_type = boost::string_ref::const_iterator;
|
||||
using iter_type = string_view::const_iterator;
|
||||
|
||||
boost::string_ref s_;
|
||||
string_view s_;
|
||||
|
||||
public:
|
||||
/// The type of each element in the token list.
|
||||
using value_type = boost::string_ref;
|
||||
using value_type = string_view;
|
||||
|
||||
/// A constant iterator to the list
|
||||
#if BEAST_DOXYGEN
|
||||
@ -251,7 +251,7 @@ public:
|
||||
must remain valid for the lifetime of the container.
|
||||
*/
|
||||
explicit
|
||||
token_list(boost::string_ref const& s)
|
||||
token_list(string_view const& s)
|
||||
: s_(s)
|
||||
{
|
||||
}
|
||||
|
@ -9,10 +9,10 @@
|
||||
#define BEAST_WEBSOCKET_DETAIL_HYBI13_HPP
|
||||
|
||||
#include <beast/core/static_string.hpp>
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/core/detail/base64.hpp>
|
||||
#include <beast/core/detail/sha1.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
@ -49,7 +49,7 @@ make_sec_ws_key(sec_ws_key_type& key, Gen& g)
|
||||
template<class = void>
|
||||
void
|
||||
make_sec_ws_accept(sec_ws_accept_type& accept,
|
||||
boost::string_ref key)
|
||||
string_view key)
|
||||
{
|
||||
BOOST_ASSERT(key.size() <= sec_ws_key_type::max_size_n);
|
||||
static_string<sec_ws_key_type::max_size_n + 36> m(key);
|
||||
|
@ -46,7 +46,7 @@ struct pmd_offer
|
||||
|
||||
template<class = void>
|
||||
int
|
||||
parse_bits(boost::string_ref const& s)
|
||||
parse_bits(string_view const& s)
|
||||
{
|
||||
if(s.size() == 0)
|
||||
return -1;
|
||||
|
@ -42,8 +42,8 @@ class stream<NextLayer>::handshake_op
|
||||
template<class Decorator>
|
||||
data(Handler& handler, stream<NextLayer>& ws_,
|
||||
response_type* res_p_,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
Decorator const& decorator)
|
||||
: cont(beast_asio_helpers::
|
||||
is_continuation(handler))
|
||||
@ -163,8 +163,8 @@ template<class HandshakeHandler>
|
||||
typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
stream<NextLayer>::
|
||||
async_handshake(boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
async_handshake(string_view const& host,
|
||||
string_view const& target,
|
||||
HandshakeHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
@ -183,8 +183,8 @@ typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
stream<NextLayer>::
|
||||
async_handshake(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
HandshakeHandler&& handler)
|
||||
{
|
||||
static_assert(is_AsyncStream<next_layer_type>::value,
|
||||
@ -202,8 +202,8 @@ template<class RequestDecorator, class HandshakeHandler>
|
||||
typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
stream<NextLayer>::
|
||||
async_handshake_ex(boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
async_handshake_ex(string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
HandshakeHandler&& handler)
|
||||
{
|
||||
@ -226,8 +226,8 @@ typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
stream<NextLayer>::
|
||||
async_handshake_ex(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
HandshakeHandler&& handler)
|
||||
{
|
||||
@ -247,8 +247,8 @@ async_handshake_ex(response_type& res,
|
||||
template<class NextLayer>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
handshake(boost::string_ref const& host,
|
||||
boost::string_ref const& target)
|
||||
handshake(string_view const& host,
|
||||
string_view const& target)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -263,8 +263,8 @@ template<class NextLayer>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
handshake(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target)
|
||||
string_view const& host,
|
||||
string_view const& target)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -278,8 +278,8 @@ template<class NextLayer>
|
||||
template<class RequestDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
handshake_ex(boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
handshake_ex(string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
@ -298,8 +298,8 @@ template<class RequestDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
handshake_ex(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
@ -316,8 +316,8 @@ handshake_ex(response_type& res,
|
||||
template<class NextLayer>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
handshake(boost::string_ref const& host,
|
||||
boost::string_ref const& target, error_code& ec)
|
||||
handshake(string_view const& host,
|
||||
string_view const& target, error_code& ec)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
"SyncStream requirements not met");
|
||||
@ -329,8 +329,8 @@ template<class NextLayer>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
handshake(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
error_code& ec)
|
||||
{
|
||||
static_assert(is_SyncStream<next_layer_type>::value,
|
||||
@ -343,8 +343,8 @@ template<class NextLayer>
|
||||
template<class RequestDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
handshake_ex(boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
handshake_ex(string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
error_code& ec)
|
||||
{
|
||||
@ -362,8 +362,8 @@ template<class RequestDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
handshake_ex(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
error_code& ec)
|
||||
{
|
||||
|
@ -127,8 +127,8 @@ template<class RequestDecorator>
|
||||
void
|
||||
stream<NextLayer>::
|
||||
do_handshake(response_type* res_p,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
error_code& ec)
|
||||
{
|
||||
@ -156,8 +156,8 @@ template<class Decorator>
|
||||
request_type
|
||||
stream<NextLayer>::
|
||||
build_request(detail::sec_ws_key_type& key,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
Decorator const& decorator)
|
||||
{
|
||||
request_type req;
|
||||
|
@ -16,9 +16,9 @@
|
||||
#include <beast/http/string_body.hpp>
|
||||
#include <beast/core/async_completion.hpp>
|
||||
#include <beast/core/buffered_read_stream.hpp>
|
||||
#include <beast/core/string_view.hpp>
|
||||
#include <beast/core/detail/get_lowest_layer.hpp>
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
@ -1465,8 +1465,8 @@ public:
|
||||
@endcode
|
||||
*/
|
||||
void
|
||||
handshake(boost::string_ref const& host,
|
||||
boost::string_ref const& target);
|
||||
handshake(string_view const& host,
|
||||
string_view const& target);
|
||||
|
||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||
|
||||
@ -1514,8 +1514,8 @@ public:
|
||||
*/
|
||||
void
|
||||
handshake(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target);
|
||||
string_view const& host,
|
||||
string_view const& target);
|
||||
|
||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||
|
||||
@ -1572,8 +1572,8 @@ public:
|
||||
*/
|
||||
template<class RequestDecorator>
|
||||
void
|
||||
handshake_ex(boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
handshake_ex(string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator);
|
||||
|
||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||
@ -1636,8 +1636,8 @@ public:
|
||||
template<class RequestDecorator>
|
||||
void
|
||||
handshake_ex(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator);
|
||||
|
||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||
@ -1679,8 +1679,8 @@ public:
|
||||
@endcode
|
||||
*/
|
||||
void
|
||||
handshake(boost::string_ref const& host,
|
||||
boost::string_ref const& target, error_code& ec);
|
||||
handshake(string_view const& host,
|
||||
string_view const& target, error_code& ec);
|
||||
|
||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||
|
||||
@ -1726,8 +1726,8 @@ public:
|
||||
*/
|
||||
void
|
||||
handshake(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
error_code& ec);
|
||||
|
||||
/** Send an HTTP WebSocket Upgrade request and receive the response.
|
||||
@ -1784,8 +1784,8 @@ public:
|
||||
*/
|
||||
template<class RequestDecorator>
|
||||
void
|
||||
handshake_ex(boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
handshake_ex(string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
error_code& ec);
|
||||
|
||||
@ -1848,8 +1848,8 @@ public:
|
||||
template<class RequestDecorator>
|
||||
void
|
||||
handshake_ex(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
error_code& ec);
|
||||
|
||||
@ -1901,8 +1901,8 @@ public:
|
||||
typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
#endif
|
||||
async_handshake(boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
async_handshake(string_view const& host,
|
||||
string_view const& target,
|
||||
HandshakeHandler&& handler);
|
||||
|
||||
/** Start an asynchronous operation to send an upgrade request and receive the response.
|
||||
@ -1958,8 +1958,8 @@ public:
|
||||
void(error_code)>::result_type
|
||||
#endif
|
||||
async_handshake(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
HandshakeHandler&& handler);
|
||||
|
||||
/** Start an asynchronous operation to send an upgrade request and receive the response.
|
||||
@ -2019,8 +2019,8 @@ public:
|
||||
typename async_completion<HandshakeHandler,
|
||||
void(error_code)>::result_type
|
||||
#endif
|
||||
async_handshake_ex(boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
async_handshake_ex(string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
HandshakeHandler&& handler);
|
||||
|
||||
@ -2086,8 +2086,8 @@ public:
|
||||
void(error_code)>::result_type
|
||||
#endif
|
||||
async_handshake_ex(response_type& res,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
HandshakeHandler&& handler);
|
||||
|
||||
@ -2968,16 +2968,16 @@ private:
|
||||
template<class RequestDecorator>
|
||||
void
|
||||
do_handshake(response_type* res_p,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
RequestDecorator const& decorator,
|
||||
error_code& ec);
|
||||
|
||||
template<class Decorator>
|
||||
request_type
|
||||
build_request(detail::sec_ws_key_type& key,
|
||||
boost::string_ref const& host,
|
||||
boost::string_ref const& target,
|
||||
string_view const& host,
|
||||
string_view const& target,
|
||||
Decorator const& decorator);
|
||||
|
||||
template<class Decorator>
|
||||
|
@ -37,6 +37,7 @@ unit-test core-tests :
|
||||
core/static_buffer.cpp
|
||||
core/static_string.cpp
|
||||
core/stream_concepts.cpp
|
||||
core/string_view.cpp
|
||||
core/base64.cpp
|
||||
core/empty_base_optimization.cpp
|
||||
core/get_lowest_layer.cpp
|
||||
|
@ -30,6 +30,7 @@ add_executable (core-tests
|
||||
static_buffer.cpp
|
||||
static_string.cpp
|
||||
stream_concepts.cpp
|
||||
string_view.cpp
|
||||
base64.cpp
|
||||
empty_base_optimization.cpp
|
||||
get_lowest_layer.cpp
|
||||
|
@ -123,13 +123,13 @@ public:
|
||||
}
|
||||
{
|
||||
static_string<3> s1(
|
||||
boost::string_ref("123"));
|
||||
string_view("123"));
|
||||
BEAST_EXPECT(s1 == "123");
|
||||
BEAST_EXPECT(*s1.end() == 0);
|
||||
try
|
||||
{
|
||||
static_string<2> s2(
|
||||
boost::string_ref("123"));
|
||||
string_view("123"));
|
||||
fail("", __FILE__, __LINE__);
|
||||
}
|
||||
catch(std::length_error const&)
|
||||
@ -232,13 +232,13 @@ public:
|
||||
}
|
||||
{
|
||||
static_string<3> s1;
|
||||
s1 = boost::string_ref("123");
|
||||
s1 = string_view("123");
|
||||
BEAST_EXPECT(s1 == "123");
|
||||
BEAST_EXPECT(*s1.end() == 0);
|
||||
try
|
||||
{
|
||||
static_string<1> s2;
|
||||
s2 = boost::string_ref("123");
|
||||
s2 = string_view("123");
|
||||
fail("", __FILE__, __LINE__);
|
||||
}
|
||||
catch(std::length_error const&)
|
||||
@ -370,15 +370,15 @@ public:
|
||||
}
|
||||
{
|
||||
static_string<5> s1;
|
||||
s1.assign(boost::string_ref("123"));
|
||||
s1.assign(string_view("123"));
|
||||
BEAST_EXPECT(s1 == "123");
|
||||
BEAST_EXPECT(*s1.end() == 0);
|
||||
s1.assign(boost::string_ref("12345"));
|
||||
s1.assign(string_view("12345"));
|
||||
BEAST_EXPECT(s1 == "12345");
|
||||
BEAST_EXPECT(*s1.end() == 0);
|
||||
try
|
||||
{
|
||||
s1.assign(boost::string_ref("1234567"));
|
||||
s1.assign(string_view("1234567"));
|
||||
fail("", __FILE__, __LINE__);
|
||||
}
|
||||
catch(std::length_error const&)
|
||||
@ -483,7 +483,7 @@ public:
|
||||
}
|
||||
{
|
||||
static_string<3> s("123");
|
||||
boost::string_ref sv = s;
|
||||
string_view sv = s;
|
||||
BEAST_EXPECT(static_string<5>(sv) == "123");
|
||||
}
|
||||
}
|
||||
@ -750,13 +750,13 @@ public:
|
||||
}
|
||||
{
|
||||
static_string<5> s1("123");
|
||||
s1.insert(1, boost::string_ref("UV"));
|
||||
s1.insert(1, string_view("UV"));
|
||||
BEAST_EXPECT(s1 == "1UV23");
|
||||
BEAST_EXPECT(*s1.end() == 0);
|
||||
try
|
||||
{
|
||||
static_string<4> s2("123");
|
||||
s2.insert(1, boost::string_ref("UV"));
|
||||
s2.insert(1, string_view("UV"));
|
||||
fail("", __FILE__, __LINE__);
|
||||
}
|
||||
catch(std::length_error const&)
|
||||
@ -766,7 +766,7 @@ public:
|
||||
try
|
||||
{
|
||||
static_string<5> s2("123");
|
||||
s2.insert(5, boost::string_ref("UV"));
|
||||
s2.insert(5, string_view("UV"));
|
||||
fail("", __FILE__, __LINE__);
|
||||
}
|
||||
catch(std::out_of_range const&)
|
||||
@ -1024,7 +1024,7 @@ public:
|
||||
}
|
||||
}
|
||||
{
|
||||
boost::string_ref s1("XYZ");
|
||||
string_view s1("XYZ");
|
||||
static_string<5> s2("12");
|
||||
s2.append(s1);
|
||||
BEAST_EXPECT(s2 == "12XYZ");
|
||||
@ -1124,7 +1124,7 @@ public:
|
||||
}
|
||||
}
|
||||
{
|
||||
boost::string_ref s1("34");
|
||||
string_view s1("34");
|
||||
static_string<4> s2("12");
|
||||
s2 += s1;
|
||||
BEAST_EXPECT(s2 == "1234");
|
||||
|
9
test/core/string_view.cpp
Normal file
9
test/core/string_view.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
//
|
||||
// Copyright (c) 2013-2017 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)
|
||||
//
|
||||
|
||||
// Test that header file is self-contained.
|
||||
#include <beast/core/string_view.hpp>
|
@ -218,7 +218,7 @@ public:
|
||||
|
||||
template<bool isRequest, class Pred>
|
||||
void
|
||||
good(boost::string_ref const& s,
|
||||
good(string_view const& s,
|
||||
Pred const& pred, bool skipBody = false)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
@ -240,7 +240,7 @@ public:
|
||||
|
||||
template<bool isRequest>
|
||||
void
|
||||
good(boost::string_ref const& s)
|
||||
good(string_view const& s)
|
||||
{
|
||||
good<isRequest>(s,
|
||||
[](test_parser<isRequest> const&)
|
||||
@ -250,7 +250,7 @@ public:
|
||||
|
||||
template<bool isRequest>
|
||||
void
|
||||
bad(boost::string_ref const& s,
|
||||
bad(string_view const& s,
|
||||
error_code const& ev, bool skipBody = false)
|
||||
{
|
||||
using boost::asio::buffer;
|
||||
|
@ -176,7 +176,7 @@ public:
|
||||
}
|
||||
|
||||
void
|
||||
write(boost::string_ref const& s,
|
||||
write(string_view const& s,
|
||||
error_code& ec)
|
||||
{
|
||||
body_.append(s.data(), s.size());
|
||||
@ -464,7 +464,7 @@ public:
|
||||
struct bodyHandler
|
||||
{
|
||||
void
|
||||
operator()(boost::string_ref const& body) const
|
||||
operator()(string_view const& body) const
|
||||
{
|
||||
// called for each piece of the body,
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace http {
|
||||
|
||||
template<class = void>
|
||||
std::string
|
||||
escaped_string(boost::string_ref const& s)
|
||||
escaped_string(string_view const& s)
|
||||
{
|
||||
std::string out;
|
||||
out.reserve(s.size());
|
||||
|
@ -168,22 +168,22 @@ public:
|
||||
boost::asio::mutable_buffers_1;
|
||||
|
||||
void
|
||||
on_request(boost::string_ref const&,
|
||||
boost::string_ref const&,
|
||||
on_request(string_view const&,
|
||||
string_view const&,
|
||||
int, error_code&)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
on_response(int,
|
||||
boost::string_ref const&,
|
||||
string_view const&,
|
||||
int, error_code&)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
on_field(boost::string_ref const&,
|
||||
boost::string_ref const&,
|
||||
on_field(string_view const&,
|
||||
string_view const&,
|
||||
error_code&)
|
||||
{
|
||||
}
|
||||
@ -205,20 +205,20 @@ public:
|
||||
}
|
||||
|
||||
void
|
||||
on_data(boost::string_ref const&,
|
||||
on_data(string_view const&,
|
||||
error_code& ec)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
on_chunk(std::uint64_t,
|
||||
boost::string_ref const&,
|
||||
string_view const&,
|
||||
error_code&)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
on_body(boost::string_ref const&,
|
||||
on_body(string_view const&,
|
||||
error_code&)
|
||||
{
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
|
||||
static
|
||||
std::string
|
||||
str(boost::string_ref const& s)
|
||||
str(string_view const& s)
|
||||
{
|
||||
return std::string(s.data(), s.size());
|
||||
}
|
||||
@ -241,7 +241,7 @@ public:
|
||||
template<class Policy>
|
||||
static
|
||||
std::vector<std::string>
|
||||
to_vector(boost::string_ref const& in)
|
||||
to_vector(string_view const& in)
|
||||
{
|
||||
std::vector<std::string> v;
|
||||
detail::basic_parsed_list<Policy> list{in};
|
||||
@ -253,7 +253,7 @@ public:
|
||||
|
||||
template<class Policy>
|
||||
void
|
||||
validate(boost::string_ref const& in,
|
||||
validate(string_view const& in,
|
||||
std::vector<std::string> const& v)
|
||||
{
|
||||
BEAST_EXPECT(to_vector<Policy>(in) == v);
|
||||
@ -261,7 +261,7 @@ public:
|
||||
|
||||
template<class Policy>
|
||||
void
|
||||
good(boost::string_ref const& in)
|
||||
good(string_view const& in)
|
||||
{
|
||||
BEAST_EXPECT(validate_list(
|
||||
detail::basic_parsed_list<Policy>{in}));
|
||||
@ -269,7 +269,7 @@ public:
|
||||
|
||||
template<class Policy>
|
||||
void
|
||||
good(boost::string_ref const& in,
|
||||
good(string_view const& in,
|
||||
std::vector<std::string> const& v)
|
||||
{
|
||||
BEAST_EXPECT(validate_list(
|
||||
@ -279,7 +279,7 @@ public:
|
||||
|
||||
template<class Policy>
|
||||
void
|
||||
bad(boost::string_ref const& in)
|
||||
bad(string_view const& in)
|
||||
{
|
||||
BEAST_EXPECT(! validate_list(
|
||||
detail::basic_parsed_list<Policy>{in}));
|
||||
|
@ -51,8 +51,8 @@ public:
|
||||
|
||||
void
|
||||
on_request(
|
||||
boost::string_ref const& method_,
|
||||
boost::string_ref const& path_,
|
||||
string_view const& method_,
|
||||
string_view const& path_,
|
||||
int version_, error_code& ec)
|
||||
{
|
||||
method = std::string(
|
||||
@ -67,7 +67,7 @@ public:
|
||||
|
||||
void
|
||||
on_response(int status_,
|
||||
boost::string_ref const& reason_,
|
||||
string_view const& reason_,
|
||||
int version_, error_code& ec)
|
||||
{
|
||||
status = status_;
|
||||
@ -80,8 +80,8 @@ public:
|
||||
}
|
||||
|
||||
void
|
||||
on_field(boost::string_ref const&,
|
||||
boost::string_ref const&,
|
||||
on_field(string_view const&,
|
||||
string_view const&,
|
||||
error_code& ec)
|
||||
{
|
||||
got_on_field = true;
|
||||
@ -116,7 +116,7 @@ public:
|
||||
}
|
||||
|
||||
void
|
||||
on_data(boost::string_ref const& s,
|
||||
on_data(string_view const& s,
|
||||
error_code& ec)
|
||||
{
|
||||
body.append(s.data(), s.size());
|
||||
@ -124,7 +124,7 @@ public:
|
||||
|
||||
void
|
||||
on_chunk(std::uint64_t,
|
||||
boost::string_ref const&,
|
||||
string_view const&,
|
||||
error_code& ec)
|
||||
{
|
||||
got_on_chunk = true;
|
||||
|
@ -198,8 +198,8 @@ public:
|
||||
template<class NextLayer>
|
||||
void
|
||||
handshake(stream<NextLayer>& ws,
|
||||
boost::string_ref const& uri,
|
||||
boost::string_ref const& path) const
|
||||
string_view const& uri,
|
||||
string_view const& path) const
|
||||
{
|
||||
ws.handshake(uri, path);
|
||||
}
|
||||
@ -208,8 +208,8 @@ public:
|
||||
void
|
||||
handshake(stream<NextLayer>& ws,
|
||||
response_type& res,
|
||||
boost::string_ref const& uri,
|
||||
boost::string_ref const& path) const
|
||||
string_view const& uri,
|
||||
string_view const& path) const
|
||||
{
|
||||
ws.handshake(res, uri, path);
|
||||
}
|
||||
@ -217,8 +217,8 @@ public:
|
||||
template<class NextLayer, class Decorator>
|
||||
void
|
||||
handshake_ex(stream<NextLayer>& ws,
|
||||
boost::string_ref const& uri,
|
||||
boost::string_ref const& path,
|
||||
string_view const& uri,
|
||||
string_view const& path,
|
||||
Decorator const& d) const
|
||||
{
|
||||
ws.handshake_ex(uri, path, d);
|
||||
@ -228,8 +228,8 @@ public:
|
||||
void
|
||||
handshake_ex(stream<NextLayer>& ws,
|
||||
response_type& res,
|
||||
boost::string_ref const& uri,
|
||||
boost::string_ref const& path,
|
||||
string_view const& uri,
|
||||
string_view const& path,
|
||||
Decorator const& d) const
|
||||
{
|
||||
ws.handshake_ex(res, uri, path, d);
|
||||
@ -409,8 +409,8 @@ public:
|
||||
template<class NextLayer>
|
||||
void
|
||||
handshake(stream<NextLayer>& ws,
|
||||
boost::string_ref const& uri,
|
||||
boost::string_ref const& path) const
|
||||
string_view const& uri,
|
||||
string_view const& path) const
|
||||
{
|
||||
error_code ec;
|
||||
ws.async_handshake(
|
||||
@ -423,8 +423,8 @@ public:
|
||||
void
|
||||
handshake(stream<NextLayer>& ws,
|
||||
response_type& res,
|
||||
boost::string_ref const& uri,
|
||||
boost::string_ref const& path) const
|
||||
string_view const& uri,
|
||||
string_view const& path) const
|
||||
{
|
||||
error_code ec;
|
||||
ws.async_handshake(
|
||||
@ -436,8 +436,8 @@ public:
|
||||
template<class NextLayer, class Decorator>
|
||||
void
|
||||
handshake_ex(stream<NextLayer>& ws,
|
||||
boost::string_ref const& uri,
|
||||
boost::string_ref const& path,
|
||||
string_view const& uri,
|
||||
string_view const& path,
|
||||
Decorator const &d) const
|
||||
{
|
||||
error_code ec;
|
||||
@ -451,8 +451,8 @@ public:
|
||||
void
|
||||
handshake_ex(stream<NextLayer>& ws,
|
||||
response_type& res,
|
||||
boost::string_ref const& uri,
|
||||
boost::string_ref const& path,
|
||||
string_view const& uri,
|
||||
string_view const& path,
|
||||
Decorator const &d) const
|
||||
{
|
||||
error_code ec;
|
||||
|
Reference in New Issue
Block a user