| 1317 | #endif |
| 1318 | |
| 1319 | bool Value::removeMember(const char* begin, const char* end, Value* removed) { |
| 1320 | if (type() != objectValue) { |
| 1321 | return false; |
| 1322 | } |
| 1323 | CZString actualKey(begin, static_cast<unsigned>(end - begin), CZString::noDuplication); |
| 1324 | auto it = value_.map_->find(actualKey); |
| 1325 | if (it == value_.map_->end()) |
| 1326 | return false; |
| 1327 | if (removed) |
| 1328 | *removed = std::move(it->second); |
| 1329 | value_.map_->erase(it); |
| 1330 | return true; |
| 1331 | } |
| 1332 | #ifdef JSONCPP_HAS_STRING_VIEW |
| 1333 | bool Value::removeMember(std::string_view key, Value* removed) { |
| 1334 | return removeMember(key.data(), key.data() + key.length(), removed); |