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.
}
}
}
要求
要求 | 價值 |
---|---|
標頭 | dbgmodel.h |