From 59f72fa52bd560003af3c4635f92a885d1c07dbc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Feb 2019 13:55:31 +0300 Subject: XmlFirstChild / XmlGetAttr - safe wrappers for tinyxml2 --- include/m_xml.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include') 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 @@ -47,6 +47,23 @@ typedef tinyxml2::XMLDocument TiXmlDocument; 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 // -- cgit v1.2.3