33#define SETTING_B_DEVELOPERMODE "internal.developermode"
34#define SETTING_B_DEBUGGER "internal.debugger"
35#define SETTING_B_SYSTEMPRINTS "internal.usesystemprints"
36#define SETTING_B_DRAFTMODE "plotting.draftmode"
37#define SETTING_B_COMPACT "table.compact"
38#define SETTING_B_LOADEMPTYCOLS "table.loademptycols"
39#define SETTING_B_SHOWHINTS "ui.showhints"
40#define SETTING_B_USECUSTOMLANG "ui.usecustomlang"
41#define SETTING_B_EXTERNALDOCWINDOW "ui.externaldocwindow"
42#define SETTING_B_EXTENDEDFILEINFO "io.extendedfileinfo"
43#define SETTING_B_LOGFILE "io.logfile"
44#define SETTING_B_DEFCONTROL "io.defcontrol"
45#define SETTING_B_TABLEREFS "flowctrl.alwaysreferencetables"
46#define SETTING_B_USEESCINSCRIPTS "flowctrl.useescinscripts"
47#define SETTING_B_ENABLEEXECUTE "flowctrl.enableexecute"
48#define SETTING_B_MASKDEFAULT "flowctrl.maskdefault"
49#define SETTING_B_DECODEARGUMENTS "debugger.decodearguments"
50#define SETTING_B_GREETING "terminal.greeting"
51#define SETTING_V_PRECISION "terminal.precision"
52#define SETTING_V_WINDOW_X "terminal.windowsize.x"
53#define SETTING_V_WINDOW_Y "terminal.windowsize.y"
54#define SETTING_V_BUFFERSIZE "terminal.buffersize"
55#define SETTING_S_TERMINALFONT "terminal.font"
56#define SETTING_S_HISTORYFONT "history.font"
57#define SETTING_V_AUTOSAVE "table.autosave"
58#define SETTING_S_EXEPATH "path.exepath"
59#define SETTING_S_SAVEPATH "path.savepath"
60#define SETTING_S_LOADPATH "path.loadpath"
61#define SETTING_S_PLOTPATH "path.plotpath"
62#define SETTING_S_SCRIPTPATH "path.scriptpath"
63#define SETTING_S_PROCPATH "path.procpath"
64#define SETTING_S_WORKPATH "path.workpath"
65#define SETTING_S_PLOTFONT "plotting.plotfont"
68#define SETTING_S_LATEXROOT "path.latexpath"
69#define SETTING_V_CARETBLINKTIME "ui.caretblinktime"
70#define SETTING_V_FOCUSEDLINE "debugger.focusedline"
71#define SETTING_B_LINESINSTACK "debugger.linenumbersinstacktrace"
72#define SETTING_B_MODULESINSTACK "debugger.modulesinstacktrace"
73#define SETTING_B_GLOBALVARS "debugger.showglobalvars"
74#define SETTING_B_PROCEDUREARGS "debugger.showarguments"
75#define SETTING_B_FLASHTASKBAR "debugger.flashtaskbar"
76#define SETTING_B_TOOLBARTEXT "ui.showtoolbartext"
77#define SETTING_B_PATHSONTABS "ui.showpathsontabs"
78#define SETTING_B_ICONSONTABS "ui.showiconsontabs"
79#define SETTING_V_POS_SASH_V "ui.position.verticalsash"
80#define SETTING_V_POS_SASH_H "ui.position.horizontalsash"
81#define SETTING_V_POS_SASH_T "ui.position.terminalsash"
82#define SETTING_S_WINDOWSIZE "ui.windowsize"
83#define SETTING_B_PRINTINCOLOR "print.usecolor"
84#define SETTING_B_PRINTLINENUMBERS "print.linenumbers"
85#define SETTING_B_SAVESESSION "save.session"
86#define SETTING_B_SAVEBOOKMARKS "save.bookmarks"
87#define SETTING_B_FORMATBEFORESAVING "save.format"
88#define SETTING_B_USEREVISIONS "save.revisions"
89#define SETTING_B_AUTOSAVEEXECUTION "save.beforeexecution"
90#define SETTING_B_SAVESASHS "save.sashs"
91#define SETTING_B_SAVEWINDOWSIZE "save.windowsize"
92#define SETTING_B_FOLDLOADEDFILE "editor.foldloadedfile"
93#define SETTING_B_HIGHLIGHTLOCALS "editor.highlightlocals"
94#define SETTING_B_USETABS "editor.usetabs"
95#define SETTING_B_LINELENGTH "editor.linelengthindicator"
96#define SETTING_B_HOMEENDCANCELS "editor.autocomp.homeendcancels"
97#define SETTING_B_BRACEAUTOCOMP "editor.autocomp.braces"
98#define SETTING_B_QUOTEAUTOCOMP "editor.autocomp.quotes"
99#define SETTING_B_BLOCKAUTOCOMP "editor.autocomp.blocks"
100#define SETTING_B_SMARTSENSE "editor.autocomp.smartsense"
101#define SETTING_S_EDITORFONT "editor.font"
102#define SETTING_B_AN_START "editor.analyzer._"
103#define SETTING_B_AN_USENOTES "editor.analyzer.usenotes"
104#define SETTING_B_AN_USEWARNINGS "editor.analyzer.usewarnings"
105#define SETTING_B_AN_USEERRORS "editor.analyzer.useerrors"
106#define SETTING_B_AN_MAGICNUMBERS "editor.analyzer.style.magicnumbers"
107#define SETTING_B_AN_UNDERSCOREARGS "editor.analyzer.style.underscoredarguments"
108#define SETTING_B_AN_THISFILE "editor.analyzer.namespace.thisfile"
109#define SETTING_B_AN_COMMENTDENS "editor.analyzer.metrics.commentdensity"
110#define SETTING_B_AN_LOC "editor.analyzer.metrics.linesofcode"
111#define SETTING_B_AN_COMPLEXITY "editor.analyzer.metrics.complexity"
112#define SETTING_B_AN_ALWAYSMETRICS "editor.analyzer.metrics.showalways"
113#define SETTING_B_AN_RESULTSUP "editor.analyzer.result.suppression"
114#define SETTING_B_AN_RESULTASS "editor.analyzer.result.assignment"
115#define SETTING_B_AN_TYPING "editor.analyzer.variables.typing"
116#define SETTING_B_AN_MISLEADINGTYPE "editor.analyzer.variables.misleadingtype"
117#define SETTING_B_AN_VARLENGTH "editor.analyzer.variables.length"
118#define SETTING_B_AN_UNUSEDVARS "editor.analyzer.variables.unused"
119#define SETTING_B_AN_GLOBALVARS "editor.analyzer.variables.globals"
120#define SETTING_B_AN_CONSTANTS "editor.analyzer.runtime.constants"
121#define SETTING_B_AN_INLINEIF "editor.analyzer.runtime.inlineif"
122#define SETTING_B_AN_PROCLENGTH "editor.analyzer.runtime.procedurelength"
123#define SETTING_B_AN_PROGRESS "editor.analyzer.runtime.progress"
124#define SETTING_B_AN_FALLTHROUGH "editor.analyzer.switch.fallthrough"
125#define SETTING_S_ST_START "editor.style._"
126#define SETTING_S_ST_STANDARD "editor.style.standard.editor"
127#define SETTING_S_ST_CONSOLESTD "editor.style.standard.terminal"
128#define SETTING_S_ST_COMMAND "editor.style.command.default"
129#define SETTING_S_ST_PROCCOMMAND "editor.style.command.procedure"
130#define SETTING_S_ST_COMMENT "editor.style.comment"
131#define SETTING_S_ST_DOCCOMMENT "editor.style.documentation.comment"
132#define SETTING_S_ST_DOCKEYWORD "editor.style.documentation.keyword"
133#define SETTING_S_ST_OPTION "editor.style.option"
134#define SETTING_S_ST_FUNCTION "editor.style.function.builtin"
135#define SETTING_S_ST_CUSTOMFUNC "editor.style.function.custom"
136#define SETTING_S_ST_CLUSTER "editor.style.cluster"
137#define SETTING_S_ST_CONSTANT "editor.style.constant"
138#define SETTING_S_ST_SPECIALVAL "editor.style.specialval"
139#define SETTING_S_ST_STRING "editor.style.string.literals"
140#define SETTING_S_ST_STRINGPARSER "editor.style.string.parser"
141#define SETTING_S_ST_INCLUDES "editor.style.includes"
142#define SETTING_S_ST_OPERATOR "editor.style.operator"
143#define SETTING_S_ST_PROCEDURE "editor.style.procedure"
144#define SETTING_S_ST_NUMBER "editor.style.number"
145#define SETTING_S_ST_METHODS "editor.style.methods"
146#define SETTING_S_ST_INSTALL "editor.style.install"
147#define SETTING_S_ST_DEFVARS "editor.style.defaultvariables"
148#define SETTING_S_ST_ACTIVELINE "editor.style.activeline"
151#define DEFAULT_ST_STANDARD "0:0:0-255:255:255-0100"
152#define DEFAULT_ST_CONSOLESTD "0:0:100-255:255:255-0000"
153#define DEFAULT_ST_COMMAND "0:128:255-255:255:255-1011"
154#define DEFAULT_ST_PROCCOMMAND "128:0:0-255:255:255-1011"
155#define DEFAULT_ST_COMMENT "0:128:0-255:255:183-0000"
156#define DEFAULT_ST_DOCCOMMENT "0:128:192-255:255:183-1000"
157#define DEFAULT_ST_DOCKEYWORD "128:0:0-255:255:183-1000"
158#define DEFAULT_ST_OPTION "0:128:100-255:255:255-0001"
159#define DEFAULT_ST_FUNCTION "0:0:255-255:255:255-1001"
160#define DEFAULT_ST_CUSTOMFUNC "0:0:160-255:255:255-0001"
161#define DEFAULT_ST_CLUSTER "96:96:96-255:255:255-0001"
162#define DEFAULT_ST_CONSTANT "255:0:128-255:255:255-1001"
163#define DEFAULT_ST_SPECIALVAL "0:0:0-255:255:255-1001"
164#define DEFAULT_ST_STRING "128:128:255-255:255:255-0001"
165#define DEFAULT_ST_STRINGPARSER "0:128:192-255:255:255-1001"
166#define DEFAULT_ST_INCLUDES "128:0:0-255:255:255-1001"
167#define DEFAULT_ST_OPERATOR "255:0:0-255:255:255-0001"
168#define DEFAULT_ST_PROCEDURE "128:0:0-255:255:255-1001"
169#define DEFAULT_ST_NUMBER "176:150:0-255:255:255-0001"
170#define DEFAULT_ST_METHODS "0:180:50-255:255:255-1001"
171#define DEFAULT_ST_INSTALL "128:128:128-255:255:255-0001"
172#define DEFAULT_ST_DEFVARS "0:0:160-255:255:255-1101"
173#define DEFAULT_ST_ACTIVELINE "0:0:0-221:230:255-0000"
237 m_value =
static_cast<void*
>(
new bool);
252 m_value =
static_cast<void*
>(
new size_t);
267 m_value =
static_cast<void*
>(
new std::string);
389 switch (
value.m_type)
423 switch (
value.m_type)
563 return *
static_cast<bool*
>(
m_value);
580 return *
static_cast<size_t*
>(
m_value);
597 return *
static_cast<std::string*
>(
m_value);
614 return *
static_cast<bool*
>(
m_value);
631 return *
static_cast<size_t*
>(
m_value);
648 return *
static_cast<std::string*
>(
m_value);
668 void import_v1x(
const std::string& sSettings);
669 bool set(
const std::string&);
698 void save(
const std::string& _sWhere,
bool bMkBackUp =
false);
699 void load(
const std::string& _sWhere);
779 iter->second.active() =
true;
796 iter->second.active() =
false;
815 return iter->second.active();
845 std::string _sPlotFont = plotFont;
847 if (_sPlotFont ==
"palatino")
848 _sPlotFont =
"pagella";
850 if (_sPlotFont ==
"times")
851 _sPlotFont =
"termes";
853 if (_sPlotFont ==
"bookman")
854 _sPlotFont =
"bonum";
856 if (_sPlotFont ==
"avantgarde")
857 _sPlotFont =
"adventor";
859 if (_sPlotFont ==
"chancery")
860 _sPlotFont =
"chorus";
862 if (_sPlotFont ==
"courier")
863 _sPlotFont =
"cursor";
865 if (_sPlotFont ==
"helvetica")
866 _sPlotFont =
"heros";
868 if (_sPlotFont ==
"pagella"
869 || _sPlotFont ==
"adventor"
870 || _sPlotFont ==
"bonum"
871 || _sPlotFont ==
"chorus"
872 || _sPlotFont ==
"cursor"
873 || _sPlotFont ==
"heros"
874 || _sPlotFont ==
"heroscn"
875 || _sPlotFont ==
"schola"
876 || _sPlotFont ==
"termes"
This class handles the documentation index and provides lookup functionalities to obtain the correspo...
This class manages the setting values of the internal (kernel) settings of this application.
std::string getDefaultPlotFont() const
Returns the current plotting font name.
std::map< std::string, SettingsValue > m_settings
void disable(const std::string &option)
Disables a setting with boolean value type. If the setting does not have this type,...
bool createCompactTables() const
Returns, whether tables shall be displayed in a more compact way (does nothing in the external table ...
std::map< std::string, SettingsValue > & getSettings()
Returns a reference to the internal map of setting values.
std::string getLoadPath() const
Returns the current loading path.
bool showGreeting() const
Returns, whether NumeRe shall greet the user with a funny message at application start-up.
const std::map< std::string, SettingsValue > & getSettings() const
Returns a const reference to the internal map of setting values.
bool useLogFile() const
Returns, whether the terminal inputs shall be protocoled in a dedicated logfile. This setting does no...
size_t getAutoSaveInterval() const
Returns the timespan for the autosave interval in seconds.
bool decodeArguments() const
Returns, whether the debugger shall try to decode procedure arguments.
bool systemPrints() const
Returns, whether system messages shall be printed to the terminal.
bool executeEnabled() const
Returns, whether the user enabled the execute command.
void import_v1x(const std::string &sSettings)
Imports a setting value string from a v1.x configuration file.
std::string getWorkPath() const
Returns the current working path (connected to the <wp> token).
bool controlDefinitions() const
Returns, whether NumeRe shall load and save custom functions automatically.
bool useExternalDocWindow() const
Returns, whether documentations shall be displayed in external windows.
bool isDeveloperMode() const
Returns, whether the developer mode is currently enabled.
std::string getSavePath() const
Returns the current saving path.
const SettingsValue & getSetting(const std::string &value) const
Returns a const reference to the setting value, which corresponds to the passed string....
size_t getPrecision() const
Returns the precision for displaying floating numbers in the terminal. This value determines the numb...
std::string getTokenPaths() const
Returns a semicolon-separated list of the current defined path placeholders and their values.
std::string getProcPath() const
Returns the current procedure root import path.
bool showHints() const
Returns, whether the tip-of-the-day shall be displayed to the user at application start-up.
std::string getPlotPath() const
Returns the current plotting path (plot storing location).
std::string sSettings_ini
bool showExtendedFileInfo() const
Returns, whether the file tree or the terminal file explorer shall display extended file information ...
std::string getExePath() const
Returns the current application root folder path.
Settings & operator=(const Settings &_settings)
Assignment operator overload.
Settings()
Settings class default constructor. Creates and fills the internal setting value map with their defau...
SettingsValue & getSetting(const std::string &value)
Returns a reference to the setting value, which corresponds to the passed string. Throws an exception...
void enableSystemPrints(bool _bSystemPrints=true)
Enables or disables the system printing functionality. This is a convenience wrapper for the direct m...
void prepareFilePaths(const std::string &_sExePath)
This member function is a helper, which will replace the <> path token in all default file paths with...
bool set(const std::string &)
Imports a setting value from a v0.9x configuration file.
size_t getWindow(int nWindow=0) const
Returns the current window size of the terminal.
void copySettings(const Settings &_settings)
This member function is an alias for the assignment operator overload.
void setDefaultPlotFont(const std::string &plotFont)
Update the default plotting font. This member function evaluates first, whether the selected font act...
bool isDraftMode() const
Returns, whether the plotting draft mode is enabled.
bool useCustomLangFiles() const
Returns, whether user language files shall be used to override internal language strings.
bool useMaskDefault() const
Returns, whether loop flow control statements shall use the mask option automatically.
std::string getScriptPath() const
Returns the current script import folder path.
std::string replaceExePath(const std::string &_sPath)
This member function is a helper, which will replace the executable path part in the passed file path...
bool loadEmptyCols() const
Returns, whether NumeRe shall keep empty columns when loading a file to memory.
void enable(const std::string &option)
Enables a setting with boolean value type. If the setting does not have this type,...
bool useDebugger() const
Returns, whether the debugger is currently active.
void load(const std::string &_sWhere)
Opens the configuration file, identifies its version and imports the setting values.
size_t getBuffer() const
Returns the current terminal buffer size.
bool useEscInScripts() const
Returns, whether ESC key presses shall be handled, when scripts are being executed.
bool isEnabled(const std::string &option) const
Returns true, if the setting with boolean value type is enabled, false otherwise. If the setting does...
void save(const std::string &_sWhere, bool bMkBackUp=false)
Saves the setting values to the corresponding config file. Does only save the setting values,...
This class represents a single abstract settings value implemented as void*. We're using asserts to a...
SettingsValue(size_t value, size_t _min, size_t _max, int properties=SettingsValue::SAVE)
Create a setting value from an unsigned integer and define its minimal and maximal possible values.
size_t value() const
Returns the value of an unsigned int value type setting.
bool shallSave() const
Returns, whether this is a setting value, which shall be saved to the configuration file.
SettingsValue(const char *value, int properties=SettingsValue::SAVE)
Create a setting value from a const char*, represented as a std::string internally.
bool active() const
Returns the value of a boolean value type setting.
void clear()
Clear the internal memory (called by the destructor, for example).
bool isHidden() const
Returns, whether this setting value is an internal-only setting and should not be presented to and mo...
size_t max() const
Returns the maximal value of an unsigned int value type.
SettingsValue & operator=(const SettingsValue &value)
Assignment operator overload. Clears the contents of the assignee and takes the value and the type of...
bool isMutable() const
Returns, whether this setting value is mutable by the user in the terminal.
void assign(bool value)
Assign a new boolean value to the internal memory.
~SettingsValue()
Destructor. Will free the allocated memory.
void assign(size_t value)
Assign a new unsigned int value to the internal memory.
SettingsValue(const std::string &value, int properties=SettingsValue::SAVE)
Create a setting value from a std::string.
std::string stringval() const
Returns the value of a std::string value type setting.
bool & active()
Returns a reference to a boolean value type setting.
SettingsValueType
The type of the setting value.
SettingsValue(const SettingsValue &value)
Copy constructor. Creates a new instance and copies all contents. (Does not copy the pointers themsel...
size_t & value()
Returns a reference to an unsigned int value type setting.
bool isPath() const
Returns, whether this setting value represents a file path and a corresponding validation is necessar...
SettingsValue(bool value, int properties=SettingsValue::SAVE)
Create a setting value from a boolean.
std::string & stringval()
Returns a reference to a std::string value type setting.
void assign(const std::string &value)
Assign a new std::string value to the internal memory.
SettingsValue()
Default constructor. Creates an empty and typeless setting value.
SettingsValueProperties
Additional setting value properties.
size_t min() const
Returns the minimal value of an unsigned int value type.
bool isUiModifying() const
Returns true, when a setting modifies the graphical user interface and therefore needs to refresh it.
SettingsValueType getType() const
Get the internal value type.
Common exception class for all exceptions thrown in NumeRe.
#define SETTING_V_PRECISION
#define SETTING_B_GREETING
#define SETTING_B_MASKDEFAULT
#define SETTING_S_PLOTFONT
#define SETTING_V_AUTOSAVE
#define SETTING_S_PROCPATH
#define SETTING_B_COMPACT
#define SETTING_B_EXTERNALDOCWINDOW
#define SETTING_B_LOADEMPTYCOLS
#define SETTING_S_EXEPATH
#define SETTING_V_WINDOW_X
#define SETTING_B_DEVELOPERMODE
#define SETTING_B_USECUSTOMLANG
#define SETTING_S_LOADPATH
#define SETTING_B_EXTENDEDFILEINFO
#define SETTING_B_USEESCINSCRIPTS
#define SETTING_V_BUFFERSIZE
#define SETTING_B_DECODEARGUMENTS
#define SETTING_V_WINDOW_Y
#define SETTING_S_SAVEPATH
#define SETTING_B_SYSTEMPRINTS
#define SETTING_B_ENABLEEXECUTE
#define SETTING_B_DRAFTMODE
#define SETTING_B_DEFCONTROL
#define SETTING_S_WORKPATH
#define SETTING_B_DEBUGGER
#define SETTING_S_PLOTPATH
#define SETTING_B_SHOWHINTS
#define SETTING_S_SCRIPTPATH
#define SETTING_B_LOGFILE