Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Tue, 30 January 2018 14:24
mirek 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

 
Read Message icon4.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: libpng on linux
Next Topic: RegExp: newlines in replacement string
Goto Forum:
  


Current Time: Sat May 04 17:53:54 CEST 2024

Total time taken to generate the page: 0.02224 seconds