diff base/XmlExportable.h @ 314:70a232b1f12a

* Make XmlExportable::toXml the function that is universally overridden (and pure virtual) instead of toXmlString. Tidies up some classes, notably the model classes, significantly. Closes #1794561.
author Chris Cannam
date Thu, 18 Oct 2007 10:15:07 +0000
parents 3b8008d09541
children 7aa1de571880
line wrap: on
line diff
--- a/base/XmlExportable.h	Wed Oct 17 12:58:45 2007 +0000
+++ b/base/XmlExportable.h	Thu Oct 18 10:15:07 2007 +0000
@@ -28,23 +28,18 @@
 
     /**
      * Stream this exportable object out to XML on a text stream.
-     * 
-     * The default implementation calls toXmlString and streams the
-     * resulting string.  This is only appropriate for objects with
-     * short representations.  Bigger objects should override this
-     * method so as to write to the stream directly and override
-     * toXmlString with a method that calls this one, so that the
-     * direct streaming method can be used when appropriate.
      */
     virtual void toXml(QTextStream &stream,
                        QString indent = "",
-                       QString extraAttributes = "") const;
+                       QString extraAttributes = "") const = 0;
 
     /**
-     * Convert this exportable object to XML in a string.
+     * Convert this exportable object to XML in a string.  The default
+     * implementation calls toXml and returns the result as a string.
+     * Do not override this unless you really know what you're doing.
      */
     virtual QString toXmlString(QString indent = "",
-				QString extraAttributes = "") const = 0;
+				QString extraAttributes = "") const;
 
     static QString encodeEntities(QString);