closes https://github.com/assimp/assimp/issues/1621: add file check for dxf file without extensions.

This commit is contained in:
Kim Kulling
2018-04-06 20:51:07 +02:00
parent 7ca8407ef2
commit 183224f045
2 changed files with 11 additions and 46 deletions

View File

@@ -119,9 +119,14 @@ DXFImporter::~DXFImporter()
// ------------------------------------------------------------------------------------------------
// Returns whether the class can handle the format of the given file.
bool DXFImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, bool /*checkSig*/) const
bool DXFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig ) const
{
return SimpleExtensionCheck(pFile,"dxf");
if ( checkSig ) {
return SimpleExtensionCheck(pFile,"dxf");
} else {
static const char *pTokens[] = { "SECTION", "HEADER", "ENDSEC", "BLOCKS" };
return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 4 );
}
}
// ------------------------------------------------------------------------------------------------