Merge branch 'new-file-detection' of https://github.com/krishty/assimp into krishty-new-file-detection

This commit is contained in:
Kim Kulling
2022-01-16 20:41:24 +01:00
51 changed files with 273 additions and 669 deletions

View File

@@ -140,22 +140,9 @@ STLImporter::~STLImporter() {
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
bool STLImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const {
const std::string extension = GetExtension(pFile);
if (extension == "stl") {
return true;
}
if (!extension.length() || checkSig) {
if (!pIOHandler) {
return true;
}
static const char * const tokens[] = { "STL", "solid" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, 2);
}
return false;
bool STLImporter::CanRead(const std::string &pFile, IOSystem *pIOHandler, bool /*checkSig*/) const {
static const char *tokens[] = { "STL", "solid" };
return SearchFileHeaderForToken(pIOHandler, pFile, tokens, AI_COUNT_OF(tokens));
}
// ------------------------------------------------------------------------------------------------