Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Filtering streams for bz2
Re: Filtering streams for bz2 [message #49428 is a reply to message #49350] |
Fri, 09 February 2018 09:54 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Tue, 30 January 2018 14:24mirek wrote on Tue, 30 January 2018 05:46
However, I am completely puzzled why have you changed OutFilterStream. AFAIK, all those new bool's there are ignored?
Code wouldn't compile otherwise. I'm getting an error "void function 'Execute' should not return a value" (Clang) in the method OutFilterStream::Set "Filter = callback<F, F, const void *, int>(&filter, &F::Put);"
"bool Put(const void *ptr, int size)" is symmetric (used by both OutFilterStream and InFilterStream).
So, either interface of filter object should be redesigned (separate methods Put and Get), or OutFilterStream::Filter should be also be Gate.
Well, I really dislike changing so many things because of this.
I have tried to resolve the issue with Gate<> FilterEof in InFilterStream. That should work. Please check trunk.
BUT, after further thinking, I believe even that is overkill. In fact, I now believe that it should work without adding anything: After encountering BZ_STREAM_END, no more data are decompressed, so no more output is produced and we get nice eof via:
int InFilterStream::_Term()
{
while(ptr == rdlim && !eof)
Fetch();
return ptr == rdlim ? -1 : *ptr;
}
(because after Fetch, ptr == rdlime)
What do you think?
Mirek
|
|
|
|
|
Filtering streams for bz2
By: Novo on Wed, 24 January 2018 20:28
|
|
|
Re: Filtering streams for bz2
By: mirek on Sun, 28 January 2018 10:54
|
|
|
Re: Filtering streams for bz2
By: Novo on Tue, 30 January 2018 02:54
|
|
|
Re: Filtering streams for bz2
By: mirek on Tue, 30 January 2018 11:46
|
|
|
Re: Filtering streams for bz2
By: Novo on Tue, 30 January 2018 14:24
|
|
|
Re: Filtering streams for bz2
By: mirek on Fri, 09 February 2018 09:54
|
|
|
Re: Filtering streams for bz2
By: Novo on Sun, 11 February 2018 21:22
|
|
|
Re: Filtering streams for bz2
By: mirek on Mon, 12 February 2018 02:10
|
|
|
Re: Filtering streams for bz2
By: Novo on Mon, 12 February 2018 14:26
|
|
|
Re: Filtering streams for bz2
By: mirek on Thu, 15 February 2018 20:40
|
Goto Forum:
Current Time: Sat May 04 17:53:54 CEST 2024
Total time taken to generate the page: 0.02224 seconds
|