|
|
constexpr | file_view (file_view const &other) noexcept=default |
|
constexpr | file_view (file_view &&other) noexcept=default |
|
constexpr file_view & | operator= (file_view const &other) noexcept=default |
|
constexpr file_view & | operator= (file_view &&other) noexcept=default |
| | file_view (file const &file, std::size_t offset=0, std::size_t size=0) |
| | Create a file-view from a file-mapping.
|
|
| file_view (std::filesystem::path const &path, access_mode access_mode=access_mode::open_for_read, std::size_t offset=0, std::size_t size=0) |
|
std::size_t | offset () const noexcept |
|
std::size_t | size () const noexcept |
| bool | unmapped () const noexcept |
| | Check if this file view is closed.
|
| | operator bool () const noexcept |
| | Check if this file view is open.
|
|
void | unmap () noexcept |
| void_span | void_span () const noexcept |
| | Span to the mapping into memory.
|
| const_void_span | const_void_span () const noexcept |
| void | flush (hi::void_span span) const noexcept |
| | Flush changes in memory to the open file view.
|
Map a file into virtual memory.
To map a file into memory there are three objects needed:
- The file object which holds a handle or file descriptor to an open file on disk.
- The file_mapping object maps a section of the file in the operating system.
- The file_view object maps a section of the file-mapping into virtual memory.
The file_mapping intermediate object is required on Windows systems which holds a handle to a file mapping object.