diff --git a/ApplicationLibCode/Application/RiaApplication.cpp b/ApplicationLibCode/Application/RiaApplication.cpp index 31af877380..cdc25e2bca 100644 --- a/ApplicationLibCode/Application/RiaApplication.cpp +++ b/ApplicationLibCode/Application/RiaApplication.cpp @@ -118,6 +118,7 @@ #include "cafPdmCodeGenerator.h" #include "cafPdmDataValueField.h" #include "cafPdmDefaultObjectFactory.h" +#include "cafPdmDeprecation.h" #include "cafPdmMarkdownBuilder.h" #include "cafPdmMarkdownGenerator.h" #include "cafPdmScriptIOMessages.h" @@ -495,7 +496,12 @@ bool RiaApplication::loadProject( const QString& projectFileName, ProjectLoadAct } m_project->setFileName( fullPathProjectFileName ); - m_project->readFile(); + std::vector deprecationMessages = m_project->readFile( defaultDeprecations() ); + for ( const QString& deprecationMessage : deprecationMessages ) + { + RiaLogging::info( deprecationMessage ); + } + m_project->updatesAfterProjectFileIsRead(); // Apply any modifications to the loaded project before we go ahead and load actual data @@ -1848,3 +1854,11 @@ RiaKeyValueStore* RiaApplication::keyValueStore() const { return m_keyValueStore.get(); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +std::vector RiaApplication::defaultDeprecations() +{ + return {}; +} diff --git a/ApplicationLibCode/Application/RiaApplication.h b/ApplicationLibCode/Application/RiaApplication.h index 909d8410d7..3133a90223 100644 --- a/ApplicationLibCode/Application/RiaApplication.h +++ b/ApplicationLibCode/Application/RiaApplication.h @@ -22,6 +22,7 @@ #include "KeyValueStore/RiaKeyValueStore.h" #include "RiaDefines.h" +#include "cafPdmDeprecation.h" #include "cafPdmPointer.h" #include "cvfObject.h" @@ -225,6 +226,8 @@ protected: bool generateCode( const QString& outputPath, gsl::not_null errMsg ); + static std::vector defaultDeprecations(); + protected: void initializeDataLoadController(); diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/CMakeLists.txt b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/CMakeLists.txt index 159e9492d2..80c3ebadf0 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/CMakeLists.txt +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/CMakeLists.txt @@ -60,6 +60,7 @@ set(PROJECT_FILES cafAsyncWorkerManager.h cafAsyncWorkerManager.cpp cafPdmObjectHandleTools.h + cafPdmDeprecation.h ) add_library(${PROJECT_NAME} ${PROJECT_FILES}) diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmDeprecation.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmDeprecation.h new file mode 100644 index 0000000000..e7bc5e9d99 --- /dev/null +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmCore/cafPdmDeprecation.h @@ -0,0 +1,50 @@ +//################################################################################################## +// +// Custom Visualization Core library +// Copyright (C) 2011-2013 Ceetron AS +// +// This library may be used under the terms of either the GNU General Public License or +// the GNU Lesser General Public License as follows: +// +// GNU General Public License Usage +// This library is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License at <> +// for more details. +// +// GNU Lesser General Public License Usage +// This library is free software; you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation; either version 2.1 of the License, or +// (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, but WITHOUT ANY +// WARRANTY; without even the implied warranty of MERCHANTABILITY or +// FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU Lesser General Public License at <> +// for more details. +// +//################################################################################################## + +#pragma once + +#include + +namespace caf +{ +struct PdmDeprecation +{ + QString objectKeyword; + QString fieldKeyword; + QString lastValidVersion; + QString message; +}; +} //namespace caf diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.cpp index 81467cbba2..c9e56d2685 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.cpp @@ -70,21 +70,22 @@ void PdmDocument::setFileName( const QString& fileName ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void PdmDocument::readFile() +std::vector PdmDocument::readFile( const std::vector& deprecations ) { QFile xmlFile( m_fileName ); - if ( !xmlFile.open( QIODevice::ReadOnly | QIODevice::Text ) ) return; + if ( !xmlFile.open( QIODevice::ReadOnly | QIODevice::Text ) ) return {}; - readFile( &xmlFile ); + return readFile( &xmlFile, deprecations ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void PdmDocument::readFile( QIODevice* xmlFile ) +std::vector PdmDocument::readFile( QIODevice* xmlFile, const std::vector& deprecations ) { QXmlStreamReader xmlStream( xmlFile ); + std::vector deprecationMessages; while ( !xmlStream.atEnd() ) { xmlStream.readNext(); @@ -92,11 +93,17 @@ void PdmDocument::readFile( QIODevice* xmlFile ) { if ( !matchesClassKeyword( xmlStream.name().toString() ) ) { - return; + return deprecationMessages; } - readFields( xmlStream, PdmDefaultObjectFactory::instance(), false ); + auto deprecationMessagesForField = + readFields( xmlStream, PdmDefaultObjectFactory::instance(), false, deprecations ); + deprecationMessages.insert( deprecationMessages.end(), + deprecationMessagesForField.begin(), + deprecationMessagesForField.end() ); } } + + return deprecationMessages; } //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.h index 146fd3f912..e422f70b37 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmDocument.h @@ -36,6 +36,7 @@ #pragma once +#include "cafPdmDeprecation.h" #include "cafPdmField.h" #include "cafPdmObject.h" @@ -57,8 +58,8 @@ public: QString fileName() const; void setFileName( const QString& fileName ); - void readFile(); - bool writeFile(); + std::vector readFile( const std::vector& deprecations = {} ); + bool writeFile(); static void updateUiIconStateRecursively( PdmObjectHandle* root ); @@ -67,9 +68,9 @@ protected: const PdmFieldHandle* fileNameHandle() const; private: - void writeDocumentToXmlStream( QXmlStreamWriter& xmlStream ); - void readFile( QIODevice* device ); - void writeFile( QIODevice* device ); + void writeDocumentToXmlStream( QXmlStreamWriter& xmlStream ); + std::vector readFile( QIODevice* device, const std::vector& deprecations ); + void writeFile( QIODevice* device ); private: PdmField m_fileName; diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.h index f86517665c..923d33733c 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.h @@ -30,9 +30,11 @@ public: // Xml Serializing public: - void readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory ) override; - void writeFieldData( QXmlStreamWriter& xmlStream ) const override; - bool resolveReferences() override; + std::vector readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations = {} ) override; + void writeFieldData( QXmlStreamWriter& xmlStream ) const override; + bool resolveReferences() override; bool isVectorField() const override; @@ -59,10 +61,12 @@ public: // Xml Serializing public: - void readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory ) override; - void writeFieldData( QXmlStreamWriter& xmlStream ) const override; - bool resolveReferences() override; - QString referenceString() const override; + std::vector readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactoryconst, + const std::vector& deprecations = {} ) override; + void writeFieldData( QXmlStreamWriter& xmlStream ) const override; + bool resolveReferences() override; + QString referenceString() const override; private: FieldType* m_field; @@ -90,10 +94,12 @@ public: // Xml Serializing public: - void readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory ) override; - void writeFieldData( QXmlStreamWriter& xmlStream ) const override; - bool resolveReferences() override; - bool isVectorField() const override; + std::vector readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations = {} ) override; + void writeFieldData( QXmlStreamWriter& xmlStream ) const override; + bool resolveReferences() override; + bool isVectorField() const override; private: FieldType* m_field; @@ -120,9 +126,11 @@ public: // Xml Serializing public: - void readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory ) override; - void writeFieldData( QXmlStreamWriter& xmlStream ) const override; - bool resolveReferences() override; + std::vector readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations = {} ) override; + void writeFieldData( QXmlStreamWriter& xmlStream ) const override; + bool resolveReferences() override; private: FieldType* m_field; @@ -146,10 +154,12 @@ public: // Xml Serializing public: - void readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory ) override; - void writeFieldData( QXmlStreamWriter& xmlStream ) const override; - bool resolveReferences() override; - bool isVectorField() const override; + std::vector readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations = {} ) override; + void writeFieldData( QXmlStreamWriter& xmlStream ) const override; + bool resolveReferences() override; + bool isVectorField() const override; private: FieldType* m_field; @@ -174,10 +184,12 @@ public: // Xml Serializing public: - void readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory ) override; - void writeFieldData( QXmlStreamWriter& xmlStream ) const override; - bool resolveReferences() override; - bool isVectorField() const override; + std::vector readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations = {} ) override; + void writeFieldData( QXmlStreamWriter& xmlStream ) const override; + bool resolveReferences() override; + bool isVectorField() const override; private: FieldType* m_field; diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.inl b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.inl index ee1c486a4d..6ac90865fe 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.inl +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafInternalPdmXmlFieldCapability.inl @@ -30,12 +30,15 @@ bool caf::PdmFieldXmlCap::isVectorField() const /// //-------------------------------------------------------------------------------------------------- template -void caf::PdmFieldXmlCap::readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory ) +std::vector caf::PdmFieldXmlCap::readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations ) { this->assertValid(); typename FieldType::FieldDataType value; PdmFieldReader::readFieldData( value, xmlStream, objectFactory ); m_field->setValue( value ); + return {}; } //-------------------------------------------------------------------------------------------------- @@ -66,12 +69,15 @@ bool caf::PdmFieldXmlCap::resolveReferences() //-------------------------------------------------------------------------------------------------- template -void caf::PdmFieldXmlCap>::readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* ) +std::vector + caf::PdmFieldXmlCap>::readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory*, + const std::vector& deprecations ) { this->assertValid(); PdmFieldIOHelper::skipComments( xmlStream ); - if ( !xmlStream.isCharacters() ) return; + if ( !xmlStream.isCharacters() ) return {}; QString dataString = xmlStream.text().toString(); @@ -92,6 +98,8 @@ void caf::PdmFieldXmlCap>::readFieldData( QXmlStream m_referenceString = dataString; m_field->setRawPtr( NULL ); + + return {}; } //-------------------------------------------------------------------------------------------------- @@ -143,12 +151,15 @@ QString caf::PdmFieldXmlCap>::referenceString() const //-------------------------------------------------------------------------------------------------- template -void caf::PdmFieldXmlCap>::readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* ) +std::vector + caf::PdmFieldXmlCap>::readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory*, + const std::vector& deprecations ) { this->assertValid(); PdmFieldIOHelper::skipComments( xmlStream ); - if ( !xmlStream.isCharacters() ) return; + if ( !xmlStream.isCharacters() ) return {}; QString dataString = xmlStream.text().toString(); @@ -163,6 +174,8 @@ void caf::PdmFieldXmlCap>::readFieldData( QXmlS m_referenceString = dataString; m_field->clearWithoutDelete(); + + return {}; } //-------------------------------------------------------------------------------------------------- @@ -228,13 +241,15 @@ bool caf::PdmFieldXmlCap>::isVectorField() cons //-------------------------------------------------------------------------------------------------- template -void caf::PdmFieldXmlCap>::readFieldData( QXmlStreamReader& xmlStream, - PdmObjectFactory* objectFactory ) +std::vector + caf::PdmFieldXmlCap>::readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations ) { PdmFieldIOHelper::skipCharactersAndComments( xmlStream ); if ( !xmlStream.isStartElement() ) { - return; // This happens when the field is "shortcut" empty (written like: ) + return {}; // This happens when the field is "shortcut" empty (written like: ) } QString className = xmlStream.name().toString(); @@ -254,7 +269,7 @@ void caf::PdmFieldXmlCap>::readFieldData( QXmlStre xmlStream.skipCurrentElement(); // Skip to the endelement of the object we was supposed to read xmlStream.skipCurrentElement(); // Skip to the endelement of this field - return; + return {}; } else { @@ -267,7 +282,7 @@ void caf::PdmFieldXmlCap>::readFieldData( QXmlStre xmlStream.skipCurrentElement(); // Skip to the endelement of the object we was supposed to read xmlStream.skipCurrentElement(); // Skip to the endelement of this field - return; + return {}; } m_field->m_fieldValue.setRawPtr( obj ); @@ -295,18 +310,20 @@ void caf::PdmFieldXmlCap>::readFieldData( QXmlStre xmlStream.skipCurrentElement(); // Skip to the endelement of the object we was supposed to read xmlStream.skipCurrentElement(); // Skip to the endelement of this field - return; + return {}; } // Everything seems ok, so read the contents of the object: - xmlObject->readFields( xmlStream, objectFactory, false ); + std::vector deprecationMessages = xmlObject->readFields( xmlStream, objectFactory, false, deprecations ); // Make stream point to endElement of this field QXmlStreamReader::TokenType type = xmlStream.readNext(); Q_UNUSED( type ); PdmFieldIOHelper::skipCharactersAndComments( xmlStream ); + + return deprecationMessages; } //-------------------------------------------------------------------------------------------------- @@ -369,11 +386,14 @@ void caf::PdmFieldXmlCap>::writeFieldData( QX /// //-------------------------------------------------------------------------------------------------- template -void caf::PdmFieldXmlCap>::readFieldData( QXmlStreamReader& xmlStream, - PdmObjectFactory* objectFactory ) +std::vector + caf::PdmFieldXmlCap>::readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations ) { m_field->deleteChildren(); PdmFieldIOHelper::skipCharactersAndComments( xmlStream ); + std::vector deprecationMessages; while ( xmlStream.isStartElement() ) { QString className = xmlStream.name().toString(); @@ -418,7 +438,11 @@ void caf::PdmFieldXmlCap>::readFieldData( QXm continue; } - xmlObject->readFields( xmlStream, objectFactory, false ); + std::vector deprecationMessagesForField = + xmlObject->readFields( xmlStream, objectFactory, false, deprecations ); + deprecationMessages.insert( deprecationMessages.end(), + deprecationMessagesForField.begin(), + deprecationMessagesForField.end() ); m_field->m_pointers.push_back( PdmPointer() ); m_field->m_pointers.back().setRawPtr( obj ); @@ -431,6 +455,8 @@ void caf::PdmFieldXmlCap>::readFieldData( QXm Q_UNUSED( type ); PdmFieldIOHelper::skipCharactersAndComments( xmlStream ); } + + return deprecationMessages; } //-------------------------------------------------------------------------------------------------- @@ -469,13 +495,16 @@ bool caf::PdmFieldXmlCap>>::isVectorField() /// //-------------------------------------------------------------------------------------------------- template -void caf::PdmFieldXmlCap>>::readFieldData( QXmlStreamReader& xmlStream, - PdmObjectFactory* objectFactory ) +std::vector caf::PdmFieldXmlCap>>::readFieldData( + QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations ) { this->assertValid(); typename FieldType::FieldDataType value; PdmFieldReader::readFieldData( value, xmlStream, objectFactory ); m_field->setValue( value ); + return {}; } //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlFieldHandle.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlFieldHandle.h index 63741d0874..80bc6949d0 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlFieldHandle.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlFieldHandle.h @@ -1,5 +1,6 @@ #pragma once +#include "cafPdmDeprecation.h" #include "cafPdmFieldCapability.h" #include @@ -39,8 +40,10 @@ public: QString dataTypeName() const; - virtual void readFieldData( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory ) = 0; - virtual void writeFieldData( QXmlStreamWriter& xmlStream ) const = 0; + virtual std::vector readFieldData( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + const std::vector& deprecations = {} ) = 0; + virtual void writeFieldData( QXmlStreamWriter& xmlStream ) const = 0; virtual bool resolveReferences() = 0; diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.cpp b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.cpp index a8b97c2311..2677836b34 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.cpp +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.cpp @@ -42,8 +42,12 @@ PdmXmlObjectHandle* xmlObj( PdmObjectHandle* obj ) /// This makes attribute based field storage possible. /// Leaves the xmlStream pointing to the EndElement of the PdmObject. //-------------------------------------------------------------------------------------------------- -void PdmXmlObjectHandle::readFields( QXmlStreamReader& xmlStream, PdmObjectFactory* objectFactory, bool isCopyOperation ) +std::vector PdmXmlObjectHandle::readFields( QXmlStreamReader& xmlStream, + PdmObjectFactory* objectFactory, + bool isCopyOperation, + const std::vector& deprecations ) { + std::vector deprecationMessages; bool isObjectFinished = false; QXmlStreamReader::TokenType type; while ( !isObjectFinished ) @@ -87,7 +91,11 @@ void PdmXmlObjectHandle::readFields( QXmlStreamReader& xmlStream, PdmObjectFacto // After reading, the xmlStream is supposed to point to the first token after the field // content. (typically an "endElement") xmlStream.readNext(); - xmlFieldHandle->readFieldData( xmlStream, objectFactory ); + std::vector deprecationMessagesForField = + xmlFieldHandle->readFieldData( xmlStream, objectFactory, deprecations ); + deprecationMessages.insert( deprecationMessages.end(), + deprecationMessagesForField.begin(), + deprecationMessagesForField.end() ); } else { @@ -99,10 +107,28 @@ void PdmXmlObjectHandle::readFields( QXmlStreamReader& xmlStream, PdmObjectFacto // Debug text is commented out, as this code is relatively often reached. Consider a new logging // concept to receive this information // - // std::cout << "Line " << xmlStream.lineNumber() << ": Warning: Could not find a field with - // name " - // << name.toLatin1().data() << " in the current object : " << classKeyword().toLatin1().data() - // << std::endl; + // std::cout << "Line " << xmlStream.lineNumber() << ": Warning: Could not find a field with name " + // << name.toLatin1().data() + // << " in the current object : " << classKeyword().toLatin1().data() << std::endl; + + auto findDeprecation = []( const std::vector& deprecations, + const QString& objectKeyword, + const QString& fieldKeyword ) -> std::optional + { + for ( const PdmDeprecation& deprecation : deprecations ) + { + if ( deprecation.fieldKeyword == fieldKeyword && deprecation.objectKeyword == objectKeyword ) + return deprecation; + } + + return {}; + }; + + auto deprecation = findDeprecation( deprecations, classKeyword(), name ); + if ( deprecation ) + { + deprecationMessages.push_back( deprecation.value().message ); + } xmlStream.skipCurrentElement(); } @@ -112,7 +138,6 @@ void PdmXmlObjectHandle::readFields( QXmlStreamReader& xmlStream, PdmObjectFacto case QXmlStreamReader::EndElement: { // End of object. - QString name = xmlStream.name().toString(); // For debugging isObjectFinished = true; } break; @@ -130,6 +155,8 @@ void PdmXmlObjectHandle::readFields( QXmlStreamReader& xmlStream, PdmObjectFacto break; } } + + return deprecationMessages; } //-------------------------------------------------------------------------------------------------- /// diff --git a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.h b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.h index 0071d8dc27..31f6c79fd0 100644 --- a/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.h +++ b/Fwk/AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXmlObjectHandle.h @@ -1,5 +1,6 @@ #pragma once +#include "cafPdmDeprecation.h" #include "cafPdmObjectCapability.h" #include @@ -45,8 +46,11 @@ public: // Main XML serialization methods that is used internally by the document serialization system // Not supposed to be used directly. - void readFields( QXmlStreamReader& inputStream, PdmObjectFactory* objectFactory, bool isCopyOperation ); - void writeFields( QXmlStreamWriter& outputStream ) const; + std::vector readFields( QXmlStreamReader& inputStream, + PdmObjectFactory* objectFactory, + bool isCopyOperation, + const std::vector& deprecations = {} ); + void writeFields( QXmlStreamWriter& outputStream ) const; /// Check if a string is a valid Xml element name static bool isValidXmlElementName( const QString& name );