12 #include <boost/filesystem.hpp>
31 static bool createAllDirectories(
const std::string& dirPath);
42 static std::string absolutePath(
const std::string& path);
63 static std::string cleanPath(
const std::string& path);
87 static bool getFilePathsWithExtension(
const std::string& rootDir,
88 const std::string& ext, std::vector<std::string>& ret);
102 static bool getFilePathsWithExtension(
const std::vector<std::string>& fileOrDirVec,
103 const std::string& ext, std::vector<std::string>& ret);
113 static bool getFilePathsInDir(
const std::string& rootDir,
114 std::vector<std::string>& ret);
122 static bool dirExistsNotEmpty(
const std::string& rootDir);
130 static bool isAbsolutePath(
const std::string& path);
136 static bool exists(
const std::string& path);
140 static std::string fileName(
const std::string& path);
146 static bool exists(
const boost::filesystem::path& path);
156 static bool equivalent(
const std::string& path1,
const std::string& path2);
174 static std::string makeRelative(
const std::string& root,
const std::string& path);
183 static std::string setExtension(std::string file, std::string ext);
193 static std::string addExtension(std::string file, std::string ext);
202 static std::string extension(
const std::string& file,
bool withDot=
false);
211 static std::string extensionCaseSensitive(std::string file,
bool withDot=
false);
218 static std::string baseName(
const std::string& file);
226 static std::string directoryOfFile(
const std::string& file);
234 static std::string directoryOfPath(
const std::string& file);
242 static std::string rootDirectoryOfPath(
const std::string& file);
248 static std::string nativePath(
const std::string& path);
260 static bool is_directory(
const std::string& path);
266 static bool is_directory(
const boost::filesystem::path& path);
272 static bool deleteFile(
const std::string& file);
278 static bool deleteDirectory(
const std::string& dir);
288 template <
typename PathCollection>
289 static bool findFile(
const std::string& filePathIn,
290 const PathCollection& paths, std::string& actualFilePathOut)
295 actualFilePathOut = filePathIn;
300 typename PathCollection::const_iterator i = paths.begin();
301 typename PathCollection::const_iterator e = paths.end();
304 if(findFileInPath(filePathIn, *i, actualFilePathOut))
322 static bool findFileInPath(
const std::string& filePathIn,
323 const std::string& path, std::string& actualFilePathOut);
326 static unsigned int makeAndXorHash(
const std::string& filePath);