TGUI  0.9-dev
tgui::Filesystem Class Reference

Helper functionality for filesystem access. More...

#include <TGUI/Filesystem.hpp>

Classes

class  Path
 Object to represent paths on a filesystem. More...
 

Static Public Member Functions

static bool directoryExists (const Path &path)
 Checks if a directory exists. More...
 
static bool directoryExists (const String &path)
 Checks if a directory exists. More...
 
static bool fileExists (const Path &path)
 Checks if a file exists. More...
 
static bool fileExists (const String &path)
 Checks if a file exists. More...
 
static bool createDirectory (const Path &path)
 Create a directory. More...
 
static bool createDirectory (const String &path)
 Create a directory. More...
 
static Path getLocalDataDirectory ()
 Returns the directory to store application data. More...
 

Detailed Description

Helper functionality for filesystem access.

When TGUI is built with c++17 support then std::filesystem is used on newer compilers. Otherwise, POSIX or Windows-specific code is used to implement the functionality.

Member Function Documentation

◆ createDirectory() [1/2]

static bool tgui::Filesystem::createDirectory ( const Path path)
static

Create a directory.

Parameters
Pathto the directory to create
Returns
True if the directory was created or already existed, false on failure.

This function will fail if the parent directory doesn't exist. It won't try to recursively create the directory.

◆ createDirectory() [2/2]

static bool tgui::Filesystem::createDirectory ( const String path)
inlinestatic

Create a directory.

Parameters
Pathto the directory to create
Returns
True if the directory was created or already existed, false on failure.

This function will fail if the parent directory doesn't exist. It won't try to recursively create the directory.

◆ directoryExists() [1/2]

static bool tgui::Filesystem::directoryExists ( const Path path)
static

Checks if a directory exists.

Parameters
Pathto the directory to check
Returns
True if the directory exists, false otherwise

◆ directoryExists() [2/2]

static bool tgui::Filesystem::directoryExists ( const String path)
inlinestatic

Checks if a directory exists.

Parameters
Pathto the directory to check
Returns
True if the directory exists, false otherwise

◆ fileExists() [1/2]

static bool tgui::Filesystem::fileExists ( const Path path)
static

Checks if a file exists.

Parameters
Pathto the file to check
Returns
True if the file exists, false otherwise

◆ fileExists() [2/2]

static bool tgui::Filesystem::fileExists ( const String path)
inlinestatic

Checks if a file exists.

Parameters
Pathto the file to check
Returns
True if the file exists, false otherwise

◆ getLocalDataDirectory()

static Path tgui::Filesystem::getLocalDataDirectory ( )
static

Returns the directory to store application data.

Returns
Path to local app data directory

On Windows, this returns the value of LOCALAPPDATA% On macOS, this returns $HOME/Library/Application Support On Linux and other platforms, this returns $HOME/.local/share


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