Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::Filesystem Class Referencefinal

Filesystem operations for the native operating system. More...

#include <Filesystem.h>

Static Public Member Functions

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)
 

Detailed Description

Filesystem operations for the native operating system.

Member Function Documentation

◆ 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
overwriteExistingIf true, any existing file will be overwritten.
Exceptions
FilesystemErrorIf 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
overwriteExistingIf true, the existing file dstFile (if present) will be overwritten by the content from srcFile.
Exceptions
FilesystemErrorIf 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: