NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
SearchController Class Reference

This class handles all specialized search requests of the assigned editor. More...

#include <searchcontroller.hpp>

Collaboration diagram for SearchController:

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

NumeReEditorm_editor
 
NumeReTerminalm_terminal
 

Detailed Description

This class handles all specialized search requests of the assigned editor.

Definition at line 33 of file searchcontroller.hpp.

Constructor & Destructor Documentation

◆ SearchController()

SearchController::SearchController ( NumeReEditor edit,
NumeReTerminal terminal 
)
inline

Definition at line 46 of file searchcontroller.hpp.

Member Function Documentation

◆ AppendToDocumentation()

void SearchController::AppendToDocumentation ( wxString &  sDocumentation,
const wxString &  sNewDocLine 
)
private

Appends the text to the current documentation.

Parameters
sDocumentationwxString&
sNewDocLineconst wxString&
Returns
void

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().

◆ CleanDocumentation()

string SearchController::CleanDocumentation ( const wxString &  __sDoc)
private

Checks layout and finishes styling of the documentation string.

Parameters
__sDocconst wxString&
Returns
string

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().

Here is the call graph for this function:

◆ FindAll()

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.

Parameters
sSymbolconst wxString&
nStyleint
nStartPosint
nEndPosint
bSearchInCommentsbool
Returns
vector<int>

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().

Here is the call graph for this function:

◆ FindClickedInclude()

wxString SearchController::FindClickedInclude ( )

Gets the name of the clicked include file.

Returns
wxString

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().

Here is the call graph for this function:

◆ FindClickedProcedure()

wxString SearchController::FindClickedProcedure ( )

Gets the name of the clicked procedure.

Returns
wxString

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().

Here is the call graph for this function:

◆ FindClickedWord()

wxString SearchController::FindClickedWord ( )

Returns the word under the cursor while clicking.

Returns
wxString

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().

◆ FindCurrentProcedureHead()

int SearchController::FindCurrentProcedureHead ( int  pos)

Find the procedure head line for the selected position.

Parameters
posint
Returns
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().

Here is the call graph for this function:

◆ FindMarkedInclude()

wxString SearchController::FindMarkedInclude ( int  charpos)

Constructs the file name of the included file.

Parameters
charposint
Returns
wxString

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().

Here is the call graph for this function:

◆ FindMarkedProcedure()

wxString SearchController::FindMarkedProcedure ( int  charpos,
bool  ignoreDefinitions = true 
)

Extracts the procedure call at the selected position.

Parameters
charposint
ignoreDefinitionsbool
Returns
wxString

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().

Here is the call graph for this function:

◆ FindNameSpaceOfProcedure()

wxString SearchController::FindNameSpaceOfProcedure ( int  charpos)

Finds the current namespace for the procedure call.

Parameters
charposint
Returns
wxString

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().

Here is the call graph for this function:

◆ FindNamingProcedure()

int SearchController::FindNamingProcedure ( )

Searches the file for the naming procedure.

Returns
int

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().

Here is the call graph for this function:

◆ FindProcedureDefinition()

wxString SearchController::FindProcedureDefinition ( )

Searches the definition below the cursor.

Returns
wxString

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().

Here is the call graph for this function:

◆ FindProcedureDefinitionInLocalFile()

wxString SearchController::FindProcedureDefinitionInLocalFile ( const wxString &  procedurename)
private

Search the procedure definition in the local file.

Parameters
procedurenameconst wxString&
Returns
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().

Here is the call graph for this function:

◆ FindProceduresInCurrentFile()

wxString SearchController::FindProceduresInCurrentFile ( wxString  sFirstChars,
wxString  sSelectedNameSpace 
)

Finds procedures, which might match the passed word start.

Parameters
sFirstCharswxString
sSelectedNameSpacewxString
Returns
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().

Here is the call graph for this function:

◆ GetNameOfNamingProcedure()

wxString SearchController::GetNameOfNamingProcedure ( )

Returns the required procedure name for the current file.

Returns
wxString

Definition at line 630 of file searchcontroller.cpp.

References NumeReEditor::GetFileName(), and m_editor.

Referenced by FindMarkedProcedure(), and FindNamingProcedure().

Here is the call graph for this function:

◆ getProceduresInFile()

vector< wxString > SearchController::getProceduresInFile ( )

Creates a list of procedures in the current file.

Returns
vector<wxString>

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().

Here is the call graph for this function:

Member Data Documentation

◆ m_editor

◆ m_terminal

NumeReTerminal* SearchController::m_terminal
private

Definition at line 37 of file searchcontroller.hpp.

Referenced by FindMarkedInclude(), and FindProcedureDefinition().


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