mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-12 10:03:51 +01:00
Fixup Json::Value append methods, run clang format. (#1022)
This commit is contained in:
parent
00b979f086
commit
d448610770
@ -1155,10 +1155,14 @@ Value const& Value::operator[](CppTL::ConstString const& key) const {
|
||||
}
|
||||
#endif
|
||||
|
||||
Value& Value::append(const Value& value) { return (*this)[size()] = value; }
|
||||
|
||||
Value& Value::append(const Value& value) { return append(Value(value)); }
|
||||
Value& Value::append(Value&& value) {
|
||||
return (*this)[size()] = std::move(value);
|
||||
JSON_ASSERT_MESSAGE(type() == nullValue || type() == arrayValue,
|
||||
"in Json::Value::append: requires arrayValue");
|
||||
if (type() == nullValue) {
|
||||
*this = Value(arrayValue);
|
||||
}
|
||||
return this->value_.map_->emplace(size(), std::move(value)).first->second;
|
||||
}
|
||||
|
||||
Value Value::get(char const* begin,
|
||||
|
Loading…
Reference in New Issue
Block a user