23 #include "lfilesystem/lfilesystem_Export.h"
35 using Path = std::filesystem::path;
37 class FilesystemEntry;
68 explicit Volume (
const Path& path = dirs::cwd().getAbsolutePath());
73 [[nodiscard]]
static std::optional<Volume>
tryCreate (
const Path& path = dirs::cwd().getAbsolutePath()) noexcept;
79 bool operator== (const
Volume& other) const noexcept;
82 bool operator!= (const
Volume& other) const noexcept;
98 [[nodiscard]] std::
string getLabel() const;
110 [[nodiscard]]
int getSerialNumber() const;
128 [[nodiscard]]
Path getPath() const noexcept;
166 [[nodiscard]]
static std::vector<Volume>
getAll() noexcept;
177 std::ostream& operator<< (std::ostream& os, const
Volume& value);
194 [[nodiscard]] LFILE_EXPORT std::string
label();
The base class for any kind of object on the filesystem.
This class represents a logical filesystem volume.
Type
Represents the type of a filesystem volume.
static std::vector< Volume > getAll() noexcept
Returns all currently mounted volumes.
Volume(const Path &path=dirs::cwd().getAbsolutePath())
Creates a Volume object representing the volume that the passed path exists on.
Type getType() const
Returns the type of this volume.
bool isReadOnly() const
Returns true if this volume is read-only.
static std::optional< Volume > tryCreate(const Path &path=dirs::cwd().getAbsolutePath()) noexcept
A noexcept method for creating a volume object.
bool isCaseSensitive() const
Returns true if paths on this volume are case-sensitive.
std::filesystem::path Path
Convenience typedef for filesystem paths.
This file contains utility functions for finding some common directories.
LFILE_EXPORT bool caseSensitive()
Returns true if the current volume is case-sensitive.
LFILE_EXPORT Volume::Type type()
Returns the type of the current volume.
LFILE_EXPORT int serialNumber()
Returns the current volume's serial number.
LFILE_EXPORT std::uintmax_t totalBytes()
Returns the total number of bytes on the current volume.
LFILE_EXPORT bool readOnly()
Returns true if the current volume is mounted as read-only.
LFILE_EXPORT std::uintmax_t bytesFree()
Returns the number of bytes free on the current volume.
LFILE_EXPORT std::string label()
Returns the current volume's label.