Boost logo

Boost-Commit :

From: technews_at_[hidden]
Date: 2008-05-31 18:51:27


Author: turkanis
Date: 2008-05-31 18:51:27 EDT (Sat, 31 May 2008)
New Revision: 45999
URL: http://svn.boost.org/trac/boost/changeset/45999

Log:
implemented putback
Text files modified:
   trunk/boost/iostreams/device/file.hpp | 8 ++++++++
   1 files changed, 8 insertions(+), 0 deletions(-)

Modified: trunk/boost/iostreams/device/file.hpp
==============================================================================
--- trunk/boost/iostreams/device/file.hpp (original)
+++ trunk/boost/iostreams/device/file.hpp 2008-05-31 18:51:27 EDT (Sat, 31 May 2008)
@@ -51,6 +51,7 @@
                 BOOST_IOS::openmode base_mode =
                     BOOST_IOS::in | BOOST_IOS::out );
     std::streamsize read(char_type* s, std::streamsize n);
+ bool putback(char_type c);
     std::streamsize write(const char_type* s, std::streamsize n);
     std::streampos seek( stream_offset off, BOOST_IOS::seekdir way,
                          BOOST_IOS::openmode which =
@@ -87,6 +88,7 @@
           closable_tag
         { };
     using basic_file<Ch>::read;
+ using basic_file<Ch>::putback;
     using basic_file<Ch>::seek;
     using basic_file<Ch>::is_open;
     using basic_file<Ch>::close;
@@ -150,6 +152,12 @@
 }
 
 template<typename Ch>
+inline bool basic_file<Ch>::putback(char_type c)
+{
+ return !!pimpl_->file_.sputbackc(c);
+}
+
+template<typename Ch>
 inline std::streamsize basic_file<Ch>::write
     (const char_type* s, std::streamsize n)
 { return pimpl_->file_.sputn(s, n); }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk