本文整理汇总了C++中ExpressionNode::GetAbsoluteExpression方法的典型用法代码示例。如果您正苦于以下问题:C++ ExpressionNode::GetAbsoluteExpression方法的具体用法?C++ ExpressionNode::GetAbsoluteExpression怎么用?C++ ExpressionNode::GetAbsoluteExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExpressionNode
的用法示例。
在下文中一共展示了ExpressionNode::GetAbsoluteExpression方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Print
// Evaluates and prints a tree version of the active watch list
// The tree will be expanded along the nodes in expansionPath
// Optionally the list is filtered to only show differences from pFilterName (the name of a persisted watch list)
HRESULT WatchCmd::Print(int expansionIndex, __in_z WCHAR* expansionPath, __in_z WCHAR* pFilterName)
{
HRESULT Status = S_OK;
INIT_API_EE();
INIT_API_DAC();
EnableDMLHolder dmlHolder(TRUE);
IfFailRet(InitCorDebugInterface());
PersistList* pFilterList = NULL;
if(pFilterName != NULL)
{
pFilterList = pPersistListHead;
while(pFilterList != NULL)
{
if(_wcscmp(pFilterList->pName, pFilterName)==0)
break;
pFilterList = pFilterList->pNext;
}
}
PersistWatchExpression* pHeadFilterExpr = (pFilterList != NULL) ? pFilterList->pHeadExpr : NULL;
WatchExpression* pExpression = pExpressionListHead;
int index = 1;
while(pExpression != NULL)
{
ExpressionNode* pResult = NULL;
if(FAILED(Status = ExpressionNode::CreateExpressionNode(pExpression->pExpression, &pResult)))
{
ExtOut(" %d) Error: HRESULT 0x%x while evaluating expression \'%S\'", index, Status, pExpression->pExpression);
}
else
{
//check for matching absolute expression
PersistWatchExpression* pCurFilterExpr = pHeadFilterExpr;
while(pCurFilterExpr != NULL)
{
if(_wcscmp(pCurFilterExpr->pExpression, pResult->GetAbsoluteExpression())==0)
break;
pCurFilterExpr = pCurFilterExpr->pNext;
}
// check for matching persist evaluation on the matching expression
BOOL print = TRUE;
if(pCurFilterExpr != NULL)
{
WCHAR pCurPersistResult[MAX_EXPRESSION];
FormatPersistResult(pCurPersistResult, MAX_EXPRESSION, pResult);
if(_wcscmp(pCurPersistResult, pCurFilterExpr->pPersistResult)==0)
{
print = FALSE;
}
}
//expand and print
if(print)
{
if(index == expansionIndex)
pResult->Expand(expansionPath);
PrintCallbackData data;
data.index = index;
WCHAR pCommand[MAX_EXPRESSION];
swprintf_s(pCommand, MAX_EXPRESSION, L"!watch -expand %d", index);
data.pCommand = pCommand;
pResult->DFSVisit(EvalPrintCallback, (VOID*)&data);
}
delete pResult;
}
pExpression = pExpression->pNext;
index++;
}
return Status;
}