|
| template<typename ... TARGS> |
| static bool | pop (ncjson &ajson, const std::array< const char *, sizeof...(TARGS)> &akeys, TARGS &... aargs) |
| | 从ncjson文档批量读取多个字段。
|
| template<typename ... TARGS> |
| static bool | pop (rapidjson::Value &ajson, const std::array< const char *, sizeof...(TARGS)> &akeys, TARGS &... aargs) |
| | 从rapidjson::Value批量读取多个字段。
|
| template<typename ... TARGS> |
| static bool | push (ncjson &ajson, const std::array< const char *, sizeof...(TARGS)> &akeys, const TARGS &... aargs) |
| | 向ncjson文档批量写入多个字段。
|
| template<typename ... TARGS> |
| static bool | push (rapidjson::Value &ajson, rapidjson::Document::AllocatorType *aallocator, const std::array< const char *, sizeof...(TARGS)> &akeys, const TARGS &... aargs) |
| | 向rapidjson::Value批量写入多个字段。
|
可变参数JSON批量读写前端。
将并行的字段名数组映射到对应的值,利用折叠表达式实现批量序列化/反序列化。 支持从ncjson文档或rapidjson::Value中读写。
int id; std::string name;
njson::pop(doc, {"id", "name"}, id, name);