OGLplus  (0.59.0) a C++ wrapper for rendering APIs

Class providing access to a const resource block embedded into the executable. More...

#include <eagine/embed.hpp>

Public Member Functions

constexpr embedded_resource () noexcept=default
 Default constructor.
 
constexpr auto source_path () const noexcept -> string_view
 Returns the path of the file this resource data comes from.
 
constexpr auto is_packed () const noexcept -> bool
 Indicates if the resource is packed and needs to be decompressed. More...
 
constexpr operator memory::const_block () const noexcept
 Implicit conversion to const block.
 
auto unpack (data_compressor &comp, memory::buffer &buf) const -> memory::const_block
 Unpacks this resource into a buffer using the provided compressor. More...
 
auto unpack (main_ctx &ctx) const -> memory::const_block
 Unpacks this resource into a buffer using compressor from main context. More...
 
auto unpack (main_ctx_object &mco) const -> memory::const_block
 Unpacks this resource using compressor from a main context object. More...
 

Related Functions

(Note that these are not member functions.)

static auto as_chars (const embedded_resource &res) noexcept
 Converts the embedded resource block to a const span of characters.
 

Detailed Description

Class providing access to a const resource block embedded into the executable.

See also
embed

Member Function Documentation

◆ is_packed()

constexpr auto eagine::embedded_resource::is_packed ( ) const -> bool
inlineconstexprnoexcept

Indicates if the resource is packed and needs to be decompressed.

See also
decompress

Referenced by unpack().

◆ unpack() [1/3]

auto eagine::embedded_resource::unpack ( data_compressor comp,
memory::buffer buf 
) const -> memory::const_block
inline

Unpacks this resource into a buffer using the provided compressor.

See also
is_packed

Referenced by unpack().

◆ unpack() [2/3]

auto eagine::embedded_resource::unpack ( main_ctx ctx) const -> memory::const_block
inline

Unpacks this resource into a buffer using compressor from main context.

See also
is_packed

◆ unpack() [3/3]

auto eagine::embedded_resource::unpack ( main_ctx_object mco) const -> memory::const_block
inline

Unpacks this resource using compressor from a main context object.

See also
is_packed

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

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).