本文整理汇总了C++中Searchable::FindNext方法的典型用法代码示例。如果您正苦于以下问题:C++ Searchable::FindNext方法的具体用法?C++ Searchable::FindNext怎么用?C++ Searchable::FindNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Searchable
的用法示例。
在下文中一共展示了Searchable::FindNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindText
// Starts the search for the user's term.
bool FindReplace::FindText( Searchable::Direction direction )
{
bool found = false;
clearMessage();
if ( !IsValidFindText() )
{
return found;
}
SetCodeViewIfNeeded();
if ( GetLookWhere() == FindReplace::LookWhere_CurrentFile || m_LookWhereCurrentFile)
{
Searchable *searchable = GetAvailableSearchable();
if ( !searchable )
{
return found;
}
found = searchable->FindNext( GetSearchRegex(), direction );
}
else
{
found = FindInAllFiles( direction );
}
if ( found )
{
clearMessage();
}
else
{
CannotFindSearchTerm();
}
UpdatePreviousFindStrings();
return found;
}
示例2: FindInAllFiles
bool FindReplace::FindInAllFiles( Searchable::Direction direction )
{
Searchable *searchable = 0;
bool found = false;
if ( IsCurrentFileInHTMLSelection() )
{
searchable = GetAvailableSearchable();
if ( searchable )
{
found = searchable->FindNext( GetSearchRegex(), direction, m_SpellCheck, false, false);
}
}
if ( !found )
{
// TODO: make this handle all types of files
Resource *containing_resource = GetNextContainingHTMLResource( direction );
if ( containing_resource )
{
// Save if editor or F&R has focus
bool has_focus = HasFocus();
// Save selected resources since opening tabs changes selection
QList<Resource *>selected_resources = GetHTMLFiles();
m_MainWindow.OpenResource( *containing_resource);
while ( !m_MainWindow.GetCurrentContentTab().IsLoadingFinished() )
{
// Make sure Qt processes events, signals and calls slots
qApp->processEvents();
SleepFunctions::msleep( 100 );
}
// Restore selection since opening tabs changes selection
if ( GetLookWhere() == FindReplace::LookWhere_SelectedHTMLFiles && !m_SpellCheck)
{
m_MainWindow.SelectResources(selected_resources);
}
// Reset focus to F&R if it had it
if (has_focus) {
SetFocus();
}
searchable = GetAvailableSearchable();
if ( searchable )
{
found = searchable->FindNext( GetSearchRegex(), direction, m_SpellCheck, true, false );
}
}
else
{
if ( searchable )
{
// Check the part of the original file above the cursor
found = searchable->FindNext( GetSearchRegex(), direction, m_SpellCheck, false, false );
}
}
}
return found;
}