5#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_FILESYSTEM_ERROR_CODE_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_FILESYSTEM_ERROR_CODE_HPP_
65 explicit operator bool() const noexcept {
return value() != 0; }
70 void clear() noexcept { error_ = 0; }
A class representing a filesystem error value. Intended to be a wrapper around errno.
Definition error_code.hpp:33
ARENE_NORETURN void throw_error_with_prefix(null_terminated_string_view const message_prefix) const
Raise an exception produced from the error with a descriptive message.
Definition error_code.cpp:114
constexpr error_code(raw_error_code const error) noexcept
Construct with a specified error value.
Definition error_code.hpp:49
void clear() noexcept
clear the error
Definition error_code.hpp:70
static auto from_errno() noexcept -> error_code
Create an instance from the current state of errno.
Definition error_code.cpp:91
constexpr auto value() const noexcept -> raw_error_code
Get the stored error value.
Definition error_code.hpp:60
auto message() const noexcept -> error_string
Get a message describing the error.
Definition error_code.cpp:96
ARENE_NORETURN void throw_error() const
Raise an exception produced from the error.
Definition error_code.cpp:112
error_code() noexcept
Construct with no error.
Definition error_code.hpp:42
int raw_error_code
Raw error code type.
Definition error_code.hpp:37
A string type with a fixed maximum capacity, where the data is stored internally without allocations.
Definition inline_string.hpp:162
A read-only string-view that provides a view onto a null-terminated string.
Definition null_terminated_string_view.hpp:62
Public export header for the inline_string subpackage.
Definition directory_handle.cpp:39
inline_string< max_error_length > error_string
An inline_string large enough to hold an error message.
Definition error_code.hpp:30
constexpr std::size_t max_error_length
The maximum length of an error message.
Definition error_code.hpp:26
Definition accumulate.hpp:37
Definition accumulate.hpp:36
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
#define ARENE_NORETURN
An alias for [[noreturn]] , or a no-op if the attribute is not supported.
Definition noreturn.hpp:24
Public export header for the string_view subpackage.