JSONVar JSONVar::keys() const
{
if (!cJSON_IsObject(_json)) {
return JSONVar(NULL, NULL);
}
int length = cJSON_GetArraySize(_json);
const char* keys[length];
cJSON* child = _json->child;
for (int i = 0; i < length; i++, child = child->next) {
keys[i] = child->string;
}
return JSONVar(cJSON_CreateStringArray(keys, length), NULL);
}