NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
calltipprovider.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2022 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 CALLTIPPROVIDER_HPP
20#define CALLTIPPROVIDER_HPP
21
22#include <string>
23namespace NumeRe
24{
30 struct CallTip
31 {
32 std::string sDefinition;
33 std::string sDocumentation;
34 size_t nStart;
35 size_t nEnd;
36
37 CallTip() : nStart(0u), nEnd(0u) {}
38 CallTip(const std::string& sDef, const std::string& sDoc = "", size_t s = 0u, size_t e = 0u)
39 : sDefinition(sDef), sDocumentation(sDoc), nStart(s), nEnd(e) {}
40 };
41
42
43
44
45
55 {
56 private:
58
59 public:
60 CallTipProvider(size_t nMaxLineLength = 100u) : m_maxLineLength(nMaxLineLength) {}
61
62 CallTip getCommand(std::string sToken) const;
63 CallTip getFunction(std::string sToken) const;
64 CallTip getProcedure(std::string sToken) const;
65 CallTip getOption(std::string sToken) const;
66 CallTip getMethod(std::string sToken) const;
67 CallTip getPredef(std::string sToken) const;
68 CallTip getConstant(std::string sToken) const;
69 };
70
71
72
73
74 CallTip FindProcedureDefinition(const std::string& pathname, const std::string& procedurename);
75 CallTip addLinebreaks(CallTip _cTip, size_t maxLineLength = 100u);
76}
77
78#endif // CALLTIPPROVIDER_HPP
79
This class uses a global Language instance to obtain the language string associated with a distinct c...
CallTip getProcedure(std::string sToken) const
Get the calltip for the selected (global) procedure.
CallTip getOption(std::string sToken) const
Get the calltip for the selected option.
CallTip getConstant(std::string sToken) const
Get the calltip for the selected constant.
CallTipProvider(size_t nMaxLineLength=100u)
CallTip getMethod(std::string sToken) const
Get the calltip for the selected method.
CallTip getFunction(std::string sToken) const
Get the calltip for the selected (built-in) function.
CallTip getCommand(std::string sToken) const
Get the calltip for the selected command.
CallTip getPredef(std::string sToken) const
Get the calltip for the selected predefined symbol.
CallTip FindProcedureDefinition(const std::string &pathname, const std::string &procedurename)
Search the procedure definition in a global file.
CallTip addLinebreaks(CallTip _cTip, size_t maxLineLength)
Adds the necessary linebreaks to the documentation part of the CallTip to fit inside the desired maxi...
This structure contains the data for a single calltip, which might be shown in the editor or the term...
CallTip(const std::string &sDef, const std::string &sDoc="", size_t s=0u, size_t e=0u)
std::string sDefinition
std::string sDocumentation