Lines Matching refs:root
57 cJSON *root = cJSON_Parse(content.c_str()); in JsonNode() local
58 if (root == nullptr || cJSON_IsInvalid(root)) { in JsonNode()
59 cJSON_Delete(root); in JsonNode()
64 Init(root, true); in JsonNode()
67 JsonNode::JsonNode(const cJSON *root, bool needDelete) in JsonNode() argument
69 if (root != nullptr && !cJSON_IsInvalid(root)) { in JsonNode()
70 Init(root, needDelete); in JsonNode()
78 void JsonNode::Init(const cJSON *root, bool needDelete) in Init() argument
80 if (auto it = GetJsonTypeMap().find(root->type); it != GetJsonTypeMap().end()) { in Init()
83 Parse(root); in Init()
85 cJSON_Delete(const_cast<cJSON *>(root)); in Init()
89 void JsonNode::Parse(const cJSON *root) in Parse() argument
97 cJSON_ArrayForEach(element, root) in Parse()
109 cJSON_ArrayForEach(element, root) in Parse()
119 innerObj_ = std::make_optional<int>(root->valueint); in Parse()
123 innerObj_ = std::make_optional<std::string>(root->valuestring); in Parse()
127 innerObj_ = std::make_optional<bool>(root->type == cJSON_True); in Parse()
136 if (root->string) { in Parse()
137 key_ = root->string; in Parse()