|
Boost Users : |
From: shunsuke (pstade.mb_at_[hidden])
Date: 2007-03-08 04:46:26
Pfligersdorffer, Christian wrote:
>>> Any suggestions? Maybe some iterator-magic can be done?
>> How about Boost.Spirit file_iterator?
>> That is a read-only RandomAccessIterator for files.
>> http://spirit.sourceforge.net/distrib/spirit_1_8_3/libs/spirit
>> /doc/file_iterator.html
>
> Hello Shunsuke,
>
> that's a good idea but unfortunately I cannot use this class in my case. I have some special decoding ifstreams doing decompression and the like. So I'd really need an iterator that takes an i(f)stream object in it's constructor and wraps that.
C++ has istream_iterator, but it seems useless in this case.
In fact, istream_iterator can be converted into ForwardIterator using
Boost.Spirit multi_pass iterator.
http://spirit.sourceforge.net/distrib/spirit_1_8_3/libs/spirit/doc/multi_pass.html
Thus you can make portions before passing them to clients.
But unfortunately multi_pass iterator may copy the whole range in many
cases.
Regards,
-- Shunsuke Sogame
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net