X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/669b0c0a0b5a3d529104256f678d985105a8a276..fc17828ab2cb3dc5dd22d5634ce4f6764e1373fc:/docs/latex/wx/xmlnode.tex diff --git a/docs/latex/wx/xmlnode.tex b/docs/latex/wx/xmlnode.tex index 12583cf956..53d8e3d29c 100644 --- a/docs/latex/wx/xmlnode.tex +++ b/docs/latex/wx/xmlnode.tex @@ -12,10 +12,10 @@ Represents a node in an XML document. See \helpref{wxXmlDocument}{wxxmldocument}. -Node has a name and may have content -and properties. Most common node types are {\tt wxXML\_TEXT\_NODE} (name and -properties are irrelevant) and {\tt wxXML\_ELEMENT\_NODE} (e.g. in {\tt hi} there is -an element with name="title", irrelevant content and one child ({\tt wxXML\_TEXT\_NODE} +Node has a name and may have content and properties. Most common node types are +{\tt wxXML\_TEXT\_NODE} (name and properties are irrelevant) and +{\tt wxXML\_ELEMENT\_NODE} (e.g. in {\tt hi} there is an element +with name="title", irrelevant content and one child ({\tt wxXML\_TEXT\_NODE} with content="hi"). If \texttt{wxUSE\_UNICODE} is 0, all strings are encoded in the encoding given to @@ -65,24 +65,31 @@ enum wxXmlNodeType \membersection{wxXmlNode::wxXmlNode}\label{wxxmlnodewxxmlnode} - \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}} \wxheading{Parameters} -\docparam{parent}{The parent node. Can be \NULL.} +\docparam{parent}{The parent node to which append this node instance. +If this argument is \NULL this new node will be {\it floating} and it can be appended later to +another one using the \helpref{AddChild}{wxxmlnodeaddchild} or \helpref{InsertChild}{wxxmlnodeinsertchild} +functions. Otherwise the child is already added to the XML tree by this +constructor and it shouldn't be done again.} \docparam{type}{One of the wxXmlNodeType enumeration value.} \docparam{name}{The name of the node. This is the string which appears between angular brackets.} -\docparam{content}{The content of the node. Only meaningful when {\it type} is {\tt wxXML\_TEXT\_NODE} or {\tt wxXML\_CDATA\_SECTION\_NODE}.} -\docparam{props}{If not \NULL, this wxXmlProperty object and its eventual siblings are attached to -the node.} +\docparam{content}{The content of the node. Only meaningful when {\it type} is +{\tt wxXML\_TEXT\_NODE} or {\tt wxXML\_CDATA\_SECTION\_NODE}.} +\docparam{props}{If not \NULL, this \helpref{wxXmlProperty}{wxxmlproperty} object +and its eventual siblings are attached to the node.} \docparam{next}{If not \NULL, this node and its eventual siblings are attached to the node.} +Creates this XML node and eventually insert it into an existing XML tree. + \func{}{wxXmlNode}{\param{const wxXmlNode\& }{node}} Copy constructor. Note that this does NOT copy syblings -and parent pointer, i.e. \helpref{GetParent()}{wxxmlnodegetparent} and \helpref{GetNext()}{wxxmlnodegetnext} will return \NULL +and parent pointer, i.e. \helpref{GetParent()}{wxxmlnodegetparent} and +\helpref{GetNext()}{wxxmlnodegetnext} will return \NULL after using copy ctor and are never unmodified by operator=. On the other hand, it DOES copy children and properties. @@ -90,7 +97,7 @@ On the other hand, it DOES copy children and properties. \func{}{wxXmlNode}{\param{wxXmlNodeType }{type}, \param{const wxString\& }{name}, \param{const wxString\& }{content = wxEmptyString}} -A simplified version of the first constructor form. +A simplified version of the first constructor form, assuming a \NULL parent. \membersection{wxXmlNode::\destruct{wxXmlNode}}\label{wxxmlnodedtor} @@ -124,7 +131,7 @@ Removes the first properties which has the given {\it name} from the list of pro \membersection{wxXmlNode::GetChildren}\label{wxxmlnodegetchildren} -\constfunc{wxXmlNode*}{GetChildren}{\param{void}{}} +\constfunc{wxXmlNode*}{GetChildren}{\void} Returns the first child of this node. To get a pointer to the second child of this node (if it does exist), use the @@ -139,6 +146,17 @@ Be aware that for nodes of type \texttt{wxXML\_ELEMENT\_NODE} (the most used nod content is an empty string. See \helpref{GetNodeContent()}{wxxmlnodegetnodecontent} for more details. +\membersection{wxXmlNode::GetDepth}\label{wxxmlnodegetdepth} + +\constfunc{int}{GetDepth}{\param{wxXmlNode* }{grandparent = NULL}} + +Returns the number of nodes which separe this node from {\tt grandparent}. + +This function searches only the parents of this node until it finds {\tt grandparent} +or the \NULL node (which is the parent of non-linked nodes or the parent of a +\helpref{wxXmlDocument}{wxxmldocument}'s root node). + + \membersection{wxXmlNode::GetNodeContent}\label{wxxmlnodegetnodecontent} \constfunc{wxString}{GetNodeContent}{\void} @@ -213,9 +231,20 @@ Returns \true if this node has a property named {\it propName}. \membersection{wxXmlNode::InsertChild}\label{wxxmlnodeinsertchild} -\func{void}{InsertChild}{\param{wxXmlNode* }{child}, \param{wxXmlNode* }{before\_node}} +\func{bool}{InsertChild}{\param{wxXmlNode* }{child}, \param{wxXmlNode* }{before\_node}} Inserts the {\it child} node after {\it before\_node} in the children list. +If {\it before\_node} is \NULL, then {\it child} is prepended to the list of children and +becomes the first child of this node. +Returns \true if {\it before\_node} has been found and the {\it child} node has been inserted. + +\membersection{wxXmlNode::IsWhitespaceOnly}\label{wxxmlnodecontainsiswhitespaceonly} + +\constfunc{bool}{IsWhitespaceOnly}{\void} + +Returns \true if the content of this node is a string containing only whitespaces (spaces, +tabs, new lines, etc). Note that this function is locale-independent since the parsing of XML +documents must always produce the exact same tree regardless of the locale it runs under. \membersection{wxXmlNode::RemoveChild}\label{wxxmlnoderemovechild} @@ -224,6 +253,8 @@ Inserts the {\it child} node after {\it before\_node} in the children list. Removes the given node from the children list. Returns \true if the node was found and removed or \false if the node could not be found. +Note that the caller is reponsible for deleting the removed node in order to avoid memory leaks. + \membersection{wxXmlNode::SetChildren}\label{wxxmlnodesetchildren} \func{void}{SetChildren}{\param{wxXmlNode* }{child}}