]> git.lyx.org Git - features.git/blob - boost/libs/filesystem/src/convenience.cpp
boost::filesystem added
[features.git] / boost / libs / filesystem / src / convenience.cpp
1 //  libs/filesystem/src/convenience.cpp  -------------------------------------//
2
3 //  (C) Copyright Beman Dawes, 2002
4 //  (C) Copyright Vladimir Prus, 2002
5 //  Permission to copy, use, modify, sell and distribute this software
6 //  is granted provided this copyright notice appears in all copies.
7 //  This software is provided "as is" without express or implied
8 //  warranty, and with no claim as to its suitability for any purpose.
9
10 //  See http://www.boost.org/libs/filesystem for documentation.
11
12 #include <boost/filesystem/convenience.hpp>
13
14 namespace boost
15 {
16   namespace filesystem
17   {
18
19 //  create_directories (contributed by Vladimir Prus)  -----------------------//
20
21      void create_directories(const path& ph)
22      {
23          if (ph.empty() || exists(ph)) return;
24
25          // First create branch, by calling ourself recursively
26          create_directories(ph.branch_path());
27          // Now that parent's path exists, create the directory
28          create_directory(ph);
29      }
30
31   } // namespace filesystem
32 } // namespace boost