Boost logo

Boost Users :

Subject: [Boost-users] basic_file_source copy to filtering_streambuf
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2010-09-11 09:34:49


Hi,

I have got a basic_file_source for reading a file. Can I copy the
whole file into a filtering_streambuf, whithout closing the stream?
I do this at this time with:

std::ifstream l_file( "filename", std::ifstream::in |
std::ifstream::binary );
std::copy( std::istream_iterator<char>(l_file),
std::istream_iterator<char>(),
std::ostreambuf_iterator<char>(&l_target) )

I would like to switch std::ifstream to basic_file_source. I can't use
boost::copy because it close after writing my target stream.
Do the basic_file_source hold a iterator, which I can use with
std::copy? How can I do this?

Thanks

Phil



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