MCPcopy Create free account
hub / github.com/assimp/assimp / ReadBinaryDataArrayHead

Function ReadBinaryDataArrayHead

code/AssetLib/FBX/FBXParser.cpp:515–531  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ read the type code and element count of a binary data array and stop there

Source from the content-addressed store, hash-verified

513// ------------------------------------------------------------------------------------------------
514// read the type code and element count of a binary data array and stop there
515void 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// ------------------------------------------------------------------------------------------------

Callers 1

ParseVectorDataArrayFunction · 0.85

Calls 1

ParseErrorFunction · 0.85

Tested by

no test coverage detected