| 37 | namespace PIME { |
| 38 | |
| 39 | static std::string uuidToString(const UUID& uuid) { |
| 40 | std::string result; |
| 41 | LPOLESTR buf = nullptr; |
| 42 | if (SUCCEEDED(::StringFromCLSID(uuid, &buf))) { |
| 43 | result = utf16ToUtf8(buf); |
| 44 | ::CoTaskMemFree(buf); |
| 45 | // convert GUID to lwoer case |
| 46 | transform(result.begin(), result.end(), result.begin(), tolower); |
| 47 | } |
| 48 | return result; |
| 49 | } |
| 50 | |
| 51 | bool uuidFromString(const char* uuidStr, UUID& result) { |
| 52 | std::wstring utf16UuidStr = utf8ToUtf16(uuidStr); |
no test coverage detected