------------------------------------------------------------------------------------------------ Parse and validate the MD5 header
| 104 | // ------------------------------------------------------------------------------------------------ |
| 105 | // Parse and validate the MD5 header |
| 106 | void 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 |
nothing calls this directly
no test coverage detected