Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/iostreams/doc/functions/putback.html @ 13

Last change on this file since 13 was 12, checked in by landauf, 18 years ago

added boost

  • Property svn:executable set to *
File size: 4.3 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4    <TITLE>Function Template putback</TITLE>
5    <LINK REL="stylesheet" HREF="../../../../boost.css">
6    <LINK REL="stylesheet" HREF="../theme/iostreams.css">
7</HEAD>
8<BODY>
9
10<!-- Begin Banner -->
11
12    <H1 CLASS="title">Function Template <CODE>putback</CODE></H1>
13    <HR CLASS="banner">
14
15<!-- End Banner -->
16
17<DL class="page-index">
18  <DT><A href="#overview">Overview</A></DT>
19  <!-- <DT><A href="#example">Example</A></DT> -->
20  <DT><A href="#headers">Headers</A></DT>
21  <DT><A href="#reference">Reference</A></DT>
22</DL>
23
24<A NAME="overview"></A>
25<H2>Overview</H2>
26
27<P>
28    The function template <CODE>put</CODE> provides a uniform interface for putting back characters read from models of <A HREF="../concepts/peekable.html">Peekable</A>, for use in the definitions of <A HREF="../concepts/filter.html">Filters</A>.
29</P>
30
31<A NAME="headers"></A>
32<H2>Headers</H2>
33
34<DL>
35  <DT><A CLASS="header" HREF="../../../../boost/iostreams/operations.hpp"><CODE>&lt;boost/iostreams/operations.hpp&gt;</CODE></A></DT>
36  <DT><A CLASS="header" HREF="../../../../boost/iostreams/putback.hpp"><CODE>&lt;boost/iostreams/putback.hpp&gt;</CODE></A></DT>
37</DL>
38
39<A NAME="reference"></A>
40<H2>Reference</H2>
41
42<A NAME="description"></A>
43<H4>Description</H4>
44
45<P>Attempt to putback a character to a given instance of the template parameter <CODE>Peekable</CODE>, returning <CODE>true</CODE> for success.</P>
46
47<A NAME="synopsis"></A>
48<H4>Synopsis</H4>
49
50<PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {
51             
52    <SPAN CLASS="keyword">template</SPAN>&lt;<SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Peekable</A>&gt;     
53    <SPAN CLASS="keyword">bool</SPAN> <A CLASS="documented" HREF="#semantics">putback</A>(Peekable& peekable, <SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="../guide/traits.html#char_type_of_ref">char_type_of</A>&lt;Peekable&gt;::type c);
54
55} } <SPAN CLASS="comment">// End namespace boost::io</SPAN></PRE>
56
57<A NAME="template_params"></A>
58<H4>Template Parameters</H4>
59
60<TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2>
61<TR>
62    <TR>
63        <TD VALIGN="top"><I>Peekable</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
64        <TD>A model of <A HREF="../concepts/peekable.html">Peekable</A>.
65    </TR>
66</TABLE>
67
68<A NAME="semantics"></A>
69<H4>Semantics</H4>
70
71<P>The semantics of <CODE>putback</CODE> depends on the <A HREF="../guide/traits.html#category">category</A> of <CODE>Peekable</CODE> as follows:</P>
72
73<TABLE STYLE="margin:0,0,2em,2em" BORDER=1 CELLPADDING=4>
74    <TR><TH><CODE>category_of&lt;Peekable&gt;::type</CODE></TH><TH>semantics</TH></TR>
75    <TR>
76        <TD VALIGN="top">convertible to <A HREF="../guide/traits.html#category_tags"><CODE>istream_tag</CODE></A></TD>
77        <TD>invokes <CODE>peekable.rdbuf()->putback(c)</CODE> and returns <CODE>true</CODE> if the operation was successful</CODE></TD>
78    </TR>
79    <TR>
80        <TD VALIGN="top">convertible to <A HREF="../guide/traits.html#category_tags"><CODE>streambuf_tag</CODE></A> but not to <A HREF="../guide/traits.html#category_tags"><CODE>istream_tag</CODE></A></TD>
81        <TD>invokes <CODE>peekable.sputbackc(c)</CODE> and returns <CODE>true</CODE> if the operation was successful</TD>
82    </TR>
83    <TR>
84        <TD VALIGN="top">convertible to <A HREF="../guide/traits.html#category_tags"><CODE>peekable_tag</CODE></A> but not to <A HREF="../guide/traits.html#category_tags"><CODE>streambuf_tag</CODE></A> or <A HREF="../guide/traits.html#category_tags"><CODE>istream_tag</CODE></A></TD>
85        <TD>returns <CODE>peekable.putback(c)</CODE></TD>
86    </TR>
87    <TR>
88        <TD VALIGN="top">otherwise</TD>
89        <TD>compile-time error</CODE></TD>
90    </TR>
91</TABLE>
92
93<!-- Begin Footer -->
94
95<HR>
96<P CLASS="copyright">Revised
97<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
9820 May, 2004
99<!--webbot bot="Timestamp" endspan i-checksum="38504" -->
100</P>
101
102<P CLASS="copyright">&copy; Copyright <A HREF="http://www.kangaroologic.com" TARGET="_top">Jonathan Turkanis</A>, 2004</P>
103<P CLASS="copyright"> 
104    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>)
105</P>
106
107<!-- End Footer -->
108
109</BODY>
Note: See TracBrowser for help on using the repository browser.