1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>buffers_to_string</title> 5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../index.html" title="Chapter 1. Boost.Beast"> 8<link rel="up" href="../ref.html" title="This Page Intentionally Left Blank 2/2"> 9<link rel="prev" href="boost__beast__buffers_range_ref.html" title="buffers_range_ref"> 10<link rel="next" href="boost__beast__detect_ssl.html" title="detect_ssl"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="boost__beast__buffers_range_ref.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__detect_ssl.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h4 class="title"> 27<a name="beast.ref.boost__beast__buffers_to_string"></a><a class="link" href="boost__beast__buffers_to_string.html" title="buffers_to_string">buffers_to_string</a> 28</h4></div></div></div> 29<p> 30 <a class="indexterm" name="idm46057512987936"></a> 31 </p> 32<p> 33 Return a string representing the contents of a buffer sequence. 34 </p> 35<h5> 36<a name="beast.ref.boost__beast__buffers_to_string.h0"></a> 37 <span class="phrase"><a name="beast.ref.boost__beast__buffers_to_string.synopsis"></a></span><a class="link" href="boost__beast__buffers_to_string.html#beast.ref.boost__beast__buffers_to_string.synopsis">Synopsis</a> 38 </h5> 39<p> 40 Defined in header <code class="literal"><<a href="../../../../../../boost/beast/core/buffers_to_string.hpp" target="_top">boost/beast/core/buffers_to_string.hpp</a>></code> 41 </p> 42<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span> 43 <span class="keyword">class</span> <a href="../../../../../../doc/html/boost_asio/reference/ConstBufferSequence.html" target="_top"><span class="emphasis"><em>ConstBufferSequence</em></span></a><span class="special">></span> 44<span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> 45<span class="identifier">buffers_to_string</span><span class="special">(</span> 46 <span class="identifier">ConstBufferSequence</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">buffers</span><span class="special">);</span> 47</pre> 48<h5> 49<a name="beast.ref.boost__beast__buffers_to_string.h1"></a> 50 <span class="phrase"><a name="beast.ref.boost__beast__buffers_to_string.description"></a></span><a class="link" href="boost__beast__buffers_to_string.html#beast.ref.boost__beast__buffers_to_string.description">Description</a> 51 </h5> 52<p> 53 This function returns a string representing an entire buffer sequence. Nulls 54 and unprintable characters in the buffer sequence are inserted to the resulting 55 string as-is. No character conversions are performed. 56 </p> 57<h5> 58<a name="beast.ref.boost__beast__buffers_to_string.h2"></a> 59 <span class="phrase"><a name="beast.ref.boost__beast__buffers_to_string.parameters"></a></span><a class="link" href="boost__beast__buffers_to_string.html#beast.ref.boost__beast__buffers_to_string.parameters">Parameters</a> 60 </h5> 61<div class="informaltable"><table class="table"> 62<colgroup> 63<col> 64<col> 65</colgroup> 66<thead><tr> 67<th> 68 <p> 69 Name 70 </p> 71 </th> 72<th> 73 <p> 74 Description 75 </p> 76 </th> 77</tr></thead> 78<tbody><tr> 79<td> 80 <p> 81 <code class="computeroutput"><span class="identifier">buffers</span></code> 82 </p> 83 </td> 84<td> 85 <p> 86 The buffer sequence to convert 87 </p> 88 </td> 89</tr></tbody> 90</table></div> 91<h5> 92<a name="beast.ref.boost__beast__buffers_to_string.h3"></a> 93 <span class="phrase"><a name="beast.ref.boost__beast__buffers_to_string.example"></a></span><a class="link" href="boost__beast__buffers_to_string.html#beast.ref.boost__beast__buffers_to_string.example">Example</a> 94 </h5> 95<p> 96 This function writes a buffer sequence converted to a string to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span></code>. 97 </p> 98<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">ConstBufferSequence</span><span class="special">></span> 99<span class="keyword">void</span> <span class="identifier">print</span><span class="special">(</span><span class="identifier">ConstBufferSequence</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">buffers</span><span class="special">)</span> 100<span class="special">{</span> 101 <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">buffers_to_string</span><span class="special">(</span><span class="identifier">buffers</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> 102<span class="special">}</span> 103</pre> 104</div> 105<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 106<td align="left"></td> 107<td align="right"><div class="copyright-footer">Copyright © 2016-2019 Vinnie 108 Falco<p> 109 Distributed under the Boost Software License, Version 1.0. (See accompanying 110 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 111 </p> 112</div></td> 113</tr></table> 114<hr> 115<div class="spirit-nav"> 116<a accesskey="p" href="boost__beast__buffers_range_ref.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost__beast__detect_ssl.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> 117</div> 118</body> 119</html> 120