comparison base/XmlExportable.cpp @ 4:149bb02a41ba

* Session file save, and the skeleton of session file load.
author Chris Cannam
date Fri, 13 Jan 2006 18:05:07 +0000
parents 581f67f370f3
children 39ae3dee27b9
comparison
equal deleted inserted replaced
3:581f67f370f3 4:149bb02a41ba
6 6
7 This is experimental software. Not for distribution. 7 This is experimental software. Not for distribution.
8 */ 8 */
9 9
10 #include "XmlExportable.h" 10 #include "XmlExportable.h"
11 #include <map>
11 12
12 QString 13 QString
13 XmlExportable::encodeEntities(QString s) 14 XmlExportable::encodeEntities(QString s)
14 { 15 {
15 s 16 s
37 if (c.blue() < 16) b = "0" + b; 38 if (c.blue() < 16) b = "0" + b;
38 39
39 return "#" + r + g + b; 40 return "#" + r + g + b;
40 } 41 }
41 42
43 int
44 XmlExportable::getObjectExportId(const void * object)
45 {
46 static std::map<const void *, int> idMap;
47 static int maxId = 0;
48
49 if (idMap.find(object) == idMap.end()) {
50 idMap[object] = maxId++;
51 }
52
53 return idMap[object];
54 }
55
56