| 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 | { |