Toast Engine
Loading...
Searching...
No Matches
ui_element.hpp
Go to the documentation of this file.
1
8
9#pragma once
10#include <string>
11#include <string_view>
13#include <toast/export.hpp>
14
15namespace assets {
16
17class TOAST_API UIElement : public Asset {
18public:
19 explicit UIElement(std::vector<uint8_t> data) : m_source(reinterpret_cast<const char*>(data.data()), data.size()) { }
20
21 [[nodiscard]]
22 auto type() const -> std::string_view override {
23 return "ui_element";
24 }
25
26 [[nodiscard]]
27 auto source() const noexcept -> std::string_view {
28 return m_source;
29 }
30
31 void setSource(std::vector<uint8_t> data) { m_source.assign(reinterpret_cast<const char*>(data.data()), data.size()); }
32
33private:
34 std::string m_source;
35};
36
37}
Base types for the asset system.