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

Method ParseHeader

code/AssetLib/MD5/MD5Parser.cpp:106–133  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Parse and validate the MD5 header

Source from the content-addressed store, hash-verified

104// ------------------------------------------------------------------------------------------------
105// Parse and validate the MD5 header
106void MD5Parser::ParseHeader() {
107 // parse and validate the file version
108 SkipSpaces();
109 if (!TokenMatch(buffer, "MD5Version", 10)) {
110 ReportError("Invalid MD5 file: MD5Version tag has not been found");
111 }
112 SkipSpaces();
113 unsigned int iVer = ::strtoul10(buffer, (const char **)&buffer);
114 if (10 != iVer) {
115 ReportError("MD5 version tag is unknown (10 is expected)");
116 }
117 SkipLine();
118
119 // print the command line options to the console
120 char *sz = buffer;
121 while (buffer < bufferEnd) {
122 if (IsLineEnd(*buffer++)) {
123 break;
124 }
125 }
126
127 if (buffer == bufferEnd) {
128 return;
129 }
130
131 ASSIMP_LOG_INFO(std::string(sz, std::min((uintptr_t)MAX_LOG_MESSAGE_LENGTH, (uintptr_t)(buffer - sz))));
132 SkipSpacesAndLineEnd();
133}
134
135// ------------------------------------------------------------------------------------------------
136// Recursive MD5 parsing function

Callers

nothing calls this directly

Calls 7

TokenMatchFunction · 0.85
strtoul10Function · 0.85
IsLineEndFunction · 0.85
SkipSpacesFunction · 0.50
SkipLineFunction · 0.50
minFunction · 0.50
SkipSpacesAndLineEndFunction · 0.50

Tested by

no test coverage detected