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);
142 static bool exists(
const boost::filesystem::path& path);
152 static bool equivalent(
const std::string& path1,
const std::string& path2);
170 static std::string makeRelative(
const std::string& root,
const std::string& path);
179 static std::string setExtension(std::string file, std::string ext);
189 static std::string addExtension(std::string file, std::string ext);
198 static std::string extension(
const std::string& file,
bool withDot=
false);
207 static std::string extensionCaseSensitive(std::string file,
bool withDot=
false);
214 static std::string baseName(
const std::string& file);
222 static std::string directoryOfFile(
const std::string& file);
230 static std::string directoryOfPath(
const std::string& file);
238 static std::string rootDirectoryOfPath(
const std::string& file);
244 static std::string nativePath(
const std::string& path);
256 static bool is_directory(
const std::string& path);
262 static bool is_directory(
const boost::filesystem::path& path);
268 static bool deleteFile(
const std::string& file);
274 static bool deleteDirectory(
const std::string& dir);
284 template <
typename PathCollection>
285 static bool findFile(
const std::string& filePathIn,
286 const PathCollection& paths, std::string& actualFilePathOut)
291 actualFilePathOut = filePathIn;
296 typename PathCollection::const_iterator i = paths.begin();
297 typename PathCollection::const_iterator e = paths.end();
300 if(findFileInPath(filePathIn, *i, actualFilePathOut))
318 static bool findFileInPath(
const std::string& filePathIn,
319 const std::string& path, std::string& actualFilePathOut);