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

#include <ttauri/static_resource_view.hpp>

Inheritance diagram for tt::static_resource_view:
tt::resource_view

Public Member Functions

 static_resource_view (std::string const &filename)
 
 static_resource_view (static_resource_view const &other)=default
 
static_resource_viewoperator= (static_resource_view const &other)=default
 
 static_resource_view (static_resource_view &&other)=default
 
static_resource_viewoperator= (static_resource_view &&other)=default
 
size_t offset () const noexcept override
 Offset into the resource file.
 
size_t size () const noexcept override
 Size of the memory mapping.
 
std::byte const * data () const noexcept override
 Pointer to the memory mapping.
 
std::span< std::byte const > bytes () const noexcept override
 Get a span to the memory mapping.
 
std::string_view string_view () const noexcept override
 Get a span to the memory mapping.
 
- Public Member Functions inherited from tt::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
 
 operator std::span< std::byte const > () const noexcept
 

Static Public Member Functions

static std::unique_ptr< resource_viewloadView (std::string const &location)
 
static std::span< std::byte const > get_static_resource (std::string const &filename)
 Get the data of a static resource.
 

Detailed Description

A resource that was included in the executable.

Member Function Documentation

◆ bytes()

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

Get a span to the memory mapping.

Implements tt::resource_view.

◆ data()

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

Pointer to the memory mapping.

Implements tt::resource_view.

◆ get_static_resource()

static std::span< std::byte const > tt::static_resource_view::get_static_resource ( std::string const & filename)
static

Get the data of a static resource.

These are resources that where linked into the executable.

Parameters
filenameName of the resource.
Returns
A span to the constant byte array.
Exceptions
key_errorThrown when static resource could not be found.

◆ offset()

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

Offset into the resource file.

Returns
offset into the resource file.

Implements tt::resource_view.

◆ size()

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

Size of the memory mapping.

Implements tt::resource_view.

◆ string_view()

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

Get a span to the memory mapping.

Implements tt::resource_view.


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