MCPcopy Create free account
hub / github.com/crownengine/crown / try_parse

Function try_parse

src/core/guid.cpp:73–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 bool try_parse(Guid &guid, const char *str)
74 {
75 CE_ENSURE(NULL != str);
76 u32 a, b, c, d, e, f;
77 int num = sscanf(str, "%8x-%4x-%4x-%4x-%4x%8x", &a, &b, &c, &d, &e, &f);
78 guid.data1 = u64(a) << 32;
79 guid.data1 |= u64(b) << 16;
80 guid.data1 |= u64(c) << 0;
81 guid.data2 = u64(d) << 48;
82 guid.data2 |= u64(e) << 32;
83 guid.data2 |= u64(f) << 0;
84 return num == 6;
85 }
86
87 const char *to_string(char *buf, u32 len, const Guid &guid)
88 {

Callers 2

parseFunction · 0.85
test_guidFunction · 0.85

Calls 1

sscanfFunction · 0.85

Tested by 1

test_guidFunction · 0.68