16 std::vector<std::string> recent_projects;
17 recent_projects.reserve(obj.recent_projects.size());
18 for(
const auto& prj : obj.recent_projects)
20 recent_projects.emplace_back(prj.generic_string());
22 try_save(ar, ser20::make_nvp(
"recent_projects", recent_projects));
27 std::vector<std::string> recent_projects;
29 try_load(ar, ser20::make_nvp(
"recent_projects", recent_projects));
31 obj.recent_projects.reserve(recent_projects.size());
32 for(
const auto& prj : recent_projects)
34 obj.recent_projects.emplace_back(fs::path(prj));
40 entt::meta_factory<editor_settings::external_tools_settings>{}
41 .type(
"external_tools_settings"_hs)
47 .data<&editor_settings::external_tools_settings::vscode_executable>(
"vscode_executable"_hs)
58 try_save(ar, ser20::make_nvp(
"vscode_executable", obj.vscode_executable.generic_string()));
63 std::string vscode_executable;
64 if(
try_load(ar, ser20::make_nvp(
"vscode_executable", vscode_executable)))
66 obj.vscode_executable = vscode_executable;
72 entt::meta_factory<editor_settings::debugger_settings>{}
73 .type(
"debugger_settings"_hs)
79 .data<&editor_settings::debugger_settings::ip>(
"ip"_hs)
83 entt::attribute{
"tooltip",
"Ip address to await connections. Default(127.0.0.1)"},
85 .data<&editor_settings::debugger_settings::port>(
"port"_hs)
89 entt::attribute{
"tooltip",
"Port to await connections. Default (55555)"},
91 .data<&editor_settings::debugger_settings::loglevel>(
"loglevel"_hs)
100 try_save(ar, ser20::make_nvp(
"ip", obj.ip));
101 try_save(ar, ser20::make_nvp(
"port", obj.port));
102 try_save(ar, ser20::make_nvp(
"loglevel", obj.loglevel));
107 try_load(ar, ser20::make_nvp(
"ip", obj.ip));
108 try_load(ar, ser20::make_nvp(
"port", obj.port));
109 try_load(ar, ser20::make_nvp(
"loglevel", obj.loglevel));
114 entt::meta_factory<editor_settings>{}
115 .type(
"editor_settings"_hs)
121 .data<&editor_settings::debugger>(
"debugger"_hs)
127 .data<&editor_settings::external_tools>(
"external_tools"_hs)
137 try_save(ar, ser20::make_nvp(
"debugger", obj.debugger));
138 try_save(ar, ser20::make_nvp(
"external_tools", obj.external_tools));
139 try_save(ar, ser20::make_nvp(
"projects", obj.projects));
146 try_load(ar, ser20::make_nvp(
"debugger", obj.debugger));
147 try_load(ar, ser20::make_nvp(
"external_tools", obj.external_tools));
148 try_load(ar, ser20::make_nvp(
"projects", obj.projects));
155 std::ofstream stream(absolute_path);
161 try_save(ar, ser20::make_nvp(
"settings", obj));
163 catch(
const ser20::Exception& e)
172 std::ofstream stream(absolute_path, std::ios::binary);
178 try_save(ar, ser20::make_nvp(
"settings", obj));
180 catch(
const ser20::Exception& e)
189 std::ifstream stream(absolute_path);
195 return try_load(ar, ser20::make_nvp(
"settings", obj));
197 catch(
const ser20::Exception& e)
208 std::ifstream stream(absolute_path, std::ios::binary);
214 return try_load(ar, ser20::make_nvp(
"settings", obj));
216 catch(
const ser20::Exception& e)
#define APPLOG_WARNING(...)
attributes::value_type attribute
std::map< std::string, meta_any > attributes
auto create_oarchive_associative(std::ostream &stream)
BinaryInputArchive iarchive_binary_t
auto create_iarchive_associative(std::istream &stream)
simd::JSONOutputArchive oarchive_associative_t
BinaryOutputArchive oarchive_binary_t
simd::JSONInputArchive iarchive_associative_t
void save_to_file_bin(const std::string &absolute_path, const animation_clip &obj)
void load_from_file(const std::string &absolute_path, animation_clip &obj)
void save_to_file(const std::string &absolute_path, const animation_clip &obj)
void load_from_file_bin(const std::string &absolute_path, animation_clip &obj)
#define REFLECT_INLINE(cls)
#define SAVE_INSTANTIATE(cls, Archive)
auto try_save(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool
#define LOAD_INSTANTIATE(cls, Archive)
auto try_load(Archive &ar, ser20::NameValuePair< T > &&t, const hpp::source_location &loc=hpp::source_location::current()) -> bool