| 437 | } |
| 438 | |
| 439 | unsigned JSONValue::size() const { |
| 440 | if (isArrayType) { |
| 441 | std::cout << "Array size: " << arrayPtr->size() << std::endl; |
| 442 | return arrayPtr->size(); |
| 443 | } |
| 444 | if (isObjectType) { |
| 445 | std::cout << "Object size: " << objectPtr->size() << std::endl; |
| 446 | return objectPtr->size(); |
| 447 | } |
| 448 | |
| 449 | /* if (GetValueType() == JSON_ARRAY) { return (*arrayValue_)->size(); } |
| 450 | else if (GetValueType() == JSON_OBJECT) { return (*objectValue_)->size(); } */ |
| 451 | |
| 452 | return 0; |
| 453 | } |
| 454 | |
| 455 | JSONValue& JSONValue::operator [](const std::string& key) { |
| 456 | // Convert to object type |
no outgoing calls