NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
searchcontroller.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2019 Erik Haenel et al.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19#ifndef SEARCHCONTROLLER_HPP
20#define SEARCHCONTROLLER_HPP
21
22#include <wx/wx.h>
23#include <string>
24#include <vector>
25
26class NumeReEditor;
27class NumeReTerminal;
28
34{
35 private:
38
39 wxString FindProcedureDefinitionInLocalFile(const wxString& procedurename);
40
41 void AppendToDocumentation(wxString& sDocumentation, const wxString& sNewDocLine);
42 std::string CleanDocumentation(const wxString& __sDoc);
43
44
45 public:
46 SearchController(NumeReEditor* edit, NumeReTerminal* terminal) : m_editor(edit), m_terminal(terminal) {}
47
48 std::vector<wxString> getProceduresInFile();
49 std::vector<int> FindAll(const wxString& sSymbol, int nStyle, int nStartPos = 0, int nEndPos = -1, bool bSearchInComments = false);
50
51 wxString FindClickedWord();
52 wxString FindClickedInclude();
53 wxString FindMarkedInclude(int charpos);
54 wxString FindClickedProcedure();
55 wxString FindMarkedProcedure(int charpos, bool ignoreDefinitions = true);
56 wxString FindNameSpaceOfProcedure(int charpos);
57 wxString FindProceduresInCurrentFile(wxString sFirstChars, wxString sSelectedNameSpace);
58 wxString FindProcedureDefinition();
59 wxString GetNameOfNamingProcedure();
60 int FindCurrentProcedureHead(int pos);
62
63};
64
65
66#endif // SEARCHCONTROLLER_HPP
67
The class of the editor window.
Definition: editor.h:53
The terminal class for the GUI. It's a specialisation of the GenericTerminal.
Definition: terminal.hpp:46
This class handles all specialized search requests of the assigned editor.
void AppendToDocumentation(wxString &sDocumentation, const wxString &sNewDocLine)
Appends the text to the current documentation.
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.
int FindNamingProcedure()
Searches the file for the naming procedure.
wxString FindProceduresInCurrentFile(wxString sFirstChars, wxString sSelectedNameSpace)
Finds procedures, which might match the passed word start.
wxString FindMarkedProcedure(int charpos, bool ignoreDefinitions=true)
Extracts the procedure call at the selected position.
wxString FindNameSpaceOfProcedure(int charpos)
Finds the current namespace for the procedure call.
std::string CleanDocumentation(const wxString &__sDoc)
Checks layout and finishes styling of the documentation string.
wxString GetNameOfNamingProcedure()
Returns the required procedure name for the current file.
SearchController(NumeReEditor *edit, NumeReTerminal *terminal)
wxString FindProcedureDefinition()
Searches the definition below the cursor.
NumeReEditor * m_editor
wxString FindProcedureDefinitionInLocalFile(const wxString &procedurename)
Search the procedure definition in the local file.
wxString FindMarkedInclude(int charpos)
Constructs the file name of the included file.
NumeReTerminal * m_terminal
wxString FindClickedProcedure()
Gets the name of the clicked procedure.
wxString FindClickedInclude()
Gets the name of the clicked include file.
std::vector< wxString > getProceduresInFile()
Creates a list of procedures in the current file.
int FindCurrentProcedureHead(int pos)
Find the procedure head line for the selected position.
wxString FindClickedWord()
Returns the word under the cursor while clicking.