| 472 | } |
| 473 | |
| 474 | std::unique_ptr<Object> CreateObjectFromJsonFile(const std::string& path, bool loadImages) |
| 475 | { |
| 476 | LOG_VERBOSE("CreateObjectFromJsonFile(\"%s\")", path.c_str()); |
| 477 | |
| 478 | try |
| 479 | { |
| 480 | json_t jRoot = Json::ReadFromFile(path.c_str()); |
| 481 | auto fileDataRetriever = FileSystemDataRetriever(Path::GetDirectory(path)); |
| 482 | return CreateObjectFromJson(jRoot, &fileDataRetriever, loadImages, path); |
| 483 | } |
| 484 | catch (const std::runtime_error& err) |
| 485 | { |
| 486 | Console::Error::WriteLine("Unable to open or read '%s': %s", path.c_str(), err.what()); |
| 487 | } |
| 488 | |
| 489 | return nullptr; |
| 490 | } |
| 491 | |
| 492 | static void ExtractSourceGames(const std::string& id, json_t& jRoot, Object& result) |
| 493 | { |
no test coverage detected