MCPcopy Create free account
hub / github.com/NodeRT/NodeRT / StrToGuid

Function StrToGuid

src/NodeRTLib/ProjectFiles/NodeRtUtils.cpp:341–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341bool StrToGuid(Local<Value> value, LPCLSID guid) {
342 if (value.IsEmpty() || !value->IsString()) {
343 return false;
344 }
345
346 v8::String::Value stringVal(value);
347 std::wstring guidStr(L"{");
348 guidStr += StringToWchar(stringVal);
349 guidStr += L"}";
350
351 HRESULT hr = CLSIDFromString(guidStr.c_str(), guid);
352 if (FAILED(hr)) {
353 return false;
354 }
355
356 return true;
357}
358
359bool IsGuid(Local<Value> value) {
360 GUID guid;

Callers 2

IsGuidFunction · 0.85
GuidFromJsFunction · 0.85

Calls 1

StringToWcharFunction · 0.85

Tested by

no test coverage detected