diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-18 00:11:25 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-10-18 00:24:13 +0300 |
commit | 3eec1310829f6ec7f3c40a35d5991b0ebbf273b5 (patch) | |
tree | ce8257ca7e35f0471bbc1fd67acd8a1c75969ec9 /include/winapi/resource.hpp | |
parent | process_tests: add stdin redirection test (diff) | |
download | winapi-common-3eec1310829f6ec7f3c40a35d5991b0ebbf273b5.tar.gz winapi-common-3eec1310829f6ec7f3c40a35d5991b0ebbf273b5.zip |
Process: add methods to load resource strings
Diffstat (limited to '')
-rw-r--r-- | include/winapi/resource.hpp | 27 |
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 |