mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-19 00:31:39 +00:00
InputCommon / VideoCommon: update to use new JsonFromFile function
This commit is contained in:
parent
e92f59e2d4
commit
50b95bbea9
4 changed files with 29 additions and 73 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "Common/CommonPaths.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/IniFile.h"
|
||||
#include "Common/JsonUtil.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
|
@ -23,18 +24,9 @@ namespace InputCommon::DynamicInputTextures
|
|||
{
|
||||
Configuration::Configuration(const std::string& json_path)
|
||||
{
|
||||
std::string json_data;
|
||||
if (!File::ReadFileToString(json_path, json_data))
|
||||
{
|
||||
ERROR_LOG_FMT(VIDEO, "Failed to load dynamic input json file '{}'", json_path);
|
||||
m_valid = false;
|
||||
return;
|
||||
}
|
||||
|
||||
picojson::value root;
|
||||
const auto error = picojson::parse(root, json_data);
|
||||
|
||||
if (!error.empty())
|
||||
std::string error;
|
||||
if (!JsonFromFile(json_path, &root, &error))
|
||||
{
|
||||
ERROR_LOG_FMT(VIDEO, "Failed to load dynamic input json file '{}' due to parse error: {}",
|
||||
json_path, error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue