Code::Blocks  SVN r11506
Public Member Functions | Private Member Functions | Private Attributes | List of all members
FindReplace Class Reference

#include <find_replace.h>

Collaboration diagram for FindReplace:

Public Member Functions

 FindReplace ()
 
 ~FindReplace ()
 
void CreateSearchLog ()
 
int ShowFindDialog (bool replace, bool explicitly_find_in_files=false)
 
int FindNext (bool goingDown, cbStyledTextCtrl *control, cbFindReplaceData *data, bool selected)
 
int FindSelectedText (bool goingDown)
 

Private Member Functions

void LogSearch (const wxString &file, int line, const wxString &lineText)
 
void CalculateFindReplaceStartEnd (cbStyledTextCtrl *control, cbFindReplaceData *data, bool replace=false)
 
int Find (cbStyledTextCtrl *control, cbFindReplaceData *data)
 
int FindInFiles (cbFindReplaceData *data)
 
int Replace (cbStyledTextCtrl *control, cbFindReplaceData *data)
 
int ReplaceInFiles (cbFindReplaceData *data)
 

Private Attributes

cbFindReplaceDatam_LastFindReplaceData
 
cbSearchResultsLogm_pSearchLog
 

Detailed Description

Definition at line 9 of file find_replace.h.

Constructor & Destructor Documentation

◆ FindReplace()

FindReplace::FindReplace ( )

Definition at line 105 of file find_replace.cpp.

◆ ~FindReplace()

FindReplace::~FindReplace ( )

Definition at line 110 of file find_replace.cpp.

References m_LastFindReplaceData.

Member Function Documentation

◆ CalculateFindReplaceStartEnd()

void FindReplace::CalculateFindReplaceStartEnd ( cbStyledTextCtrl control,
cbFindReplaceData data,
bool  replace = false 
)
private

◆ CreateSearchLog()

void FindReplace::CreateSearchLog ( )

◆ Find()

int FindReplace::Find ( cbStyledTextCtrl control,
cbFindReplaceData data 
)
private

◆ FindInFiles()

int FindReplace::FindInFiles ( cbFindReplaceData data)
private

Definition at line 1304 of file find_replace.cpp.

References _(), _T, wxArrayString::Add(), ProjectFile::buildTargets, wxString::c_str(), cbEVT_SHOW_LOG_MANAGER, cbEVT_SWITCH_TO_LOG_WINDOW, cbMessageBox(), ListCtrlLogger::Clear(), cbFindReplaceData::delOldSearches, ProjectFile::file, Find(), FindNext(), cbFindReplaceData::findText, cbSearchResultsLog::FocusEntry(), Manager::Get(), wxDir::GetAllFiles(), Manager::GetAppWindow(), GetArrayFromString(), cbProject::GetBuildTarget(), EditorManager::GetBuiltinActiveEditor(), EditorManager::GetBuiltinEditor(), cbEditor::GetControl(), wxArrayString::GetCount(), Manager::GetEditorManager(), EditorManager::GetEditorsCount(), EditorBase::GetFilename(), cbProject::GetFilesList(), wxFileName::GetFullPath(), ListCtrlLogger::GetItemsCount(), wxScintilla::GetLine(), EditorManager::GetNotebook(), Manager::GetProjectManager(), ProjectManager::GetProjects(), wxScintilla::GetSelectionStart(), wxScintilla::GetText(), CompileTargetBase::GetTitle(), EncodingDetector::GetWxStr(), cbFindReplaceData::hiddenSearch, wxArrayString::Index(), EditorManager::IsBuiltinOpen(), wxString::IsEmpty(), EncodingDetector::IsOK(), wxScintilla::LineFromPosition(), LogSearch(), m_LastFindReplaceData, m_pSearchLog, wxFileName::MakeRelativeTo(), PlaceWindow(), wxString::Printf(), Manager::ProcessEvent(), cbFindReplaceData::recursiveSearch, cbFindReplaceData::scope, cbFindReplaceData::searchMask, cbFindReplaceData::searchPath, cbFindReplaceData::searchProject, cbFindReplaceData::searchTarget, cbSearchResultsLog::SetBasePath(), wxScintilla::SetSCIFocus(), wxScintilla::SetText(), wxArrayString::Sort(), cbFindReplaceData::sortSearchResult, cbFindReplaceData::startFile, wxString::StartsWith(), wxGenericProgressDialog::Update(), wxDefaultPosition, wxDIR_DIRS, wxDIR_FILES, wxDIR_HIDDEN, wxEmptyString, wxFileExists(), wxICON_INFORMATION, wxICON_WARNING, wxPD_APP_MODAL, wxPD_AUTO_HIDE, and wxPD_CAN_ABORT.

Referenced by ShowFindDialog().

◆ FindNext()

int FindReplace::FindNext ( bool  goingDown,
cbStyledTextCtrl control,
cbFindReplaceData data,
bool  selected 
)

◆ FindSelectedText()

int FindReplace::FindSelectedText ( bool  goingDown)

◆ LogSearch()

void FindReplace::LogSearch ( const wxString file,
int  line,
const wxString lineText 
)
private

◆ Replace()

int FindReplace::Replace ( cbStyledTextCtrl control,
cbFindReplaceData data 
)
private

Definition at line 409 of file find_replace.cpp.

References _(), _T, cbFindReplaceData::autoWrapSearch, wxScintilla::BeginUndoAction(), ConfirmReplaceDlg::CalcPosition(), CalculateFindReplaceStartEnd(), cbMessageBox(), wxRegEx::Compile(), cbFindReplaceData::ConvertEOLs(), wxScintilla::ConvertEOLs(), crAll, crCancel, crNo, crYes, cbFindReplaceData::directionDown, InfoWindow::Display(), cbFindReplaceData::end, wxScintilla::EndUndoAction(), wxScintilla::EnsureVisible(), cbFindReplaceData::findText, wxScintilla::FindText(), cbFindReplaceData::fixEOLs, Manager::Get(), Manager::GetConfigManager(), wxScintilla::GetEOLMode(), wxScintilla::GetLength(), wxRegEx::GetMatch(), wxScintilla::GetReadOnly(), wxScintilla::GetSelectedText(), wxScintilla::GetSelectionEnd(), wxScintilla::GetSelectionStart(), wxScintilla::GetTextRange(), wxScintilla::GotoPos(), cbFindReplaceData::initialreplacing, cbFindReplaceData::IsMultiLine(), wxString::Len(), wxString::Length(), wxScintilla::LineFromPosition(), cbFindReplaceData::matchCase, wxRegEx::Matches(), cbFindReplaceData::matchWord, wxString::Mid(), wxString::Printf(), ConfigManager::ReadBool(), cbFindReplaceData::regEx, wxRegEx::Replace(), wxScintilla::ReplaceSelection(), wxScintilla::ReplaceTargetRE(), cbFindReplaceData::replaceText, cbFindReplaceData::scope, wxScintilla::SetChangeCollection(), wxScintilla::SetSCIFocus(), wxScintilla::SetSelectionVoid(), wxScintilla::SetTargetEnd(), wxScintilla::SetTargetStart(), wxDialog::ShowModal(), cbFindReplaceData::start, cbFindReplaceData::startFile, cbFindReplaceData::startWord, wxBell(), wxCANCEL, wxICON_EXCLAMATION, wxICON_INFORMATION, wxICON_QUESTION, wxID_OK, wxOK, wxRE_ADVANCED, wxRE_ICASE, wxRE_NEWLINE, wxSCI_FIND_MATCHCASE, wxSCI_FIND_POSIX, wxSCI_FIND_REGEXP, wxSCI_FIND_WHOLEWORD, and wxSCI_FIND_WORDSTART.

Referenced by ShowFindDialog().

◆ ReplaceInFiles()

int FindReplace::ReplaceInFiles ( cbFindReplaceData data)
private

Definition at line 678 of file find_replace.cpp.

References _(), _T, wxArrayString::Add(), wxScintilla::BeginUndoAction(), ProjectFile::buildTargets, ConfirmReplaceDlg::CalcPosition(), CalculateFindReplaceStartEnd(), cbMessageBox(), cbReadFileContents(), EditorManager::Close(), wxRegEx::Compile(), cbFindReplaceData::ConvertEOLs(), wxScintilla::ConvertEOLs(), crAll, crAllInFile, crCancel, crNo, crSkipFile, crYes, cbFindReplaceData::directionDown, InfoWindow::Display(), cbFindReplaceData::end, wxScintilla::EndUndoAction(), wxScintilla::EnsureVisible(), ProjectFile::file, wxString::Find(), cbFindReplaceData::findText, wxScintilla::FindText(), cbFindReplaceData::fixEOLs, Manager::Get(), wxDir::GetAllFiles(), Manager::GetAppWindow(), GetArrayFromString(), cbProject::GetBuildTarget(), EditorManager::GetBuiltinEditor(), Manager::GetConfigManager(), cbEditor::GetControl(), wxArrayString::GetCount(), Manager::GetEditorManager(), EditorManager::GetEditorsCount(), wxFontMapper::GetEncodingFromName(), wxScintilla::GetEOLMode(), EditorBase::GetFilename(), cbProject::GetFilesList(), wxFileName::GetFullPath(), wxRegEx::GetMatch(), Manager::GetProjectManager(), ProjectManager::GetProjects(), wxScintilla::GetReadOnly(), wxScintilla::GetSelectedText(), wxScintilla::GetSelectionEnd(), wxScintilla::GetSelectionStart(), wxLocale::GetSystemEncodingName(), wxScintilla::GetTextRange(), CompileTargetBase::GetTitle(), wxScintilla::GotoPos(), cbFindReplaceData::hiddenSearch, wxArrayString::Index(), cbFindReplaceData::initialreplacing, wxString::IsEmpty(), cbFindReplaceData::IsMultiLine(), EditorManager::IsOpen(), wxFile::IsOpened(), wxString::Len(), wxString::Length(), wxScintilla::LineFromPosition(), cbFindReplaceData::matchCase, wxRegEx::Matches(), cbFindReplaceData::matchWord, wxString::Mid(), NULL, AnnoyingDialog::OK, EditorManager::Open(), PlaceWindow(), wxString::Printf(), ConfigManager::Read(), ConfigManager::ReadBool(), cbFindReplaceData::recursiveSearch, cbFindReplaceData::regEx, wxRegEx::Replace(), wxScintilla::ReplaceSelection(), wxScintilla::ReplaceTargetRE(), cbFindReplaceData::replaceText, wxGenericProgressDialog::Resume(), cbFindReplaceData::scope, cbFindReplaceData::searchMask, cbFindReplaceData::searchPath, cbFindReplaceData::searchProject, cbFindReplaceData::searchTarget, EditorManager::SetActiveEditor(), wxScintilla::SetChangeCollection(), wxScintilla::SetSelectionVoid(), wxScintilla::SetTargetEnd(), wxScintilla::SetTargetStart(), wxDialog::ShowModal(), AnnoyingDialog::ShowModal(), cbFindReplaceData::start, cbFindReplaceData::startFile, cbFindReplaceData::startWord, wxGenericProgressDialog::Update(), wxString::Upper(), wxART_INFORMATION, wxDIR_DIRS, wxDIR_FILES, wxDIR_HIDDEN, wxEmptyString, wxFileExists(), wxICON_QUESTION, wxICON_WARNING, wxID_YES, wxPD_APP_MODAL, wxPD_AUTO_HIDE, wxPD_CAN_ABORT, wxRE_ADVANCED, wxRE_ICASE, wxRE_NEWLINE, wxSCI_FIND_MATCHCASE, wxSCI_FIND_POSIX, wxSCI_FIND_REGEXP, wxSCI_FIND_WHOLEWORD, wxSCI_FIND_WORDSTART, and wxYES_NO.

Referenced by ShowFindDialog().

◆ ShowFindDialog()

int FindReplace::ShowFindDialog ( bool  replace,
bool  explicitly_find_in_files = false 
)

Definition at line 166 of file find_replace.cpp.

References _(), _T, cbFindReplaceData::autoWrapSearch, cbMessageBox(), cbFindReplaceData::delOldSearches, cbFindReplaceData::directionDown, wxString::empty(), cbFindReplaceData::end, cbFindReplaceData::eolMode, Find(), FindInFiles(), cbFindReplaceData::findInFiles, cbFindReplaceData::findText, cbFindReplaceData::findUsesSelectedText, cbFindReplaceData::fixEOLs, Manager::Get(), EditorManager::GetActiveEditor(), FindReplaceBase::GetAutoWrapSearch(), EditorManager::GetBuiltinEditor(), cbEditor::GetControl(), wxScintilla::GetCurrentPos(), FindReplaceBase::GetDeleteOldSearches(), FindReplaceBase::GetDirection(), Manager::GetEditorManager(), FindReplaceBase::GetFindString(), FindReplaceBase::GetFindUsesSelectedText(), FindReplaceBase::GetFixEOLs(), FindReplaceBase::GetHidden(), FindReplaceBase::GetMatchCase(), FindReplaceBase::GetMatchWord(), FindReplaceBase::GetMultiLine(), FindReplaceBase::GetOrigin(), FindReplaceBase::GetProject(), FindReplaceBase::GetRecursive(), FindReplaceBase::GetRegEx(), FindReplaceBase::GetReplaceString(), FindReplaceBase::GetScope(), FindReplaceBase::GetSearchMask(), FindReplaceBase::GetSearchPath(), wxScintilla::GetSelectedText(), wxScintilla::GetSelectionEnd(), wxScintilla::GetSelectionStart(), FindReplaceBase::GetSortSearchResult(), FindReplaceBase::GetStartFile(), FindReplaceBase::GetStartWord(), FindReplaceBase::GetTarget(), wxScintilla::GetTextRange(), cbFindReplaceData::hiddenSearch, cbFindReplaceData::initialreplacing, wxString::IsEmpty(), FindReplaceBase::IsFindInFiles(), wxString::IsSameAs(), wxScintilla::LineFromPosition(), m_LastFindReplaceData, cbFindReplaceData::matchCase, cbFindReplaceData::matchWord, cbFindReplaceData::multiLine, cbFindReplaceData::NewSearch, cbFindReplaceData::originEntireScope, PlaceWindow(), cbFindReplaceData::recursiveSearch, cbFindReplaceData::regEx, Replace(), ReplaceInFiles(), cbFindReplaceData::replaceText, cbFindReplaceData::scope, cbFindReplaceData::SearchInSelectionEnd, cbFindReplaceData::SearchInSelectionStart, cbFindReplaceData::searchMask, cbFindReplaceData::searchPath, cbFindReplaceData::searchProject, cbFindReplaceData::searchTarget, wxDialog::ShowModal(), cbFindReplaceData::sortSearchResult, cbFindReplaceData::start, cbFindReplaceData::startFile, cbFindReplaceData::startWord, wxScintilla::WordEndPosition(), wxScintilla::WordStartPosition(), wxEmptyString, wxICON_ERROR, wxICON_EXCLAMATION, wxID_CANCEL, wxOK, and wxSCI_EOL_LF.

Referenced by FindNext().

Member Data Documentation

◆ m_LastFindReplaceData

cbFindReplaceData* FindReplace::m_LastFindReplaceData
private

Definition at line 31 of file find_replace.h.

Referenced by FindInFiles(), FindNext(), ShowFindDialog(), and ~FindReplace().

◆ m_pSearchLog

cbSearchResultsLog* FindReplace::m_pSearchLog
private

Definition at line 32 of file find_replace.h.

Referenced by CreateSearchLog(), FindInFiles(), and LogSearch().


The documentation for this class was generated from the following files: