Helper functionality for filesystem access.
More...
#include <TGUI/Filesystem.hpp>
|
struct | FileInfo |
| Information about a file or directory, used to return data from the listFilesInDirectory function. More...
|
|
class | Path |
| Object to represent paths on a filesystem. More...
|
|
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.
◆ createDirectory() [1/2]
static bool tgui::Filesystem::createDirectory |
( |
const Path & | path | ) |
|
|
static |
Create a directory.
- Parameters
-
path | Path to 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
-
path | Path to 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 | ) |
|
|
staticnodiscard |
Checks if a directory exists.
- Parameters
-
path | Path to the directory to check |
- Returns
- True if the directory exists, false otherwise
◆ directoryExists() [2/2]
static bool tgui::Filesystem::directoryExists |
( |
const String & | path | ) |
|
|
inlinestaticnodiscard |
Checks if a directory exists.
- Parameters
-
path | Path to the directory to check |
- Returns
- True if the directory exists, false otherwise
◆ fileExists() [1/2]
static bool tgui::Filesystem::fileExists |
( |
const Path & | path | ) |
|
|
staticnodiscard |
Checks if a file exists.
- Parameters
-
path | Path to the file to check |
- Returns
- True if the file exists, false otherwise
◆ fileExists() [2/2]
static bool tgui::Filesystem::fileExists |
( |
const String & | path | ) |
|
|
inlinestaticnodiscard |
Checks if a file exists.
- Parameters
-
path | Path to the file to check |
- Returns
- True if the file exists, false otherwise
◆ getCurrentWorkingDirectory()
static Path tgui::Filesystem::getCurrentWorkingDirectory |
( |
| ) |
|
|
staticnodiscard |
Returns the current working directory.
- Returns
- Path to the current working directory
◆ getHomeDirectory()
static Path tgui::Filesystem::getHomeDirectory |
( |
| ) |
|
|
staticnodiscard |
Returns the home directory.
- Returns
- Path to the home directory
◆ getLocalDataDirectory()
static Path tgui::Filesystem::getLocalDataDirectory |
( |
| ) |
|
|
staticnodiscard |
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
◆ listFilesInDirectory()
static std::vector< FileInfo > tgui::Filesystem::listFilesInDirectory |
( |
const Path & | path | ) |
|
|
staticnodiscard |
Returns a list of all files and folders inside a given directory.
- Parameters
-
path | Path in which all directories and files should be listed |
- Returns
- List of files (including directories) that are found within the given path
The documentation for this class was generated from the following file: