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

#include <TTauri/Foundation/FileView.hpp>

Inheritance diagram for tt::FileView:
tt::ResourceView

Public Member Functions

 FileView (std::shared_ptr< FileMapping > const &mappingObject, size_t offset, size_t size)
 
 FileView (URL const &location, AccessMode accessMode=AccessMode::OpenForRead, size_t offset=0, size_t size=0)
 
 FileView (FileView const &other) noexcept
 
 FileView (FileView &&other) noexcept
 
FileViewoperator= (FileView const &other) noexcept
 
FileViewoperator= (FileView &&other) noexcept
 
AccessMode accessMode () const noexcept
 
URL const & location () const noexcept
 
size_t offset () const noexcept override
 
size_t size () const noexcept override
 
std::byte * data () noexcept
 
std::byte const * data () const noexcept override
 
nonstd::span< std::byte > bytes () noexcept
 
nonstd::span< std::byte const > bytes () const noexcept override
 
std::string_view string_view () noexcept
 
std::string_view string_view () const noexcept override
 
void flush (void *base, size_t size)
 
- Public Member Functions inherited from tt::ResourceView
 ResourceView (ResourceView const &other)=default
 
 ResourceView (ResourceView &&other)=default
 
ResourceViewoperator= (ResourceView const &other)=default
 
ResourceViewoperator= (ResourceView &&other)=default
 
 operator std::string_view () const noexcept
 

Static Public Member Functions

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

Detailed Description

Map a file into virtual memory.

Member Function Documentation

◆ accessMode()

AccessMode tt::FileView::accessMode ( ) const
inlinenoexcept

Access mode of the opened file.

◆ bytes() [1/2]

nonstd::span< std::byte const > tt::FileView::bytes ( ) const
inlineoverridevirtualnoexcept

Span to the mapping into memory.

Implements tt::ResourceView.

◆ bytes() [2/2]

nonstd::span< std::byte > tt::FileView::bytes ( )
inlinenoexcept

Span to the mapping into memory.

◆ data() [1/2]

std::byte const * tt::FileView::data ( ) const
inlineoverridevirtualnoexcept

Pointer to the mapping into memory.

Implements tt::ResourceView.

◆ data() [2/2]

std::byte * tt::FileView::data ( )
inlinenoexcept

Pointer to the mapping into memory.

◆ flush()

void tt::FileView::flush ( void * base,
size_t size )

Flush changes in memory to the open file.

Parameters
basestart location of the memory to flush.
Numberof bytes from the base of the memory region to flush.

◆ loadView()

static std::unique_ptr< ResourceView > tt::FileView::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 & tt::FileView::location ( ) const
inlinenoexcept

URL location to the file.

◆ offset()

size_t tt::FileView::offset ( ) const
inlineoverridevirtualnoexcept

Offset of the mapping into the file.

Implements tt::ResourceView.

◆ size()

size_t tt::FileView::size ( ) const
inlineoverridevirtualnoexcept

Number of bytes which is mapped to memory.

Implements tt::ResourceView.

◆ string_view() [1/2]

std::string_view tt::FileView::string_view ( ) const
inlineoverridevirtualnoexcept

String view to the mapping into memory.

Implements tt::ResourceView.

◆ string_view() [2/2]

std::string_view tt::FileView::string_view ( )
inlinenoexcept

String view to the mapping into memory.


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