Boost logo

Boost :

Subject: Re: [boost] [iostreams] array and gzip_decompressor
From: Nikolay Mladenov (nikolay.mladenov_at_[hidden])
Date: 2010-03-01 10:12:42


Thank you eg, Chris,

But I have probably misled you a bit with my post.
The gzipped data is actually in memory (inside the storage variable),
and I wanted to have a gzip_decompressing stream from that.

for no I am using this patch

Index: detail/adapter/direct_adapter.hpp
===================================================================
--- detail/adapter/direct_adapter.hpp (revision 59992)
+++ detail/adapter/direct_adapter.hpp (working copy)
@@ -116,6 +116,7 @@
     std::streamsize write(const char_type* s, std::streamsize n);
     std::streampos seek( stream_offset, BOOST_IOS::seekdir,
                          BOOST_IOS::openmode = BOOST_IOS::in |
BOOST_IOS::out );
+ bool putback(const char_type c);
     void close();
     void close(BOOST_IOS::openmode which);
 #ifndef BOOST_IOSTREAMS_NO_LOCALE
@@ -204,6 +205,18 @@
 }

 template<typename Direct>
+inline bool direct_adapter<Direct>::putback
+ (const char_type c)
+{
+ pointers& get = ptrs_.first();
+ if( get.ptr == get.beg )
+ throw bad_putback();
+ get.ptr -= 1;
+ *get.ptr = c;
+ return true;
+}
+
+template<typename Direct>
 inline std::streamsize direct_adapter<Direct>::write
     (const char_type* s, std::streamsize n)
 {

Nikolay Mladenov


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk