| 346 | } |
| 347 | |
| 348 | bool DebugVisualizers::Load(const StringImpl& fileNamesStr) |
| 349 | { |
| 350 | bool hasError = !mErrorString.IsEmpty(); |
| 351 | mErrorString.Clear(); |
| 352 | |
| 353 | Array<String> fileNames; |
| 354 | int startIdx = 0; |
| 355 | while (true) |
| 356 | { |
| 357 | int crPos = (int)fileNamesStr.IndexOf('\n', startIdx); |
| 358 | if (crPos == -1) |
| 359 | { |
| 360 | fileNames.Add(fileNamesStr.Substring(startIdx)); |
| 361 | break; |
| 362 | } |
| 363 | |
| 364 | fileNames.Add(fileNamesStr.Substring(startIdx, crPos - startIdx)); |
| 365 | startIdx = crPos + 1; |
| 366 | } |
| 367 | |
| 368 | HashContext hashCtx; |
| 369 | for (auto fileName : fileNames) |
| 370 | { |
| 371 | hashCtx.MixinStr(fileName); |
| 372 | BfpTimeStamp lastWrite = BfpFile_GetTime_LastWrite(fileName.c_str()); |
| 373 | if (lastWrite == 0) |
| 374 | { |
| 375 | Fail(StrFormat("Failed to load debug visualizer file %s", fileName.c_str())); |
| 376 | } |
| 377 | hashCtx.Mixin(lastWrite); |
| 378 | } |
| 379 | |
| 380 | Val128 hash = hashCtx.Finish128(); |
| 381 | if ((hash == mHash) && (!hasError)) |
| 382 | return true; |
| 383 | mHash = hash; |
| 384 | |
| 385 | mDebugVisualizers.Clear(); |
| 386 | bool success = true; |
| 387 | for (auto fileName : fileNames) |
| 388 | { |
| 389 | mCurFileName = fileName; |
| 390 | if (!ReadFileTOML(fileName)) |
| 391 | success = false; |
| 392 | mCurFileName.Clear(); |
| 393 | } |
| 394 | return success; |
| 395 | } |
| 396 | |
| 397 | DebugVisualizerEntry* DebugVisualizers::FindEntryForType(const StringImpl& typeName, DbgFlavor wantFlavor, Array<String>* wildcardCaptures) |
| 398 | { |
no test coverage detected