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

Function checkTokenCount

code/AssetLib/FBX/FBXProperties.cpp:65–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63namespace {
64
65 void checkTokenCount(const TokenList &tok, unsigned int expectedCount) {
66 ai_assert(expectedCount >= 2);
67 if (tok.size() < expectedCount) {
68 const std::string &s = ParseTokenAsString(*tok[1]);
69 if (tok[1]->IsBinary()) {
70 throw DeadlyImportError("Not enough tokens for property of type ", s, " at offset ", tok[1]->Offset());
71 } else {
72 throw DeadlyImportError("Not enough tokens for property of type ", s, " at line ", tok[1]->Line());
73 }
74 }
75}
76
77// ------------------------------------------------------------------------------------------------
78// read a typed property out of a FBX element. The return value is nullptr if the property cannot be read.

Callers 1

ReadTypedPropertyFunction · 0.85

Calls 6

ParseTokenAsStringFunction · 0.85
DeadlyImportErrorFunction · 0.85
sizeMethod · 0.45
IsBinaryMethod · 0.45
OffsetMethod · 0.45
LineMethod · 0.45

Tested by

no test coverage detected