Last active
May 27, 2023 06:45
-
-
Save vladon/8b487e41cb3b49e172db to your computer and use it in GitHub Desktop.
Returns `boost::asio::streambuf` contents represented as `std::string`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::string buffer_to_string(const boost::asio::streambuf &buffer) | |
{ | |
using boost::asio::buffers_begin; | |
auto bufs = buffer.data(); | |
std::string result(buffers_begin(bufs), buffers_begin(bufs) + buffer.size()); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment