Added IsErased() member to WithPolyXml class

git-svn-id: svn://ultimatepp.org/upp/trunk@3838 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
micio 2011-09-08 16:21:45 +00:00
parent a46d595bc3
commit 5f17ea72f0

View file

@ -10,6 +10,11 @@ template<class T> class WithPolyXML : public WithFactory<T>
public:
// Xmlizer
virtual void Xmlize(XmlIO xml) {};
// Check if object is marked as erased so the array don't store it on xml
// useful if you don't remove objects from array but just mark them as erased
// to be redefined if you need this feature !
virtual bool IsErased(void) { return false; }
};
template<class T> class PolyXMLUnknown : public T
@ -55,8 +60,11 @@ template<class T> void PolyXMLArray<T>::Xmlize(XmlIO xml)
for(int i = 0; i < PolyXMLArray::GetCount(); i++)
{
T &data = PolyXMLArray::operator[](i);
String tag = data.IsA();
data.Xmlize(xml.Add(tag));
if(!data.IsErased())
{
String tag = data.IsA();
data.Xmlize(xml.Add(tag));
}
}
}
else