AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Functions | |
std::string | getCWD () |
Returns the current working directory within the file system. More... | |
int | changeCWD (const std::string &dirName) |
Changes the current working directory within the file system. More... | |
bool | pathExists (const std::string &fileName) |
Checks if the path pointed to by fileName exists. More... | |
std::string | joinPath (const std::string &fileDir, const std::string &fileName, const std::string &separator="/") |
Joins two strings with the given separator char. More... | |
int | makeDirsForPath (const std::string &path) |
Make directories for a given path string. More... | |
void | getDirName (std::string &dir, const std::string &path) |
Get directory name from a path that contains a file name. More... | |
int | removeFile (const std::string &filename) |
Remove the specified file. More... | |
std::string axom::utilities::filesystem::getCWD | ( | ) |
Returns the current working directory within the file system.
int axom::utilities::filesystem::changeCWD | ( | const std::string & | dirName | ) |
Changes the current working directory within the file system.
[in] | dirName | an absolute or relative directory path |
bool axom::utilities::filesystem::pathExists | ( | const std::string & | fileName | ) |
Checks if the path pointed to by fileName exists.
[in] | fileName | name of the file to check |
std::string axom::utilities::filesystem::joinPath | ( | const std::string & | fileDir, |
const std::string & | fileName, | ||
const std::string & | separator = "/" |
||
) |
Joins two strings with the given separator char.
[in] | fileDir | The directory of the file |
[in] | fileName | The name of the file |
[in] | separator | a single character to seperate the two strings |
int axom::utilities::filesystem::makeDirsForPath | ( | const std::string & | path | ) |
Make directories for a given path string.
[in] | path | string representing an absolute or relative directory path |
Everything in the path is assumed to be intended to be a directory. If a directory in the path already exists, nothing is done. If a directory doesn't exist, it is created.
void axom::utilities::filesystem::getDirName | ( | std::string & | dir, |
const std::string & | path | ||
) |
Get directory name from a path that contains a file name.
[out] | dir | a directory path formed by removing the file name from the input path |
[in] | path | an absolute or relative directory/file path |
This function assumes that the input path has a file name at the end, and it removes that file name, leaving a string containing only a directory path.
For example, if the path string is "abc/def/ghi/file.txt", the output dir string will be "abc/def/ghi". If the path string is "file.txt", the output dir string will be "" (the empty string).
int axom::utilities::filesystem::removeFile | ( | const std::string & | filename | ) |
Remove the specified file.
filename | The name of the file. |