cvs_iterator & operator++() { assert( !!entries_file ); std::string contents; do { do { std::getline( entries_file, contents ); if ( entries_file.eof() ) { entries_file.close(); value_path = ""; return *this; } } while ( contents == "D" ); if ( contents[0] == 'D' ) contents.erase( 0, 1 ); value_path = dir_path / boost::filesystem::path( contents.substr( 1, contents.find( '/', 1 ) ), boost::filesystem::no_check ); // in case entries file is mistaken, do until value_path actually found } while ( !boost::filesystem::exists( value_path ) ); return *this; }
~cvs_iterator() { if ( !!entries_file ) entries_file.close(); }