MCPcopy Create free account
hub / github.com/FastFlowLM/FastFlowLM / wstring_to_string

Function wstring_to_string

src/include/utils/wmi_helper.hpp:203–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203inline std::string wstring_to_string(const std::wstring& wstr) {
204 if (wstr.empty()) return std::string();
205
206 int size_needed = WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(), NULL, 0, NULL, NULL);
207 std::string strTo(size_needed, 0);
208 WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(), &strTo[0], size_needed, NULL, NULL);
209 return strTo;
210}
211
212inline std::string get_property_string(IWbemClassObject* pObj, const std::wstring& prop_name) {
213 VARIANT vtProp;

Callers 1

get_property_stringFunction · 0.85

Calls 3

emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected