<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>basic_streambuf::prepare</title> <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> <link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../basic_streambuf.html" title="basic_streambuf"> <link rel="prev" href="overflow.html" title="basic_streambuf::overflow"> <link rel="next" href="reserve.html" title="basic_streambuf::reserve"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> <td align="center"><a href="../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="overflow.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_streambuf.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="reserve.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="boost_asio.reference.basic_streambuf.prepare"></a><a class="link" href="prepare.html" title="basic_streambuf::prepare"> basic_streambuf::prepare</a> </h4></div></div></div> <p> <a class="indexterm" name="id1104718"></a> Get a list of buffers that represents the output sequence, with the given size. </p> <pre class="programlisting"><span class="identifier">mutable_buffers_type</span> <span class="identifier">prepare</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">n</span><span class="special">);</span> </pre> <p> Ensures that the output sequence can accommodate <code class="computeroutput"><span class="identifier">n</span></code> characters, reallocating character array objects as necessary. </p> <a name="boost_asio.reference.basic_streambuf.prepare.return_value"></a><h6> <a name="id1104797"></a> <a class="link" href="prepare.html#boost_asio.reference.basic_streambuf.prepare.return_value">Return Value</a> </h6> <p> An object of type <code class="computeroutput"><span class="identifier">mutable_buffers_type</span></code> that satisfies MutableBufferSequence requirements, representing character array objects at the start of the output sequence such that the sum of the buffer sizes is <code class="computeroutput"><span class="identifier">n</span></code>. </p> <a name="boost_asio.reference.basic_streambuf.prepare.exceptions"></a><h6> <a name="id1104846"></a> <a class="link" href="prepare.html#boost_asio.reference.basic_streambuf.prepare.exceptions">Exceptions</a> </h6> <div class="variablelist"> <p class="title"><b></b></p> <dl> <dt><span class="term">std::length_error</span></dt> <dd><p> If <code class="computeroutput"><span class="identifier">size</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">n</span> <span class="special">></span> <span class="identifier">max_size</span><span class="special">()</span></code>. </p></dd> </dl> </div> <a name="boost_asio.reference.basic_streambuf.prepare.remarks"></a><h6> <a name="id1104928"></a> <a class="link" href="prepare.html#boost_asio.reference.basic_streambuf.prepare.remarks">Remarks</a> </h6> <p> The returned object is invalidated by any <code class="computeroutput"><span class="identifier">basic_streambuf</span></code> member function that modifies the input sequence or output sequence. </p> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright © 2003 - 2010 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying 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>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="overflow.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_streambuf.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="reserve.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>