49 [[nodiscard]]
static auto open(
const std::filesystem::path& path)
56 [[nodiscard]]
auto data()
const noexcept ->
const std::uint8_t*;
62 [[nodiscard]]
auto size()
const noexcept -> std::size_t;
68 [[nodiscard]]
auto as_span()
const noexcept -> std::span<const std::uint8_t>;
82 void unmap() noexcept;
84 const std::uint8_t*
data_ =
nullptr;
88 void* file_handle_ =
nullptr;
89 void* mapping_handle_ =
nullptr;
const std::uint8_t * data_
static auto open(const std::filesystem::path &path) -> kcenon::pacs::Result< memory_mapped_file >
Open and memory-map a file for reading.
auto as_span() const noexcept -> std::span< const std::uint8_t >
Get a span over the mapped data.
memory_mapped_file(const memory_mapped_file &)=delete
auto size() const noexcept -> std::size_t
Get the size of the mapped file.
auto operator=(const memory_mapped_file &) -> memory_mapped_file &=delete
memory_mapped_file()=default
auto data() const noexcept -> const std::uint8_t *
Get pointer to the mapped data.
Result<T> type aliases and helpers for PACS system.