buffers_cat replaces buffer_cat (API Change):

fix #773

* buffer_cat is renamed to buffers_cat
* buffer_cat_view is renamed to buffers_cat_view

Actions Required:

* Use buffers_cat instead of buffer_cat
* Use buffers_cat_view instead of buffer_cat_view
This commit is contained in:
Vinnie Falco
2017-09-15 10:03:59 -07:00
parent 38c2816539
commit 06fb2b9dfc
17 changed files with 90 additions and 86 deletions

View File

@@ -6,6 +6,8 @@ API Changes:
* buffers_prefix replaces buffer_prefix * buffers_prefix replaces buffer_prefix
* buffers_prefix_view replaces buffer_prefix_view * buffers_prefix_view replaces buffer_prefix_view
* buffers_front replaces buffer_front * buffers_front replaces buffer_front
* buffers_cat replaces buffer_cat
* buffers_cat_view replaces buffer_cat_view
Actions Required: Actions Required:
@@ -13,6 +15,8 @@ Actions Required:
* Use buffers_prefix instead of buffer_prefix * Use buffers_prefix instead of buffer_prefix
* Use buffers_prefix_view instead of buffer_prefix_view * Use buffers_prefix_view instead of buffer_prefix_view
* Use buffers_front instead of buffer_front * Use buffers_front instead of buffer_front
* Use buffers_cat instead of buffer_cat
* Use buffers_cat_view instead of buffer_cat_view
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@@ -107,7 +107,7 @@ transferred.
[table Buffer Algorithms and Types [table Buffer Algorithms and Types
[[Name][Description]] [[Name][Description]]
[[ [[
[link beast.ref.boost__beast__buffer_cat `buffer_cat`] [link beast.ref.boost__beast__buffers_cat `buffers_cat`]
][ ][
This functions returns a new buffer sequence which, when iterated, This functions returns a new buffer sequence which, when iterated,
traverses the sequence which would be formed if all of the input buffer traverses the sequence which would be formed if all of the input buffer
@@ -116,11 +116,11 @@ transferred.
expensive system calls. expensive system calls.
]] ]]
[[ [[
[link beast.ref.boost__beast__buffer_cat_view `buffer_cat_view`] [link beast.ref.boost__beast__buffers_cat_view `buffers_cat_view`]
][ ][
This class represents the buffer sequence formed by concatenating This class represents the buffer sequence formed by concatenating
two or more buffer sequences. This is type of object returned by two or more buffer sequences. This is type of object returned by
[link beast.ref.boost__beast__buffer_cat `buffer_cat`]. [link beast.ref.boost__beast__buffers_cat `buffers_cat`].
]] ]]
[[ [[
[link beast.ref.boost__beast__buffers_front `buffers_front`] [link beast.ref.boost__beast__buffers_front `buffers_front`]

View File

@@ -179,9 +179,9 @@
<member><link linkend="beast.ref.boost__beast__async_return_type">async_return_type</link></member> <member><link linkend="beast.ref.boost__beast__async_return_type">async_return_type</link></member>
<member><link linkend="beast.ref.boost__beast__basic_flat_buffer">basic_flat_buffer</link></member> <member><link linkend="beast.ref.boost__beast__basic_flat_buffer">basic_flat_buffer</link></member>
<member><link linkend="beast.ref.boost__beast__basic_multi_buffer">basic_multi_buffer</link></member> <member><link linkend="beast.ref.boost__beast__basic_multi_buffer">basic_multi_buffer</link></member>
<member><link linkend="beast.ref.boost__beast__buffer_cat_view">buffer_cat_view</link></member>
<member><link linkend="beast.ref.boost__beast__buffered_read_stream">buffered_read_stream</link></member> <member><link linkend="beast.ref.boost__beast__buffered_read_stream">buffered_read_stream</link></member>
<member><link linkend="beast.ref.boost__beast__buffers_adapter">buffers_adapter</link></member> <member><link linkend="beast.ref.boost__beast__buffers_adapter">buffers_adapter</link></member>
<member><link linkend="beast.ref.boost__beast__buffers_cat_view">buffer_cat_view</link></member>
<member><link linkend="beast.ref.boost__beast__buffers_prefix_view">buffers_prefix_view</link></member> <member><link linkend="beast.ref.boost__beast__buffers_prefix_view">buffers_prefix_view</link></member>
<member><link linkend="beast.ref.boost__beast__buffers_suffix">buffers_suffix</link></member> <member><link linkend="beast.ref.boost__beast__buffers_suffix">buffers_suffix</link></member>
<member><link linkend="beast.ref.boost__beast__file">file</link></member> <member><link linkend="beast.ref.boost__beast__file">file</link></member>
@@ -215,8 +215,8 @@
<bridgehead renderas="sect3">Functions</bridgehead> <bridgehead renderas="sect3">Functions</bridgehead>
<simplelist type="vert" columns="1"> <simplelist type="vert" columns="1">
<member><link linkend="beast.ref.boost__beast__bind_handler">bind_handler</link></member> <member><link linkend="beast.ref.boost__beast__bind_handler">bind_handler</link></member>
<member><link linkend="beast.ref.boost__beast__buffer_cat">buffer_cat</link></member>
<member><link linkend="beast.ref.boost__beast__buffers">buffers</link></member> <member><link linkend="beast.ref.boost__beast__buffers">buffers</link></member>
<member><link linkend="beast.ref.boost__beast__buffers_cat">buffer_cat</link></member>
<member><link linkend="beast.ref.boost__beast__buffers_front">buffers_front</link></member> <member><link linkend="beast.ref.boost__beast__buffers_front">buffers_front</link></member>
<member><link linkend="beast.ref.boost__beast__buffers_prefix">buffers_prefix</link></member> <member><link linkend="beast.ref.boost__beast__buffers_prefix">buffers_prefix</link></member>
<member><link linkend="beast.ref.boost__beast__generic_category">generic_category</link></member> <member><link linkend="beast.ref.boost__beast__generic_category">generic_category</link></member>

View File

@@ -14,7 +14,7 @@
#include <boost/beast/core/async_result.hpp> #include <boost/beast/core/async_result.hpp>
#include <boost/beast/core/bind_handler.hpp> #include <boost/beast/core/bind_handler.hpp>
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/buffers_prefix.hpp> #include <boost/beast/core/buffers_prefix.hpp>
#include <boost/beast/core/buffered_read_stream.hpp> #include <boost/beast/core/buffered_read_stream.hpp>
#include <boost/beast/core/buffers_adapter.hpp> #include <boost/beast/core/buffers_adapter.hpp>

View File

@@ -7,8 +7,8 @@
// Official repository: https://github.com/boostorg/beast // Official repository: https://github.com/boostorg/beast
// //
#ifndef BOOST_BEAST_BUFFER_CAT_HPP #ifndef BOOST_BEAST_BUFFERS_CAT_HPP
#define BOOST_BEAST_BUFFER_CAT_HPP #define BOOST_BEAST_BUFFERS_CAT_HPP
#include <boost/beast/config.hpp> #include <boost/beast/config.hpp>
#include <boost/beast/core/detail/type_traits.hpp> #include <boost/beast/core/detail/type_traits.hpp>
@@ -19,10 +19,10 @@ namespace beast {
/** A buffer sequence representing a concatenation of buffer sequences. /** A buffer sequence representing a concatenation of buffer sequences.
@see @ref buffer_cat @see @ref buffers_cat
*/ */
template<class... Buffers> template<class... Buffers>
class buffer_cat_view class buffers_cat_view
{ {
std::tuple<Buffers...> bn_; std::tuple<Buffers...> bn_;
@@ -44,13 +44,13 @@ public:
class const_iterator; class const_iterator;
/// Constructor /// Constructor
buffer_cat_view(buffer_cat_view&&) = default; buffers_cat_view(buffers_cat_view&&) = default;
/// Assignment /// Assignment
buffer_cat_view& operator=(buffer_cat_view&&) = default; buffers_cat_view& operator=(buffers_cat_view&&) = default;
/// Assignment /// Assignment
buffer_cat_view& operator=(buffer_cat_view const&) = default; buffers_cat_view& operator=(buffers_cat_view const&) = default;
/** Constructor /** Constructor
@@ -59,12 +59,12 @@ public:
of memory is not transferred. of memory is not transferred.
*/ */
explicit explicit
buffer_cat_view(Buffers const&... buffers); buffers_cat_view(Buffers const&... buffers);
//----- //-----
/// Required for @b BufferSequence /// Required for @b BufferSequence
buffer_cat_view(buffer_cat_view const&) = default; buffers_cat_view(buffers_cat_view const&) = default;
/// Required for @b BufferSequence /// Required for @b BufferSequence
const_iterator const_iterator
@@ -92,28 +92,28 @@ public:
also a @b MutableBufferSequence; otherwise the returned buffer also a @b MutableBufferSequence; otherwise the returned buffer
sequence will be a @b ConstBufferSequence. sequence will be a @b ConstBufferSequence.
@see @ref buffer_cat_view @see @ref buffers_cat_view
*/ */
#if BOOST_BEAST_DOXYGEN #if BOOST_BEAST_DOXYGEN
template<class... BufferSequence> template<class... BufferSequence>
buffer_cat_view<BufferSequence...> buffers_cat_view<BufferSequence...>
buffer_cat(BufferSequence const&... buffers) buffers_cat(BufferSequence const&... buffers)
#else #else
template<class B1, class B2, class... Bn> template<class B1, class B2, class... Bn>
inline inline
buffer_cat_view<B1, B2, Bn...> buffers_cat_view<B1, B2, Bn...>
buffer_cat(B1 const& b1, B2 const& b2, Bn const&... bn) buffers_cat(B1 const& b1, B2 const& b2, Bn const&... bn)
#endif #endif
{ {
static_assert( static_assert(
detail::is_all_const_buffer_sequence<B1, B2, Bn...>::value, detail::is_all_const_buffer_sequence<B1, B2, Bn...>::value,
"BufferSequence requirements not met"); "BufferSequence requirements not met");
return buffer_cat_view<B1, B2, Bn...>{b1, b2, bn...}; return buffers_cat_view<B1, B2, Bn...>{b1, b2, bn...};
} }
} // beast } // beast
} // boost } // boost
#include <boost/beast/core/impl/buffer_cat.ipp> #include <boost/beast/core/impl/buffers_cat.ipp>
#endif #endif

View File

@@ -7,8 +7,8 @@
// Official repository: https://github.com/boostorg/beast // Official repository: https://github.com/boostorg/beast
// //
#ifndef BOOST_BEAST_IMPL_BUFFER_CAT_IPP #ifndef BOOST_BEAST_IMPL_BUFFERS_CAT_IPP
#define BOOST_BEAST_IMPL_BUFFER_CAT_IPP #define BOOST_BEAST_IMPL_BUFFERS_CAT_IPP
#include <boost/beast/core/detail/type_traits.hpp> #include <boost/beast/core/detail/type_traits.hpp>
#include <boost/asio/buffer.hpp> #include <boost/asio/buffer.hpp>
@@ -25,14 +25,14 @@ namespace boost {
namespace beast { namespace beast {
template<class... Bn> template<class... Bn>
class buffer_cat_view<Bn...>::const_iterator class buffers_cat_view<Bn...>::const_iterator
{ {
std::size_t n_; std::size_t n_;
std::tuple<Bn...> const* bn_; std::tuple<Bn...> const* bn_;
std::array<char, detail::max_sizeof< std::array<char, detail::max_sizeof<
typename Bn::const_iterator...>()> buf_; typename Bn::const_iterator...>()> buf_;
friend class buffer_cat_view<Bn...>; friend class buffers_cat_view<Bn...>;
template<std::size_t I> template<std::size_t I>
using C = std::integral_constant<std::size_t, I>; using C = std::integral_constant<std::size_t, I>;
@@ -322,14 +322,14 @@ private:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
template<class... Bn> template<class... Bn>
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::~const_iterator() const_iterator::~const_iterator()
{ {
destroy(C<0>{}); destroy(C<0>{});
} }
template<class... Bn> template<class... Bn>
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::const_iterator() const_iterator::const_iterator()
: n_(sizeof...(Bn)) : n_(sizeof...(Bn))
, bn_(nullptr) , bn_(nullptr)
@@ -337,7 +337,7 @@ const_iterator::const_iterator()
} }
template<class... Bn> template<class... Bn>
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::const_iterator( const_iterator::const_iterator(
std::tuple<Bn...> const& bn, bool at_end) std::tuple<Bn...> const& bn, bool at_end)
: bn_(&bn) : bn_(&bn)
@@ -349,7 +349,7 @@ const_iterator::const_iterator(
} }
template<class... Bn> template<class... Bn>
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::const_iterator(const_iterator&& other) const_iterator::const_iterator(const_iterator&& other)
: n_(other.n_) : n_(other.n_)
, bn_(other.bn_) , bn_(other.bn_)
@@ -358,7 +358,7 @@ const_iterator::const_iterator(const_iterator&& other)
} }
template<class... Bn> template<class... Bn>
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::const_iterator(const_iterator const& other) const_iterator::const_iterator(const_iterator const& other)
: n_(other.n_) : n_(other.n_)
, bn_(other.bn_) , bn_(other.bn_)
@@ -368,7 +368,7 @@ const_iterator::const_iterator(const_iterator const& other)
template<class... Bn> template<class... Bn>
auto auto
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::operator=(const_iterator&& other) -> const_iterator::operator=(const_iterator&& other) ->
const_iterator& const_iterator&
{ {
@@ -384,7 +384,7 @@ const_iterator::operator=(const_iterator&& other) ->
template<class... Bn> template<class... Bn>
auto auto
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::operator=(const_iterator const& other) -> const_iterator::operator=(const_iterator const& other) ->
const_iterator& const_iterator&
{ {
@@ -400,7 +400,7 @@ const_iterator&
template<class... Bn> template<class... Bn>
bool bool
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::operator==(const_iterator const& other) const const_iterator::operator==(const_iterator const& other) const
{ {
if(bn_ != other.bn_) if(bn_ != other.bn_)
@@ -412,7 +412,7 @@ const_iterator::operator==(const_iterator const& other) const
template<class... Bn> template<class... Bn>
auto auto
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::operator*() const -> const_iterator::operator*() const ->
reference reference
{ {
@@ -421,7 +421,7 @@ const_iterator::operator*() const ->
template<class... Bn> template<class... Bn>
auto auto
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::operator++() -> const_iterator::operator++() ->
const_iterator& const_iterator&
{ {
@@ -431,7 +431,7 @@ const_iterator::operator++() ->
template<class... Bn> template<class... Bn>
auto auto
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::operator++(int) -> const_iterator::operator++(int) ->
const_iterator const_iterator
{ {
@@ -442,7 +442,7 @@ const_iterator::operator++(int) ->
template<class... Bn> template<class... Bn>
auto auto
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::operator--() -> const_iterator::operator--() ->
const_iterator& const_iterator&
{ {
@@ -452,7 +452,7 @@ const_iterator::operator--() ->
template<class... Bn> template<class... Bn>
auto auto
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
const_iterator::operator--(int) -> const_iterator::operator--(int) ->
const_iterator const_iterator
{ {
@@ -464,8 +464,8 @@ const_iterator::operator--(int) ->
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
template<class... Bn> template<class... Bn>
buffer_cat_view<Bn...>:: buffers_cat_view<Bn...>::
buffer_cat_view(Bn const&... bn) buffers_cat_view(Bn const&... bn)
: bn_(bn...) : bn_(bn...)
{ {
} }
@@ -474,7 +474,7 @@ buffer_cat_view(Bn const&... bn)
template<class... Bn> template<class... Bn>
inline inline
auto auto
buffer_cat_view<Bn...>::begin() const -> buffers_cat_view<Bn...>::begin() const ->
const_iterator const_iterator
{ {
return const_iterator{bn_, false}; return const_iterator{bn_, false};
@@ -483,7 +483,7 @@ buffer_cat_view<Bn...>::begin() const ->
template<class... Bn> template<class... Bn>
inline inline
auto auto
buffer_cat_view<Bn...>::end() const -> buffers_cat_view<Bn...>::end() const ->
const_iterator const_iterator
{ {
return const_iterator{bn_, true}; return const_iterator{bn_, true};

View File

@@ -11,7 +11,7 @@
#define BOOST_BEAST_HTTP_CHUNK_ENCODE_HPP #define BOOST_BEAST_HTTP_CHUNK_ENCODE_HPP
#include <boost/beast/config.hpp> #include <boost/beast/config.hpp>
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/string.hpp> #include <boost/beast/core/string.hpp>
#include <boost/beast/http/type_traits.hpp> #include <boost/beast/http/type_traits.hpp>
#include <boost/beast/http/detail/chunk_encode.hpp> #include <boost/beast/http/detail/chunk_encode.hpp>
@@ -104,7 +104,7 @@ struct chunk_crlf
*/ */
class chunk_header class chunk_header
{ {
using view_type = buffer_cat_view< using view_type = buffers_cat_view<
detail::chunk_size, // chunk-size detail::chunk_size, // chunk-size
boost::asio::const_buffers_1, // chunk-extensions boost::asio::const_buffers_1, // chunk-extensions
chunk_crlf>; // CRLF chunk_crlf>; // CRLF
@@ -283,7 +283,7 @@ public:
template<class ConstBufferSequence> template<class ConstBufferSequence>
class chunk_body class chunk_body
{ {
using view_type = buffer_cat_view< using view_type = buffers_cat_view<
detail::chunk_size, // chunk-size detail::chunk_size, // chunk-size
boost::asio::const_buffers_1, // chunk-extensions boost::asio::const_buffers_1, // chunk-extensions
chunk_crlf, // CRLF chunk_crlf, // CRLF
@@ -466,7 +466,7 @@ class chunk_last
detail::buffers_or_fields<Trailer>::type; detail::buffers_or_fields<Trailer>::type;
using view_type = using view_type =
buffer_cat_view< buffers_cat_view<
detail::chunk_size0, // "0\r\n" detail::chunk_size0, // "0\r\n"
buffers_type>; // Trailer (includes CRLF) buffers_type>; // Trailer (includes CRLF)

View File

@@ -10,7 +10,7 @@
#ifndef BOOST_BEAST_HTTP_IMPL_FIELDS_IPP #ifndef BOOST_BEAST_HTTP_IMPL_FIELDS_IPP
#define BOOST_BEAST_HTTP_IMPL_FIELDS_IPP #define BOOST_BEAST_HTTP_IMPL_FIELDS_IPP
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/string.hpp> #include <boost/beast/core/string.hpp>
#include <boost/beast/core/static_string.hpp> #include <boost/beast/core/static_string.hpp>
#include <boost/beast/core/detail/buffers_ref.hpp> #include <boost/beast/core/detail/buffers_ref.hpp>
@@ -142,7 +142,7 @@ public:
} }
}; };
using view_type = buffer_cat_view< using view_type = buffers_cat_view<
boost::asio::const_buffers_1, boost::asio::const_buffers_1,
boost::asio::const_buffers_1, boost::asio::const_buffers_1,
boost::asio::const_buffers_1, boost::asio::const_buffers_1,

View File

@@ -11,7 +11,7 @@
#define BOOST_BEAST_HTTP_SERIALIZER_HPP #define BOOST_BEAST_HTTP_SERIALIZER_HPP
#include <boost/beast/config.hpp> #include <boost/beast/config.hpp>
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/buffers_prefix.hpp> #include <boost/beast/core/buffers_prefix.hpp>
#include <boost/beast/core/buffers_suffix.hpp> #include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/string.hpp> #include <boost/beast/core/string.hpp>
@@ -120,7 +120,7 @@ private:
Fields::reader::const_buffers_type>; // header Fields::reader::const_buffers_type>; // header
using pcb1_t = buffers_prefix_view<cb1_t const&>; using pcb1_t = buffers_prefix_view<cb1_t const&>;
using cb2_t = buffers_suffix<buffer_cat_view< using cb2_t = buffers_suffix<buffers_cat_view<
typename Fields::reader::const_buffers_type,// header typename Fields::reader::const_buffers_type,// header
typename reader::const_buffers_type>>; // body typename reader::const_buffers_type>>; // body
using pcb2_t = buffers_prefix_view<cb2_t const&>; using pcb2_t = buffers_prefix_view<cb2_t const&>;
@@ -129,7 +129,7 @@ private:
typename reader::const_buffers_type>; // body typename reader::const_buffers_type>; // body
using pcb3_t = buffers_prefix_view<cb3_t const&>; using pcb3_t = buffers_prefix_view<cb3_t const&>;
using cb4_t = buffers_suffix<buffer_cat_view< using cb4_t = buffers_suffix<buffers_cat_view<
typename Fields::reader::const_buffers_type,// header typename Fields::reader::const_buffers_type,// header
detail::chunk_size, // chunk-size detail::chunk_size, // chunk-size
boost::asio::const_buffers_1, // chunk-ext boost::asio::const_buffers_1, // chunk-ext
@@ -138,7 +138,7 @@ private:
chunk_crlf>>; // crlf chunk_crlf>>; // crlf
using pcb4_t = buffers_prefix_view<cb4_t const&>; using pcb4_t = buffers_prefix_view<cb4_t const&>;
using cb5_t = buffers_suffix<buffer_cat_view< using cb5_t = buffers_suffix<buffers_cat_view<
detail::chunk_size, // chunk-header detail::chunk_size, // chunk-header
boost::asio::const_buffers_1, // chunk-ext boost::asio::const_buffers_1, // chunk-ext
chunk_crlf, // crlf chunk_crlf, // crlf
@@ -146,7 +146,7 @@ private:
chunk_crlf>>; // crlf chunk_crlf>>; // crlf
using pcb5_t = buffers_prefix_view<cb5_t const&>; using pcb5_t = buffers_prefix_view<cb5_t const&>;
using cb6_t = buffers_suffix<buffer_cat_view< using cb6_t = buffers_suffix<buffers_cat_view<
detail::chunk_size, // chunk-header detail::chunk_size, // chunk-header
boost::asio::const_buffers_1, // chunk-size boost::asio::const_buffers_1, // chunk-size
chunk_crlf, // crlf chunk_crlf, // crlf
@@ -157,7 +157,7 @@ private:
chunk_crlf>>; // crlf chunk_crlf>>; // crlf
using pcb6_t = buffers_prefix_view<cb6_t const&>; using pcb6_t = buffers_prefix_view<cb6_t const&>;
using cb7_t = buffers_suffix<buffer_cat_view< using cb7_t = buffers_suffix<buffers_cat_view<
typename Fields::reader::const_buffers_type,// header typename Fields::reader::const_buffers_type,// header
detail::chunk_size, // chunk-size detail::chunk_size, // chunk-size
boost::asio::const_buffers_1, // chunk-ext boost::asio::const_buffers_1, // chunk-ext
@@ -169,7 +169,7 @@ private:
chunk_crlf>>; // crlf chunk_crlf>>; // crlf
using pcb7_t = buffers_prefix_view<cb7_t const&>; using pcb7_t = buffers_prefix_view<cb7_t const&>;
using cb8_t = buffers_suffix<buffer_cat_view< using cb8_t = buffers_suffix<buffers_cat_view<
boost::asio::const_buffers_1, // chunk-final boost::asio::const_buffers_1, // chunk-final
boost::asio::const_buffers_1, // trailers boost::asio::const_buffers_1, // trailers
chunk_crlf>>; // crlf chunk_crlf>>; // crlf

View File

@@ -11,7 +11,7 @@
#define BOOST_BEAST_HTTP_WRITE_HPP #define BOOST_BEAST_HTTP_WRITE_HPP
#include <boost/beast/config.hpp> #include <boost/beast/config.hpp>
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/buffers_suffix.hpp> #include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/multi_buffer.hpp> #include <boost/beast/core/multi_buffer.hpp>
#include <boost/beast/http/message.hpp> #include <boost/beast/http/message.hpp>

View File

@@ -18,7 +18,7 @@
#include <boost/beast/http/read.hpp> #include <boost/beast/http/read.hpp>
#include <boost/beast/http/write.hpp> #include <boost/beast/http/write.hpp>
#include <boost/beast/http/rfc7230.hpp> #include <boost/beast/http/rfc7230.hpp>
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/buffers_prefix.hpp> #include <boost/beast/core/buffers_prefix.hpp>
#include <boost/beast/core/buffers_suffix.hpp> #include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/flat_static_buffer.hpp> #include <boost/beast/core/flat_static_buffer.hpp>

View File

@@ -11,7 +11,7 @@
#define BOOST_BEAST_WEBSOCKET_IMPL_WRITE_IPP #define BOOST_BEAST_WEBSOCKET_IMPL_WRITE_IPP
#include <boost/beast/core/bind_handler.hpp> #include <boost/beast/core/bind_handler.hpp>
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/buffers_prefix.hpp> #include <boost/beast/core/buffers_prefix.hpp>
#include <boost/beast/core/buffers_suffix.hpp> #include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/handler_ptr.hpp> #include <boost/beast/core/handler_ptr.hpp>
@@ -246,7 +246,7 @@ operator()(
// Send frame // Send frame
BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD
boost::asio::async_write(ws_.stream_, boost::asio::async_write(ws_.stream_,
buffer_cat(ws_.wr_fb_.data(), cb_), buffers_cat(ws_.wr_fb_.data(), cb_),
std::move(*this)); std::move(*this));
if(! ws_.check_ok(ec)) if(! ws_.check_ok(ec))
goto upcall; goto upcall;
@@ -271,7 +271,7 @@ operator()(
// Send frame // Send frame
BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD
boost::asio::async_write( boost::asio::async_write(
ws_.stream_, buffer_cat( ws_.stream_, buffers_cat(
ws_.wr_fb_.data(), buffers_prefix( ws_.wr_fb_.data(), buffers_prefix(
clamp(fh_.len), cb_)), clamp(fh_.len), cb_)),
std::move(*this)); std::move(*this));
@@ -320,7 +320,7 @@ operator()(
// Send frame header and partial payload // Send frame header and partial payload
BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD
boost::asio::async_write( boost::asio::async_write(
ws_.stream_, buffer_cat(ws_.wr_fb_.data(), ws_.stream_, buffers_cat(ws_.wr_fb_.data(),
buffer(ws_.wr_buf_.get(), n)), buffer(ws_.wr_buf_.get(), n)),
std::move(*this)); std::move(*this));
if(! ws_.check_ok(ec)) if(! ws_.check_ok(ec))
@@ -371,7 +371,7 @@ operator()(
// Send frame // Send frame
BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD
boost::asio::async_write(ws_.stream_, boost::asio::async_write(ws_.stream_,
buffer_cat(ws_.wr_fb_.data(), buffers_cat(ws_.wr_fb_.data(),
buffer(ws_.wr_buf_.get(), n)), buffer(ws_.wr_buf_.get(), n)),
std::move(*this)); std::move(*this));
if(! ws_.check_ok(ec)) if(! ws_.check_ok(ec))
@@ -435,7 +435,7 @@ operator()(
// Send frame // Send frame
BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD
boost::asio::async_write(ws_.stream_, boost::asio::async_write(ws_.stream_,
buffer_cat(ws_.wr_fb_.data(), buffers_cat(ws_.wr_fb_.data(),
mutable_buffers_1{b}), std::move(*this)); mutable_buffers_1{b}), std::move(*this));
if(! ws_.check_ok(ec)) if(! ws_.check_ok(ec))
goto upcall; goto upcall;
@@ -580,7 +580,7 @@ write_some(bool fin,
flat_static_buffer_base>(fh_buf, fh); flat_static_buffer_base>(fh_buf, fh);
wr_cont_ = ! fin; wr_cont_ = ! fin;
boost::asio::write(stream_, boost::asio::write(stream_,
buffer_cat(fh_buf.data(), b), ec); buffers_cat(fh_buf.data(), b), ec);
if(! check_ok(ec)) if(! check_ok(ec))
return bytes_transferred; return bytes_transferred;
if(! more) if(! more)
@@ -607,7 +607,7 @@ write_some(bool fin,
flat_static_buffer_base>(fh_buf, fh); flat_static_buffer_base>(fh_buf, fh);
wr_cont_ = ! fin; wr_cont_ = ! fin;
boost::asio::write(stream_, boost::asio::write(stream_,
buffer_cat(fh_buf.data(), buffers), ec); buffers_cat(fh_buf.data(), buffers), ec);
if(! check_ok(ec)) if(! check_ok(ec))
return bytes_transferred; return bytes_transferred;
bytes_transferred += remain; bytes_transferred += remain;
@@ -629,7 +629,7 @@ write_some(bool fin,
flat_static_buffer_base>(fh_buf, fh); flat_static_buffer_base>(fh_buf, fh);
wr_cont_ = ! fin; wr_cont_ = ! fin;
boost::asio::write(stream_, boost::asio::write(stream_,
buffer_cat(fh_buf.data(), buffers_cat(fh_buf.data(),
buffers_prefix(n, cb)), ec); buffers_prefix(n, cb)), ec);
if(! check_ok(ec)) if(! check_ok(ec))
return bytes_transferred; return bytes_transferred;
@@ -663,7 +663,7 @@ write_some(bool fin,
detail::mask_inplace(b, key); detail::mask_inplace(b, key);
wr_cont_ = ! fin; wr_cont_ = ! fin;
boost::asio::write(stream_, boost::asio::write(stream_,
buffer_cat(fh_buf.data(), b), ec); buffers_cat(fh_buf.data(), b), ec);
if(! check_ok(ec)) if(! check_ok(ec))
return bytes_transferred; return bytes_transferred;
bytes_transferred += n; bytes_transferred += n;
@@ -705,7 +705,7 @@ write_some(bool fin,
detail::write< detail::write<
flat_static_buffer_base>(fh_buf, fh); flat_static_buffer_base>(fh_buf, fh);
boost::asio::write(stream_, boost::asio::write(stream_,
buffer_cat(fh_buf.data(), b), ec); buffers_cat(fh_buf.data(), b), ec);
if(! check_ok(ec)) if(! check_ok(ec))
return bytes_transferred; return bytes_transferred;
bytes_transferred += n; bytes_transferred += n;

View File

@@ -20,9 +20,9 @@ add_executable (tests-beast-core
file_test.hpp file_test.hpp
async_result.cpp async_result.cpp
bind_handler.cpp bind_handler.cpp
buffer_cat.cpp
buffered_read_stream.cpp buffered_read_stream.cpp
buffers_adapter.cpp buffers_adapter.cpp
buffers_cat.cpp
buffers_prefix.cpp buffers_prefix.cpp
buffers_suffix.cpp buffers_suffix.cpp
error.cpp error.cpp

View File

@@ -10,9 +10,9 @@
local SOURCES = local SOURCES =
async_result.cpp async_result.cpp
bind_handler.cpp bind_handler.cpp
buffer_cat.cpp
buffered_read_stream.cpp buffered_read_stream.cpp
buffers_adapter.cpp buffers_adapter.cpp
buffers_cat.cpp
buffers_prefix.cpp buffers_prefix.cpp
buffers_suffix.cpp buffers_suffix.cpp
error.cpp error.cpp

View File

@@ -8,7 +8,7 @@
// //
// Test that header file is self-contained. // Test that header file is self-contained.
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/unit_test/suite.hpp> #include <boost/beast/unit_test/suite.hpp>
#include <boost/asio/buffer.hpp> #include <boost/asio/buffer.hpp>
@@ -21,7 +21,7 @@
namespace boost { namespace boost {
namespace beast { namespace beast {
class buffer_cat_test : public unit_test::suite class buffers_cat_test : public unit_test::suite
{ {
public: public:
template<class Iterator> template<class Iterator>
@@ -100,7 +100,7 @@ public:
std::list<const_buffer> b5{ std::list<const_buffer> b5{
const_buffer{buf+9, 1}}; const_buffer{buf+9, 1}};
std::list<const_buffer> b6; std::list<const_buffer> b6;
auto bs = buffer_cat( auto bs = buffers_cat(
b1, b2, b3, b4, b5, b6); b1, b2, b3, b4, b5, b6);
BEAST_EXPECT(buffer_size(bs) == 10); BEAST_EXPECT(buffer_size(bs) == 10);
BEAST_EXPECT(bsize1(bs) == 10); BEAST_EXPECT(bsize1(bs) == 10);
@@ -116,11 +116,11 @@ public:
auto bs3(std::move(bs)); auto bs3(std::move(bs));
{ {
boost::asio::streambuf sb1, sb2; boost::asio::streambuf sb1, sb2;
BEAST_EXPECT(buffer_size(buffer_cat( BEAST_EXPECT(buffer_size(buffers_cat(
sb1.prepare(5), sb2.prepare(7))) == 12); sb1.prepare(5), sb2.prepare(7))) == 12);
sb1.commit(5); sb1.commit(5);
sb2.commit(7); sb2.commit(7);
BEAST_EXPECT(buffer_size(buffer_cat( BEAST_EXPECT(buffer_size(buffers_cat(
sb1.data(), sb2.data())) == 12); sb1.data(), sb2.data())) == 12);
} }
for(auto it = bs.begin(); it != bs.end(); ++it) for(auto it = bs.begin(); it != bs.end(); ++it)
@@ -145,7 +145,7 @@ public:
const_buffer{buf+3, 1}, const_buffer{buf+3, 1},
const_buffer{buf+4, 2}, const_buffer{buf+4, 2},
const_buffer{buf+6, 3}}}; const_buffer{buf+6, 3}}};
auto bs = buffer_cat(b1, b2); auto bs = buffers_cat(b1, b2);
for(int n = 0; for(int n = 0;
n <= std::distance(bs.begin(), bs.end()); ++n) n <= std::distance(bs.begin(), bs.end()); ++n)
{ {
@@ -243,7 +243,7 @@ public:
// sequences results in a mutable buffer sequence // sequences results in a mutable buffer sequence
BOOST_STATIC_ASSERT(std::is_same< BOOST_STATIC_ASSERT(std::is_same<
mutable_buffer, mutable_buffer,
decltype(buffer_cat( decltype(buffers_cat(
std::declval<mutable_buffer>(), std::declval<mutable_buffer>(),
std::declval<user_defined>(), std::declval<user_defined>(),
std::declval<mutable_buffer>() std::declval<mutable_buffer>()
@@ -253,7 +253,7 @@ public:
// sequences results in a const buffer sequence. // sequences results in a const buffer sequence.
BOOST_STATIC_ASSERT(std::is_same< BOOST_STATIC_ASSERT(std::is_same<
const_buffer, const_buffer,
decltype(buffer_cat( decltype(buffers_cat(
std::declval<mutable_buffer>(), std::declval<mutable_buffer>(),
std::declval<user_defined>(), std::declval<user_defined>(),
std::declval<const_buffer>() std::declval<const_buffer>()
@@ -264,7 +264,7 @@ public:
} }
}; };
BEAST_DEFINE_TESTSUITE(beast,core,buffer_cat); BEAST_DEFINE_TESTSUITE(beast,core,buffers_cat);
} // beast } // beast
} // boost } // boost

View File

@@ -12,7 +12,7 @@
#include "buffer_test.hpp" #include "buffer_test.hpp"
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/ostream.hpp> #include <boost/beast/core/ostream.hpp>
#include <boost/beast/unit_test/suite.hpp> #include <boost/beast/unit_test/suite.hpp>
#include <boost/asio/buffer.hpp> #include <boost/asio/buffer.hpp>
@@ -133,7 +133,7 @@ public:
testInPlace() testInPlace()
{ {
using namespace test; using namespace test;
buffers_suffix<buffer_cat_view< buffers_suffix<buffers_cat_view<
boost::asio::const_buffers_1, boost::asio::const_buffers_1,
boost::asio::const_buffers_1>> cb( boost::asio::const_buffers_1>> cb(
boost::in_place_init, boost::in_place_init,

View File

@@ -13,7 +13,7 @@
#include "message_fuzz.hpp" #include "message_fuzz.hpp"
#include "test_parser.hpp" #include "test_parser.hpp"
#include <boost/beast/core/buffer_cat.hpp> #include <boost/beast/core/buffers_cat.hpp>
#include <boost/beast/core/buffers_prefix.hpp> #include <boost/beast/core/buffers_prefix.hpp>
#include <boost/beast/core/buffers_suffix.hpp> #include <boost/beast/core/buffers_suffix.hpp>
#include <boost/beast/core/multi_buffer.hpp> #include <boost/beast/core/multi_buffer.hpp>
@@ -193,7 +193,7 @@ public:
error_code ec; error_code ec;
buffers_suffix<ConstBufferSequence> cb{buffers}; buffers_suffix<ConstBufferSequence> cb{buffers};
cb.consume(i); cb.consume(i);
auto n = p.put(buffer_cat( auto n = p.put(buffers_cat(
buffers_prefix(i, buffers), cb), ec); buffers_prefix(i, buffers), cb), ec);
if(! BEAST_EXPECTS(! ec, ec.message())) if(! BEAST_EXPECTS(! ec, ec.message()))
continue; continue;
@@ -265,7 +265,7 @@ public:
Parser p; Parser p;
p.eager(true); p.eager(true);
error_code ec; error_code ec;
p.put(buffer_cat( p.put(buffers_cat(
boost::asio::const_buffers_1{msg.data(), i}, boost::asio::const_buffers_1{msg.data(), i},
boost::asio::const_buffers_1{ boost::asio::const_buffers_1{
msg.data() + i, msg.size() - i}), ec); msg.data() + i, msg.size() - i}), ec);
@@ -948,7 +948,7 @@ public:
"hello", "hello",
expect_body(*this, "hello")); expect_body(*this, "hello"));
parsegrind<test_parser<true>>(buffer_cat( parsegrind<test_parser<true>>(buffers_cat(
buf("GET / HTTP/1.1\r\n" buf("GET / HTTP/1.1\r\n"
"Content-Length: 10\r\n" "Content-Length: 10\r\n"
"\r\n"), "\r\n"),