| 2364 | bool Value::operator!() const { return isNull(); } |
| 2365 | |
| 2366 | void Value::clear() { |
| 2367 | JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue || |
| 2368 | type_ == objectValue, |
| 2369 | "in Json::Value::clear(): requires complex value"); |
| 2370 | start_ = 0; |
| 2371 | limit_ = 0; |
| 2372 | switch (type_) { |
| 2373 | #ifndef JSON_VALUE_USE_INTERNAL_MAP |
| 2374 | case arrayValue: |
| 2375 | case objectValue: |
| 2376 | value_.map_->clear(); |
| 2377 | break; |
| 2378 | #else |
| 2379 | case arrayValue: |
| 2380 | value_.array_->clear(); |
| 2381 | break; |
| 2382 | case objectValue: |
| 2383 | value_.map_->clear(); |
| 2384 | break; |
| 2385 | #endif |
| 2386 | default: |
| 2387 | break; |
| 2388 | } |
| 2389 | } |
| 2390 | |
| 2391 | void Value::resize(ArrayIndex newSize) { |
| 2392 | JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue, |
no outgoing calls