30 if (!document.LoadFile())
32 MITK_ERROR <<
"Could not open/read/parse " <<
m_Filename <<
"\nTinyXML reports: " << document.ErrorDesc()
39 TiXmlElement *versionObject = document.FirstChildElement(
"Version");
42 if (versionObject->QueryIntAttribute(
"FileVersion", &fileVersion) != TIXML_SUCCESS)
44 MITK_ERROR <<
"Property file " <<
m_Filename <<
" does not contain version information! Trying version 1 format." 49 std::stringstream propertyListDeserializerClassName;
50 propertyListDeserializerClassName <<
"PropertyListDeserializerV" << fileVersion;
52 std::list<itk::LightObject::Pointer> readers =
53 itk::ObjectFactoryBase::CreateAllInstance(propertyListDeserializerClassName.str().c_str());
54 if (readers.size() < 1)
56 MITK_ERROR <<
"No property list reader found for file version " << fileVersion;
58 if (readers.size() > 1)
60 MITK_WARN <<
"Multiple property list readers found for file version " << fileVersion
61 <<
". Using arbitrary first one.";
64 for (
auto iter = readers.begin(); iter != readers.end(); ++iter)
66 if (
auto *reader = dynamic_cast<PropertyListDeserializer *>(iter->GetPointer()))
69 bool success = reader->Deserialize();
76 <<
". Your data may be corrupted";
PropertyList::Pointer m_PropertyList
~PropertyListDeserializer() override
virtual bool Deserialize()
Reads a propertylist from file.
virtual PropertyList::Pointer GetOutput()
PropertyListDeserializer()