IDebugHostTypeSignature::IsMatch 方法 (dbgmodel.h)

IsMatch 方法返回指示特定类型实例是否与类型签名中指定的条件匹配。 如果返回,则返回此指示,以及一个枚举器,该枚举器将指示类型实例的所有特定部分 (作为符号) 与类型签名中的通配符匹配。

语法

HRESULT IsMatch(
  IDebugHostType             *type,
  bool                       *isMatch,
  IDebugHostSymbolEnumerator **wildcardMatches
);

参数

type

要与类型签名进行比较的类型实例。

isMatch

此处返回类型实例是否与类型签名匹配的指示。

wildcardMatches

如果类型实例与类型签名匹配,则将在此处返回枚举器,该枚举器将枚举类型实例的所有特定部分 (作为符号) 与类型签名中的通配符匹配。

返回值

此方法返回指示成功或失败的 HRESULT。

注解

示例代码

ComPtr<IDebugHostSymbols> spSym; /* get the host's symbols interface */
ComPtr<IDebugHostType> spType;   /* get a type */

ComPtr<IDebugHostTypeSignature> spSig;
if (SUCCEEDED(spSym->CreateTypeSignature(L"MyTemplateType<*>", 
                                         nullptr, 
                                         &spSig)))
{
    bool isMatch;
    ComPtr<IDebugHostSymbolEnumerator> spWildcardEnum;
    if (SUCCEEDED(spSig->IsMatch(spType.get(), &isMatch, &spWildcardEnum)))
    {
        // isMatch will contain whether the type matches the signature (whether 
        // it is a MyTemplateType template with *ANY* template arguments
        if (isMatch)
        {
            // spWildcardEnum will contain what the '*' in 'MyTemplateType<*>' 
            // matched against.  This may be one or more template arguments in 
            // linear order.  An IDebugHostType would be present for type arguments.
        }
    }
}

要求

要求
Header dbgmodel.h

另请参阅

IDebugHostTypeSignature 接口