geode/loader/include/Geode/loader/SettingJsonTest.hpp
matcool deab672bc2 json rewrite, use custom lib instead of nlohmann::json
This is in attempt to make compile times better, as the old json library
was quite slow to compile due to many template instantiations and such a
large header.

macOS tests have shown build times from 610s to ~390s, about a 1.5x
speedup

Co-authored-by: camila314 <47485054+camila314@users.noreply.github.com>
2023-01-27 21:14:26 -03:00

21 lines
No EOL
442 B
C++

#include "Setting.hpp"
#include <json.hpp>
namespace geode {
template<class T>
bool GeodeSettingValue<T>::load(json::Value const& json) {
try {
m_value = json.as<ValueType>();
return true;
}
catch (...) {
return false;
}
}
template<class T>
bool GeodeSettingValue<T>::save(json::Value& json) const {
json = m_value;
return true;
}
}