feat(reflect-cpp): Switched from glaze -> reflect cpp
A bug was discovered in glaze which prevented valid toml output. We have switched to toml++ and reflect-cpp. The interface has remained the same so this should not break any code
This commit is contained in:
31
build-config/reflect-cpp/include/rfl/json/save.hpp
Normal file
31
build-config/reflect-cpp/include/rfl/json/save.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef RFL_JSON_SAVE_HPP_
|
||||
#define RFL_JSON_SAVE_HPP_
|
||||
|
||||
#if __has_include(<yyjson.h>)
|
||||
#include <yyjson.h>
|
||||
#else
|
||||
#include "../thirdparty/yyjson.h"
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../Result.hpp"
|
||||
#include "../io/save_string.hpp"
|
||||
#include "write.hpp"
|
||||
|
||||
namespace rfl {
|
||||
namespace json {
|
||||
|
||||
template <class... Ps>
|
||||
Result<Nothing> save(const std::string& _fname, const auto& _obj,
|
||||
const yyjson_write_flag _flag = 0) {
|
||||
const auto write_func = [_flag](const auto& _obj_ref, auto& _stream) -> auto& {
|
||||
return write<Ps...>(_obj_ref, _stream, _flag);
|
||||
};
|
||||
return rfl::io::save_string(_fname, _obj, write_func);
|
||||
}
|
||||
|
||||
} // namespace json
|
||||
} // namespace rfl
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user