diff layer/Layer.h @ 316:c0b9eec70639

* 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 5c59c433b358
children 984c1975f1ff
line wrap: on
line diff
--- a/layer/Layer.h	Wed Oct 17 12:58:45 2007 +0000
+++ b/layer/Layer.h	Thu Oct 18 10:15:07 2007 +0000
@@ -280,29 +280,30 @@
 
     /**
      * Convert the layer's data (though not those of the model it
-     * refers to) into an XML string for file output.  This class
-     * implements the basic name/type/model-id output; subclasses will
-     * typically call this superclass implementation with extra
-     * attributes describing their particular properties.
+     * refers to) into XML for file output.  This class implements the
+     * basic name/type/model-id output; subclasses will typically call
+     * this superclass implementation with extra attributes describing
+     * their particular properties.
      */
-    virtual QString toXmlString(QString indent = "",
-				QString extraAttributes = "") const;
+    virtual void toXml(QTextStream &stream, QString indent = "",
+                       QString extraAttributes = "") const;
 
     /**
      * Set the particular properties of a layer (those specific to the
      * subclass) from a set of XML attributes.  This is the effective
-     * inverse of the toXmlString method.
+     * inverse of the toXml method.
      */
     virtual void setProperties(const QXmlAttributes &) = 0;
 
     /**
-     * Produce an XML string containing the layer's ID and type.  This
-     * is used to refer to the layer in the display section of the SV
-     * session file, for a layer that has already been described in
-     * the data section.
+     * Produce XML containing the layer's ID and type.  This is used
+     * to refer to the layer in the display section of the SV session
+     * file, for a layer that has already been described in the data
+     * section.
      */
-    virtual QString toBriefXmlString(QString indent = "",
-                                     QString extraAttributes = "") const;
+    virtual void toBriefXml(QTextStream &stream,
+                            QString indent = "",
+                            QString extraAttributes = "") const;
 
     /**
      * Add a measurement rectangle from the given XML attributes
@@ -467,7 +468,7 @@
         double endY;
 
         bool operator<(const MeasureRect &mr) const;
-        QString toXmlString(QString indent) const;
+        void toXml(QTextStream &stream, QString indent) const;
     };
 
     class AddMeasurementRectCommand : public Command