summaryrefslogtreecommitdiff
path: root/include/m_xml.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-26 13:55:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-26 13:55:31 +0300
commit59f72fa52bd560003af3c4635f92a885d1c07dbc (patch)
treea574aa7c8115bda94252bbd0587cf1158b49e1b3 /include/m_xml.h
parent1bf0fece31876c453bea93479e6d0d40bd8a564d (diff)
XmlFirstChild / XmlGetAttr - safe wrappers for tinyxml2
Diffstat (limited to 'include/m_xml.h')
-rw-r--r--include/m_xml.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/m_xml.h b/include/m_xml.h
index 0df86097ad..2403b20997 100644
--- a/include/m_xml.h
+++ b/include/m_xml.h
@@ -48,6 +48,23 @@ typedef tinyxml2::XMLHandle TiXmlHandle;
typedef tinyxml2::XMLConstHandle TiXmlConst;
/////////////////////////////////////////////////////////////////////////////////////////
+// safe wrappers
+
+EXTERN_C MIR_CORE_DLL(int) XmlGetChildCount(const TiXmlElement*);
+
+EXTERN_C MIR_CORE_DLL(TiXmlElement*) XmlAddChild(TiXmlElement*, const char *pszName);
+EXTERN_C MIR_CORE_DLL(TiXmlElement*) XmlAddChildA(TiXmlElement*, const char *pszName, const char *ptszValue);
+EXTERN_C MIR_CORE_DLL(TiXmlElement*) XmlAddChildI(TiXmlElement*, const char *pszName, int iValue);
+
+EXTERN_C MIR_CORE_DLL(int) XmlGetChildInt(const TiXmlElement *hXml, const char *key);
+EXTERN_C MIR_CORE_DLL(const char*) XmlGetChildText(const TiXmlElement *hXml, const char *key);
+EXTERN_C MIR_CORE_DLL(const TiXmlElement*) XmlGetChildByTag(const TiXmlElement *hXml, const char *key, const char *attrName, const char *attrValue);
+EXTERN_C MIR_CORE_DLL(const TiXmlElement*) XmlFirstChild(const TiXmlElement *hXml, const char *key = nullptr);
+
+EXTERN_C MIR_CORE_DLL(void) XmlAddAttr(TiXmlElement*, const char *pszName, const char *ptszValue);
+EXTERN_C MIR_CORE_DLL(const char*) XmlGetAttr(const TiXmlElement*, const char *pszName);
+
+/////////////////////////////////////////////////////////////////////////////////////////
// simple element iterator
//
// allows traversing subnodes in a cycle like