Mercurial > hg > svcore
comparison base/XmlExportable.h @ 1713:978c143c767f
Merge from branch single-point
author | Chris Cannam |
---|---|
date | Fri, 17 May 2019 10:02:43 +0100 |
parents | f97d64b8674f |
children | 4abc0f08adf9 |
comparison
equal
deleted
inserted
replaced
1709:ab4fd193262b | 1713:978c143c767f |
---|---|
23 class QTextStream; | 23 class QTextStream; |
24 | 24 |
25 class XmlExportable | 25 class XmlExportable |
26 { | 26 { |
27 public: | 27 public: |
28 XmlExportable() : m_exportId(-1) { } | |
28 virtual ~XmlExportable() { } | 29 virtual ~XmlExportable() { } |
30 | |
31 /** | |
32 * Return the numerical export identifier for this object. It's | |
33 * allocated the first time this is called, so objects on which | |
34 * this is never called do not get allocated one. | |
35 */ | |
36 int getExportId() const; | |
29 | 37 |
30 /** | 38 /** |
31 * Stream this exportable object out to XML on a text stream. | 39 * Stream this exportable object out to XML on a text stream. |
32 */ | 40 */ |
33 virtual void toXml(QTextStream &stream, | 41 virtual void toXml(QTextStream &stream, |
44 | 52 |
45 static QString encodeEntities(QString); | 53 static QString encodeEntities(QString); |
46 | 54 |
47 static QString encodeColour(int r, int g, int b); | 55 static QString encodeColour(int r, int g, int b); |
48 | 56 |
49 static int getObjectExportId(const void *); // thread-safe | 57 private: |
58 mutable int m_exportId; | |
50 }; | 59 }; |
51 | 60 |
52 #endif | 61 #endif |