MCPcopy Create free account
hub / github.com/GPUOpen-Tools/GPU-Reshape / ToString

Method ToString

Source/Libraries/Common/Source/GlobalUID.cpp:108–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108std::string GlobalUID::ToString() const {
109#ifdef GRS_WINDOWS
110 GUID guid;
111 std::memcpy(&guid, uuid, sizeof(guid));
112
113 // To string (wchar_t)
114 OLECHAR *guidString;
115 StringFromCLSID(guid, &guidString);
116
117 // Get the converted length
118 int32_t wideLength = static_cast<int32_t>(std::wcslen(guidString));
119
120 // Get the UTF8 length
121 int32_t length = WideCharToMultiByte(CP_UTF8, 0, guidString, wideLength, nullptr, 0, nullptr, nullptr);
122
123 // To UTF8
124 std::string str(length, 0);
125 WideCharToMultiByte(CP_UTF8, 0, guidString, wideLength, &str[0], length, nullptr, nullptr);
126
127 // OK
128 CoTaskMemFree(guidString);
129 return str;
130#else
131# error Not implemented
132#endif
133}
134
135GlobalUID GlobalUID::FromPlatformGUID(const GUID &value) {
136 GlobalUID uid;

Callers 15

AllocatePathMethod · 0.80
SpvModuleMethod · 0.80
AllocatePathMethod · 0.80
DXBCModuleMethod · 0.80
BootstrapLayerFunction · 0.80
DeferredInitializationFunction · 0.80
mainFunction · 0.80
OnDiscoveryMethod · 0.80
ComputeMethod · 0.80
WriteEnvironmentMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected