Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::FileSystemOperations Struct Reference

Low level filesystem operations, requiring paths in native encoding (UTF-16 on Windows, UTF-8 elsewhere) More...

#include <FileSystemOperations.h>

Static Public Member Functions

static Result createSymbolicLink (StringViewData sourceFileOrDirectory, StringViewData linkFile)
 Create a symbolic link.
 
static Result makeDirectory (StringViewData dir)
 Create a directory.
 
static Result exists (StringViewData path)
 Check if a path exists.
 
static Result existsAndIsDirectory (StringViewData path)
 Check if a path exists and is a directory.
 
static Result existsAndIsFile (StringViewData path)
 Check if a path exists and is a file.
 
static Result existsAndIsLink (StringViewData path)
 Check if a path exists and is a link.
 
static Result removeEmptyDirectory (StringViewData path)
 Remove an empty directory.
 
static Result moveDirectory (StringViewData source, StringViewData destination)
 Move a directory.
 
static Result removeFile (StringViewData path)
 Remove a file.
 
static Result copyFile (StringViewData srcPath, StringViewData destPath, FileSystemCopyFlags flags)
 Copy a file.
 
static Result rename (StringViewData path, StringViewData newPath)
 Rename a file or directory.
 
static Result copyDirectory (StringViewData srcPath, StringViewData destPath, FileSystemCopyFlags flags)
 Copy a directory.
 
static Result removeDirectoryRecursive (StringViewData directory)
 Remove a directory recursively.
 
static Result getFileStat (StringViewData path, FileSystemStat &fileStat)
 Get the file stat.
 
static Result setLastModifiedTime (StringViewData path, Time::Realtime time)
 Set the last modified time of a file.
 

Detailed Description

Low level filesystem operations, requiring paths in native encoding (UTF-16 on Windows, UTF-8 elsewhere)

See also
SC::FileSystem when an higher level API that also handles paths in a different encoding is needed

Member Function Documentation

◆ copyDirectory()

static Result SC::FileSystemOperations::copyDirectory ( StringViewData srcPath,
StringViewData destPath,
FileSystemCopyFlags flags )
static

Copy a directory.

Parameters
srcPathThe source directory to copy
destPathThe destination directory to copy to
flagsThe copy flags
Returns
Result::Error if the directory could not be copied

◆ copyFile()

static Result SC::FileSystemOperations::copyFile ( StringViewData srcPath,
StringViewData destPath,
FileSystemCopyFlags flags )
static

Copy a file.

Parameters
srcPathThe source file to copy
destPathThe destination file to copy to
flagsThe copy flags
Returns
Result::Error if the file could not be copied

◆ createSymbolicLink()

static Result SC::FileSystemOperations::createSymbolicLink ( StringViewData sourceFileOrDirectory,
StringViewData linkFile )
static

Create a symbolic link.

Parameters
sourceFileOrDirectoryThe source file or directory to link to
linkFileThe link file to create
Returns
Result::Error if the symbolic link could not be created

◆ exists()

static Result SC::FileSystemOperations::exists ( StringViewData path)
static

Check if a path exists.

Parameters
pathThe path to check
Returns
Result::Error if the path could not be checked

◆ existsAndIsDirectory()

static Result SC::FileSystemOperations::existsAndIsDirectory ( StringViewData path)
static

Check if a path exists and is a directory.

Parameters
pathThe path to check
Returns
Result::Error if the path could not be checked

◆ existsAndIsFile()

static Result SC::FileSystemOperations::existsAndIsFile ( StringViewData path)
static

Check if a path exists and is a file.

Parameters
pathThe path to check
Returns
Result::Error if the path could not be checked

◆ existsAndIsLink()

static Result SC::FileSystemOperations::existsAndIsLink ( StringViewData path)
static

Check if a path exists and is a link.

Parameters
pathThe path to check
Returns
Result::Error if the path could not be checked

◆ getFileStat()

static Result SC::FileSystemOperations::getFileStat ( StringViewData path,
FileSystemStat & fileStat )
static

Get the file stat.

Parameters
pathThe path to the file to get the stat of
fileStatThe file stat to fill

◆ makeDirectory()

static Result SC::FileSystemOperations::makeDirectory ( StringViewData dir)
static

Create a directory.

Parameters
dirThe directory to create
Returns
Result::Error if the directory could not be created

◆ moveDirectory()

static Result SC::FileSystemOperations::moveDirectory ( StringViewData source,
StringViewData destination )
static

Move a directory.

Parameters
sourceThe source directory to move
destinationThe destination directory to move to

◆ removeDirectoryRecursive()

static Result SC::FileSystemOperations::removeDirectoryRecursive ( StringViewData directory)
static

Remove a directory recursively.

Parameters
directoryThe directory to remove
Returns
Result::Error if the directory could not be removed

◆ removeEmptyDirectory()

static Result SC::FileSystemOperations::removeEmptyDirectory ( StringViewData path)
static

Remove an empty directory.

Parameters
pathThe path to the empty directory to remove
Returns
Result::Error if the directory could not be removed

◆ removeFile()

static Result SC::FileSystemOperations::removeFile ( StringViewData path)
static

Remove a file.

Parameters
pathThe path to the file to remove
Returns
Result::Error if the file could not be removed

◆ rename()

static Result SC::FileSystemOperations::rename ( StringViewData path,
StringViewData newPath )
static

Rename a file or directory.

Parameters
pathThe path to the file or directory to rename
newPathThe new path to the file or directory
Returns
Result::Error if the file or directory could not be renamed

◆ setLastModifiedTime()

static Result SC::FileSystemOperations::setLastModifiedTime ( StringViewData path,
Time::Realtime time )
static

Set the last modified time of a file.

Parameters
pathThe path to the file to set the last modified time of
timeThe last modified time to set
Returns
Result::Error if the last modified time could not be set

The documentation for this struct was generated from the following file: