|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
JSON 序列化器 更多...
#include <json_serializer.hpp>
静态 Public 成员函数 | |
| static unique_ptr< json_value > | serialize (const reflect::meta_any &obj, const serialize_context &ctx={}) |
| 将反射对象序列化为 JSON 值树 | |
| static string | to_string (const reflect::meta_any &obj, const serialize_context &ctx={}) |
| 将反射对象序列化为 JSON 字符串 | |
| static reflect::meta_any | deserialize (const json_value &value, const reflect::meta_type &type, const serialize_context &ctx={}) |
| 从 JSON 值树反序列化对象 | |
| static reflect::meta_any | from_string (const string &json_str, const reflect::meta_type &type, const serialize_context &ctx={}) |
| 从 JSON 字符串反序列化对象 | |
JSON 序列化器
将反射注册的对象转换为 JSON 表示,或从 JSON 重建对象。 自动遍历 meta_type 的属性列表,跳过暂态属性。
在文件 json_serializer.hpp 第 30 行定义.
|
static |
从 JSON 值树反序列化对象
| value | JSON 值树 |
| type | 目标类型元数据 |
| ctx | 序列化上下文 |
|
static |
从 JSON 字符串反序列化对象
| json_str | JSON 字符串 |
| type | 目标类型元数据 |
| ctx | 序列化上下文 |
|
static |
将反射对象序列化为 JSON 值树
| obj | 要序列化的对象 |
| ctx | 序列化上下文 |
|
static |
将反射对象序列化为 JSON 字符串
| obj | 要序列化的对象 |
| ctx | 序列化上下文 |