mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-27 11:21:02 +08:00
partial
This commit is contained in:
parent
7956ccd61e
commit
9de2c2d84d
@ -395,6 +395,15 @@ Json::Value obj_value(Json::objectValue); // {}
|
||||
Value removeMember(const char* key);
|
||||
/// Same as removeMember(const char*)
|
||||
Value removeMember(const std::string& key);
|
||||
/** \brief Remove the indexed array element.
|
||||
|
||||
O(n) expensive operations.
|
||||
Update 'removed' iff removed.
|
||||
(This is a better pattern than removeMember().)
|
||||
JSON_FAIL if !isValidIndex(i) or if not arrayObject
|
||||
\return true iff removed
|
||||
*/
|
||||
bool removeIndex(ArrayIndex i, Value* removed);
|
||||
|
||||
/// Return true if the object has a member named key.
|
||||
bool isMember(const char* key) const;
|
||||
|
@ -1018,6 +1018,14 @@ Value Value::removeMember(const std::string& key) {
|
||||
return removeMember(key.c_str());
|
||||
}
|
||||
|
||||
bool Value::removeIndex(ArrayIndex i, Value* removed) {
|
||||
JSON_ASSERT_MESSAGE(this->type_ == arrayValue,
|
||||
"in Json::Value::removeIndex(): requires arrayValue");
|
||||
JSON_ASSERT_MESSAGE(this->isValidIndex(i),
|
||||
"invalid index i=" << i << " for array of size " << this->size());
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef JSON_USE_CPPTL
|
||||
Value Value::get(const CppTL::ConstString& key,
|
||||
const Value& defaultValue) const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user