mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 09:55:34 -05:00
deab672bc2
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>
21 lines
No EOL
442 B
C++
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;
|
|
}
|
|
} |