Caf::Pdm: Added better Error messages and Recovery when encountering unknown field names and class types

p4#: 21001
This commit is contained in:
Jacob Støren
2013-03-20 13:56:17 +01:00
parent d5b056b078
commit ad8cbfa651
2 changed files with 83 additions and 21 deletions

View File

@@ -30,10 +30,10 @@ namespace caf
//--------------------------------------------------------------------------------------------------
/// Reads all the fields into this PdmObject
/// Assumes xmlStream points to the start element token of the containing object.
/// Assumes xmlStream points to the start element token of the PdmObject for which to read fields.
/// ( and not first token of object content)
/// This makes attribute based field storage possible.
/// Leaves the xmlStream pointing to the EndElement corresponding to the start element.
/// Leaves the xmlStream pointing to the EndElement of the PdmObject.
//--------------------------------------------------------------------------------------------------
void PdmObject::readFields (QXmlStreamReader& xmlStream )
{
@@ -48,6 +48,11 @@ void PdmObject::readFields (QXmlStreamReader& xmlStream )
case QXmlStreamReader::StartElement:
{
QString name = xmlStream.name().toString();
if (name == QString("SimpleObjPtrField"))
{
int a;
a = 2 + 7;
}
PdmFieldHandle* currentField = findField(name);
if (currentField)
{
@@ -76,6 +81,7 @@ void PdmObject::readFields (QXmlStreamReader& xmlStream )
case QXmlStreamReader::EndElement:
{
// End of object.
QString name = xmlStream.name().toString(); // For debugging
isObjectFinished = true;
}
break;