1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>read_until (10 of 24 overloads)</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="../../../boost_asio.html" title="Boost.Asio"> 8<link rel="up" href="../read_until.html" title="read_until"> 9<link rel="prev" href="overload9.html" title="read_until (9 of 24 overloads)"> 10<link rel="next" href="overload11.html" title="read_until (11 of 24 overloads)"> 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="overload9.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../read_until.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="overload11.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="boost_asio.reference.read_until.overload10"></a><a class="link" href="overload10.html" title="read_until (10 of 24 overloads)">read_until 28 (10 of 24 overloads)</a> 29</h4></div></div></div> 30<p> 31 Read data into a streambuf until it contains a specified delimiter. 32 </p> 33<pre class="programlisting">template< 34 typename <a class="link" href="../SyncReadStream.html" title="Buffer-oriented synchronous read stream requirements">SyncReadStream</a>, 35 typename Allocator> 36std::size_t read_until( 37 SyncReadStream & s, 38 boost::asio::basic_streambuf< Allocator > & b, 39 char delim, 40 boost::system::error_code & ec); 41</pre> 42<p> 43 This function is used to read data into the specified streambuf until the 44 streambuf's get area contains the specified delimiter. The call will block 45 until one of the following conditions is true: 46 </p> 47<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 48<li class="listitem"> 49 The get area of the streambuf contains the specified delimiter. 50 </li> 51<li class="listitem"> 52 An error occurred. 53 </li> 54</ul></div> 55<p> 56 This operation is implemented in terms of zero or more calls to the stream's 57 read_some function. If the streambuf's get area already contains the delimiter, 58 the function returns immediately. 59 </p> 60<h6> 61<a name="boost_asio.reference.read_until.overload10.h0"></a> 62 <span class="phrase"><a name="boost_asio.reference.read_until.overload10.parameters"></a></span><a class="link" href="overload10.html#boost_asio.reference.read_until.overload10.parameters">Parameters</a> 63 </h6> 64<div class="variablelist"> 65<p class="title"><b></b></p> 66<dl class="variablelist"> 67<dt><span class="term">s</span></dt> 68<dd><p> 69 The stream from which the data is to be read. The type must support 70 the SyncReadStream concept. 71 </p></dd> 72<dt><span class="term">b</span></dt> 73<dd><p> 74 A streambuf object into which the data will be read. 75 </p></dd> 76<dt><span class="term">delim</span></dt> 77<dd><p> 78 The delimiter character. 79 </p></dd> 80<dt><span class="term">ec</span></dt> 81<dd><p> 82 Set to indicate what error occurred, if any. 83 </p></dd> 84</dl> 85</div> 86<h6> 87<a name="boost_asio.reference.read_until.overload10.h1"></a> 88 <span class="phrase"><a name="boost_asio.reference.read_until.overload10.return_value"></a></span><a class="link" href="overload10.html#boost_asio.reference.read_until.overload10.return_value">Return 89 Value</a> 90 </h6> 91<p> 92 The number of bytes in the streambuf's get area up to and including the 93 delimiter. Returns 0 if an error occurred. 94 </p> 95<h6> 96<a name="boost_asio.reference.read_until.overload10.h2"></a> 97 <span class="phrase"><a name="boost_asio.reference.read_until.overload10.remarks"></a></span><a class="link" href="overload10.html#boost_asio.reference.read_until.overload10.remarks">Remarks</a> 98 </h6> 99<p> 100 After a successful read_until operation, the streambuf may contain additional 101 data beyond the delimiter. An application will typically leave that data 102 in the streambuf for a subsequent read_until operation to examine. 103 </p> 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 © 2003-2020 Christopher M. 108 Kohlhoff<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="overload9.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../read_until.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="overload11.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 117</div> 118</body> 119</html> 120