mysvac-jsonlib 2.1.1
一个轻量高校的C++17 JSON解析库
 
载入中...
搜索中...
未找到
Jsonlib 命名空间参考

class  JsonException
 Json专用异常基类类 更多...
 
class  JsonStructureException
 Json结构错误异常类 更多...
 
class  JsonTypeException
 Json类型错误异常类 更多...
 
class  JsonValue
 Json数据通用类 更多...
 

类型定义

using JsonObject = std::map< std::string, JsonValue >
 JsonObject类型
 
using JsonArray = std::vector< JsonValue >
 JsonArray类型
 

函数

static void json_escape_unicode (std::string &res, std::string_view str, std::string_view::const_iterator &it)
 内部函数,转义\u字符
 
static std::string json_escape_next (std::string_view str, std::string_view::const_iterator &it)
 内部函数,转义字符串且移动指针
 
static std::string json_reverse_escape (std::string_view str) noexcept
 内部函数,反转义字符串
 
static std::string json_escape (std::string_view str)
 内部函数,转义字符串
 
JsonValue deserialize (std::string_view str)
 反序列化函数
 

类型定义说明

◆ JsonArray

using Jsonlib::JsonArray = typedef std::vector<JsonValue>

JsonArray类型

注解
本质是 std::vector<JsonValue>

在文件 jsonlib.h102 行定义.

◆ JsonObject

using Jsonlib::JsonObject = typedef std::map<std::string,JsonValue>

JsonObject类型

注解
本质是 std::map<std::string,JsonValue>

在文件 jsonlib.h96 行定义.

函数说明

◆ deserialize()

JSONLIB_EXPORT JsonValue Jsonlib::deserialize ( std::string_view  str)

反序列化函数

参数
str需要反转义的原JSON字符串
注解
解析JSON数据统一使用此函数

在文件 jsonlib.cpp275 行定义.

◆ json_escape()

static std::string Jsonlib::json_escape ( std::string_view  str)
static

内部函数,转义字符串

在文件 jsonlib.cpp196 行定义.

◆ json_escape_next()

static std::string Jsonlib::json_escape_next ( std::string_view  str,
std::string_view::const_iterator &  it 
)
static

内部函数,转义字符串且移动指针

在文件 jsonlib.cpp89 行定义.

◆ json_escape_unicode()

static void Jsonlib::json_escape_unicode ( std::string &  res,
std::string_view  str,
std::string_view::const_iterator &  it 
)
static

内部函数,转义\u字符

在文件 jsonlib.cpp16 行定义.

◆ json_reverse_escape()

static std::string Jsonlib::json_reverse_escape ( std::string_view  str)
staticnoexcept

内部函数,反转义字符串

在文件 jsonlib.cpp157 行定义.