Boost logo

Boost :

From: Jonathan de Halleux (dehalleux_at_[hidden])
Date: 2003-10-13 02:21:40

>The above two functions require the data to be compressed/decompressed
>from from an input stream. That is fine for compressing/decompressing
>files, for example, but it's not as generic as it would be. What I
>exactly had in mind was some more STL-ish, like:
> template < class Policy, class InputIterator, class OutputIterator >
>void compress(InputIterator begin, InputIterator end, OutputIterator
> template < class Policy, class InputIterator, class OutputIterator >
>void decompress(InputIterator begin, InputIterator end, OutputIterator
> // to use:
> compress< gzip_compressor >(in_stream.begin(), in_stream.end(),
>out_stream.begin()); decompress< gzip_decompressor >(in_stream.begin(),
>in_stream.end(), out_stream.begin());

Since the compressor_stream are basically filter on top of other streams,
the methods need to read from a stream output towards it. Hence,
the following could be done:

>void compress(InputIterator begin, InputIterator end, ostream& out);

without much problems. But I don't think I would get rid of the ostream.

>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