// HistoryParser.h: interface for the CHistoryParser class. // ////////////////////////////////////////////////////////////////////// //hcp://system/sysinfo/msinfo.htm #if !defined(AFX_HISTORYPARSER_H__3ECAF67C_3080_4166_A5FB_BF98C0BD9588__INCLUDED_) #define AFX_HISTORYPARSER_H__3ECAF67C_3080_4166_A5FB_BF98C0BD9588__INCLUDED_ #include "fdi.h" // Added by ClassView #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "datasource.h" #include "category.h" extern CTime GetDateFromString(const CString& strDate, int nTimeZone); extern CString GetIDForClass(CString strClass); extern CTime GetDeltaTime(CComPtr pDorSNode); extern HRESULT GetTimeStampFromFromD_or_SNodeNode(CComPtr pDorSNode,CString* pString, int& nTimeZone); extern HRESULT GetDataCollectionNode(CComPtr pXMLDoc,CComPtr& pDCNode); extern CString GetPNPNameByID(CComPtr pDoc,CComBSTR bstrPNPID); //----------------------------------------------------------------------------- // Encapsulates data from a single Instance node in the XML blob // Has methods for comparing identical instances across time slices //----------------------------------------------------------------------------- class CInstance : public CObject { CString m_strClassName; public: CString GetChangeType() { //Note:there will be no change if data is from snapshot CString strChange; m_mapNameValue.Lookup(_T("Change"),strChange); return strChange; } CString GetClassFriendlyName(); HRESULT ProcessPNPAllocatedResource(CComPtr pInstanceNode); HRESULT ProcessPropertyDotReferenceNodes(CComPtr pInstanceNameNode,CString* pstrClassName, CString* pstrKeyName,CString* pstrKeyValue); CString GetInstanceDescription(); CString GetDescriptionForClass(CString strClass); CString GetIDForClass(CString strClass); CInstance(CTime tmstmp, CComPtr pInstanceNode,CString strClass); CMapStringToString m_mapNameValue; CTime m_tmstamp; CString GetClassName(){return m_strClassName;}; BOOL GetValueFromMap(CString strKey,CString& strVal) { return m_mapNameValue.Lookup(strKey, strVal); }; CString GetInstanceID(); }; //----------------------------------------------------------------------------- // Encapsulates the parsing of history data (deltas) from the history XML blob //----------------------------------------------------------------------------- class CHistoryParser : public CObject { private: CTime m_tmBack; CObList m_listInstances; CComPtr m_pDoc; CMSInfoHistoryCategory* m_pHistCat; void DeleteAllInstances(); public: int m_nDeltasBack; BOOL AreThereChangeLines(); BOOL m_fChangeLines; HRESULT Refresh(CMSInfoHistoryCategory* pHistCat,int nDeltasBack); HRESULT GetDeltaAndSnapshotNodes(CComPtr& pDeltaList); CHistoryParser(CComPtr pDoc); virtual ~CHistoryParser(); CInstance* FindPreviousInstance(CInstance* pNewInstance); CString GetIDForClass(CString strClass); void CreateChangeStrings(CInstance* pOld, CInstance* pNew); void ResetInstance(CInstance* pOld, CInstance* pNew); void ProcessInstance(CInstance* pNewInstance); HRESULT GetInstanceNodeList(CString strClass,CComPtr pDeltaNode, CComPtr& pInstanceList); HRESULT ProcessDeltaNode(CComPtr pDeltaNode,CString strClass); HRESULT ProcessDeltas(CComPtr pDeltaList,CString strClassName,int nDeltasBack); }; #endif // !defined(AFX_HISTORYPARSER_H__3ECAF67C_3080_4166_A5FB_BF98C0BD9588__INCLUDED_)