Home » U++ Library support » U++ Core » Xmlize works only for storing
Xmlize works only for storing [message #18445] |
Wed, 01 October 2008 15:16 |
exhu
Messages: 12 Registered: April 2008 Location: Belarus
|
Promising Member |
|
|
Please, help understanding the XML serialization implemented in UPP.
This code perfectly saves the XML as intended, but does not load attribute values:
void ServData::save() {
StoreAsXMLFile(*this);
}
void ServData::load() {
LoadFromXMLFile(*this);
}
void ServData::Xmlize(XmlIO xml) {
::Xmlize(xml.Add("map"), locationMap);
}
/////////
void Xmlize(XmlIO xml, Map & locMap) {
Xmlize(xml.Add("left"), locMap.left);
Xmlize(xml.Add("right"), locMap.right);
Xmlize(xml.Add("top"), locMap.top);
Xmlize(xml.Add("bottom"), locMap.bottom);
}
void Xmlize(XmlIO xml, MapPlace & place) {
String nm;
if (xml.IsStoring())
nm = place.name;
xml.Attr("name", nm); // nm is always empty on xml.IsLoading! why?
if (xml.IsLoading())
place.name = nm;
}
|
|
|
Goto Forum:
Current Time: Mon May 13 03:59:24 CEST 2024
Total time taken to generate the page: 0.02411 seconds
|