json::JObject added method putArray
This commit is contained in:
parent
c8a283c645
commit
647662b0d3
@ -295,6 +295,12 @@ JObject& JObject::put(string key, bool value){
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JArray& JObject::putArray(std::string key) {
|
||||||
|
JArray* arr = new JArray();
|
||||||
|
put(key, arr);
|
||||||
|
return *arr;
|
||||||
|
}
|
||||||
|
|
||||||
bool JObject::has(string key) {
|
bool JObject::has(string key) {
|
||||||
return map.find(key) != map.end();
|
return map.find(key) != map.end();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,6 +87,7 @@ namespace json {
|
|||||||
JObject& put(std::string key, JObject* value);
|
JObject& put(std::string key, JObject* value);
|
||||||
JObject& put(std::string key, JArray* value);
|
JObject& put(std::string key, JArray* value);
|
||||||
JObject& put(std::string key, bool value);
|
JObject& put(std::string key, bool value);
|
||||||
|
JArray& putArray(std::string key);
|
||||||
|
|
||||||
bool has(std::string key);
|
bool has(std::string key);
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user