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;
45 [[nodiscard]] hi::const_void_span const_void_span()
const noexcept override
47 return _value.const_void_span();
77 } : _pimpl(
std::make_shared<detail::resource_view_impl<std::decay_t<T>>>(std::forward<T>(view))) {}
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());
Defines the file_view class.
@ other
The gui_event does not have associated data.
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
Map a file into virtual memory.
Definition file_view.hpp:39
Definition resource_view.hpp:30
Definition resource_view.hpp:38
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