Nui Engine
A game engine framework
Loading...
Searching...
No Matches
Nui::Filesystem Class Reference

Filesystem utility class with static methods. More...

#include <Filesystem.h>

Static Public Member Functions

static bool Exists (const fs::path &path)
 Check if path exists.
 
static bool IsDirectory (const fs::path &path)
 Check if path is a directory.
 
static bool IsFile (const fs::path &path)
 Check if path is a file.
 
static bool MakeDirectory (const fs::path &path)
 Create directory.
 
static bool DeleteDirectory (const fs::path &path)
 Delete directory.
 
static fs::path GetCurrentWorkingDirectory ()
 Get current working directory.
 
static String GetFilename (const fs::path &path, bool includeExtension=true)
 Get filename.
 
static String GetFileExtension (const fs::path &path)
 Get file extension.
 
static U32Max GetFileSize (const fs::path &path)
 Get file size.
 
static std::vector< Byte > ReadFileAsBytes (const fs::path &path)
 Read file as bytes.
 
static String ReadFileAsString (const fs::path &path)
 Read file as string.
 

Detailed Description

Filesystem utility class with static methods.

Note
Acts as a wrapper for std::filesystem

Member Function Documentation

◆ DeleteDirectory()

bool Nui::Filesystem::DeleteDirectory ( const fs::path & path)
static

Delete directory.

Parameters
pathPath to delete
Returns
True if directory was deleted

◆ Exists()

bool Nui::Filesystem::Exists ( const fs::path & path)
static

Check if path exists.

Parameters
pathPath to check
Returns
True if path exists

◆ GetCurrentWorkingDirectory()

fs::path Nui::Filesystem::GetCurrentWorkingDirectory ( )
static

Get current working directory.

Returns
Current working directory
Note
This is equivalent to fs::current_path()

◆ GetFileExtension()

String Nui::Filesystem::GetFileExtension ( const fs::path & path)
static

Get file extension.

Parameters
pathPath to get extension from
Returns
File extension

◆ GetFilename()

String Nui::Filesystem::GetFilename ( const fs::path & path,
bool includeExtension = true )
static

Get filename.

Parameters
pathPath to get filename from
includeExtensionInclude file extension
Returns
Filename

◆ GetFileSize()

U32Max Nui::Filesystem::GetFileSize ( const fs::path & path)
static

Get file size.

Parameters
pathPath to get file size from
Returns
File size

◆ IsDirectory()

bool Nui::Filesystem::IsDirectory ( const fs::path & path)
static

Check if path is a directory.

Parameters
pathPath to check
Returns
True if path is a directory

◆ IsFile()

bool Nui::Filesystem::IsFile ( const fs::path & path)
static

Check if path is a file.

Parameters
pathPath to check
Returns
True if path is a file

◆ MakeDirectory()

bool Nui::Filesystem::MakeDirectory ( const fs::path & path)
static

Create directory.

Parameters
pathPath to create
Returns
True if directory was created or already exists

◆ ReadFileAsBytes()

std::vector< Byte > Nui::Filesystem::ReadFileAsBytes ( const fs::path & path)
static

Read file as bytes.

Parameters
pathPath to read
Returns
File contents

◆ ReadFileAsString()

String Nui::Filesystem::ReadFileAsString ( const fs::path & path)
static

Read file as string.

Parameters
pathPath to read
Returns
File contents as String

The documentation for this class was generated from the following files: