Leaked source code of windows server 2003
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.

110 lines
2.4 KiB

  1. /******************************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. WMIParser_Property_Scalar.cpp
  5. Abstract:
  6. This file contains the implementation of the WMIParser::Property_Scalar class,
  7. which is used to hold the data of an property inside a CIM schema.
  8. Revision History:
  9. Davide Massarenti (Dmassare) 07/25/99
  10. created
  11. ******************************************************************************/
  12. #include "stdafx.h"
  13. #define TAG_VALUE L"VALUE"
  14. WMIParser::Property_Scalar::Property_Scalar()
  15. {
  16. __HCP_FUNC_ENTRY( "WMIParser::Property_Scalar::Property_Scalar" );
  17. // Value m_wmipvData;
  18. }
  19. WMIParser::Property_Scalar::~Property_Scalar()
  20. {
  21. __HCP_FUNC_ENTRY( "WMIParser::Property_Scalar::~Property_Scalar" );
  22. }
  23. ////////////////////////////////////////////////
  24. bool WMIParser::Property_Scalar::operator==( /*[in]*/ Property_Scalar const &wmipps ) const
  25. {
  26. __HCP_FUNC_ENTRY( "WMIParser::Property_Scalar::operator==" );
  27. bool fRes;
  28. fRes = (*(static_cast<Property const *>(this)) == wmipps.m_szName);
  29. if(fRes)
  30. {
  31. fRes = (this->m_wmipvData == wmipps.m_wmipvData);
  32. }
  33. __HCP_FUNC_EXIT(fRes);
  34. }
  35. ////////////////////////////////////////////////
  36. HRESULT WMIParser::Property_Scalar::put_Node( /*[in]*/ IXMLDOMNode* pxdnNode )
  37. {
  38. __HCP_FUNC_ENTRY( "WMIParser::Property_Scalar::put_Node" );
  39. HRESULT hr;
  40. __MPC_EXIT_IF_METHOD_FAILS(hr, (static_cast<Property*>(this))->put_Node( pxdnNode ));
  41. __MPC_EXIT_IF_METHOD_FAILS(hr, m_wmipvData.Parse( pxdnNode, TAG_VALUE ));
  42. hr = S_OK;
  43. __HCP_FUNC_CLEANUP;
  44. __HCP_FUNC_EXIT(hr);
  45. }
  46. ////////////////////////////////////////////////
  47. HRESULT WMIParser::Property_Scalar::get_Data( /*[out]*/ MPC::wstring& szData )
  48. {
  49. __HCP_FUNC_ENTRY( "WMIParser::Property_Scalar::get_Data" );
  50. HRESULT hr;
  51. hr = m_wmipvData.get_Data( szData );
  52. __HCP_FUNC_EXIT(hr);
  53. }
  54. HRESULT WMIParser::Property_Scalar::put_Data( /*[in]*/ const MPC::wstring& szData ,
  55. /*[out]*/ bool& fFound )
  56. {
  57. __HCP_FUNC_ENTRY( "WMIParser::Property_Scalar::put_Data" );
  58. HRESULT hr;
  59. CComVariant vValue( szData.c_str() );
  60. __MPC_EXIT_IF_METHOD_FAILS(hr, m_xmlNode.PutValue( TAG_VALUE, vValue, fFound ));
  61. hr = S_OK;
  62. __HCP_FUNC_CLEANUP;
  63. __HCP_FUNC_EXIT(hr);
  64. }