X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/434cf5a4488ebcf1101cce6e0aec4c438c5e86fc..6e65f80be5dfcc75bd520fc320d3389e4559bccf:/docs/latex/wx/xmlnode.tex?ds=sidebyside diff --git a/docs/latex/wx/xmlnode.tex b/docs/latex/wx/xmlnode.tex index a7e693e43b..2e00889722 100644 --- a/docs/latex/wx/xmlnode.tex +++ b/docs/latex/wx/xmlnode.tex @@ -124,7 +124,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 @@ -135,15 +135,26 @@ To get a pointer to the second child of this node (if it does exist), use the \constfunc{wxString}{GetContent}{\void} Returns the content of this node. Can be an empty string. -Be aware that for nodes of type \texttt{wxXML_ELEMENT_NODE} (the most used node type) the +Be aware that for nodes of type \texttt{wxXML\_ELEMENT\_NODE} (the most used node type) the 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} -Returns the content of the first child node of type \texttt{wxXML_TEXT_NODE} or \texttt{wxXML_CDATA_SECTION_NODE}. +Returns the content of the first child node of type \texttt{wxXML\_TEXT\_NODE} or \texttt{wxXML\_CDATA\_SECTION\_NODE}. This function is very useful since the XML snippet \texttt{``tagcontent"} is represented by expat with the following tag tree: @@ -159,7 +170,7 @@ wxXML_ENTITY_NODE name="tagname", content="" |-- wxXML_CDATA_SECTION_NODE name="", content="tagcontent" \end{verbatim} -An empty string is returned if the node has no children of type \texttt{wxXML_TEXT_NODE} or \texttt{wxXML_CDATA_SECTION_NODE}, or if the content of the first child of such types is empty. +An empty string is returned if the node has no children of type \texttt{wxXML\_TEXT\_NODE} or \texttt{wxXML\_CDATA\_SECTION\_NODE}, or if the content of the first child of such types is empty. \membersection{wxXmlNode::GetName}\label{wxxmlnodegetname} @@ -213,9 +224,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 +246,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}}