HikoGUI
A low latency retained GUI
|
#include <hikogui/file/file_view.hpp>
Public Member Functions | |
file_view (file_view const &other) noexcept=default | |
file_view (file_view &&other) noexcept=default | |
file_view & | operator= (file_view const &other) noexcept=default |
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. | |
Friends | |
template<typename T > | |
std::span< T > | as_span (file_view const &view) noexcept |
std::string_view | as_string_view (file_view const &view) noexcept |
bstring_view | as_bstring_view (file_view const &view) noexcept |
Map a file into virtual memory.
To map a file into memory there are three objects needed:
file
object which holds a handle or file descriptor to an open file on disk.file_view
object maps a section of the file-mapping into virtual memory.
|
inline |
Create a file-view from a file-mapping.
file | An open file object. |
offset | The offset from the beginning of the file-mapping (a file mapping may have an offset on its own). The offset must also be a multiple of the granularity. |
size | The size of the mapping, if zero the full file-mapping object is mapped. |
|
inlinenoexcept |
Span to the mapping into memory.
|
inlinenoexcept |
Flush changes in memory to the open file view.
span | The part of the buffer to flush. |
|
inlineexplicitnoexcept |
Check if this file view is open.
|
inlinenoexcept |
Check if this file view is closed.
|
inlinenoexcept |
Span to the mapping into memory.