6 #include "aloptional.h"
9 #define WIN32_LEAN_AND_MEAN
13 inline std::string
wstr_to_utf8(const WCHAR
*wstr
)
17 int len
= WideCharToMultiByte(CP_UTF8
, 0, wstr
, -1, nullptr, 0, nullptr, nullptr);
21 WideCharToMultiByte(CP_UTF8
, 0, wstr
, -1, &ret
[0], len
, nullptr, nullptr);
28 inline std::wstring
utf8_to_wstr(const char *str
)
32 int len
= MultiByteToWideChar(CP_UTF8
, 0, str
, -1, nullptr, 0);
36 MultiByteToWideChar(CP_UTF8
, 0, str
, -1, &ret
[0], len
);
47 al::optional
<std::string
> getenv(const char *envname
);
49 al::optional
<std::wstring
> getenv(const WCHAR
*envname
);
54 #endif /* AL_STRUTILS_H */