本文整理汇总了C++中nsAutoTArray::IndexOf方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAutoTArray::IndexOf方法的具体用法?C++ nsAutoTArray::IndexOf怎么用?C++ nsAutoTArray::IndexOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsAutoTArray
的用法示例。
在下文中一共展示了nsAutoTArray::IndexOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTopAncestorInRange
void
nsContentSubtreeIterator::Next()
{
if (mIsDone || !mCurNode)
return;
if (mCurNode == mLast)
{
mIsDone = PR_TRUE;
return;
}
nsINode *nextNode = GetNextSibling(mCurNode, nsnull);
NS_ASSERTION(nextNode, "No next sibling!?! This could mean deadlock!");
/*
nextNode = GetDeepFirstChild(nextNode);
return GetTopAncestorInRange(nextNode, address_of(mCurNode));
*/
PRInt32 i = mEndNodes.IndexOf(nextNode);
while (i != -1)
{
// as long as we are finding ancestors of the endpoint of the range,
// dive down into their children
nextNode = nextNode->GetChildAt(0);
NS_ASSERTION(nextNode, "Iterator error, expected a child node!");
// should be impossible to get a null pointer. If we went all the way
// down the child chain to the bottom without finding an interior node,
// then the previous node should have been the last, which was
// was tested at top of routine.
i = mEndNodes.IndexOf(nextNode);
}
mCurNode = nextNode;
// This shouldn't be needed, but since our selection code can put us
// in a situation where mLast is in generated content, we need this
// to stop the iterator when we've walked past past the last node!
mIsDone = mCurNode == nsnull;
return;
}