]>
git.saurik.com Git - wxWidgets.git/blob - contrib/utils/wxrcedit/xmlhelpr.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Author: Vaclav Slavik
5 // Copyright: (c) 2000 Vaclav Slavik
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
10 #pragma implementation "xmlhelpr.h"
13 // For compilers that support precompilation, includes "wx/wx.h".
14 #include "wx/wxprec.h"
20 #include "wx/xml/xml.h"
26 wxXmlNode
*XmlFindNode(wxXmlNode
*parent
, const wxString
& param
)
28 wxXmlNode
*n
= parent
->GetChildren();
32 if (n
->GetType() == wxXML_ELEMENT_NODE
&& n
->GetName() == param
)
40 void XmlWriteValue(wxXmlNode
*parent
, const wxString
& name
, const wxString
& value
)
42 wxXmlNode
*n
= XmlFindNode(parent
, name
);
45 n
= new wxXmlNode(wxXML_ELEMENT_NODE
, name
);
47 n
->AddChild(new wxXmlNode(wxXML_TEXT_NODE
, ""));
54 if (n
->GetType() == wxXML_TEXT_NODE
||
55 n
->GetType() == wxXML_CDATA_SECTION_NODE
)
66 wxString
XmlReadValue(wxXmlNode
*parent
, const wxString
& name
)
68 wxXmlNode
*n
= XmlFindNode(parent
, name
);
69 if (n
== NULL
) return wxEmptyString
;
74 if (n
->GetType() == wxXML_TEXT_NODE
||
75 n
->GetType() == wxXML_CDATA_SECTION_NODE
)
76 return n
->GetContent();