MCPcopy Create free account
hub / github.com/boostorg/filesystem / main

Function main

example/tut6b.cpp:16–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

depthMethod · 0.80
pathMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected