26#ifndef TGUI_FILESYSTEM_HPP
27#define TGUI_FILESYSTEM_HPP
29#include <TGUI/String.hpp>
32#ifdef TGUI_USE_STD_FILESYSTEM
107#ifdef TGUI_SYSTEM_WINDOWS
108 std::wstring asNativeString()
const;
113#ifdef TGUI_USE_STD_FILESYSTEM
117 operator const std::filesystem::path&()
const
142 return *
this /
Path(path);
165 return *
this /=
Path(path);
172#ifdef TGUI_USE_STD_FILESYSTEM
173 std::filesystem::path m_path;
175 std::vector<String> m_parts;
177 bool m_absolute =
false;
201 return directoryExists(
Path{path});
224 return fileExists(
Path{path});
251 return createDirectory(
Path{path});
Object to represent paths on a filesystem.
Definition: Filesystem.hpp:54
bool isEmpty() const
Check if this object is empty.
std::string asNativeString() const
Returns the path as a string, but with a string type and contents that depends on the OS.
Path()=default
Default constructor that creates an empty path object.
String asString() const
Returns the path as a string.
Path getParentPath() const
Returns to path to the parent directory.
Path operator/(const Path &path) const
Returns a new path that consists of this object joined with another path.
Path & operator/=(const Path &path)
Joins this object with another path.
Path & operator/=(const String &path)
Joins this object with another path.
Definition: Filesystem.hpp:163
Path(const String &path)
Default constructor that creates an empty path object.
Path operator/(const String &path) const
Returns a new path that consists of this object joined with another path.
Definition: Filesystem.hpp:140
Helper functionality for filesystem access.
Definition: Filesystem.hpp:47
static bool directoryExists(const Path &path)
Checks if a directory exists.
static Path getLocalDataDirectory()
Returns the directory to store application data.
static bool fileExists(const String &path)
Checks if a file exists.
Definition: Filesystem.hpp:222
static bool directoryExists(const String &path)
Checks if a directory exists.
Definition: Filesystem.hpp:199
static bool fileExists(const Path &path)
Checks if a file exists.
static bool createDirectory(const Path &path)
Create a directory.
static bool createDirectory(const String &path)
Create a directory.
Definition: Filesystem.hpp:249
Wrapper class to store strings.
Definition: String.hpp:119
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37