]> pilppa.org Git - libplp.git/blob - src/FileUtil.hh
w1 independent file cleanups.
[libplp.git] / src / FileUtil.hh
1 /*
2  * FileUtil.hh
3  *
4  *  Created on: Mar 5, 2011
5  *      Author: lamikr
6  */
7
8 #ifndef FILEUTIL_HH_
9 #define FILEUTIL_HH_
10
11 #include <string>
12 #include <vector>
13
14 #include <dirent.h>
15
16 namespace plp {
17         class FileUtil {
18                 public:
19                         FileUtil();
20                         virtual ~FileUtil();
21                         static std::string concat_paths(std::string path_start, std::string path_end);
22                         static std::string concat_paths(const char *path_start, const char *path_end);
23                         static bool is_subdirectory(const char *path, dirent *direntry);
24                         static bool is_datafile(const char *path, dirent *direntry);
25                         static std::vector<std::string> get_subdirectories(const std::string& path);
26                         static std::vector<std::string> get_data_files(const std::string& path);
27                         static char *parse_directory_path(const char *file_path);
28                         static bool mkdirs(const char *path);
29                         static std::ofstream *open_for_writing(const char *path);
30         };
31 }
32
33 #endif /* FILEUTIL_HH_ */