NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
plugin.cpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2014 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
20
21#include "plugin.hpp"
22#include "../../kernel.hpp"
23#include "../utils/tools.hpp"
24
26// CLASS PLUGIN
28
29
33Package::Package() : sCommand(""), sMainProcedure(""), sArgumentList(""), sType("TYPE_UNSPECIFIED"), sLicense(""), sName("Plugin"), sVersion("<AUTO>"), sAuthor("User"), sDescription("Description"), sMenuEntry(""), sDocumentationIndexID(""), sKeyWords("NONE"), sChangesLog("NONE")
34{ }
35
36
45Package::Package(const std::string& sInstallInfoString) : Package()
46{
47 // Get the options values from the string
48 sCommand = getOptionValue(sInstallInfoString, "plugincommand", "");
49 sMainProcedure = getOptionValue(sInstallInfoString, "pluginmain", "");
50 sArgumentList = getOptionValue(sInstallInfoString, "pluginmain", "");
51 sMenuEntry = getOptionValue(sInstallInfoString, "pluginmenuentry", "");
52 sType = getOptionValue(sInstallInfoString, "type", "TYPE_UNSPECIFIED");
53 sLicense = getOptionValue(sInstallInfoString, "license", "???");
54 sName = getOptionValue(sInstallInfoString, "name", "Plugin");
55 sVersion = getOptionValue(sInstallInfoString, "version", "0.0.1");
56 sAuthor = getOptionValue(sInstallInfoString, "author", "User");
57 sKeyWords = getOptionValue(sInstallInfoString, "keywords", "NONE");
58 sChangesLog = getOptionValue(sInstallInfoString, "changelog", "NONE");
59 sDescription = getOptionValue(sInstallInfoString, "desc", "Description");
60
61 if (!sDescription.length())
62 sDescription = getOptionValue(sInstallInfoString, "plugindesc", "Description");
63
64 // If the main procedure was defined, separate it
65 // here into name and argument list
66 if (sMainProcedure.length())
67 {
68 sMainProcedure.erase(sMainProcedure.find('('));
69
70 if (sMainProcedure.front() == '$')
71 sMainProcedure.erase(0, 1);
72
73 sArgumentList = sArgumentList.substr(sArgumentList.find('('));
74 }
75}
76
77
90std::string Package::getOptionValue(const std::string& sInstallInfoString, const std::string& sOption, const std::string& sDefault)
91{
92 // Option is available? If no,
93 // return the default value
94 if (findParameter(sInstallInfoString, sOption, '='))
95 {
96 // Get the value
97 std::string sOptionValue = getArgAtPos(sInstallInfoString, findParameter(sInstallInfoString, sOption, '=')+sOption.length());
98 StripSpaces(sOptionValue);
99
100 // Does it have a length? If no,
101 // return the default value
102 if (sOptionValue.length())
103 {
104 // If the default value has a non-zero length,
105 // surround the extracted value using parentheses,
106 // if it contains whitespaces or commas.
107 if (sDefault.length() && (sOptionValue.find(' ') != std::string::npos || sOptionValue.find(',') != std::string::npos))
108 sOptionValue = "(" + sOptionValue + ")";
109
110 return sOptionValue;
111 }
112 }
113
114 return sDefault;
115}
116
117
126std::string Package::exportDefinition() const
127{
128 return sCommand + "," + sMainProcedure + "," + sArgumentList + "," + sType + "," + sName + "," + sVersion + "," + sAuthor + "," + sDescription + "," + sDocumentationIndexID + "," + sLicense + "," + sMenuEntry + "," + sKeyWords + "," + sChangesLog + ",";
129}
130
131
144void Package::importDefinition(std::string sDefinitionString)
145{
146 sCommand = getNextArgument(sDefinitionString, true);
147 sMainProcedure = getNextArgument(sDefinitionString, true);
148 sArgumentList = getNextArgument(sDefinitionString, true);
149 sType = getNextArgument(sDefinitionString, true);
150 sName = getNextArgument(sDefinitionString, true);
151
152 if (!sDefinitionString.length())
153 return;
154
155 sVersion = getNextArgument(sDefinitionString, true);
156
157 if (!sDefinitionString.length())
158 return;
159
160 sAuthor = getNextArgument(sDefinitionString, true);
161
162 if (!sDefinitionString.length())
163 return;
164
165 sDescription = getNextArgument(sDefinitionString, true);
166
167 if (!sDefinitionString.length())
168 return;
169
170 sDocumentationIndexID = getNextArgument(sDefinitionString, true);
171
172 if (!sDefinitionString.length())
173 return;
174
175 sLicense = getNextArgument(sDefinitionString, true);
176
177 if (!sDefinitionString.length())
178 return;
179
180 sMenuEntry = getNextArgument(sDefinitionString, true);
181
182 if (!sDefinitionString.length())
183 return;
184
185 sKeyWords = getNextArgument(sDefinitionString, true);
186
187 if (!sDefinitionString.length())
188 return;
189
190 sChangesLog = getNextArgument(sDefinitionString, true);
191}
192
193
202{
203 return sType.substr(0, 11) == "TYPE_PLUGIN";
204}
205
206
215bool Package::operator==(const Package& _package) const
216{
217 return _package.sCommand == sCommand && _package.sName == sName && _package.sAuthor == sAuthor;
218}
219
220
229bool Package::operator!=(const Package& _package) const
230{
231 return !operator==(_package);
232}
233
234
245void Package::update(const Package& _package)
246{
248 sArgumentList = _package.sArgumentList;
249 sType = _package.sType;
250 sName = _package.sName;
251 sAuthor = _package.sAuthor;
252 sDescription = _package.sDescription;
253 sLicense = _package.sLicense;
254
255 // Do we need to increment the current
256 // package version?
257 if (_package.sVersion == "<AUTO>")
259 else
260 sVersion = _package.sVersion;
261}
262
263
272{
274}
275
276
283std::string Package::getName() const
284{
285 return stripParentheses(sName);
286}
287
288
295std::string Package::getAuthor() const
296{
298}
299
300
307std::string Package::getDescription() const
308{
310}
311
312
319std::string Package::getKeyWords() const
320{
322}
323
324
331std::string Package::getLicense() const
332{
334}
335
336
343std::string Package::getMenuEntry() const
344{
346}
347
348
358{
359 if (!sCommand.length())
360 return "";
361
362 std::string sSignature = sCommand + " ";
363
364 if (sArgumentList.find("<EXPRESSION>") != std::string::npos && sArgumentList.find("<PARAMSTRING>") != std::string::npos)
365 sSignature += "EX -set PAR ";
366 else if (sArgumentList.find("<EXPRESSION>") != std::string::npos)
367 sSignature += "EX ";
368 else if (sArgumentList.find("<PARAMSTRING>") != std::string::npos)
369 sSignature += "-PAR ";
370 else if (sArgumentList.find("<CMDSTRING>") != std::string::npos)
371 sSignature += "(...) ";
372
373 if (sType.find("TYPE_PLUGIN_WITH_RETURN_VALUE") != std::string::npos)
374 sSignature += "-> ARG";
375
376 return sSignature;
377}
378
379
386std::string Package::getChangesLog() const
387{
389}
390
391
392
393
394
396// CLASS PLUGINMANAGER
398
399
400
405{
406 sPluginDefinitionFile = "<>/numere.plugins";
407 sPluginProcName = "";
408 sPluginVarList = "";
409}
410
411
419{
420 assign(_manager);
421}
422
423
433{
434 vPackageInfo = _manager.vPackageInfo;
435}
436
437
443{
444 if (fPlugins.is_open())
445 fPlugins.close();
446}
447
448
458{
459 assign(_manager);
460 return *this;
461}
462
463
473{
475
476 fPlugins.open(sPluginDefinitionFile.c_str(), std::ios_base::trunc | std::ios_base::out);
477
478 // Ensure that the file is read and writeable
479 if (fPlugins.fail())
481
482 // Write the contents to file
483 for (unsigned int i = 0; i < vPackageInfo.size(); i++)
484 {
485 fPlugins << vPackageInfo[i].exportDefinition() << std::endl;
486 }
487
488 fPlugins.close();
489 return;
490}
491
492
502{
503 std::string sLine = "";
504
506
507 fPlugins.open(sPluginDefinitionFile.c_str());
508
509 // Ensure that the file is readable
510 if (fPlugins.fail())
512
513 // Read the file's contents to memory
514 while (!fPlugins.eof())
515 {
516 std::getline(fPlugins, sLine);
517 StripSpaces(sLine);
518
519 if (sLine.length())
520 {
521 // Create a new Plugin instance and import
522 // the definition
523 vPackageInfo.push_back(Package());
524 vPackageInfo.back().importDefinition(sLine);
525 }
526 }
527
528 fPlugins.close();
529
530 return true;
531}
532
533
544bool PackageManager::evalPluginCmd(std::string& sCmd)
545{
546 std::string sExpr = "";
547 std::string sParams = "";
548 std::string sCommand = "";
549 std::string sCommandLine = "";
550 Package _plugin;
551
552 if (!vPackageInfo.size())
553 return false;
554
555 // Find the plugin definition
556 for (unsigned int i = 0; i < vPackageInfo.size(); i++)
557 {
558 if (findCommand(sCmd, vPackageInfo[i].sCommand).sString == vPackageInfo[i].sCommand)
559 {
560 _plugin = vPackageInfo[i];
561 break;
562 }
563 }
564
565 if (!_plugin.sCommand.length())
566 return false;
567
568 // Find the plugin call
569 Match _match = findCommand(sCmd, _plugin.sCommand);
570 sCommandLine = extractCommandString(sCmd, _match);
571
572 // Fill the internal variables with the values from the
573 // definition
576
577 if (sPluginVarList[0] == '(' && sPluginVarList[sPluginVarList.length()-1] == ')')
578 sPluginVarList = sPluginVarList.substr(1, sPluginVarList.length()-2);
579
580 // Fill the different command line tags
581 // If the argument list expects an expression, expression
582 // and parameters are determined different than without
583 // an expression
584 if (sPluginVarList.find("<EXPRESSION>") != std::string::npos)
585 {
586 if (sCommandLine.find("-set") != std::string::npos || sCommandLine.find("--") != std::string::npos)
587 {
588 if (sCommandLine.find("-set") != std::string::npos)
589 sParams = sCommandLine.substr(sCommandLine.find("-set"));
590 else
591 sParams = sCommandLine.substr(sCommandLine.find("--"));
592 }
593
594 if (sParams.length())
595 {
596 sExpr = sCommandLine.substr(sCommandLine.find(_plugin.sCommand)+_plugin.sCommand.length());
597 sExpr.erase(sExpr.find(sParams));
598 StripSpaces(sParams);
599 }
600 else
601 sExpr = sCommandLine.substr(sCommandLine.find(_plugin.sCommand)+_plugin.sCommand.length());
602
603 StripSpaces(sExpr);
604 sParams = "\"" + sParams + "\"";
605 }
606 else if (sPluginVarList.find("<PARAMSTRING>") != std::string::npos)
607 {
608 if (sCommandLine.find('-') != std::string::npos)
609 sParams = sCommandLine.substr(sCommandLine.find('-', sCommandLine.find(_plugin.sCommand)));
610
611 StripSpaces(sParams);
612 sParams = "\"" + sParams + "\"";
613 }
614
615 sCommand = "\"" + sCommandLine + "\"";
616
617 for (unsigned int i = 1; i < sCommandLine.length()-1; i++)
618 {
619 if (sCommandLine[i] == '"' && sCommandLine[i-1] != '\\')
620 sCommandLine.insert(i,1,'\\');
621 }
622
623 if (sParams.length())
624 {
625 for (unsigned int i = 1; i < sParams.length()-1; i++)
626 {
627 if (sParams[i] == '"' && sParams[i-1] != '\\')
628 sParams.insert(i,1,'\\');
629 }
630 }
631
632 // Replace the procedure argument list with the
633 // corresponding command line tags
634 while (sPluginVarList.find("<CMDSTRING>") != std::string::npos)
635 sPluginVarList.replace(sPluginVarList.find("<CMDSTRING>"), 11, sCommand);
636
637 while (sPluginVarList.find("<EXPRESSION>") != std::string::npos)
638 sPluginVarList.replace(sPluginVarList.find("<EXPRESSION>"), 12, sExpr);
639
640 while (sPluginVarList.find("<PARAMSTRING>") != std::string::npos)
641 sPluginVarList.replace(sPluginVarList.find("<PARAMSTRING>"), 13, sParams);
642
643 // If the plugin should have a return value,
644 // add a corresponding tag to the command line
645 // at the location of the call to the plugin.
646 if (_plugin.sType.find("TYPE_PLUGIN_WITH_RETURN_VALUE") != std::string::npos)
647 sCmd.replace(_match.nPos, sCommandLine.length(), "<<RETURNVAL>>");
648 else
649 sCmd.clear();
650
651 return true;
652}
653
654
664bool PackageManager::declareNewPackage(const std::string& sInstallInfoString)
665{
666 static std::string sProtectedCommands = ";quit;help;find;uninstall;install;include;credits;about;continue;break;var;cst;tab;global;throw;namespace;return;abort;explicit;str;if;else;elseif;endif;while;endwhile;for;endfor;switch;case;default;endswitch;";
667 bool bAllowOverride = false;
668
669 // Create the new plugin
670 Package _package(sInstallInfoString);
671
672 // Determine, whether a forced override is
673 // allowed
674 if (findParameter(sInstallInfoString, "flags", '='))
675 {
676 if (getArgAtPos(sInstallInfoString, findParameter(sInstallInfoString, "flags", '=')+5).find("ENABLE_FORCE_OVERRIDE") != std::string::npos)
677 bAllowOverride = true;
678 }
679
680 // Ensure that the necessary information has been provided
681 // if the new package is a plugin
682 if (_package.isPlugin())
683 {
684 if (!_package.sCommand.length())
686
687 if (sProtectedCommands.find(";" + _package.sCommand + ";") != std::string::npos)
689
690 if (!_package.sMainProcedure.length())
692 }
693
694 // Append the plugin or override an existing one
695 if (vPackageInfo.size())
696 {
697 for (unsigned int i = 0; i < vPackageInfo.size(); i++)
698 {
699 // Identical plugin command found?
700 if (_package.isPlugin() && vPackageInfo[i].sCommand == _package.sCommand)
701 {
702 // Plugin is identical or forced override is enabled
703 if (vPackageInfo[i] == _package || bAllowOverride)
704 {
705 // Plugin names have to be unique: ensure that there's no
706 // duplicate
707 for (unsigned int j = i+1; j < vPackageInfo.size(); j++)
708 {
709 if (vPackageInfo[j].sName == _package.sName && vPackageInfo[j] != _package)
711 }
712
713 // Update the existing plugin
714 vPackageInfo[i].update(_package);
715 }
716 else
718
719 break;
720 }
721 else if (vPackageInfo[i].sName == _package.sName)
722 {
723 // Plugin names have to be unique
724 if (vPackageInfo[i] != _package)
726
727 vPackageInfo[i] = _package;
728 break;
729 }
730
731 // Nothing found? Simply append the new plugin
732 if (i == vPackageInfo.size()-1)
733 {
734 vPackageInfo.push_back(_package);
735
736 if (vPackageInfo.back().sVersion == "<AUTO>")
737 vPackageInfo.back().sVersion = "0.0.1";
738
739 break;
740 }
741 }
742 }
743 else
744 {
745 // No plugin installed? Simply append the
746 // new plugin
747 vPackageInfo.push_back(_package);
748
749 if (vPackageInfo.back().sVersion == "<AUTO>")
750 vPackageInfo.back().sVersion = "0.0.1";
751 }
752
754
756 return true;
757}
758
759
770void PackageManager::addHelpIndex(const std::string& _sPluginName, std::string _sHelpId)
771{
772 StripSpaces(_sHelpId);
773 std::string sPluginName = _sPluginName;
774 StripSpaces(sPluginName);
775
776 if (!vPackageInfo.size() || !_sHelpId.length())
777 return;
778
779 if (sPluginName.length())
780 {
781 // Search for the plugin with the selected name
782 for (unsigned int i = 0; i < vPackageInfo.size(); i++)
783 {
784 // Identical name found? Append the documentation
785 // index ID
786 if (vPackageInfo[i].getName() == sPluginName)
787 {
788 if (vPackageInfo[i].sDocumentationIndexID.length())
789 {
790 if (vPackageInfo[i].sDocumentationIndexID != _sHelpId
791 && vPackageInfo[i].sDocumentationIndexID.find(";"+_sHelpId) == std::string::npos
792 && vPackageInfo[i].sDocumentationIndexID.find(_sHelpId+";") == std::string::npos
793 && vPackageInfo[i].sDocumentationIndexID.find(";"+_sHelpId+";") == std::string::npos)
794 vPackageInfo[i].sDocumentationIndexID += ";" + _sHelpId;
795 }
796 else
797 vPackageInfo[i].sDocumentationIndexID = _sHelpId;
798
800 break;
801 }
802 }
803 }
804 else
805 {
806 // No plugin name selected? Simply append it to the last
807 // available plugin definition
808 if (vPackageInfo.back().sDocumentationIndexID.length())
809 vPackageInfo.back().sDocumentationIndexID += ";" + _sHelpId;
810 else
811 vPackageInfo.back().sDocumentationIndexID = _sHelpId;
812
814 }
815
816 return;
817}
818
819
829bool PackageManager::isPluginCmd(const std::string& sCmd) const
830{
831 if (findCommand(sCmd, "explicit").sString == "explicit")
832 return false;
833
834 if (vPackageInfo.size())
835 {
836 for (unsigned int i = 0; i < vPackageInfo.size(); i++)
837 {
838 if (vPackageInfo[i].isPlugin() && findCommand(sCmd, vPackageInfo[i].sCommand).sString == vPackageInfo[i].sCommand)
839 return true;
840 }
841 }
842
843 return false;
844}
845
846
857std::string PackageManager::deletePackage(const std::string& sPackage)
858{
859 std::string sHLPIDs = "<<NO_HLP_ENTRY>>";
860
861 for (size_t i = 0; i < vPackageInfo.size(); i++)
862 {
863 // Plugin found?
864 if (vPackageInfo[i].getName() == sPackage)
865 {
866 // Store the documentation index ID
867 if (vPackageInfo[i].sDocumentationIndexID.length())
868 sHLPIDs = vPackageInfo[i].sDocumentationIndexID;
869
870 // Remove the plugin
871 vPackageInfo.erase(i + vPackageInfo.begin());
872
874
876 return sHLPIDs;
877 }
878 }
879
880 return "";
881}
882
883
892std::map<std::string, std::string> PackageManager::getMenuMap() const
893{
894 std::map<std::string, std::string> mMenuMap;
895
896 for (size_t i = 0; i < vPackageInfo.size(); i++)
897 {
898 if (vPackageInfo[i].sType == "TYPE_GUI_PLUGIN" && vPackageInfo[i].getMenuEntry().length())
899 mMenuMap[vPackageInfo[i].getMenuEntry()] = vPackageInfo[i].sMainProcedure;
900 }
901
902 return mMenuMap;
903}
904
905
914{
916}
917
const std::string sVersion
This class implements the basic input/ output file system and provides functionalities to work with f...
Definition: filesystem.hpp:92
std::string ValidFileName(std::string _sFileName, const std::string sExtension=".dat", bool checkExtension=true, bool doCleanPath=true) const
This member function evaluates, whether the passed filename is a valid filename. One may supply a pre...
Definition: filesystem.cpp:280
static NumeReKernel * getInstance()
This static member function returns a a pointer to the singleton instance of the kernel.
Definition: kernel.hpp:221
void refreshFunctionTree()
This member function informs the GUI to reload the contents of the function tree as soon as possible.
Definition: kernel.cpp:3573
This class implements a single declared package. It can be constructed directly from an install infor...
Definition: plugin.hpp:45
std::string sKeyWords
Definition: plugin.hpp:77
std::string getCommandSignature() const
Creates a command signature for a plugin depending on the selected command line exraction tags of the...
Definition: plugin.cpp:357
std::string sDocumentationIndexID
Definition: plugin.hpp:76
std::string sMainProcedure
Definition: plugin.hpp:67
Package()
Default constructor.
Definition: plugin.cpp:33
std::string sAuthor
Definition: plugin.hpp:73
bool operator!=(const Package &_plugin) const
This member function is an overload for the inequality comparison operator.
Definition: plugin.cpp:229
std::string sVersion
Definition: plugin.hpp:72
std::string getLicense() const
Returns the package license.
Definition: plugin.cpp:331
std::string getChangesLog() const
Returns the package changeslog.
Definition: plugin.cpp:386
std::string sLicense
Definition: plugin.hpp:70
void importDefinition(std::string sDefinitionString)
This member function will import the package definition from the passed definition string.
Definition: plugin.cpp:144
std::string sType
Definition: plugin.hpp:69
std::string sName
Definition: plugin.hpp:71
std::string getOptionValue(const std::string &sInstallInfoString, const std::string &sOption, const std::string &sDefault)
This private member function extracts the option value of the passed option and replaces it by its de...
Definition: plugin.cpp:90
std::string getName() const
Returns the package name.
Definition: plugin.cpp:283
std::string sArgumentList
Definition: plugin.hpp:68
bool operator==(const Package &_plugin) const
This member function is an overload for the equality comparison operator.
Definition: plugin.cpp:215
std::string getDescription() const
Returns the package description.
Definition: plugin.cpp:307
std::string exportDefinition() const
This member function will create the definition export string to be written to the plugin definition ...
Definition: plugin.cpp:126
void update(const Package &_plugin)
This member function can be used to update a package definition with a newer definition....
Definition: plugin.cpp:245
std::string stripParentheses(const std::string &sString) const
This private member function removes the surrounding parentheses, if available.
Definition: plugin.hpp:57
bool isPlugin() const
Returns, whether the current package provides plugin functionalities.
Definition: plugin.cpp:201
std::string getMenuEntry() const
Returns the menu entry of this plugin.
Definition: plugin.cpp:343
std::string sDescription
Definition: plugin.hpp:74
std::string sCommand
Definition: plugin.hpp:66
std::string sChangesLog
Definition: plugin.hpp:78
void incrementVersion()
This member function will increment the package version number by a build count.
Definition: plugin.cpp:271
std::string getKeyWords() const
Returns the package keywords.
Definition: plugin.cpp:319
std::string sMenuEntry
Definition: plugin.hpp:75
std::string getAuthor() const
Returns the package author.
Definition: plugin.cpp:295
This class implements the procedure plugin system. It will be a parent class of the procedure class.
Definition: plugin.hpp:115
PackageManager()
PluginManager default constructor.
Definition: plugin.cpp:404
void addHelpIndex(const std::string &_sPluginName, std::string _sHelpId)
This member function adds the passed documentation index ID to the plugin definition.
Definition: plugin.cpp:770
std::string deletePackage(const std::string &sPackage)
This member function deletes the plugin with the passed name from the internal set of definitions and...
Definition: plugin.cpp:857
std::fstream fPlugins
Definition: plugin.hpp:117
std::vector< Package > vPackageInfo
Definition: plugin.hpp:118
std::string getPluginInfoPath()
This member function simply returns the plugin definition file path.
Definition: plugin.cpp:913
std::string sPluginProcName
Definition: plugin.hpp:121
bool loadPlugins()
This member function will read the plugin definitions from the definitions file and create the intern...
Definition: plugin.cpp:501
bool isPluginCmd(const std::string &sCmd) const
This member function determines, whether the passed command line contains a plugin command.
Definition: plugin.cpp:829
bool evalPluginCmd(std::string &sCmd)
This member function converts the call to a plugin in the passed command line into a call to the corr...
Definition: plugin.cpp:544
~PackageManager()
PluginManager destructor. Will close the internal file stream if it is still open.
Definition: plugin.cpp:442
void updatePluginFile()
This member function will update the plugin definition file with the internal plugin definitions.
Definition: plugin.cpp:472
std::string sPluginDefinitionFile
Definition: plugin.hpp:119
bool declareNewPackage(const std::string &sInstallInfoString)
This member function declares a new plugin from the passed install information string.
Definition: plugin.cpp:664
PackageManager & operator=(const PackageManager &_manager)
This is the overload for the assignment operator.
Definition: plugin.cpp:457
std::map< std::string, std::string > getMenuMap() const
Returns the menu map connecting menu entry names with their corresponding procedure,...
Definition: plugin.cpp:892
std::string sPluginVarList
Definition: plugin.hpp:122
void assign(const PackageManager &_manager)
This private member function handles the actual copy process.
Definition: plugin.cpp:432
Common exception class for all exceptions thrown in NumeRe.
Definition: error.hpp:32
@ PLUGIN_MAY_NOT_OVERRIDE
Definition: error.hpp:194
@ PLUGINNAME_ALREADY_EXISTS
Definition: error.hpp:191
@ CANNOT_READ_FILE
Definition: error.hpp:75
@ PLUGINCMD_ALREADY_EXISTS
Definition: error.hpp:190
@ PLUGIN_HAS_NO_MAIN
Definition: error.hpp:193
@ PLUGIN_HAS_NO_CMD
Definition: error.hpp:192
static size_t invalid_position
Definition: error.hpp:235
CONSTCD11 std::enable_if<!std::chrono::treat_as_floating_point< T >::value, T >::type trunc(T t) NOEXCEPT
Definition: date.h:1113
void StripSpaces(std::string &)
Removes leading and trailing white spaces and tabulator characters.
int findParameter(const std::string &sCmd, const std::string &sParam, const char cFollowing)
This function searches the passed parameter in the passed command string. If something is found,...
Definition: tools.cpp:113
std::string getNextArgument(std::string &sArgList, bool bCut)
Definition: tools.cpp:2294
Structure for the findCommand function.
unsigned int nPos
Match findCommand(StringView sCmd, const std::string &sCommand)
This function is very important for the command handler.
Definition: tools.cpp:1275
string getArgAtPos(const string &sCmd, unsigned int nPos, int extraction)
Extracts a options value at the selected position and applies automatic parsing, if necessary.
Definition: tools.cpp:1598
string extractCommandString(const string &sCmd, const Match &_mMatch)
Extracts the whole command string from a command line (which might contain more than one).
Definition: tools.cpp:1325