本文整理汇总了C++中nsTArray::GreatestIndexLtEq方法的典型用法代码示例。如果您正苦于以下问题:C++ nsTArray::GreatestIndexLtEq方法的具体用法?C++ nsTArray::GreatestIndexLtEq怎么用?C++ nsTArray::GreatestIndexLtEq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsTArray
的用法示例。
在下文中一共展示了nsTArray::GreatestIndexLtEq方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Append
//.........这里部分代码省略.........
mVInt <<= 8;
mVInt |= *p++;
mVIntLeft -= 1;
} else {
mState = mNextState;
}
break;
case TIMECODE_SYNC:
if (*p++ != TIMECODE_ID) {
p -= 1;
mState = CLUSTER_SYNC;
break;
}
mClusterTimecode = 0;
mState = READ_VINT;
mNextState = READ_CLUSTER_TIMECODE;
break;
case READ_CLUSTER_TIMECODE:
if (mVInt) {
mClusterTimecode <<= 8;
mClusterTimecode |= *p++;
mVInt -= 1;
} else {
mState = ANY_BLOCK_SYNC;
}
break;
case ANY_BLOCK_SYNC: {
unsigned char c = *p++;
if (c == BLOCKGROUP_ID) {
mState = READ_VINT;
mNextState = ANY_BLOCK_SYNC;
} else if (c == SIMPLEBLOCK_ID || c == BLOCK_ID) {
mBlockOffset = mCurrentOffset + (p - aBuffer) - 1;
mState = READ_VINT;
mNextState = READ_BLOCK;
} else {
uint32_t length = VIntLength(c, nullptr);
if (length == 4) {
p -= 1;
mState = CLUSTER_SYNC;
} else {
mState = READ_VINT;
mNextState = SKIP_ELEMENT;
}
}
break;
}
case READ_BLOCK:
mBlockSize = mVInt;
mBlockTimecode = 0;
mBlockTimecodeLength = 2;
mState = READ_VINT;
mNextState = READ_BLOCK_TIMECODE;
break;
case READ_BLOCK_TIMECODE:
if (mBlockTimecodeLength) {
mBlockTimecode <<= 8;
mBlockTimecode |= *p++;
mBlockTimecodeLength -= 1;
} else {
// It's possible we've parsed this data before, so avoid inserting
// duplicate nsWebMTimeDataOffset entries.
{
ReentrantMonitorAutoEnter mon(aReentrantMonitor);
uint32_t idx;
if (!aMapping.GreatestIndexLtEq(mBlockOffset, idx)) {
nsWebMTimeDataOffset entry(mBlockOffset, mClusterTimecode + mBlockTimecode);
aMapping.InsertElementAt(idx, entry);
}
}
// Skip rest of block header and the block's payload.
mBlockSize -= mVIntLength;
mBlockSize -= 2;
mSkipBytes = uint32_t(mBlockSize);
mState = SKIP_DATA;
mNextState = ANY_BLOCK_SYNC;
}
break;
case SKIP_DATA:
if (mSkipBytes) {
uint32_t left = aLength - (p - aBuffer);
left = NS_MIN(left, mSkipBytes);
p += left;
mSkipBytes -= left;
} else {
mState = mNextState;
}
break;
case SKIP_ELEMENT:
mSkipBytes = uint32_t(mVInt);
mState = SKIP_DATA;
mNextState = ANY_BLOCK_SYNC;
break;
}
}
NS_ASSERTION(p == aBuffer + aLength, "Must have parsed to end of data.");
mCurrentOffset += aLength;
}