MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetGuid

Method GetGuid

Source/Engine/Serialization/JsonTools.cpp:270–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270Guid JsonTools::GetGuid(const Value& value)
271{
272 if (!value.IsString() || value.GetStringLength() != 32)
273 return Guid::Empty;
274
275 // Split
276 const char* a = value.GetString();
277 const char* b = a + 8;
278 const char* c = b + 8;
279 const char* d = c + 8;
280
281 // Parse
282 Guid result;
283 bool failed = StringUtils::ParseHex(a, 8, &result.A);
284 failed |= StringUtils::ParseHex(b, 8, &result.B);
285 failed |= StringUtils::ParseHex(c, 8, &result.C);
286 failed |= StringUtils::ParseHex(d, 8, &result.D);
287 if (failed)
288 return Guid::Empty;
289 return result;
290}
291
292DateTime JsonTools::GetDate(const Value& value)
293{

Callers

nothing calls this directly

Calls 3

ParseHexFunction · 0.85
GetStringLengthMethod · 0.45
GetStringMethod · 0.45

Tested by

no test coverage detected