Commit d1669237 authored by Dan Lipsa's avatar Dan Lipsa Committed by Kitware Robot
Browse files

Merge topic 'file-version-15578'

4e531cd0

 ENH: CanReadFile does not fail for newer file version.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Berk Geveci's avatarBerk Geveci <berk.geveci@kitware.com>
Merge-request: !413
parents dbea2d5e 4e531cd0
......@@ -631,9 +631,9 @@ int vtkXMLReader::ReadVTKFile(vtkXMLDataElement* eVTKFile)
const char* version = eVTKFile->GetAttribute("version");
if (version && !this->CanReadFileVersionString(version))
{
vtkErrorMacro("File version: " << version << " is is higher than "
"this reader supports. Cannot read file.");
return 0;
vtkWarningMacro("File version: " << version << " is higher than "
"this reader supports " << vtkXMLReaderMajorVersion << "."
<< vtkXMLReaderMinorVersion);
}
::ReadStringVersion(version, this->FileMajorVersion, this->FileMinorVersion);
......@@ -839,18 +839,7 @@ int vtkXMLReader::CanReadFile(const char* name)
{
if (this->CanReadFileWithDataType(tester->GetFileDataType()))
{
const char* version = tester->GetFileVersion();
if (version)
{
if (this->CanReadFileVersionString(version))
{
result = 3;
}
}
else
{
result = 3;
}
result = 1;
}
}
......
......@@ -55,8 +55,11 @@ public:
void SetInputString(std::string s) { this->InputString = s; }
// Description:
// Test whether the file with the given name can be read by this
// reader.
// Test whether the file (type) with the given name can be read by this
// reader. If the file has a newer version than the reader, we still say
// we can read the file type and we fail later, when we try to read the file.
// This enables clients (ParaView) to distinguish between failures when we
// need to look for another reader and failures when we don't.
virtual int CanReadFile(const char* name);
// Description:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment