feat.初步完成跨平台移植的初始化部分

This commit is contained in:
MistEO
2021-12-25 17:48:20 +08:00
parent 077c8fa734
commit 8658395fee
30 changed files with 3774 additions and 3592 deletions

View File

@@ -1,27 +1,27 @@
#include "AbstractConfiger.h"
#include <meojson/json.h>
#include "AsstUtils.hpp"
bool asst::AbstractConfiger::load(const std::string& filename)
{
std::string content = utils::load_file_without_bom(filename);
auto&& ret = json::parser::parse(content);
if (!ret) {
m_last_error = "json pasing error " + content;
return false;
}
json::value root = std::move(ret.value());
try {
return parse(root);
}
catch (json::exception& e) {
m_last_error = std::string("json field error ") + e.what();
return false;
}
return true;
}
#include "AbstractConfiger.h"
#include <meojson/json.h>
#include "AsstUtils.hpp"
bool asst::AbstractConfiger::load(const std::string& filename)
{
std::string content = utils::load_file_without_bom(filename);
auto&& ret = json::parser::parse(content);
if (!ret) {
m_last_error = "json pasing error, content:" + content;
return false;
}
json::value root = std::move(ret.value());
try {
return parse(root);
}
catch (json::exception& e) {
m_last_error = std::string("json field error ") + e.what();
return false;
}
return true;
}