Use option 3 - iterator predicate functions. Document recently added functionality such as if_other(), basic_recursive_directory_iterator

[SVN r30021]
This commit is contained in:
Beman Dawes
2005-07-12 19:41:22 +00:00
parent 44e141579f
commit 1885818461
10 changed files with 291 additions and 292 deletions

View File

@@ -48,29 +48,29 @@ int main( int argc, char* argv[] )
{
try
{
fs::status_flags flags( dir_itr->status() );
fs::status_flags flags( dir_itr.status() );
if ( (flags & fs::directory_flag) == fs::directory_flag )
{
++dir_count;
std::cout << dir_itr->path().leaf() << " [directory]\n";
std::cout << dir_itr->leaf() << " [directory]\n";
}
else if ( (flags & fs::file_flag) == fs::file_flag )
{
++file_count;
std::cout << dir_itr->path().leaf() << "\n";
std::cout << dir_itr->leaf() << "\n";
}
else
{
++other_count;
std::cout << dir_itr->path().leaf() << " [other]\n";
std::cout << dir_itr->leaf() << " [other]\n";
}
}
catch ( const std::exception & ex )
{
++err_count;
std::cout << dir_itr->path().leaf() << " " << ex.what() << std::endl;
std::cout << dir_itr->leaf() << " " << ex.what() << std::endl;
}
}
std::cout << "\n" << file_count << " files\n"