8#include "win32_error_intf.hpp"
11#include <system_error>
13hi_export_module(hikogui.win32 : winnls);
15hi_export
namespace hi {
inline namespace v1 {
17[[nodiscard]]
inline std::expected<std::string, win32_error> win32_GetUserDefaultLocaleName() noexcept
19 auto code = win32_error{};
22 name.resize_and_overwrite(LOCALE_NAME_MAX_LENGTH - 1, [&code](
wchar_t *p,
size_t count) {
23 if (
auto actual_count = ::GetUserDefaultLocaleName(p,
static_cast<int>(count + 1))) {
24 return actual_count - 1;
26 code = win32_GetLastError();
31 if (
static_cast<bool>(code)) {
Rules for working with win32 headers.
@ code
Text is a piece of programming-code; a variable name, a function name.
The HikoGUI namespace.
Definition array_generic.hpp:20
std::expected< std::string, win32_error > win32_WideCharToMultiByte(std::wstring_view s, unsigned int code_page=CP_UTF8, uint32_t flags=0) noexcept
Convert a win32-API compatible std::wstring to a multi-byte std::string.
Definition stringapiset.hpp:26
DOXYGEN BUG.
Definition algorithm_misc.hpp:20