7#include "../macros.hpp"
9#include <errhandlingapi.h>
10#include <system_error>
12hi_export_module(hikogui.win32 : win32_error_intf);
14hi_export
namespace hi {
inline namespace v1 {
16enum class win32_error : uint32_t {
17 success = ERROR_SUCCESS,
18 file_not_found = ERROR_FILE_NOT_FOUND,
19 more_data = ERROR_MORE_DATA,
20 invalid_data = ERROR_INVALID_DATA,
21 insufficient_buffer = ERROR_INSUFFICIENT_BUFFER,
22 status_pending = STATUS_PENDING,
23 not_supported = ERROR_NOT_SUPPORTED,
24 invalid_parameter = ERROR_INVALID_PARAMETER,
32hi_export
namespace hi {
inline namespace v1 {
35 char const *name()
const noexcept override
44 switch (
static_cast<hi::win32_error
>(code)) {
45 case hi::win32_error::file_not_found:
46 return condition == std::errc::no_such_file_or_directory;
47 case hi::win32_error::more_data:
48 return condition == std::errc::message_size;
49 case hi::win32_error::invalid_data:
50 return condition == std::errc::bad_message;
51 case hi::win32_error::status_pending:
52 return condition == std::errc::interrupted;
53 case hi::win32_error::insufficient_buffer:
54 return condition == std::errc::no_buffer_space;
55 case hi::win32_error::not_supported:
56 return condition == std::errc::not_supported;
57 case hi::win32_error::invalid_parameter:
58 return condition == std::errc::invalid_argument;
67[[nodiscard]]
inline std::error_code make_error_code(win32_error code)
noexcept
69 return {
static_cast<int>(code), global_win32_error_category};
72[[nodiscard]]
inline win32_error win32_GetLastError() noexcept
74 return static_cast<win32_error
>(::GetLastError());
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
Definition win32_error_intf.hpp:34