Boost logo

Boost :

From: Jonathan de Halleux (dehalleux_at_[hidden])
Date: 2003-10-06 02:35:06

Thank you for your positive answers about the zipped streams. Here's a
summary of the suggestions I received:

   1 - yes, zipped streams could be useful in boost,

   2 - "is it appropriate for a boost library to require another library
(excluding the standard library) to use" (Jeff Garland). ¨
Personaly, I think it is not a problem. zlib or bzip2 are already used in a
looooot of applications with problem. Of course, boost people should give
their oppinion on this,

   3 - A third suggestion was asking for user defined compression support
(Ehsan Akhgari, Pavel Vozenilek ): basically, the wrapper is not designed
for that right now. There are a few reasons for that, that could be
discussed further:
        The zlib and bzip2 libraries have some intrisic differences: their
constructor arguments, the number of configuration parameters, zlib can add
a header, bzip2 not, etc... All these differences would make a common
wrapper quite difficult to make. Anyway, all suggestions are welcome.

I'm hoping some feedback on this :)

At 06:59 4/10/2003 -0700, you wrote:
>On Fri, 03 Oct 2003 17:53:28 +0200, Jonathan de Halleux wrote
> > I have implement iostream wrappers around the zlib and bzip2
> > compression library. I emphasize that the zlib wrapper does not rely
> > on gz methods and therefore it is not limited to file->buffer or
> > buffer->file operation.
> >
> > A simple example of the stream is as follows:
> >
> > ostream& output; // suppose this reference is initialized
> >
> > {
> > zip_ostream zipper( output ); // creating a zipper on top of output
> > // zipper behaves as any ostream
> > zipper<<"hello";
> > ...
> > } // when closed, the zipper is flushed.
> >
> > That's it. Basically, these wrapper makes it very easy to add
> > compression to existing applications. Any suggestions welcome :)
> >
> > The demo application is in the yahoo files section, at
> >
>You can also have a look at an article that explains deeper zipstreams at
>Johnathan -
>Very interesting. I wrote one of these a couple years ago, so you might want
>to have a look.
>Reading thru your article it looks like we have similar approaches: adapt the
>stream buf to use zlib for compression. Your implementation is nice since it
>supports all stream types while I was focused on file types.
>Anyway, I would love to see something like this go into boost and I certainly
>don't have the time to do it...
>One problem you will face is the question whether it is appropriate for a
>boost library to require another library (excluding the standard library) to
>use. There was some discussion of this on the list a couple years back when I
>posted my library. As I recall, I think people were leaning towards saying it
>was ok -- especially given that zlib has been ported all over.
>Unsubscribe & other changes:

Jonathan de Halleux, Research Assistant
Center for Systems Engineering and Applied Mechanics (CESAME)
Universite catholique de Louvain
Batiment Euler , Av. Georges Lemaitre, 4 Tel : +32-10-47 2595
B-1348 Louvain-la-Neuve Belgium
E-mail : dehalleux_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at