MCPcopy Create free account
hub / github.com/aixed/WeChat-Hook / StringToWString

Function StringToWString

src/tools.cpp:78–89  ·  view source on GitHub ↗

多字节字符串转宽字符字符串

Source from the content-addressed store, hash-verified

76
77// 多字节字符串转宽字符字符串
78std::wstring StringToWString(const std::string& str)
79{
80 if (str.empty())
81 return L"";
82
83 int size_needed = MultiByteToWideChar(CP_ACP, 0, &str[0], (int)str.size(),
84 NULL, 0);
85 std::wstring wstrTo(size_needed, 0);
86 MultiByteToWideChar(CP_ACP, 0, &str[0], (int)str.size(),
87 &wstrTo[0], size_needed);
88 return wstrTo;
89}
90
91// 辅助函数:从字符串中提取引号内的内容
92std::string ExtractQuotedString(const std::string& str, size_t start_pos)

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected