29 #ifndef YCL_MinGW32_INC_MinGW32_h_
30 #define YCL_MinGW32_INC_MinGW32_h_ 1
33 #include YFM_YCLib_Host
35 # error "This file is only for MinGW32."
52 inline namespace Windows
89 FormatMessage(ErrorCode) ynothrow;
97 # define YF_Raise_Win32Exception(...) \
99 const auto err(::GetLastError()); \
101 throw platform_ex::Windows::Win32Exception(err, __VA_ARGS__); \
130 inline PDefH(std::
string,
MBCSToMBCS, const std::
string& str,
131 int cp_src = CP_UTF8,
int cp_dst = CP_ACP)
132 ImplRet(Windows::MBCSToMBCS(str.c_str(), str.length(), cp_src, cp_dst))
135 WCSToMBCS(const
wchar_t*, std::
size_t,
int = CP_ACP);
136 inline PDefH(std::
string,
WCSToMBCS, const
wchar_t* str,
int cp = CP_ACP)
138 inline PDefH(std::
string, WCSToMBCS, const std::wstring& str,
int cp = CP_ACP)
139 ImplRet(Windows::WCSToMBCS(str.c_str(), str.length(), cp))
142 MBCSToWCS(const
char*, std::
size_t,
int = CP_ACP);
143 inline PDefH(std::wstring,
MBCSToWCS, const
char* str,
int cp = CP_ACP)
145 inline PDefH(std::wstring, MBCSToWCS, const std::
string& str,
int cp = CP_ACP)
146 ImplRet(Windows::MBCSToWCS(str.c_str(), str.length(), cp))
163 if(!::RegOpenKeyExW(h_parent, key, 0, KEY_READ, &h_key))
168 ::RegCloseKey(h_key);
std::wstring MBCSToWCS(const char *str, std::size_t len, int cp)
size_t ntctslen(const _tChar *s)
计算简单 NTCTS 长度。
DefGetter(const ynothrow,::HKEY, Key, h_key)}
YF_API std::string MBCSToMBCS(const char *, std::size_t, int=CP_UTF8, int=CP_ACP)
转换第一个 int 参数指定编码的字符串为第二个 int 参数指定的编码。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
GSStringTemplate< char >::basic_string string
#define YF_Raise_Win32Exception(...)
按 ::GetLastError 的结果和指定参数抛出 Windows::Win32Exception 对象。
std::string WCSToMBCS(const wchar_t *str, std::size_t len, int cp)
YF_API bool CheckWine()
判断是否在 Wine 环境下运行。
#define DefCvt(_q, _t,...)
RegisterKey(::HKEY h_parent, const wchar_t *key)
注册表键。
pair< std::type_index, StyleItem > Key
标识查找样式的键。