iguana icon indicating copy to clipboard operation
iguana copied to clipboard

universal serialization engine

Results 67 iguana issues
Sort by recently updated
recently updated
newest added

struct ca{ std::string c_id; std::string ca_id; std::string c_name; float pan; // =0.0; float tilt; float zoom; } REFLECTION(ca, c_id,ca_id, c_name, pan, tilt , zoom) 执行完上面的定义后,在一个执行函数中定义这个ca类 ca tb_ca; 发现成员变量的值 tb_ca.pan 不为接近于0的一个数,而为一个正的有意义的值。...

我在尝试使用这个库时遇到一些问题,对于json字符串的解析,没有安全检查,比如某个字段类型不正确,不存在,iguana::json::from_json0()会仍然返回true,并且在对象中使用不正确的值. 举个例子: struct test { std::string username; std::string password; long long id; bool error; }; REFLECTION(test, username, password, id, error); int main(void) { test test1; std::string str1 = "{\"username1\":\"test\",\"password\":\"test\",\"id\": 10.1,...

对于自定义的类,序列化代码已经很少了,不错 1)流能支持 std::stringstream吗? 2)类外定义,可以放到类内定义,这样也许可以少些一个类名。 struct one_t { int id; }; REFLECTION(one_t, id); 能不能够改为: struct one_t { int id; REFLECTIONINNER( id); }; 3)private/protect可以支持吗? 4)编译性能的benchmark。

以“六年级-三班-某学生”为例,学生由结构体转换为json字符,作为班级的成员; 班级由结构体转换为json字符,作为年级的成员; 由年级json字符无法解析出classParm成员变量,解析出的结构只有"{" ``` #include "mainwindow.h" #include #include #include "../iguana/iguana/json.hpp" // 六年级-三班-某学生 struct Person { std::string name; int age; }; REFLECTION(Person, name, age); struct Class { int classID; std::string personParm;...

结构体数组怎么支持啊 c类型的 谢谢大佬

/root/source/vcpkg/installed/x64-linux/include/iguana/json.hpp:1213:13: error: variable of non-literal type 'iguana::json::reader_t' cannot be defined in a constexpr function reader_t rd(buf, len);

```c++ #include "stdafx.h" #include "iguana\json.hpp" #include struct struct_A { int aa[2]; }; REFLECTION(struct_A, aa) int main() { struct_A A = { {1,2} }; iguana::string_stream ss; iguana::json::to_json(ss, A); auto json_s =...

`template void set_field_value(T& to_obj, std::string_view to_field_name, const V& from_v) { using M = decltype(iguana_reflect_members(to_obj)); auto tp = M::apply_impl(); constexpr auto Size = M::value(); auto index = iguana::get_index(to_field_name); tuple_switch(index, tp, [&](auto&...

这样导致一次调用from_json失败后,其后反序列化为顺序容器时,即使数据正常,from_json也可能失败。