// XmlUtils.h: interface for the CXmlUtils class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_XMLUTILS_H__707096EC_D4D7_4D8B_B251_5DC2E686B4FA__INCLUDED_) #define AFX_XMLUTILS_H__707096EC_D4D7_4D8B_B251_5DC2E686B4FA__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define CHECKHR(x) {hr = x; if (FAILED(hr)) goto CleanUp;} #define SAFERELEASE(p) {if (p) {(p)->Release(); p = NULL;}} class CXmlUtils { public: static CString GetText (MSXML::IXMLDOMNode *pNode); static BOOL LoadDocumentSync(MSXML::IXMLDOMDocument *pDoc, CString fName, char **Error); static MSXML::IXMLDOMNodeList* GetNodeList(MSXML::IXMLDOMNode *pParent, CString str); static CString GetNodeTextByName(MSXML::IXMLDOMNode *pParent, CString str); static MSXML::IXMLDOMNode * GetNodeByName(MSXML::IXMLDOMNode *pParent, CString str); static CString GetNodeTextByIndex(MSXML::IXMLDOMNodeList *pNodeList, int i); static CString itoa(int i); static CString ftoa(float source); static BOOL SaveDocument(MSXML::IXMLDOMDocument *pDoc, CString fName); static CString GetXML(MSXML::IXMLDOMNode* pNode); static MSXML::IXMLDOMDocument* CreateDoc(); static MSXML::IXMLDOMNode * AddNode(MSXML::IXMLDOMDocument* pDoc, MSXML::IXMLDOMNode * Parent, CString tagName, CString text); static BOOL loadXMLStr(MSXML::IXMLDOMDocument *pDoc, BSTR xmlString, char **Error); static BOOL loadXMLCStr(MSXML::IXMLDOMDocument *pDoc, CString xmlString, char **Error); static HRESULT CheckLoad(MSXML::IXMLDOMDocument* pDoc, char **Error); static HRESULT ReportError(MSXML::IXMLDOMParseError *pXMLError, char ** Error); }; #endif // !defined(AFX_XMLUTILS_H__707096EC_D4D7_4D8B_B251_5DC2E686B4FA__INCLUDED_)