gamedb: move away from deprecated `ryml::parse` func

This commit is contained in:
Tyler Wilding 2022-02-17 23:07:01 -05:00 committed by refractionpcsx2
parent 8d498b564d
commit 624dff1b96
1 changed files with 2 additions and 3 deletions

View File

@ -465,15 +465,14 @@ void GameDatabase::initDatabase()
}); });
try try
{ {
std::optional<std::vector<u8>> buf(Host::ReadResourceFile(GAMEDB_YAML_FILE_NAME)); auto buf = Host::ReadResourceFileToString(GAMEDB_YAML_FILE_NAME);
if (!buf.has_value()) if (!buf.has_value())
{ {
Console.Error("[GameDB] Unable to open GameDB file, file does not exist."); Console.Error("[GameDB] Unable to open GameDB file, file does not exist.");
return; return;
} }
const ryml::substr view = c4::basic_substring<char>(reinterpret_cast<char*>(buf->data()), buf->size()); ryml::Tree tree = ryml::parse_in_arena(c4::to_csubstr(buf.value()));
ryml::Tree tree = ryml::parse(view);
ryml::NodeRef root = tree.rootref(); ryml::NodeRef root = tree.rootref();
for (const ryml::NodeRef& n : root.children()) for (const ryml::NodeRef& n : root.children())