mirror of
https://github.com/boostorg/iostreams.git
synced 2026-02-22 03:22:24 +00:00
68 lines
2.5 KiB
HTML
Executable File
68 lines
2.5 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>Function Template copy</TITLE>
|
|
<LINK REL="stylesheet" HREF="../../../../boost.css">
|
|
<LINK REL="stylesheet" HREF="../theme/iostreams.css">
|
|
</HEAD>
|
|
<BODY>
|
|
|
|
<!-- Begin Banner -->
|
|
|
|
<H1 CLASS="title">Function Template <CODE>copy</CODE></H1>
|
|
<HR CLASS="banner">
|
|
|
|
<!-- End Banner -->
|
|
|
|
<DL class="page-index">
|
|
<DT><A href="#description">Description</A></DT>
|
|
<DT><A href="#headers">Headers</A></DT>
|
|
<DT><A href="#synopsis">Synopsis</A></DT>
|
|
</DL>
|
|
|
|
<A NAME="description">
|
|
<H2>Description</H2>
|
|
|
|
<P>The function template <CODE>copy</CODE> reads data from a given model of <A HREF="../concepts/source.html">Source</A> and writes it to a given model of <A HREF="../concepts/sink.html">Sink</A> until the end of stream is reached. It returns the number of characters written.</P>
|
|
|
|
<P>The size of the temporary buffer used may be supplied as an optional parameter.</P>
|
|
|
|
<P>There are four overloads of <CODE>copy</CODE> to accommodate all combinations of <A HREF="../concepts/source.html">Sources</A> and <A HREF="../concepts/sink.html">Sinks</A>, which are passed by <CODE>const</CODE> reference, and streams and stream buffers, which are passed by non-<CODE>const</CODE> reference.</P>
|
|
|
|
<A NAME="headers">
|
|
<H2>Headers</H2>
|
|
|
|
<DL>
|
|
<DT><A CLASS="header" HREF="../../../../boost/iostreams/copy.hpp"><CODE><boost/iostreams/copy.hpp></CODE></A></DT>
|
|
</DL>
|
|
|
|
<A NAME="synopsis">
|
|
<H2>Synopsis</H2>
|
|
|
|
<PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {
|
|
|
|
<SPAN CLASS="keyword">template</SPAN><<SPAN CLASS="keyword">typename</SPAN> Source, <SPAN CLASS="keyword">typename</SPAN> Sink>
|
|
std::streamsize
|
|
copy( [<SPAN CLASS="keyword">const</SPAN>] Source& src, [<SPAN CLASS="keyword">const</SPAN>] Sink& sink,
|
|
std::streamsize buffer_size = <SPAN CLASS="omitted">default value</SPAN> );
|
|
|
|
} } <SPAN CLASS="comment">// End namespace boost::io</SPAN></PRE>
|
|
|
|
|
|
<!-- Begin Footer -->
|
|
|
|
<HR>
|
|
<P CLASS="copyright">Revised
|
|
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
|
20 May, 2004
|
|
<!--webbot bot="Timestamp" endspan i-checksum="38504" -->
|
|
</P>
|
|
|
|
<P CLASS="copyright">© Copyright Jonathan Turkanis, 2004</P>
|
|
<P CLASS="copyright">
|
|
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">http://www.boost.org/LICENSE_1_0.txt</A>)
|
|
</P>
|
|
|
|
<!-- End Footer -->
|
|
|
|
</BODY> |