Lines Matching refs:root
57 cJSON *root = cJSON_Parse(content.c_str()); in JsonNode() local
58 if (root == nullptr || cJSON_IsInvalid(root)) { in JsonNode()
63 Init(root, true); in JsonNode()
66 JsonNode::JsonNode(const cJSON *root, bool needDelete) in JsonNode() argument
68 if (root != nullptr && !cJSON_IsInvalid(root)) { in JsonNode()
69 Init(root, needDelete); in JsonNode()
77 void JsonNode::Init(const cJSON *root, bool needDelete) in Init() argument
79 if (auto it = GetJsonTypeMap().find(root->type); it != GetJsonTypeMap().end()) { in Init()
82 Parse(root); in Init()
84 cJSON_Delete(const_cast<cJSON *>(root)); in Init()
88 void JsonNode::Parse(const cJSON *root) in Parse() argument
96 cJSON_ArrayForEach(element, root) in Parse()
108 cJSON_ArrayForEach(element, root) in Parse()
118 innerObj_ = std::make_optional<int>(root->valueint); in Parse()
122 innerObj_ = std::make_optional<std::string>(root->valuestring); in Parse()
126 innerObj_ = std::make_optional<bool>(root->type == cJSON_True); in Parse()
135 if (root->string) { in Parse()
136 key_ = root->string; in Parse()