bool Window::writeAutoChildWindowXML(XMLSerializer& xml_stream) const
{
// just stop now if we are'nt allowed to write XML
if (!d_allowWriteXML)
{
return false;
}
// we temporarily output to this string stream to see if have to do the tag at all. // Make sure this stream does UTF-8
std::ostringstream ss;
XMLSerializer xml(ss);
xml.openTag("AutoWindow");
// Create the XML Child Tree
// write out properties.
writePropertiesXML(xml);
// write out attached child windows.
writeChildWindowsXML(xml);
xml.closeTag();
if (xml.getTagCount() <= 1)
{
return false;
}
// output opening AutoWindow tag
xml_stream.openTag("AutoWindow");
// extract the name suffix
String suffix(getName(), getParent()->getName().length(), String::npos);
// write name suffix attribute
xml_stream.attribute("NameSuffix", suffix);
// Inefficient : do the XML serialization again
// write out properties.
writePropertiesXML(xml_stream);
// write out attached child windows.
writeChildWindowsXML(xml_stream);
xml_stream.closeTag();
return true;
}