------------------------------------------------------------------------------------------------ read the type code and element count of a binary data array and stop there
| 513 | // ------------------------------------------------------------------------------------------------ |
| 514 | // read the type code and element count of a binary data array and stop there |
| 515 | void ReadBinaryDataArrayHead(const char*& data, const char* end, char& type, uint32_t& count, |
| 516 | const Element& el) |
| 517 | { |
| 518 | if (static_cast<size_t>(end-data) < 5) { |
| 519 | ParseError("binary data array is too short, need five (5) bytes for type signature and element count",&el); |
| 520 | } |
| 521 | |
| 522 | // data type |
| 523 | type = *data; |
| 524 | |
| 525 | // read number of elements |
| 526 | BE_NCONST uint32_t len = SafeParse<uint32_t>(data+1, end); |
| 527 | AI_SWAP4(len); |
| 528 | |
| 529 | count = len; |
| 530 | data += 5; |
| 531 | } |
| 532 | |
| 533 | |
| 534 | // ------------------------------------------------------------------------------------------------ |
no test coverage detected