| 384 | //========================================================================== |
| 385 | |
| 386 | bool FSerializer::BeginArray(const char *name) |
| 387 | { |
| 388 | if (isWriting()) |
| 389 | { |
| 390 | WriteKey(name); |
| 391 | w->StartArray(); |
| 392 | w->mInObject.Push(false); |
| 393 | } |
| 394 | else |
| 395 | { |
| 396 | auto val = r->FindKey(name); |
| 397 | if (val != nullptr) |
| 398 | { |
| 399 | assert(val->IsArray()); |
| 400 | if (val->IsArray()) |
| 401 | { |
| 402 | r->mObjects.Push(FJSONObject(val)); |
| 403 | } |
| 404 | else |
| 405 | { |
| 406 | Printf(TEXTCOLOR_RED "Array expected for '%s'\n", name); |
| 407 | mErrors++; |
| 408 | return false; |
| 409 | } |
| 410 | } |
| 411 | else |
| 412 | { |
| 413 | return false; |
| 414 | } |
| 415 | } |
| 416 | return true; |
| 417 | } |
| 418 | |
| 419 | //========================================================================== |
| 420 | // |
no test coverage detected