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.

45 lines
907 B

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. Abstract:
  5. History:
  6. --*/
  7. #ifndef __WBEM_TEXT_TEMPLATE__H_
  8. #define __WBEM_TEXT_TEMPLATE__H_
  9. #include <windows.h>
  10. #include <wbemidl.h>
  11. #include <wstring.h>
  12. class CTextTemplate
  13. {
  14. protected:
  15. WString m_wsTemplate;
  16. public:
  17. CTextTemplate(LPCWSTR wszTemplate = NULL);
  18. ~CTextTemplate();
  19. void SetTemplate(LPCWSTR wszTemplate);
  20. BSTR Apply(IWbemClassObject* pObj);
  21. private:
  22. BSTR HandleEmbeddedObjectProperties(WCHAR* wszTemplate, IWbemClassObject* pObj);
  23. BOOL IsEmbeddedObjectProperty(WCHAR * wszProperty);
  24. BSTR GetPropertyFromIUnknown(WCHAR *wszProperty, IUnknown *pUnk);
  25. BSTR ProcessArray(const VARIANT& v, BSTR str);
  26. void ConcatWithoutQuotes(WString& str, BSTR& property);
  27. bool HasEscapeSequence(BSTR str);
  28. BSTR ReturnEscapedReturns(BSTR str);
  29. };
  30. #endif