Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.5 KiB

  1. //////////////////////////////////////////////////////////////////////
  2. /****************************************************************************
  3. Copyright information : Copyright (c) 1998-1999 Microsoft Corporation
  4. File Name : WMICliXMLLog.h
  5. Project Name : WMI Command Line
  6. Author Name : Biplab Mistry
  7. Date of Creation (dd/mm/yy) : 02-March-2001
  8. Version Number : 1.0
  9. Revision History :
  10. Last Modified By : Ch. Sriramachandramurthy
  11. Last Modified Date : 09-March-2001
  12. ****************************************************************************/
  13. // WMICliXMLLog.h : header file
  14. //
  15. /*-------------------------------------------------------------------
  16. Class Name : CWMICliXMLLog
  17. Class Type : Concrete
  18. Brief Description : This class encapsulates the functionality needed
  19. for logging the input and output in XML format
  20. Super Classes : None
  21. Sub Classes : None
  22. Classes Used : None
  23. Interfaces Used : None
  24. --------------------------------------------------------------------*/
  25. class CWMICliXMLLog
  26. {
  27. public:
  28. CWMICliXMLLog();
  29. virtual ~CWMICliXMLLog();
  30. // Restrict Assignment
  31. CWMICliXMLLog& operator=(CWMICliXMLLog& rWmiCliXMLLog);
  32. // Attributes
  33. private:
  34. // Pointer to object of type IXMLDOMDocument,
  35. IXMLDOMDocument2 *m_pIXMLDoc;
  36. //the xml log file name
  37. _TCHAR *m_pszLogFile;
  38. //status of whether the new xml document has to be created or not
  39. BOOL m_bCreate;
  40. WMICLIINT m_nItrNum;
  41. BOOL m_bTrace;
  42. ERRLOGOPT m_eloErrLogOpt;
  43. // Operations
  44. private:
  45. HRESULT CreateXMLLogRoot(CParsedInfo& rParsedInfo, BSTR bstrUser);
  46. HRESULT CreateNodeAndSetContent(IXMLDOMNode** pINode, VARIANT varType,
  47. BSTR bstrName, BSTR bstrValue,
  48. CParsedInfo& rParsedInfo);
  49. HRESULT AppendAttribute(IXMLDOMNode* pINode, BSTR bstrAttribName,
  50. VARIANT varValue, CParsedInfo& rParsedInfo);
  51. HRESULT CreateNodeFragment(WMICLIINT nSeqNum, BSTR bstrNode, BSTR bstrStart,
  52. BSTR bstrInput, BSTR bstrOutput, BSTR bstrTarget,
  53. CParsedInfo& rParsedInfo);
  54. HRESULT FrameOutputNode(IXMLDOMNode **pINode, BSTR bstrOutput,
  55. BSTR bstrTarget, CParsedInfo& rParsedInfo);
  56. HRESULT AppendOutputNode(BSTR bstrOutput, BSTR bstrTarget,
  57. CParsedInfo& rParsedInfo);
  58. public:
  59. // write in to the log file
  60. HRESULT WriteToXMLLog(CParsedInfo& rParsedInfo, BSTR bstrOutput);
  61. // Set the Log File Path
  62. void SetLogFilePath(_TCHAR* pszFile);
  63. // Stops the logging
  64. void StopLogging();
  65. void Uninitialize(BOOL bFinal = FALSE);
  66. };