12#include "../container/container.hpp"
13#include "../utility/utility.hpp"
14#include "../macros.hpp"
24hi_export_module(hikogui.file.resource_view);
26hi_export
namespace hi {
inline namespace v1 {
34 [[nodiscard]]
virtual hi::const_void_span const_void_span()
const noexcept = 0;
43 resource_view_impl(T
const&
other) noexcept : _value(
other) {}
45 [[nodiscard]] hi::const_void_span const_void_span()
const noexcept override
47 return _value.const_void_span();
81 [[nodiscard]]
bool empty()
const noexcept
83 return _pimpl ==
nullptr;
86 explicit operator bool()
const noexcept
95 hi_assert_not_null(_pimpl);
96 return _pimpl->const_void_span();
102 static_assert(std::is_const_v<T>);
103 return as_span<T>(view.const_void_span());
106 [[nodiscard]]
friend std::string_view as_string_view(
const_resource_view const& view)
noexcept
108 return as_string_view(view.const_void_span());
111 [[nodiscard]]
friend bstring_view as_bstring_view(const_resource_view
const& view)
noexcept
113 return as_bstring_view(view.const_void_span());
117 std::shared_ptr<detail::resource_view_base> _pimpl;
Defines the file_view class.
@ other
The gui_event does not have associated data.
Definition gui_event_variant.hpp:24
The HikoGUI namespace.
Definition array_generic.hpp:21
The HikoGUI API version 1.
Definition array_generic.hpp:22
Map a file into virtual memory.
Definition file_view.hpp:41
Definition resource_view.hpp:30
A read-only view of a resource.
Definition resource_view.hpp:64
hi::const_void_span const_void_span() const noexcept
Get a span to the memory mapping.
Definition resource_view.hpp:93