mirror of
https://github.com/boostorg/filesystem.git
synced 2026-01-31 20:22:07 +00:00
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user