mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
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:
parent
a46d595bc3
commit
5f17ea72f0
1 changed files with 10 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue