]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/filesystem/example/tut6c.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / filesystem / example / tut6c.cpp
1 // filesystem tut6c.cpp --------------------------------------------------------------//
2
3 // Copyright Beman Dawes 2010
4
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
7
8 // Library home page: http://www.boost.org/libs/filesystem
9
10 #include <iostream>
11 #include <exception>
12 #include <boost/filesystem.hpp>
13 #include <boost/system/error_code.hpp>
14
15 using namespace boost::filesystem;
16 using namespace boost::system;
17
18 int main(int argc, char* argv[])
19 {
20 if (argc < 2)
21 {
22 std::cout << "Usage: tut6c path\n";
23 return 1;
24 }
25
26 error_code ec;
27 for (recursive_directory_iterator it(argv[1], ec);
28 it != recursive_directory_iterator();)
29 {
30 for (int i = 0; i <= it.level(); ++i)
31 std::cout << " ";
32
33 std::cout << it->path() << '\n';
34
35 it.increment(ec);
36 }
37
38 return 0;
39 }