6#include "TTauri/Foundation/ResourceView.hpp"
7#include "TTauri/Foundation/required.hpp"
10#include <unordered_map>
19 nonstd::span<std::byte const> _bytes;
31 [[nodiscard]]
size_t offset() const noexcept
override {
return 0; }
33 [[nodiscard]]
size_t size() const noexcept
override {
return _bytes.size(); }
35 [[nodiscard]] std::byte
const *
data() const noexcept
override {
return _bytes.data(); }
37 [[nodiscard]] nonstd::span<std::byte const>
bytes() const noexcept
override {
return _bytes; }
39 [[nodiscard]] std::string_view
string_view() const noexcept
override {
return {
reinterpret_cast<char const*
>(
data()),
size()}; }
42 return std::make_unique<StaticResourceView>(location);
A read-only memory mapping of a resource.
Definition ResourceView.hpp:17
A resource that was included in the executable.
Definition StaticResourceView.hpp:16
nonstd::span< std::byte const > bytes() const noexcept override
Get a span to the memory mapping.
Definition StaticResourceView.hpp:37
std::byte const * data() const noexcept override
Pointer to the memory mapping.
Definition StaticResourceView.hpp:35
size_t size() const noexcept override
Size of the memory mapping.
Definition StaticResourceView.hpp:33
std::string_view string_view() const noexcept override
Get a span to the memory mapping.
Definition StaticResourceView.hpp:39
size_t offset() const noexcept override
Offset into the resource file.
Definition StaticResourceView.hpp:31