| 14 | using namespace boost::filesystem; |
| 15 | |
| 16 | int main(int argc, char* argv[]) |
| 17 | { |
| 18 | if (argc < 2) |
| 19 | { |
| 20 | std::cout << "Usage: tut6a path\n"; |
| 21 | return 1; |
| 22 | } |
| 23 | |
| 24 | try |
| 25 | { |
| 26 | for (recursive_directory_iterator it(argv[1]); |
| 27 | it != recursive_directory_iterator(); |
| 28 | ++it) |
| 29 | { |
| 30 | if (it.depth() > 1) |
| 31 | it.pop(); |
| 32 | else |
| 33 | { |
| 34 | for (int i = 0; i <= it.depth(); ++i) |
| 35 | std::cout << " "; |
| 36 | |
| 37 | std::cout << it->path() << '\n'; |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | catch (std::exception& ex) |
| 42 | { |
| 43 | std::cout << "************* exception *****************\n"; |
| 44 | std::cout << ex.what() << '\n'; |
| 45 | } |
| 46 | |
| 47 | return 0; |
| 48 | } |
nothing calls this directly
no test coverage detected