]> git.localhorst.tv Git - blank.git/blob - src/io/filesystem.hpp
load block types from data file
[blank.git] / src / io / filesystem.hpp
1 #ifndef BLANK_IO_FILESYSTEM_HPP_
2 #define BLANK_IO_FILESYSTEM_HPP_
3
4 #include <string>
5
6
7 namespace blank {
8
9 /// check if give path points to an existing directory
10 bool is_dir(const char *);
11 inline bool is_dir(const std::string &s) {
12         return is_dir(s.c_str());
13 }
14 /// check if give path points to an existing file
15 bool is_file(const char *);
16 inline bool is_file(const std::string &s) {
17         return is_file(s.c_str());
18 }
19
20 /// create given directory
21 /// @return true if the directory was created
22 ///         the directory might already exist, see errno
23 bool make_dir(const char *);
24 inline bool make_dir(const std::string &s) {
25         return make_dir(s.c_str());
26 }
27 /// create given directory and all parents
28 /// @return true if the directory was created or already exists
29 bool make_dirs(const std::string &);
30
31 }
32
33 #endif