aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/winapi/resource.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/winapi/resource.hpp')
-rw-r--r--include/winapi/resource.hpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/winapi/resource.hpp b/include/winapi/resource.hpp
new file mode 100644
index 0000000..2f77d3e
--- /dev/null
+++ b/include/winapi/resource.hpp
@@ -0,0 +1,27 @@
+// Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com>
+// This file is part of the "winapi-common" project.
+// For details, see https://github.com/egor-tensin/winapi-common.
+// Distributed under the MIT License.
+
+#pragma once
+
+#include "buffer.hpp"
+
+#include <cstddef>
+
+namespace winapi {
+
+struct Resource {
+ // This is just a pointer to static data.
+
+ Resource() = default;
+
+ Resource(const void* data, std::size_t nb) : data{data}, nb{nb} {}
+
+ Buffer copy() const { return {data, nb}; }
+
+ const void* data = nullptr;
+ std::size_t nb = 0;
+};
+
+} // namespace winapi