forked from boostorg/beast
Use beast::string_view alias
This commit is contained in:
1 parent
f50a37b778
commit
84ece031f2
36 files changed
+319
-288
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user