OpenMPCD
FilesystemUtilities.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines the OpenMPCD::FilesystemUtilities class.
4  */
5 
6 #ifndef OPENMPCD_FILESYSTEMUTILITIES_HPP
7 #define OPENMPCD_FILESYSTEMUTILITIES_HPP
8 
9 #include <string>
10 
11 namespace OpenMPCD
12 {
13 /**
14  * Provides utility functions for filesystem access.
15  */
17 {
18  private:
19  /**
20  * The constructor.
21  */
23 
24  public:
25  /**
26  * Ensures that the given directory exists, creating it and its parents if necessary.
27  * @throw IOException Throws on failure.
28  * @param[in] path The directory's path.
29  */
30  static void ensureDirectory(const std::string& path);
31 
32  /**
33  * Ensures that the parent directory of the path given exists.
34  * If the path given has no parent, nothing is done.
35  * @throw IOException Throws on failure.
36  * @param[in] path The path in question.
37  */
38  static void ensureParentDirectory(const std::string& path);
39 
40 }; //class FilesystemUtilities
41 } //namespace OpenMPCD
42 
43 #endif
OpenMPCD::FilesystemUtilities::ensureDirectory
static void ensureDirectory(const std::string &path)
Ensures that the given directory exists, creating it and its parents if necessary.
Definition: FilesystemUtilities.cpp:9
OpenMPCD::FilesystemUtilities::ensureParentDirectory
static void ensureParentDirectory(const std::string &path)
Ensures that the parent directory of the path given exists.
Definition: FilesystemUtilities.cpp:18
OpenMPCD::FilesystemUtilities
Provides utility functions for filesystem access.
Definition: FilesystemUtilities.hpp:16