Boost logo

Boost Users :

From: ope (ope-devel_at_[hidden])
Date: 2008-02-13 15:15:27


Hi,

I've the following code:

namespace io = boost::iostreams;

bool foo::open( const std::string& file )
{
     io::filtering_istream is;

     is.push( my_line_filter() );
     is.push( io::file_source( file ) );

     // ??? how to check success

     do {
         std::string line;
         std::getline(is, line);
         std::cout << line << std::endl;
     } while (!is.eof());

     return true;
}

Well, how can I check that the file is opened correct/the stream is
valid? is_open() and good() seems not supported? Or I'm wrong? Giving a
wrong name does nothings.

Thanks,
Olaf


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