forked from boostorg/beast
1 parent
787de2111b
commit
df95a09024
14 files changed
+265
-263
No files matched your search
@@ -9,8 +9,14 @@
|
||||
#define BEAST_PREPARE_BUFFER_HPP
|
||||
|
||||
#include <beast/config.hpp>
|
||||
#include <beast/core/detail/prepare_buffer.hpp>
|
||||
#include <boost/asio/buffer.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace beast {
|
||||
|
||||
@@ -64,6 +70,34 @@ prepare_buffer(std::size_t n,
|
||||
(std::min)(n, buffer_size(buffer)) };
|
||||
}
|
||||
|
||||
/** Return a shortened buffer sequence.
|
||||
|
||||
This function returns a new buffer sequence which adapts the
|
||||
passed buffer sequence and efficiently presents a shorter subset
|
||||
of the original list of buffers starting with the first byte of
|
||||
the original sequence.
|
||||
|
||||
@param n The maximum number of bytes in the wrapped
|
||||
sequence. If this is larger than the size of passed,
|
||||
buffers, the resulting sequence will represent the
|
||||
entire input sequence.
|
||||
|
||||
@param buffers The buffer sequence to adapt. A copy of
|
||||
the sequence will be made, but ownership of the underlying
|
||||
memory is not transferred.
|
||||
*/
|
||||
template<class BufferSequence>
|
||||
#if BEAST_DOXYGEN
|
||||
implementation_defined
|
||||
#else
|
||||
inline
|
||||
detail::prepare_buffers_helper<BufferSequence>
|
||||
#endif
|
||||
prepare_buffers(std::size_t n, BufferSequence const& buffers)
|
||||
{
|
||||
return detail::prepare_buffers_helper<BufferSequence>(n, buffers);
|
||||
}
|
||||
|
||||
} // beast
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user