8#include "../macros.hpp"
17hi_export_module(hikogui.win32.winreg);
19hi_export
namespace hi {
inline namespace v1 {
101 return wname.error();
130 if (
status == win32_error::success) {
158 DWORD result_type = 0;
161 if (
static_cast<bool>(
status)) {
165 return static_cast<uint32_t
>(
result);
191 auto status = win32_error{};
203 case win32_error::success:
205 case win32_error::more_data:
224[[
nodiscard]] hi_inline std::expected<std::vector<std::string>, win32_error>
246 case win32_error::success:
249 case win32_error::more_data:
281template<std::
integral T>
285 return static_cast<T
>(*tmp);
298[[
nodiscard]] hi_inline std::expected<std::vector<std::string>, win32_error>
Rules for working with win32 headers.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
std::expected< T, win32_error > win32_RegGetValue(HKEY key, std::string_view path, std::string_view name)=delete
Read from the registry value.
Definition winreg.hpp:282
hi_inline std::expected< std::vector< std::string >, win32_error > win32_MultiSZToStringVector(wchar_t const *first, wchar_t const *last) noexcept
Convert a win32 zero terminated list of zero terminated strings.
Definition base.hpp:153
hi_inline win32_error win32_RegSetKeyValue(HKEY key, std::string_view path, std::string_view name, uint32_t value)
Write a DWORD registry value.
Definition winreg.hpp:66
hi_inline win32_error win32_RegDeleteKeyValue(HKEY key, std::string_view path, std::string_view name) noexcept
Delete a registry value.
Definition winreg.hpp:27
hi_inline std::expected< std::wstring, win32_error > win32_MultiByteToWideChar(std::string_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 base.hpp:119
hi_inline std::expected< void, win32_error > win32_RegGetValue_void(HKEY key, std::string_view path, std::string_view name)
Check if a registry entry exists.
Definition winreg.hpp:117
hi_inline std::expected< std::vector< std::string >, win32_error > win32_RegGetValue_multi_string(HKEY key, std::string_view path, std::string_view name) noexcept
Read a list of strings from the registry value.
Definition winreg.hpp:225
hi_inline win32_error win32_RegDeleteKey(HKEY key, std::string_view path) noexcept
Delete all registry values and the last part of the subkey.
Definition winreg.hpp:47
hi_inline std::expected< uint32_t, win32_error > win32_RegGetValue_dword(HKEY key, std::string_view path, std::string_view name) noexcept
Read a DWORD registry value.
Definition winreg.hpp:144
hi_inline std::expected< std::string, win32_error > win32_RegGetValue_string(HKEY key, std::string_view path, std::string_view name) noexcept
Read a strings from the registry value.
Definition winreg.hpp:175
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
hi_inline 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 base.hpp:87