23 #include "lfilesystem/lfilesystem_Export.h"
43 using Path = std::filesystem::path;
92 using Time = std::filesystem::file_time_type;
147 [[nodiscard]]
bool operator== (
const Path& other)
const noexcept;
149 [[nodiscard]]
bool operator!= (
const Path& other)
const noexcept;
163 [[nodiscard]]
bool operator> (
const Path& other)
const noexcept;
272 [[nodiscard]]
Path getPath (
bool makePreferred = false) const noexcept;
285 [[nodiscard]]
Path getAbsolutePath (
bool makePreferred = false) const noexcept;
290 operator
Path() const noexcept;
293 [[nodiscard]] std::
string getName() const noexcept;
348 [[nodiscard]]
bool isBelow (const
Directory& directory, std::
size_t depthLimit = 50) const;
357 [[nodiscard]]
bool isAbsolutePath() const noexcept;
366 [[nodiscard]]
bool isRelativePath() const noexcept;
372 [[nodiscard]]
bool isValid() const noexcept;
378 [[nodiscard]]
bool isHidden() const;
394 [[nodiscard]] virtual
bool isFile() const noexcept;
399 [[nodiscard]] virtual
bool isDirectory() const noexcept;
404 [[nodiscard]] virtual
bool isSymLink() const noexcept;
409 [[nodiscard]]
bool exists() const noexcept;
416 operator
bool() const noexcept;
422 [[nodiscard]] virtual std::uintmax_t sizeInBytes() const;
427 [[nodiscard]]
Time getLastModificationTime() const noexcept;
432 [[nodiscard]] std::optional<
Volume> getVolume() const noexcept;
444 [[nodiscard]] std::optional<
File> getFileObject() const noexcept;
451 [[nodiscard]] std::optional<
Directory> getDirectoryObject() const noexcept;
458 [[nodiscard]] std::optional<
SymLink> getSymLinkObject() const noexcept;
472 virtual
bool createIfDoesntExist() const noexcept;
480 bool deleteIfExists() const noexcept;
488 bool moveToTrash() noexcept;
504 bool touch_noCreate() const;
517 bool rename (const
Path& newPath) noexcept;
576 bool revealToUserInFileBrowser() const;
579 bool filenameBeginsWithDot() const;
603 struct LFILE_EXPORT hash<limes::files::FilesystemEntry> final
This class represents a directory on the filesystem.
This class represents a file on the filesystem.
The base class for any kind of object on the filesystem.
bool makeAbsoluteRelativeToCWD() noexcept
Similar to makeAbsoluteRelativeTo(), but uses the current working directory as the base path.
bool operator<(const FilesystemEntry &other) const noexcept
Lexicographically compares this filesystem entry's absolute path with another path.
FilesystemEntry()=default
Creates a FilesystemEntry with an empty path.
std::filesystem::copy_options CopyOptions
Options bitfield for copying.
FilesystemEntry & changeName(const std::string_view &newName)
Changes the last section of the path (the filename).
FilesystemEntry & assignPath(const Path &newPath) noexcept
Assigns the path this filesystem entry represents.
bool makeAbsoluteRelativeTo(const Path &basePath) noexcept
If the path this object holds is already absolute, this function does nothing and returns false.
virtual ~FilesystemEntry()=default
Destructor.
std::filesystem::file_time_type Time
A time point used for filesystem time.
std::filesystem::perm_options PermOptions
Options bitfield for setting permissions.
bool operator<(const Path &other) const noexcept
Lexicographically compares this filesystem entry's absolute path with another path.
FilesystemEntry(const Path &pathToUse)
Creates a FilesystemEntry referring to the specified path.
This class encapsulates the standard library's permissions bitmask type, and provides some higher-lev...
This class represents a symbolic link on the filesystem.
This class represents a logical filesystem volume.
std::filesystem::perms FSPerms
A typedef for the standard library permissions type.
std::filesystem::path Path
Convenience typedef for filesystem paths.
This file defines the Permissions class.