Filesystem operations for the native operating system.
More...
#include <Filesystem.h>
|
| static bool | hasDirectory (const Path &path) |
| | Check if the path points to an existing directory.
|
| |
| static bool | hasFile (const Path &path) |
| | Check if the path points to an existing file.
|
| |
| static void | createDirectory (const Path &path) |
| | Create a directory as specified by the path. Similar to createDirectories(), except that the parent directory must already exist.
|
| |
| static void | createDirectories (const Path &path) |
| | Create a directory as specified by the path. Treat the path as a directory representation and create all missing folders if any of them does not already exist.
|
| |
| static void | copyFile (const Path &srcFile, const Path &dstFile, bool overwriteExisting=false) |
| | Copy a file to another destination. Both paths should represent a file.
|
| |
| static void | copyFileToDirectory (const Path &srcFile, const Path &dstDir, bool overwriteExisting=false, bool createMissingDirectories=true) |
| |
| static void | copy (const Path &srcPath, const Path &dstPath, bool overwriteExisting=false) |
| | Copy a file or directory recursively to another destination. If srcPath is a file, dstPath will be interpreted as a file and the method is equivalent to calling copyFile(). If srcPath is a directory, dstPath will be interpreted as a directory. For directory copying, contents in srcPath will be copied to dstPath. Missing directories are automatically created.
|
| |
| static Path | makeRelative (const Path &src, const Path &base) |
| |
Filesystem operations for the native operating system.
◆ copy()
| void ph::Filesystem::copy |
( |
const Path & | srcPath, |
|
|
const Path & | dstPath, |
|
|
bool | overwriteExisting = false ) |
|
static |
Copy a file or directory recursively to another destination. If srcPath is a file, dstPath will be interpreted as a file and the method is equivalent to calling copyFile(). If srcPath is a directory, dstPath will be interpreted as a directory. For directory copying, contents in srcPath will be copied to dstPath. Missing directories are automatically created.
- Parameters
-
| overwriteExisting | If true, any existing file will be overwritten. |
- Exceptions
-
| FilesystemError | If any error during copying occurred. |
◆ copyFile()
| void ph::Filesystem::copyFile |
( |
const Path & | srcFile, |
|
|
const Path & | dstFile, |
|
|
bool | overwriteExisting = false ) |
|
static |
Copy a file to another destination. Both paths should represent a file.
- Parameters
-
| overwriteExisting | If true, the existing file dstFile (if present) will be overwritten by the content from srcFile. |
- Exceptions
-
| FilesystemError | If any error during copying occurred. |
◆ copyFileToDirectory()
| void ph::Filesystem::copyFileToDirectory |
( |
const Path & | srcFile, |
|
|
const Path & | dstDir, |
|
|
bool | overwriteExisting = false, |
|
|
bool | createMissingDirectories = true ) |
|
static |
◆ createDirectories()
| void ph::Filesystem::createDirectories |
( |
const Path & | path | ) |
|
|
static |
Create a directory as specified by the path. Treat the path as a directory representation and create all missing folders if any of them does not already exist.
◆ createDirectory()
| void ph::Filesystem::createDirectory |
( |
const Path & | path | ) |
|
|
static |
Create a directory as specified by the path. Similar to createDirectories(), except that the parent directory must already exist.
◆ hasDirectory()
| bool ph::Filesystem::hasDirectory |
( |
const Path & | path | ) |
|
|
static |
Check if the path points to an existing directory.
◆ hasFile()
| bool ph::Filesystem::hasFile |
( |
const Path & | path | ) |
|
|
static |
Check if the path points to an existing file.
◆ makeRelative()
| Path ph::Filesystem::makeRelative |
( |
const Path & | src, |
|
|
const Path & | base ) |
|
static |
The documentation for this class was generated from the following files: