windows-nt/Source/XPSP1/NT/admin/wmi/wbem/winmgmt/wbemcomn/txttempl.h

46 lines
862 B
C
Raw Normal View History

2020-09-26 03:20:57 -05:00
/*++
Copyright (C) 1996-2001 Microsoft Corporation
Module Name:
Abstract:
History:
--*/
#ifndef __WBEM_TEXT_TEMPLATE__H_
#define __WBEM_TEXT_TEMPLATE__H_
#include <windows.h>
#include <wbemidl.h>
#include <wstring.h>
class CTextTemplate
{
protected:
WString m_wsTemplate;
public:
CTextTemplate(LPCWSTR wszTemplate = NULL);
~CTextTemplate();
void SetTemplate(LPCWSTR wszTemplate);
BSTR Apply(IWbemClassObject* pObj);
private:
BSTR HandleEmbeddedObjectProperties(WCHAR* wszTemplate, IWbemClassObject* pObj);
BOOL IsEmbeddedObjectProperty(WCHAR * wszProperty);
BSTR GetPropertyFromIUnknown(WCHAR *wszProperty, IUnknown *pUnk);
BSTR ProcessArray(const VARIANT& v, BSTR str);
void ConcatWithoutQuotes(WString& str, BSTR& property);
bool HasEscapeSequence(BSTR str);
BSTR ReturnEscapedReturns(BSTR str);
};
#endif