From 285b58f2a302abd65ef57b0807e78ad1cd9ad96c Mon Sep 17 00:00:00 2001 From: Beman Dawes Date: Thu, 19 May 2005 12:19:05 +0000 Subject: [PATCH] update for i18n [SVN r29058] --- example/simple_ls.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/example/simple_ls.cpp b/example/simple_ls.cpp index f8dd394..0523e0d 100644 --- a/example/simple_ls.cpp +++ b/example/simple_ls.cpp @@ -17,7 +17,7 @@ namespace fs = boost::filesystem; int main( int argc, char* argv[] ) { - fs::path full_path( fs::initial_path() ); + fs::path full_path( fs::initial_path() ); if ( argc > 1 ) full_path = fs::system_complete( fs::path( argv[1], fs::native ) ); @@ -26,6 +26,7 @@ int main( int argc, char* argv[] ) unsigned long file_count = 0; unsigned long dir_count = 0; + unsigned long other_count = 0; unsigned long err_count = 0; if ( !fs::exists( full_path ) ) @@ -48,13 +49,19 @@ int main( int argc, char* argv[] ) if ( fs::is_directory( *dir_itr ) ) { ++dir_count; - std::cout << dir_itr->leaf()<< " [directory]\n"; + std::cout << dir_itr->leaf() << " [directory]\n"; } - else + else if ( fs::is_file( *dir_itr ) ) { ++file_count; std::cout << dir_itr->leaf() << "\n"; } + else + { + ++other_count; + std::cout << dir_itr->leaf() << " [other]\n"; + } + } catch ( const std::exception & ex ) { @@ -64,6 +71,7 @@ int main( int argc, char* argv[] ) } std::cout << "\n" << file_count << " files\n" << dir_count << " directories\n" + << other_count << " others\n" << err_count << " errors\n"; } else // must be a file