|
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
>out);
>
> template < class Policy, class InputIterator, class OutputIterator >
>void decompress(InputIterator begin, InputIterator end, OutputIterator
>out);
>
> // 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:
>http://lists.boost.org/mailman/listinfo.cgi/boost
-----------------------------------------------------------------------------------
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 acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk