]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/xmlnode.tex
set up scrollbars correctly when we don't need them (fixes the problems reported...
[wxWidgets.git] / docs / latex / wx / xmlnode.tex
CommitLineData
4c43dd90
JS
1\section{\class{wxXmlNode}}\label{wxxmlnode}
2
3Represents a node in an XML document. See \helpref{wxXmlDocument}{wxxmldocument}.
4
5Node has a name and may have content
6and properties. Most common node types are {\tt wxXML\_TEXT\_NODE} (name and
7properties are irrelevant) and {\tt wxXML\_ELEMENT\_NODE} (e.g. in {\tt <title>hi</title>} there is
8an element with name="title", irrelevant content and one child ({\tt wxXML\_TEXT\_NODE}
9with content="hi").
10
11If wxUSE\_UNICODE is 0, all strings are encoded in the encoding given to Load
12(default is UTF-8).
13
14
15\wxheading{Derived from}
16
17No base class
18
19\wxheading{Include files}
20
21<wx/xml/xml.h>
22
23\wxheading{Constants}
24
25The following are the node types supported by wxXmlNode:
26
27{\small
28\begin{verbatim}
29enum wxXmlNodeType
30{
31 wxXML_ELEMENT_NODE,
32 wxXML_ATTRIBUTE_NODE,
33 wxXML_TEXT_NODE,
34 wxXML_CDATA_SECTION_NODE,
35 wxXML_ENTITY_REF_NODE,
36 wxXML_ENTITY_NODE,
37 wxXML_PI_NODE,
38 wxXML_COMMENT_NODE,
39 wxXML_DOCUMENT_NODE,
40 wxXML_DOCUMENT_TYPE_NODE,
41 wxXML_DOCUMENT_FRAG_NODE,
42 wxXML_NOTATION_NODE,
43 wxXML_HTML_DOCUMENT_NODE
44}
45\end{verbatim}
46}
47
48\wxheading{See also}
49
50\helpref{wxXmlDocument}{wxxmldocument}, \helpref{wxXmlProperty}{wxxmlproperty}
51
52
53\latexignore{\rtfignore{\wxheading{Members}}}
54
55
56\membersection{wxXmlNode::wxXmlNode}\label{wxxmlnodewxxmlnode}
57
58
59\func{}{wxXmlNode}{\param{wxXmlNode* }{parent}, \param{wxXmlNodeType }{type}, \param{const wxString\& }{name}, \param{const wxString\& }{content = wxEmptyString}, \param{wxXmlProperty* }{props = NULL}, \param{wxXmlNode* }{next = NULL}}
60
61\wxheading{Parameters}
62
63\docparam{parent}{The parent node. Can be NULL.}
64\docparam{type}{One of the wxXmlNodeType enumeration value.}
65\docparam{name}{The name of the node. This is the string which appears between angular brackets.}
66\docparam{content}{The content of the node. Only meaningful when {\it type} is {\tt wxXML\_TEXT\_NODE} or {\tt wxXML\_CDATA\_SECTION\_NODE}.}
67\docparam{props}{If not NULL, this wxXmlProperty object and its eventual siblings are attached to
68the node.}
69\docparam{next}{If not NULL, this node and its eventual siblings are attached to
70the node.}
71
72\func{}{wxXmlNode}{\param{const wxXmlNode\& }{node}}
73
74Copy constructor. Note that this does NOT copy syblings
75and parent pointer, i.e. \helpref{GetParent()}{wxxmlnodegetparent} and \helpref{GetNext()}{wxxmlnodegetnext} will return NULL
76after using copy ctor and are never unmodified by operator=.
77
78On the other hand, it DOES copy children and properties.
79
80
81\func{}{wxXmlNode}{\param{wxXmlNodeType }{type}, \param{const wxString\& }{name}, \param{const wxString\& }{content = wxEmptyString}}
82
83A simplified version of the first constructor form.
84
85
86\membersection{wxXmlNode::\destruct{wxXmlNode}}\label{wxxmlnodedtor}
87
88\func{}{\destruct{wxXmlNode}}{\void}
89
90The virtual destructor. Deletes attached children and properties.
91
92\membersection{wxXmlNode::AddChild}\label{wxxmlnodeaddchild}
93
94\func{void}{AddChild}{\param{wxXmlNode* }{child}}
95
96Adds the given node as child of this node. To attach a second children to this node, use the
97\helpref{SetNext()}{wxxmlnodesetnext} function of the {\it child} node.
98
99\membersection{wxXmlNode::AddProperty}\label{wxxmlnodeaddproperty}
100
101\func{void}{AddProperty}{\param{const wxString\& }{name}, \param{const wxString\& }{value}}
102
103Appends a property with given {\it name} and {\it value} to the list of properties for this node.
104
105\func{void}{AddProperty}{\param{wxXmlProperty* }{prop}}
106
107Appends the given property to the list of properties for this node.
108
109\membersection{wxXmlNode::DeleteProperty}\label{wxxmlnodedeleteproperty}
110
111\func{bool}{DeleteProperty}{\param{const wxString\& }{name}}
112
113Removes the first properties which has the given {\it name} from the list of properties for this node.
114
115\membersection{wxXmlNode::GetChildren}\label{wxxmlnodegetchildren}
116
117\constfunc{wxXmlNode*}{GetChildren}{\void}
118
119Returns the first child of this node.
120To get a pointer to the second child of this node (if it does exist), use the
121\helpref{GetNext()}{wxxmlnodegetnext} function on the returned value.
122
123\membersection{wxXmlNode::GetContent}\label{wxxmlnodegetcontent}
124
125\constfunc{wxString}{GetContent}{\void}
126
127Returns the content of this node. Can be an empty string.
128
129\membersection{wxXmlNode::GetName}\label{wxxmlnodegetname}
130
131\constfunc{wxString}{GetName}{\void}
132
133Returns the name of this node. Can be an empty string (e.g. for nodes of type {\tt wxXML\_TEXT\_NODE} or {\tt wxXML\_CDATA\_SECTION\_NODE}).
134
135\membersection{wxXmlNode::GetNext}\label{wxxmlnodegetnext}
136
137\constfunc{wxXmlNode*}{GetNext}{\void}
138
139Returns a pointer to the sibling of this node or NULL if there are no siblings.
140
141\membersection{wxXmlNode::GetParent}\label{wxxmlnodegetparent}
142
143\constfunc{wxXmlNode*}{GetParent}{\void}
144
145Returns a pointer to the parent of this node or NULL if this node has no parent.
146
147\membersection{wxXmlNode::GetPropVal}\label{wxxmlnodegetpropval}
148
149\constfunc{bool}{GetPropVal}{\param{const wxString\& }{propName}, \param{wxString* }{value}}
150
151Returns \true if a property named {\it propName} could be found.
152If the {\it value} pointer is not NULL, the value of that property is saved there.
153
154\constfunc{wxString}{GetPropVal}{\param{const wxString\& }{propName}, \param{const wxString\& }{defaultVal}}
155
156Returns the value of the property named {\it propName} if it does exist.
157If it does not exist, the {\it defaultVal} is returned.
158
159\membersection{wxXmlNode::GetProperties}\label{wxxmlnodegetproperties}
160
161\constfunc{wxXmlProperty*}{GetProperties}{\void}
162
163Return a pointer to the first property of this node.
164
165\membersection{wxXmlNode::GetType}\label{wxxmlnodegettype}
166
167\constfunc{wxXmlNodeType}{GetType}{\void}
168
169Returns the type of this node.
170
171
172\membersection{wxXmlNode::HasProp}\label{wxxmlnodehasprop}
173
174\constfunc{bool}{HasProp}{\param{const wxString\& }{propName}}
175
176Returns \true if this node has a property named {\it propName}.
177
178\membersection{wxXmlNode::InsertChild}\label{wxxmlnodeinsertchild}
179
180\func{void}{InsertChild}{\param{wxXmlNode* }{child}, \param{wxXmlNode* }{before\_node}}
181
182Inserts the {\it child} node after {\it before\_node} in the children list.
183
184\membersection{wxXmlNode::RemoveChild}\label{wxxmlnoderemovechild}
185
186\func{bool}{RemoveChild}{\param{wxXmlNode* }{child}}
187
188Removes the given node from the children list. Returns \true if the node was found and removed
189or \false if the node could not be found.
190
191\membersection{wxXmlNode::SetChildren}\label{wxxmlnodesetchildren}
192
193\func{void}{SetChildren}{\param{wxXmlNode* }{child}}
194
195Sets as first child the given node. The caller is responsible to delete any previously present
196children node.
197
198\membersection{wxXmlNode::SetContent}\label{wxxmlnodesetcontent}
199
200\func{void}{SetContent}{\param{const wxString\& }{con}}
201
202Sets the content of this node.
203
204\membersection{wxXmlNode::SetName}\label{wxxmlnodesetname}
205
206\func{void}{SetName}{\param{const wxString\& }{name}}
207
208Sets the name of this node.
209
210\membersection{wxXmlNode::SetNext}\label{wxxmlnodesetnext}
211
212\func{void}{SetNext}{\param{wxXmlNode* }{next}}
213
214Sets as sibling the given node. The caller is responsible to delete any previously present
215sibling node.
216
217\membersection{wxXmlNode::SetParent}\label{wxxmlnodesetparent}
218
219\func{void}{SetParent}{\param{wxXmlNode* }{parent}}
220
221Sets as parent the given node. The caller is responsible to delete any previously present
222parent node.
223
224\membersection{wxXmlNode::SetProperties}\label{wxxmlnodesetproperties}
225
226\func{void}{SetProperties}{\param{wxXmlProperty* }{prop}}
227
228Sets as first property the given wxXmlProperty object.
229The caller is responsible to delete any previously present properties attached to this node.
230
231\membersection{wxXmlNode::SetType}\label{wxxmlnodesettype}
232
233\func{void}{SetType}{\param{wxXmlNodeType }{type}}
234
235Sets the type of this node.
236
237\membersection{wxXmlNode::operator=}\label{wxxmlnodeoperatorassign}
238
239\func{wxXmlNode\& operator}{operator=}{\param{const wxXmlNode\& }{node}}
240
241See the copy constructor for more info.
242