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 &key)
 Get the data of a static resource.
 
static void add_static_resource (std::string const &key, std::span< std::byte const > value) noexcept
 Add static resource.
 

Detailed Description

A resource that was included in the executable.

Member Function Documentation

◆ add_static_resource()

static void tt::static_resource_view::add_static_resource ( std::string const & key,
std::span< std::byte const > value )
staticnoexcept

Add static resource.

This function should only be called on resources that are linked into the executable and therefor only be called by the application class.

Parameters
keyName of the resource.
valueA span to the constant byte array

◆ 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 & key)
static

Get the data of a static resource.

These are resources that where linked into the exectuable.

Parameters
keyName 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: