Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

buffers_to_string

Return a string representing the contents of a buffer sequence.

Synopsis

Defined in header <boost/beast/core/buffers_to_string.hpp>

template<
    class ConstBufferSequence>
std::string
buffers_to_string(
    ConstBufferSequence const& buffers);
Description

This function returns a string representing an entire buffer sequence. Nulls and unprintable characters in the buffer sequence are inserted to the resulting string as-is. No character conversions are performed.

Parameters

Name

Description

buffers

The buffer sequence to convert

Example

This function writes a buffer sequence converted to a string to std::cout.

template < class ConstBufferSequence>
void print(ConstBufferSequence const & buffers)
{
    std::cout << buffers_to_string(buffers) << std::endl;
}

PrevUpHomeNext