本文整理汇总了C++中codedocument::Iterator::isEOF方法的典型用法代码示例。如果您正苦于以下问题:C++ Iterator::isEOF方法的具体用法?C++ Iterator::isEOF怎么用?C++ Iterator::isEOF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类codedocument::Iterator
的用法示例。
在下文中一共展示了Iterator::isEOF方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getIteratorForPosition
void CodeEditorComponent::getIteratorForPosition (int position, CodeDocument::Iterator& source)
{
if (codeTokeniser == 0)
return;
for (int i = cachedIterators.size(); --i >= 0;)
{
CodeDocument::Iterator* t = cachedIterators.getUnchecked (i);
if (t->getPosition() <= position)
{
source = *t;
break;
}
}
while (source.getPosition() < position)
{
const CodeDocument::Iterator original (source);
codeTokeniser->readNextToken (source);
if (source.getPosition() > position || source.isEOF())
{
source = original;
break;
}
}
}
示例2: updateCachedIterators
void CodeEditorComponent::updateCachedIterators (int maxLineNum)
{
const int maxNumCachedPositions = 5000;
const int linesBetweenCachedSources = jmax (10, document.getNumLines() / maxNumCachedPositions);
if (cachedIterators.size() == 0)
cachedIterators.add (new CodeDocument::Iterator (&document));
if (codeTokeniser == 0)
return;
for (;;)
{
CodeDocument::Iterator* last = cachedIterators.getLast();
if (last->getLine() >= maxLineNum)
break;
CodeDocument::Iterator* t = new CodeDocument::Iterator (*last);
cachedIterators.add (t);
const int targetLine = last->getLine() + linesBetweenCachedSources;
for (;;)
{
codeTokeniser->readNextToken (*t);
if (t->getLine() >= targetLine)
break;
if (t->isEOF())
return;
}
}
}