mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
vjson: Add simple accessors for getting arrays and dicts
This commit is contained in:
1 parent
ab96a3fc70
commit
9d158fcf2d
1 file changed
+7
-1
+7
-1
@@ -41,6 +41,12 @@ struct json_value
|
||||
int numSiblings() const; // num siblings *after* this one only
|
||||
const json_value *get(const char *child_name) const;
|
||||
const json_value *get(const char *child_name, json_type type) const;
|
||||
const json_value *getArray(const char *child_name) const {
|
||||
return get(child_name, JSON_ARRAY);
|
||||
}
|
||||
const json_value *getDict(const char *child_name) const {
|
||||
return get(child_name, JSON_OBJECT);
|
||||
}
|
||||
const char *getString(const char *child_name) const;
|
||||
const char *getString(const char *child_name, const char *default_value) const;
|
||||
bool getStringVector(std::vector<std::string> *vec) const;
|
||||
@@ -50,7 +56,7 @@ struct json_value
|
||||
int getInt(const char *child_name, int default_value) const;
|
||||
bool getBool(const char *child_name) const;
|
||||
bool getBool(const char *child_name, bool default_value) const;
|
||||
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(json_value);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user