aboutsummaryrefslogtreecommitdiff
path: root/src/old/xmldocument.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/old/xmldocument.h')
-rw-r--r--src/old/xmldocument.h165
1 files changed, 0 insertions, 165 deletions
diff --git a/src/old/xmldocument.h b/src/old/xmldocument.h
deleted file mode 100644
index e0c36eb..0000000
--- a/src/old/xmldocument.h
+++ /dev/null
@@ -1,165 +0,0 @@
1#ifndef XMLDOCUMENT
2#define XMLDOCUMENT
3
4#include "xmlnode.h"
5
6/**
7 * Keeps track of an easily managed set of XmlNode information. Allows simple
8 * operations for logical writing to and reading from XML structures. Using
9 * already formed structures is simply done through the XmlNode structures,
10 * and the getRoot function here. Creation is performed through a simple set
11 * of operations that creates the data in a stream type format.
12 *@author Mike Buland
13 */
14class XmlDocument
15{
16public:
17 /**
18 * Construct either a blank XmlDocuemnt or construct a document around an
19 * existing XmlNode. Be careful, once an XmlNode is passed into a document
20 * the document takes over ownership and will delete it when the XmlDocument
21 * is deleted.
22 *@param pRoot The XmlNode to use as the root of this document, or NULL if
23 * you want to start a new document.
24 */
25 XmlDocument( XmlNode *pRoot=NULL );
26
27 /**
28 * Destroy all contained nodes.
29 */
30 virtual ~XmlDocument();
31
32 /**
33 * Add a new node to the document. The new node is appended to the end of
34 * the current context, i.e. XmlNode, and the new node, provided it isn't
35 * close as part of this operation, will become the current context.
36 *@param sName The name of the new node to add.
37 *@param sContent A content string to be placed inside of the new node.
38 *@param bClose Set this to true to close the node immediately after adding
39 * the node and setting the content and name. If this is set to true the
40 * node is appended, but the context node doesn't change.
41 */
42 void addNode( const Bu::FString &sName );
43
44 /**
45 * Close the current node context. This will move the current context to
46 * the parent node of the former current node. If the current node was the
47 * root then the "completed" flag is set and no more operations are allowed.
48 */
49 void closeNode();
50
51 /**
52 * Change the content of the current node at the current position between
53 * nodes.
54 *@param sContent The new content of the current node.
55 */
56 void setContent( const char *sContent );
57
58 /**
59 * Add a named property to the current context node.
60 *@param sName The name of the property to add.
61 *@param sValue The string value of the property.
62 */
63 void addProperty( const char *sName, const char *sValue );
64
65 /**
66 * Add a named property to the current context node, converting the
67 * numerical parameter to text using standrd printf style conversion.
68 *@param sName The name of the property to add.
69 *@param nValue The numerical value to add.
70 */
71 void addProperty( const char *sName, const unsigned char nValue );
72
73 /**
74 * Add a named property to the current context node, converting the
75 * numerical parameter to text using standrd printf style conversion.
76 *@param sName The name of the property to add.
77 *@param nValue The numerical value to add.
78 */
79 void addProperty( const char *sName, const char nValue );
80
81 /**
82 * Add a named property to the current context node, converting the
83 * numerical parameter to text using standrd printf style conversion.
84 *@param sName The name of the property to add.
85 *@param nValue The numerical value to add.
86 */
87 void addProperty( const char *sName, const unsigned short nValue );
88
89 /**
90 * Add a named property to the current context node, converting the
91 * numerical parameter to text using standrd printf style conversion.
92 *@param sName The name of the property to add.
93 *@param nValue The numerical value to add.
94 */
95 void addProperty( const char *sName, const short nValue );
96
97 /**
98 * Add a named property to the current context node, converting the
99 * numerical parameter to text using standrd printf style conversion.
100 *@param sName The name of the property to add.
101 *@param nValue The numerical value to add.
102 */
103 void addProperty( const char *sName, const unsigned long nValue );
104
105 /**
106 * Add a named property to the current context node, converting the
107 * numerical parameter to text using standrd printf style conversion.
108 *@param sName The name of the property to add.
109 *@param nValue The numerical value to add.
110 */
111 void addProperty( const char *sName, const long nValue );
112
113 /**
114 * Add a named property to the current context node, converting the
115 * numerical parameter to text using standrd printf style conversion.
116 *@param sName The name of the property to add.
117 *@param nValue The numerical value to add.
118 */
119 void addProperty( const char *sName, const int nValue );
120
121 /**
122 * Add a named property to the current context node, converting the
123 * numerical parameter to text using standrd printf style conversion.
124 *@param sName The name of the property to add.
125 *@param dValue The numerical value to add.
126 */
127 void addProperty( const char *sName, const double dValue );
128
129 /**
130 * The XmlDocuemnt is considered completed if the root node has been closed.
131 * Once an XmlDocument has been completed, you can no longer perform
132 * operations on it.
133 *@return True if completed, false if still in progress.
134 */
135 bool isCompleted();
136
137 /**
138 * Get a pointer to the root object of this XmlDocument.
139 *@returns A pointer to an internally owned XmlNode. Do not delete this
140 * XmlNode.
141 */
142 XmlNode *getRoot();
143
144 /**
145 * Get a pointer to the root object of this XmlDocument, and remove the
146 * ownership from this object.
147 *@returns A pointer to an internally owned XmlNode. Do not delete this
148 * XmlNode.
149 */
150 XmlNode *detatchRoot();
151
152 /**
153 * Get the current context node, which could be the same as the root node.
154 *@returns A pointer to an internally owned XmlNode. Do not delete this
155 * XmlNode.
156 */
157 XmlNode *getCurrent();
158
159private:
160 XmlNode *pRoot; /**< The root node. */
161 XmlNode *pCurrent; /**< The current node. */
162 bool bCompleted; /**< Is it completed? */
163};
164
165#endif