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

Function main

example/tut6a.cpp:16–48  ·  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: 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}

Callers

nothing calls this directly

Calls 5

depthMethod · 0.80
popMethod · 0.80
pathMethod · 0.80
whatMethod · 0.80

Tested by

no test coverage detected