Code::Blocks
SVN r11506
|
#include <coderefactoring.h>
Public Member Functions | |
CodeRefactoring (NativeParser &np) | |
virtual | ~CodeRefactoring () |
void | FindReferences () |
void | RenameSymbols () |
Private Types | |
typedef std::list< crSearchData > | SearchDataList |
typedef std::map< wxString, SearchDataList > | SearchDataMap |
Private Member Functions | |
size_t | SearchInFiles (const wxArrayString &files, const wxString &targetText) |
size_t | VerifyResult (const TokenIdxSet &targetResult, const wxString &targetText, bool isLocalVariable) |
void | Find (cbStyledTextCtrl *control, const wxString &file, const wxString &target) |
wxString | GetSymbolUnderCursor () |
void | DoFindReferences () |
void | DoRenameSymbols (const wxString &targetText, const wxString &replaceText) |
void | GetAllProjectFiles (wxArrayString &files, cbProject *project) |
void | GetOpenedFiles (wxArrayString &files) |
bool | Parse () |
Private Attributes | |
NativeParser & | m_NativeParser |
SearchDataMap | m_SearchDataMap |
Definition at line 23 of file coderefactoring.h.
|
private |
Definition at line 25 of file coderefactoring.h.
|
private |
Definition at line 26 of file coderefactoring.h.
CodeRefactoring::CodeRefactoring | ( | NativeParser & | np | ) |
Definition at line 116 of file coderefactoring.cpp.
|
virtual |
Definition at line 121 of file coderefactoring.cpp.
|
private |
Definition at line 454 of file coderefactoring.cpp.
References _T, wxArrayString::Add(), ListCtrlLogger::Append(), cbEVT_SHOW_LOG_MANAGER, cbEVT_SWITCH_TO_LOG_WINDOW, ListCtrlLogger::Clear(), cbSearchResultsLog::FocusEntry(), wxString::Format(), Manager::Get(), EditorManager::GetBuiltinActiveEditor(), cbEditor::GetControl(), wxScintilla::GetCurrentLine(), Manager::GetEditorManager(), EditorBase::GetFilename(), wxFileName::GetFullPath(), wxFileName::GetPath(), Manager::GetSearchResultLogger(), Logger::info, m_SearchDataMap, wxFileName::MakeRelativeTo(), Manager::ProcessEvent(), and cbSearchResultsLog::SetBasePath().
Referenced by FindReferences(), and RenameSymbols().
|
private |
Definition at line 504 of file coderefactoring.cpp.
References wxScintilla::BeginUndoAction(), wxScintilla::EndUndoAction(), Manager::Get(), EditorManager::GetBuiltinActiveEditor(), cbEditor::GetControl(), Manager::GetEditorManager(), cbProject::GetFileByFilename(), NativeParser::GetProjectByEditor(), EditorManager::IsBuiltinOpen(), wxString::Len(), m_NativeParser, m_SearchDataMap, EditorManager::Open(), wxScintilla::ReplaceTarget(), wxScintilla::SetTargetEnd(), and wxScintilla::SetTargetStart().
Referenced by RenameSymbols().
|
private |
Definition at line 433 of file coderefactoring.cpp.
References wxScintilla::FindText(), wxScintilla::GetLength(), wxScintilla::GetLine(), wxScintilla::LineFromPosition(), m_SearchDataMap, wxString::Trim(), wxSCI_FIND_MATCHCASE, wxSCI_FIND_WHOLEWORD, and wxSCI_INVALID_POSITION.
Referenced by SearchInFiles().
void CodeRefactoring::FindReferences | ( | ) |
Definition at line 215 of file coderefactoring.cpp.
References DoFindReferences(), and Parse().
|
private |
Definition at line 538 of file coderefactoring.cpp.
References wxArrayString::Add(), ProjectFile::file, ParserCommon::FileType(), ParserCommon::ftOther, cbProject::GetFilesList(), wxFileName::GetFullPath(), and ProjectFile::relativeFilename.
Referenced by Parse().
|
private |
Definition at line 557 of file coderefactoring.cpp.
References wxArrayString::Add(), Manager::Get(), EditorManager::GetEditor(), Manager::GetEditorManager(), EditorManager::GetEditorsCount(), and EditorBase::GetFilename().
Referenced by Parse().
|
private |
Definition at line 125 of file coderefactoring.cpp.
References _(), cbMessageBox(), CCLogger::DebugLog(), ParserBase::Done(), CCLogger::Get(), Manager::Get(), EditorManager::GetBuiltinActiveEditor(), cbEditor::GetControl(), wxScintilla::GetCurrentPos(), Manager::GetEditorManager(), NativeParser::GetParser(), wxScintilla::GetStyleAt(), wxScintilla::GetTextRange(), cbStyledTextCtrl::IsComment(), cbStyledTextCtrl::IsString(), m_NativeParser, ParserBase::NotDoneReason(), wxScintilla::WordEndPosition(), wxScintilla::WordStartPosition(), wxEmptyString, wxICON_WARNING, and wxOK.
Referenced by Parse(), and RenameSymbols().
|
private |
Definition at line 153 of file coderefactoring.cpp.
References _(), wxArrayString::Add(), TokenTree::at(), cbMessageBox(), CC_LOCKER_TRACK_TT_MTX_LOCK, CC_LOCKER_TRACK_TT_MTX_UNLOCK, Manager::Get(), GetAllProjectFiles(), EditorManager::GetBuiltinActiveEditor(), cbEditor::GetControl(), wxScintilla::GetCurrentPos(), Manager::GetEditorManager(), EditorBase::GetFilename(), GetOpenedFiles(), NativeParser::GetParser(), NativeParser::GetProjectByEditor(), GetSymbolUnderCursor(), ParserBase::GetTokenTree(), ScopeDialog::ID_OPEN_FILES, ScopeDialog::ID_PROJECT_FILES, wxArrayString::IsEmpty(), wxString::IsEmpty(), m_NativeParser, Token::m_ParentIndex, Token::m_TokenKind, NativeParser::MarkItemsByAI(), s_TokenTreeMutex, SearchInFiles(), wxDialog::ShowModal(), tkFunction, VerifyResult(), wxScintilla::WordEndPosition(), wxICON_WARNING, and wxOK.
Referenced by FindReferences(), and RenameSymbols().
void CodeRefactoring::RenameSymbols | ( | ) |
Definition at line 221 of file coderefactoring.cpp.
References _(), cbGetTextFromUser(), DoFindReferences(), DoRenameSymbols(), Manager::Get(), GetSymbolUnderCursor(), wxString::IsEmpty(), and Parse().
|
private |
Definition at line 238 of file coderefactoring.cpp.
References _(), Find(), Manager::Get(), Manager::GetAppWindow(), EditorManager::GetBuiltinActiveEditor(), cbEditor::GetControl(), wxArrayString::GetCount(), Manager::GetEditorManager(), wxScintilla::GetText(), EncodingDetector::GetWxStr(), EditorManager::IsBuiltinOpen(), EncodingDetector::IsOK(), m_SearchDataMap, PlaceWindow(), wxScintilla::SetText(), wxGenericProgressDialog::Update(), wxDefaultPosition, wxID_ANY, wxPD_APP_MODAL, wxPD_AUTO_HIDE, and wxPD_CAN_ABORT.
Referenced by Parse().
|
private |
Definition at line 283 of file coderefactoring.cpp.
References _(), EditorColourSet::Apply(), cbEditor::ApplyStyles(), TokenTree::at(), CC_LOCKER_TRACK_TT_MTX_LOCK, CC_LOCKER_TRACK_TT_MTX_UNLOCK, Manager::Get(), EditorManager::GetBuiltinActiveEditor(), cbEditor::GetControl(), Manager::GetEditorManager(), cbEditor::GetLanguage(), NativeParser::GetParser(), wxScintilla::GetStyleAt(), wxScintilla::GetText(), ParserBase::GetTokenTree(), EncodingDetector::GetWxStr(), wxScintilla::GotoPos(), EditorManager::IsBuiltinOpen(), cbStyledTextCtrl::IsComment(), EncodingDetector::IsOK(), cbStyledTextCtrl::IsString(), wxString::Len(), m_NativeParser, Token::m_ParentIndex, m_SearchDataMap, NativeParser::MarkItemsByAI(), PlaceWindow(), s_TokenTreeMutex, wxScintilla::SetText(), wxGenericProgressDialog::Update(), wxDefaultPosition, wxID_ANY, wxPD_APP_MODAL, wxPD_AUTO_HIDE, and wxPD_CAN_ABORT.
Referenced by Parse().
|
private |
Definition at line 50 of file coderefactoring.h.
Referenced by DoRenameSymbols(), GetSymbolUnderCursor(), Parse(), and VerifyResult().
|
private |
Definition at line 51 of file coderefactoring.h.
Referenced by DoFindReferences(), DoRenameSymbols(), Find(), SearchInFiles(), and VerifyResult().