Boost logo

Boost Users :

Subject: Re: [Boost-users] [iostreams] How can I use the Stream Insertion operator (<<) with a filtering_streambuf?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2013-07-30 14:59:59


On 07/29/13 11:27, Larry Evans wrote:
> On 07/29/13 11:10, Larry Evans wrote:
> [snip]
>> BTW, I tried modifying Ken's code to use filtering_ostream instead
>> of filtering_streambuf, and it worked. I also removed the ios_base
>> flags and it still worked. Then I tried using stringstream instead
>> of filestream and it no longer worked. Anyone have any clues about
>> why stringstream doesn't work? The code is attached. With the
>> attached code and attached Jamfile.v2, and with:
>>
>> #define USE_STRINGSTRM
>>
>> in the code, the KenApplebyStrm.output produced by bjam is
>> in the next attachment.
>> In contrast, with:
>> //#define USE_STRINGSTRM
>> int the code, the KenApplebyStrm.output produced by bjam is
>> in the last attachment.
> [snip]
> OOPS. The code attached previously used streambuf instead of
> stream. The current attachment uses stream.

Based on running the attached both with:

#define USE_FILT_COMPRESS

then with:

//#define USE_FILT_COMPRESS

on line 40 showed that using the gzip_decompressor starts reading
at the end of the stream instead of at the beginning.

The corresponding outputs are also attached.

This contrasts with the count filter which starts reading, as one
would expect, at the beginning of the stream.

Still trying to track down why.

-Larry






Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net