43#include <StormByte/bitmask.hxx>
44#include <StormByte/error.hxx>
45#include <StormByte/byte_size.hxx>
46#include <StormByte/safe/string.hxx>
48#include <StormByte/type_traits/safe.hxx>
54#include <system_error>
181 explicit Device(std::string_view path)
noexcept;
187 explicit Device(std::wstring_view path)
noexcept;
193 explicit Device(
const std::filesystem::path& path)
noexcept:
195 Device(std::wstring_view(path.native())) {}
197 Device(std::string_view(path.native())) {}
236 explicit operator
bool() const noexcept;
289 bool m_initialization_failed{
false};
302 static constexpr const char*
Name =
"StormByte.System.Device";
314 return "Broken symbolic link";
316 return "Device not found";
318 return "Path is not a classifiable device";
320 return "Device permission denied";
322 return "Device probe failed";
324 return "Unknown Device error";
351 struct is_error_code_enum<
StormByte::System::Device::Error>: true_type {};
constexpr Bitmask() noexcept
Bitmask of AccessFlag.
Definition device.hxx:138
Query object for the medium behind a filesystem accessor.
Definition device.hxx:89
Error
Device classification and probe enumerators.
Definition device.hxx:97
@ NotADevice
The path exists but is not a classifiable file, directory or device node.
Definition device.hxx:101
@ ProbeFailed
Classification I/O failed.
Definition device.hxx:103
@ Success
No error.
Definition device.hxx:98
@ BrokenSymlink
The path is a symlink whose target does not exist.
Definition device.hxx:99
@ DeviceNotFound
No volume or node could be resolved.
Definition device.hxx:100
@ Permission
The process may not stat or access this path.
Definition device.hxx:102
const StormByte::Safe::String & Path() const noexcept
Accessor stored at construction.
Device(std::string_view path) noexcept
Store a UTF-8 accessor view.
Device(std::wstring_view path) noexcept
Store a wide accessor as UTF-8 text.
Device(const std::filesystem::path &path) noexcept
Store a filesystem path using its native path view.
Definition device.hxx:193
AccessFlag
Transfer permission of this path for this process.
Definition device.hxx:129
Device(Device &&) noexcept=default
Move constructor.
StormByte::Error::Fault Fault() const noexcept
Result of the current probe.
Kind
Classified storage or network medium.
Definition device.hxx:112
Device(const Device &)=default
Copy constructor.
Device(const StormByte::Safe::String &path) noexcept
Store an owned UTF-8 accessor.
STORMBYTE_DECLARE_MAYBE_SAFE(class StormByte::System::Device::Access)
System module of the StormByte suite.
Definition device.hxx:59
STORMBYTE_FORCE_INLINE std::error_code make_error_code(Device::Error e) noexcept
Builds an std::error_code from Device::Error.
Definition device.hxx:341
const StormByte::Error::Category< Device::Error > & device_category() noexcept
Category singleton for Device::Error.
static STORMBYTE_FORCE_INLINE std::string Message(StormByte::System::Device::Error e)
Text for one Device enumerator.
Definition device.hxx:309
static constexpr const char * Name
Stable category tag.
Definition device.hxx:302
Nominal sequential rates of the resolved medium.
Definition device.hxx:150
StormByte::ByteSize write_bps
Nominal sequential write.
Definition device.hxx:152
StormByte::ByteSize read_bps
Nominal sequential read.
Definition device.hxx:151
Suggested transfer windows derived from Throughput.
Definition device.hxx:161
StormByte::ByteSize read
Suggested read window.
Definition device.hxx:162
StormByte::ByteSize write
Suggested write window.
Definition device.hxx:163
#define STORMBYTE_SYSTEM_PUBLIC
Definition visibility.h:53