HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
v1::file_view Class Reference

#include <hikogui/file_view.hpp>

Inheritance diagram for v1::file_view:
v1::writable_resource_view v1::resource_view

Public Member Functions

 file_view (std::shared_ptr< file_mapping > const &mappingObject, std::size_t offset, std::size_t size)
 
 file_view (URL const &location, access_mode accessMode=access_mode::open_for_read, std::size_t offset=0, std::size_t size=0)
 
 file_view (file_view const &other) noexcept
 
 file_view (file_view &&other) noexcept
 
file_viewoperator= (file_view const &other) noexcept
 
file_viewoperator= (file_view &&other) noexcept
 
access_mode accessMode () const noexcept
 
URL const & location () const noexcept
 
std::size_t offset () const noexcept override
 
void_span writable_span () noexcept override
 
const_void_span span () const noexcept override
 
void flush (void *base, std::size_t size)
 Flush changes in memory to the open file.
 
- Public Member Functions inherited from v1::resource_view
 resource_view (resource_view const &other)=default
 
 resource_view (resource_view &&other)=default
 
resource_viewoperator= (resource_view const &other)=default
 
resource_viewoperator= (resource_view &&other)=default
 

Static Public Member Functions

static std::unique_ptr< resource_viewloadView (URL const &location)
 

Detailed Description

Map a file into virtual memory.

Member Function Documentation

◆ accessMode()

access_mode v1::file_view::accessMode ( ) const
inlinenoexcept

Access mode of the opened file.

◆ flush()

void v1::file_view::flush ( void * base,
std::size_t size )

Flush changes in memory to the open file.

Parameters
baseStart location of the memory to flush.
sizeNumber of bytes from the base of the memory region to flush.

◆ loadView()

static std::unique_ptr< resource_view > v1::file_view::loadView ( URL const & location)
inlinestatic

Load a view of a resource. This is used when the resource that needs to be opened is a file.

◆ location()

URL const & v1::file_view::location ( ) const
inlinenoexcept

URL location to the file.

◆ offset()

std::size_t v1::file_view::offset ( ) const
inlineoverridevirtualnoexcept

Offset of the mapping into the file.

Implements v1::resource_view.

◆ span()

const_void_span v1::file_view::span ( ) const
inlineoverridevirtualnoexcept

Span to the mapping into memory.

Implements v1::resource_view.

◆ writable_span()

void_span v1::file_view::writable_span ( )
inlineoverridevirtualnoexcept

Span to the mapping into memory.

Implements v1::writable_resource_view.


The documentation for this class was generated from the following file: