| 268 | } |
| 269 | |
| 270 | Guid 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 | |
| 292 | DateTime JsonTools::GetDate(const Value& value) |
| 293 | { |
nothing calls this directly
no test coverage detected