![]() |
Pixie
|
Move-only owner of a read-only POSIX memory-mapped file. More...
#include <mapped_file.h>
Public Member Functions | |
| MappedFile (const std::filesystem::path &path) | |
Map path for reading. | |
| MappedFile (const MappedFile &)=delete | |
| MappedFile & | operator= (const MappedFile &)=delete |
| MappedFile (MappedFile &&other) noexcept | |
| Transfer ownership of a mapping. | |
| MappedFile & | operator= (MappedFile &&other) noexcept |
Release this mapping and transfer ownership from other. | |
| ~MappedFile () | |
| Unmap the file contents, if any. | |
| std::span< const std::byte > | as_bytes () const noexcept |
| Return the mapped file contents. | |
| std::size_t | size_bytes () const noexcept |
| Return the mapped file size in bytes. | |
Move-only owner of a read-only POSIX memory-mapped file.
The mapping remains valid after the file is unlinked. Empty files expose an empty byte view without creating a zero-length mapping.
|
inlineexplicit |
Map path for reading.
| std::system_error | if the file cannot be opened, inspected, or mapped. |
| std::length_error | if the file does not fit in std::size_t. |