23 #ifndef __FILESYSTEM_UTIL_H__ 24 #define __FILESYSTEM_UTIL_H__ 41 std::string
absolutePath(
const std::string& relative_path );
68 std::string
locateFile(
const std::string& path );
79 std::string
locateFile(
const std::string& path, std::vector<std::string>& locations );
94 bool fileExists(
const char* path,
bool regularFilesOnly=
false );
106 size_t fileSize(
const char* path );
114 std::string
filePath(
const std::string& filename );
141 std::string
fileChangeExtension(
const std::string& filename,
const std::string& newExtension );
std::string fileRemoveExtension(const std::string &filename)
Return the input string with the file extension removed For example, strRemoveExtension("~/user/somef...
std::string processDirectory()
Return the directory that the calling process resides in.
std::string filePath(const std::string &filename)
Extract the path out of the supplied string, removing the filename and extension For example...
std::string fileChangeExtension(const std::string &filename, const std::string &newExtension)
Return the input string with a changed file extension For example, strChangeExtension("~/user/somefil...
bool fileExists(const char *path, bool regularFilesOnly=false)
Verify path and return true if the file exists.
size_t fileSize(const char *path)
Return the size (in bytes) of the specified file.
std::string absolutePath(const std::string &relative_path)
Given a relative path, resolve the absolute path based on the location of the process that calls the ...
std::string workingDirectory()
Return the current working directory of the calling process.
std::string processPath()
Return the absolute path that of the calling process executable, include the process executable's fil...
std::string fileExtension(const std::string &path)
Extract the file extension from the path.
std::string locateFile(const std::string &path)
Return a list of all the files in the specified directory.