File indexing completed on 2025-01-18 09:29:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_BEAST_BUFFERS_TO_STRING_HPP
0011 #define BOOST_BEAST_BUFFERS_TO_STRING_HPP
0012
0013 #include <boost/beast/core/detail/config.hpp>
0014 #include <boost/beast/core/buffer_traits.hpp>
0015 #include <boost/beast/core/buffers_range.hpp>
0016 #include <boost/asio/buffer.hpp>
0017 #include <string>
0018
0019 namespace boost {
0020 namespace beast {
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 template<class ConstBufferSequence>
0045 std::string
0046 buffers_to_string(ConstBufferSequence const& buffers)
0047 {
0048 static_assert(
0049 net::is_const_buffer_sequence<ConstBufferSequence>::value,
0050 "ConstBufferSequence type requirements not met");
0051 std::string result;
0052 result.reserve(buffer_bytes(buffers));
0053 for(auto const buffer : buffers_range_ref(buffers))
0054 result.append(static_cast<char const*>(
0055 buffer.data()), buffer.size());
0056 return result;
0057 }
0058
0059 }
0060 }
0061
0062 #endif