NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class handles all specialized search requests of the assigned editor. More...
#include <searchcontroller.hpp>
Public Member Functions | |
SearchController (NumeReEditor *edit, NumeReTerminal *terminal) | |
std::vector< wxString > | getProceduresInFile () |
Creates a list of procedures in the current file. More... | |
std::vector< int > | FindAll (const wxString &sSymbol, int nStyle, int nStartPos=0, int nEndPos=-1, bool bSearchInComments=false) |
Finds all occurences of a code symbol considering the style. More... | |
wxString | FindClickedWord () |
Returns the word under the cursor while clicking. More... | |
wxString | FindClickedInclude () |
Gets the name of the clicked include file. More... | |
wxString | FindMarkedInclude (int charpos) |
Constructs the file name of the included file. More... | |
wxString | FindClickedProcedure () |
Gets the name of the clicked procedure. More... | |
wxString | FindMarkedProcedure (int charpos, bool ignoreDefinitions=true) |
Extracts the procedure call at the selected position. More... | |
wxString | FindNameSpaceOfProcedure (int charpos) |
Finds the current namespace for the procedure call. More... | |
wxString | FindProceduresInCurrentFile (wxString sFirstChars, wxString sSelectedNameSpace) |
Finds procedures, which might match the passed word start. More... | |
wxString | FindProcedureDefinition () |
Searches the definition below the cursor. More... | |
wxString | GetNameOfNamingProcedure () |
Returns the required procedure name for the current file. More... | |
int | FindCurrentProcedureHead (int pos) |
Find the procedure head line for the selected position. More... | |
int | FindNamingProcedure () |
Searches the file for the naming procedure. More... | |
Private Member Functions | |
wxString | FindProcedureDefinitionInLocalFile (const wxString &procedurename) |
Search the procedure definition in the local file. More... | |
void | AppendToDocumentation (wxString &sDocumentation, const wxString &sNewDocLine) |
Appends the text to the current documentation. More... | |
std::string | CleanDocumentation (const wxString &__sDoc) |
Checks layout and finishes styling of the documentation string. More... | |
Private Attributes | |
NumeReEditor * | m_editor |
NumeReTerminal * | m_terminal |
This class handles all specialized search requests of the assigned editor.
Definition at line 33 of file searchcontroller.hpp.
|
inline |
Definition at line 46 of file searchcontroller.hpp.
|
private |
Appends the text to the current documentation.
sDocumentation | wxString& |
sNewDocLine | const wxString& |
This member function appends a found documentation line to the overall documentation and converts some TeX-commands into plain text and rudimentary styling.
Definition at line 647 of file searchcontroller.cpp.
Referenced by FindProcedureDefinitionInLocalFile().
|
private |
Checks layout and finishes styling of the documentation string.
__sDoc | const wxString& |
This member function checks the layout of the found documentations and applies some special modifications.
Definition at line 712 of file searchcontroller.cpp.
References _guilang, NumeReEditor::addLinebreaks(), Language::get(), m_editor, min, and toUpperCase().
Referenced by FindProcedureDefinitionInLocalFile().
vector< int > SearchController::FindAll | ( | const wxString & | sSymbol, |
int | nStyle, | ||
int | nStartPos = 0 , |
||
int | nEndPos = -1 , |
||
bool | bSearchInComments = false |
||
) |
Finds all occurences of a code symbol considering the style.
sSymbol | const wxString& |
nStyle | int |
nStartPos | int |
nEndPos | int |
bSearchInComments | bool |
This member function detects all occurences of a code symbol between the passed positions. It does take the current style into account and returns the matches as a vector
Definition at line 82 of file searchcontroller.cpp.
References FILE_NPRC, FILE_NSCR, NumeReEditor::isStyleType(), m_editor, NumeReEditor::m_fileType, NumeReEditor::STYLE_COMMENT_BLOCK, and NumeReEditor::STYLE_COMMENT_LINE.
Referenced by NumeReEditor::AbstrahizeSection(), CodeAnalyzer::analyseCommands(), FindCurrentProcedureHead(), FindNameSpaceOfProcedure(), FindProcedureDefinitionInLocalFile(), NumeReEditor::fixSymbolName(), NumeReEditor::generateAutoCompList(), getProceduresInFile(), NumeReEditor::GotoPipe(), NumeReEditor::markLocalVariableOfType(), and NumeReEditor::RenameSymbols().
wxString SearchController::FindClickedInclude | ( | ) |
Gets the name of the clicked include file.
This member function is used from the context menu to obtain the name of the included file and to store it internally
Definition at line 141 of file searchcontroller.cpp.
References FindMarkedInclude(), m_editor, and NumeReEditor::m_lastRightClick.
Referenced by NumeReEditor::OnRightClick().
wxString SearchController::FindClickedProcedure | ( | ) |
Gets the name of the clicked procedure.
This member function is used from the context menu to obtain the name of the procedure and to store it internally
Definition at line 224 of file searchcontroller.cpp.
References FindMarkedProcedure(), m_editor, and NumeReEditor::m_lastRightClick.
Referenced by NumeReEditor::OnRightClick().
wxString SearchController::FindClickedWord | ( | ) |
Returns the word under the cursor while clicking.
Definition at line 119 of file searchcontroller.cpp.
References NumeReEditor::m_clickedWord, NumeReEditor::m_clickedWordLength, m_editor, and NumeReEditor::m_lastRightClick.
Referenced by NumeReEditor::OnRightClick().
int SearchController::FindCurrentProcedureHead | ( | int | pos | ) |
Find the procedure head line for the selected position.
pos | int |
This member function identifies the position of the procedure head, to which the selected position belongs.
Definition at line 829 of file searchcontroller.cpp.
References FILE_MATLAB, FILE_NPRC, FindAll(), m_editor, and NumeReEditor::m_fileType.
Referenced by NumeReEditor::AbstrahizeSection(), NumeReEditor::AddProcedureDocumentation(), FindNameSpaceOfProcedure(), and NumeReEditor::RenameSymbols().
wxString SearchController::FindMarkedInclude | ( | int | charpos | ) |
Constructs the file name of the included file.
charpos | int |
This member function constructs the name of the included file at the passed position, returns its name and stores the name internally
Definition at line 158 of file searchcontroller.cpp.
References EXEPATH, NumeReEditor::GetFileName(), NumeReTerminal::getPathSettings(), LOADPATH, NumeReEditor::m_clickedInclude, m_editor, m_terminal, PLOTPATH, PROCPATH, replacePathSeparator(), SAVEPATH, and SCRIPTPATH.
Referenced by FindClickedInclude(), and NumeReEditor::OnFindIncludeFromMenu().
wxString SearchController::FindMarkedProcedure | ( | int | charpos, |
bool | ignoreDefinitions = true |
||
) |
Extracts the procedure call at the selected position.
charpos | int |
ignoreDefinitions | bool |
This member function extracts the procedure call located around the position charpos and stores its value internally. If ignoreDefinitions is set to false, then also definitions are detected
Definition at line 243 of file searchcontroller.cpp.
References FILE_NPRC, FindNameSpaceOfProcedure(), GetNameOfNamingProcedure(), NumeReEditor::m_clickedProcedure, m_editor, and NumeReEditor::m_fileType.
Referenced by NumeReEditor::AddProcedureDocumentation(), CodeAnalyzer::analyseProcedures(), FindClickedProcedure(), NumeReEditor::GetCurrentFunctionContext(), getProceduresInFile(), NumeReEditor::OnFindProcedureFromMenu(), and NumeReEditor::OnMouseDwell().
wxString SearchController::FindNameSpaceOfProcedure | ( | int | charpos | ) |
Finds the current namespace for the procedure call.
charpos | int |
Returns the namespace of the procedure call at the selected position. Searches the current procedure scope for "namespace" commands and decodes them
Definition at line 328 of file searchcontroller.cpp.
References decodeNameSpace(), FILE_NPRC, FindAll(), FindCurrentProcedureHead(), m_editor, and NumeReEditor::m_fileType.
Referenced by FindMarkedProcedure(), and NumeReEditor::OnChar().
int SearchController::FindNamingProcedure | ( | ) |
Searches the file for the naming procedure.
Searches the file for the naming procedure and returns its position in the file or wxNOT_FOUND, if no matching procedure can be found.
Definition at line 857 of file searchcontroller.cpp.
References GetNameOfNamingProcedure(), and m_editor.
Referenced by CodeAnalyzer::analyseCommands().
wxString SearchController::FindProcedureDefinition | ( | ) |
Searches the definition below the cursor.
This member function searches for the definition of the procedure, which is currently below the cursor.
Definition at line 410 of file searchcontroller.cpp.
References NumeRe::addLinebreaks(), NumeRe::FindProcedureDefinition(), FindProcedureDefinitionInLocalFile(), NumeReEditor::GetFileNameAndPath(), NumeReTerminal::getPathSettings(), NumeReEditor::m_clickedProcedure, m_editor, m_terminal, PROCPATH, NumeRe::CallTip::sDefinition, and NumeRe::CallTip::sDocumentation.
Referenced by CodeAnalyzer::analyseProcedures(), getProceduresInFile(), NumeReEditor::HandleFunctionCallTip(), and NumeReEditor::OnMouseDwell().
|
private |
Search the procedure definition in the local file.
procedurename | const wxString& |
This private member function searches for the procedure definition in the currently opened procedure file. It also appends the documentation to the definition, so that it might be shown in the tooltip
Definition at line 490 of file searchcontroller.cpp.
References AppendToDocumentation(), CleanDocumentation(), FindAll(), getMatchingParenthesis(), getNextArgument(), NumeReEditor::isStyleType(), m_editor, StripSpaces(), NumeReEditor::STYLE_COMMENT_SECTION_BLOCK, and NumeReEditor::STYLE_COMMENT_SECTION_LINE.
Referenced by FindProcedureDefinition().
wxString SearchController::FindProceduresInCurrentFile | ( | wxString | sFirstChars, |
wxString | sSelectedNameSpace | ||
) |
Finds procedures, which might match the passed word start.
sFirstChars | wxString |
sSelectedNameSpace | wxString |
Finds all procedures in the current file, which might fit the passed word start, and return them as a single autocompletion string
Definition at line 367 of file searchcontroller.cpp.
References NumeReEditor::_syntax, NumeReSyntax::getNameSpaceAutoCompList(), NumeReEditor::isStyleType(), m_editor, NumeReEditor::STYLE_COMMENT_BLOCK, NumeReEditor::STYLE_COMMENT_LINE, NumeReSyntax::SYNTAX_PROCEDURE, and toString().
Referenced by NumeReEditor::OnChar().
wxString SearchController::GetNameOfNamingProcedure | ( | ) |
Returns the required procedure name for the current file.
Definition at line 630 of file searchcontroller.cpp.
References NumeReEditor::GetFileName(), and m_editor.
Referenced by FindMarkedProcedure(), and FindNamingProcedure().
vector< wxString > SearchController::getProceduresInFile | ( | ) |
Creates a list of procedures in the current file.
This member function creates the procedure list from the current viewed file. It does nothing, if the current file is not a procedure file
Definition at line 34 of file searchcontroller.cpp.
References FILE_NPRC, FindAll(), FindMarkedProcedure(), FindProcedureDefinition(), m_editor, and NumeReEditor::m_fileType.
Referenced by NumeReEditor::getProceduresInFile(), and NumeReEditor::UpdateProcedureViewer().
|
private |
Definition at line 36 of file searchcontroller.hpp.
Referenced by CleanDocumentation(), FindAll(), FindClickedInclude(), FindClickedProcedure(), FindClickedWord(), FindCurrentProcedureHead(), FindMarkedInclude(), FindMarkedProcedure(), FindNameSpaceOfProcedure(), FindNamingProcedure(), FindProcedureDefinition(), FindProcedureDefinitionInLocalFile(), FindProceduresInCurrentFile(), GetNameOfNamingProcedure(), and getProceduresInFile().
|
private |
Definition at line 37 of file searchcontroller.hpp.
Referenced by FindMarkedInclude(), and FindProcedureDefinition().