#include <tools/Filesystem.hpp>
|
static std::string | filename (const std::string &Path) |
|
static std::string | basename (const std::string &Path) |
|
static std::string | dirname (const std::string &Path) |
|
static std::string | extension (const std::string &Path) |
|
static std::string | currentPath () |
|
static bool | isDirectory (const std::string &Path) |
|
static bool | isFile (const std::string &Path) |
|
static bool | makeDirectory (const std::string &Path) |
|
static bool | removeDirectory (const std::string &Path) |
|
static std::string | makeUniqueSubdirectory (const std::string &Path, const std::string &SubdirName) |
|
static std::string | makeUniqueFile (const std::string &Path, const std::string &FileName) |
|
static bool | removeFile (const std::string &Path) |
|
static bool | copyFile (const std::string &SrcPath, const std::string &DestPath) |
|
static bool | copyDirectory (const std::string &SrcPath, const std::string &DestPath, const bool DontCopyDotDirs=false) |
|
◆ basename()
static std::string openfluid::tools::Filesystem::basename |
( |
const std::string & |
Path | ) |
|
|
static |
Returns the complete base name of the file in the given path
- Parameters
-
- Returns
- the base name of the file
◆ copyDirectory()
static bool openfluid::tools::Filesystem::copyDirectory |
( |
const std::string & |
SrcPath, |
|
|
const std::string & |
DestPath, |
|
|
const bool |
DontCopyDotDirs = false |
|
) |
| |
|
static |
Recursively copies a directory from source to destination.
- Parameters
-
[in] | SrcPath | the source path |
[in] | DestPath | the destination path |
[in] | DontCopyDotDirs | if set to true, it ignores the directories beginning with a dot ('.'). Default is false |
- Returns
- true if the directory was successfully copied, false otherwise
◆ copyFile()
static bool openfluid::tools::Filesystem::copyFile |
( |
const std::string & |
SrcPath, |
|
|
const std::string & |
DestPath |
|
) |
| |
|
static |
Copies a file from source to destination.
- Parameters
-
[in] | SrcPath | the source path |
[in] | DestPath | the destination path |
- Returns
- true if the file was successfully copied, false otherwise
◆ currentPath()
static std::string openfluid::tools::Filesystem::currentPath |
( |
| ) |
|
|
static |
Returns the current application path
- Returns
- the current path
◆ dirname()
static std::string openfluid::tools::Filesystem::dirname |
( |
const std::string & |
Path | ) |
|
|
static |
Returns the directory name (parent path) of the given path
- Parameters
-
- Returns
- the directory name
◆ extension()
static std::string openfluid::tools::Filesystem::extension |
( |
const std::string & |
Path | ) |
|
|
static |
Returns the extension of the file of the given path
- Parameters
-
- Returns
- the extension
◆ filename()
static std::string openfluid::tools::Filesystem::filename |
( |
const std::string & |
Path | ) |
|
|
static |
Returns the name of the file in the given path
- Parameters
-
- Returns
- the filename
◆ isDirectory()
static bool openfluid::tools::Filesystem::isDirectory |
( |
const std::string & |
Path | ) |
|
|
static |
Returns true if the given path is a directory
- Parameters
-
- Returns
- true or false
◆ isFile()
static bool openfluid::tools::Filesystem::isFile |
( |
const std::string & |
Path | ) |
|
|
static |
Returns true if the given path is a file or a valid symbolic link
- Parameters
-
- Returns
- true or false
◆ makeDirectory()
static bool openfluid::tools::Filesystem::makeDirectory |
( |
const std::string & |
Path | ) |
|
|
static |
Creates the directory of the given path. It creates all parent directories necessary to create the directory. If the directory already exists, it does nothing.
- Parameters
-
- Returns
- true if the directory was successfully created, false otherwise
◆ makeUniqueFile()
static std::string openfluid::tools::Filesystem::makeUniqueFile |
( |
const std::string & |
Path, |
|
|
const std::string & |
FileName |
|
) |
| |
|
static |
Creates a unique file in the given path, using the given File name and extension as prefix and suffix. If the file already exists, it adds an incremental part to the file name. If the Path does not exists, it creates all needed parent directories.
- Parameters
-
[in] | Path | the given path for the file |
[in] | FileName | the file name used to make a unique one |
- Returns
- the full path of the created unique file
◆ makeUniqueSubdirectory()
static std::string openfluid::tools::Filesystem::makeUniqueSubdirectory |
( |
const std::string & |
Path, |
|
|
const std::string & |
SubdirName |
|
) |
| |
|
static |
Creates a unique subdirectory in the given path, using the given subdirectory name as a prefix. If the subdirectory already exists, it adds an incremental suffix to the subdirectory name. It creates all parent directories necessary to create the subdirectory.
- Parameters
-
[in] | Path | the given path |
[in] | SubdirName | the given path |
- Returns
- the full path of the created unique subdirectory
◆ removeDirectory()
static bool openfluid::tools::Filesystem::removeDirectory |
( |
const std::string & |
Path | ) |
|
|
static |
Removes the directory of the given path. It recursively deletes all contents of the directory.
- Parameters
-
- Returns
- true if the directory was successfully deleted, false otherwise
◆ removeFile()
static bool openfluid::tools::Filesystem::removeFile |
( |
const std::string & |
Path | ) |
|
|
static |
Removes the file of the given path.
- Parameters
-
- Returns
- true if the file was successfully deleted, false otherwise
The documentation for this class was generated from the following file: