Missed a few replacements of content.find

This commit is contained in:
IceCryptonym 2020-03-24 19:04:44 +10:00
parent 5122206d83
commit 7baa77ef7e
2 changed files with 4 additions and 4 deletions

View File

@ -18,9 +18,9 @@ CProject* CProject::fromFile (const irr::io::path& filename)
{ {
json content = json::parse (WallpaperEngine::FileSystem::loadFullFile (filename)); json content = json::parse (WallpaperEngine::FileSystem::loadFullFile (filename));
auto title = jsonFindValueRequired (&content, "title", "Project title missing"); auto title = jsonFindRequired (&content, "title", "Project title missing");
auto type = jsonFindValueRequired (&content, "title", "Project type missing"); auto type = jsonFindRequired (&content, "title", "Project type missing");
auto file = jsonFindValueRequired (&content, "title", "Project's main file missing"); auto file = jsonFindRequired (&content, "title", "Project's main file missing");
auto general = content.find ("general"); auto general = content.find ("general");
CProject* project = new CProject ( CProject* project = new CProject (

View File

@ -60,7 +60,7 @@ irr::video::SColor Core::atoSColor (const std::string& str)
return Core::atoSColor (str.c_str ()); return Core::atoSColor (str.c_str ());
} }
nlohmann::detail::iter_impl<nlohmann::json> jsonFindRequired (nlohmann::json *data, const char *key, const char *notFoundMsg) nlohmann::detail::iter_impl<nlohmann::json> Core::jsonFindRequired (nlohmann::json *data, const char *key, const char *notFoundMsg)
{ {
auto value = data->find (key); auto value = data->find (key);
if (value == data->end ()) if (value == data->end ())