#2449 closed Bugs (wontfix)
tellg() not working for filtering_istream
Reported by: | Owned by: | Jonathan Turkanis | |
---|---|---|---|
Milestone: | Boost 1.37.0 | Component: | iostreams |
Version: | Boost 1.36.0 | Severity: | Problem |
Keywords: | iostreams filtering_istream tellg | Cc: |
Description
Hi,
tellg() member function is not working for boost::iostreams::filtering_istream (see attached example).
This means that filtering_istream cannot be treated like an std::istream without having strange effects. In my eyes this is practically a showstopper for using filtering_istream.
Regards,
Roland
Attachments (1)
Change History (9)
by , 14 years ago
Attachment: | IoStreams.cpp added |
---|
comment:1 by , 14 years ago
Status: | new → assigned |
---|
follow-up: 4 comment:3 by , 12 years ago
After poking through the source for a while, I'm beginning to think that this behavior is by design. You can make the example work using
boost::iostreams::filtering_stream<boost::iostreams::input_seekable>
follow-up: 8 comment:4 by , 12 years ago
Replying to steven_watanabe:
After poking through the source for a while, I'm beginning to think that this behavior is by design. You can make the example work using
boost::iostreams::filtering_stream<boost::iostreams::input_seekable>
Hmm. In that case, wouldn't it be better to throw an exception with some meaningful text instead of just returning -1 and invalidating the stream (good() == false)?
comment:5 by , 12 years ago
I get an exception with msvc-10 and the trunk. If you don't get an exception, it's probably because std::istream is swallowing it.
follow-up: 7 comment:6 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
comment:7 by , 9 years ago
Replying to steven_watanabe: Hi, I tried using boost::iostreams::filtering_stream<boost::iostreams::input_seekable>, but, I am not able to push gzip_decompressor object into this filter (push(boost::iostreams::gzip_decompressor())). Can you please let me know if there is workaround for this.
thanks, Edwin.
comment:8 by , 9 years ago
Hi, Were you able to use boost::iostreams::filtering_stream<boost::iostreams::input_seekable> and push boost::iostreams::gzip_decompressor() into the filter. I am not able to.. please let me know how you got around this.
thanks, Edwin.
A short sample showing that filtering_istream::tellg() does not work (and corrupts the stream).