/
putback.html
103 lines (78 loc) · 4.25 KB
/
putback.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Function Template putback</TITLE>
<LINK REL="stylesheet" HREF="../../../../boost.css">
<LINK REL="stylesheet" HREF="../theme/iostreams.css">
</HEAD>
<BODY>
<!-- Begin Banner -->
<H1 CLASS="title">Function Template <CODE>putback</CODE></H1>
<HR CLASS="banner">
<!-- End Banner -->
<DL class="page-index">
<DT><A href="#overview">Overview</A></DT>
<DT><A href="#headers">Headers</A></DT>
<DT><A href="#reference">Reference</A></DT>
</DL>
<A NAME="overview"></A>
<H2>Overview</H2>
<P>
The function template <CODE>putback</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>.
</P>
<A NAME="headers"></A>
<H2>Headers</H2>
<DL>
<DT><A CLASS="header" HREF="../../../../boost/iostreams/operations.hpp"><CODE><boost/iostreams/operations.hpp></CODE></A></DT>
<DT><A CLASS="header" HREF="../../../../boost/iostreams/putback.hpp"><CODE><boost/iostreams/putback.hpp></CODE></A></DT>
</DL>
<A NAME="reference"></A>
<H2>Reference</H2>
<A NAME="description"></A>
<H4>Description</H4>
<P>Attempt to putback a character to a given instance of the template parameter <CODE>Peekable</CODE>, returning <CODE>true</CODE> for success.</P>
<A NAME="synopsis"></A>
<H4>Synopsis</H4>
<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> <A CLASS="documented" HREF="#template_params">Peekable</A>>
<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><Peekable>::type c);
} } <SPAN CLASS="comment">// End namespace boost::io</SPAN></PRE>
<A NAME="template_params"></A>
<H4>Template Parameters</H4>
<TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2>
<TR>
<TR>
<TD VALIGN="top"><I>Peekable</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
<TD>A model of <A HREF="../concepts/peekable.html">Peekable</A>.
</TR>
</TABLE>
<A NAME="semantics"></A>
<H4>Semantics</H4>
<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>
<TABLE STYLE="margin:0,0,2em,2em" BORDER=1 CELLPADDING=4>
<TR><TH><CODE>category_of<Peekable>::type</CODE></TH><TH>semantics</TH></TR>
<TR>
<TD VALIGN="top">convertible to <A HREF="../guide/traits.html#category_tags"><CODE>istream_tag</CODE></A></TD>
<TD>invokes <CODE>peekable.rdbuf()->putback(c)</CODE> and returns <CODE>true</CODE> if the operation was successful</CODE></TD>
</TR>
<TR>
<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>
<TD>invokes <CODE>peekable.sputbackc(c)</CODE> and returns <CODE>true</CODE> if the operation was successful</TD>
</TR>
<TR>
<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>
<TD>returns <CODE>peekable.putback(c)</CODE></TD>
</TR>
<TR>
<TD VALIGN="top">otherwise</TD>
<TD>compile-time error</CODE></TD>
</TR>
</TABLE>
<!-- Begin Footer -->
<HR>
<P CLASS="copyright">© Copyright 2008 <a href="http://www.coderage.com/" target="_top">CodeRage, LLC</a><br/>© Copyright 2004-2007 <a href="https://www.boost.org/users/people/jonathan_turkanis.html" target="_top">Jonathan Turkanis</a></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>