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

This class manages the setting values of the internal (kernel) settings of this application. More...

#include <settings.hpp>

Inheritance diagram for Settings:
Collaboration diagram for Settings:

Public Member Functions

 Settings ()
 Settings class default constructor. Creates and fills the internal setting value map with their default values. More...
 
 Settings (const Settings &_settings)
 Settings class copy constructor. Delegates the initialization to the default constructor. More...
 
void copySettings (const Settings &_settings)
 This member function is an alias for the assignment operator overload. More...
 
Settingsoperator= (const Settings &_settings)
 Assignment operator overload. More...
 
void save (const std::string &_sWhere, bool bMkBackUp=false)
 Saves the setting values to the corresponding config file. Does only save the setting values, which are marked that they shall be saved. More...
 
void load (const std::string &_sWhere)
 Opens the configuration file, identifies its version and imports the setting values. More...
 
SettingsValuegetSetting (const std::string &value)
 Returns a reference to the setting value, which corresponds to the passed string. Throws an exception, if the setting does not exist. More...
 
const SettingsValuegetSetting (const std::string &value) const
 Returns a const reference to the setting value, which corresponds to the passed string. Throws an exception, if the setting does not exist. More...
 
std::map< std::string, SettingsValue > & getSettings ()
 Returns a reference to the internal map of setting values. More...
 
const std::map< std::string, SettingsValue > & getSettings () const
 Returns a const reference to the internal map of setting values. More...
 
void enable (const std::string &option)
 Enables a setting with boolean value type. If the setting does not have this type, nothing happens. More...
 
void disable (const std::string &option)
 Disables a setting with boolean value type. If the setting does not have this type, nothing happens. More...
 
bool isEnabled (const std::string &option) const
 Returns true, if the setting with boolean value type is enabled, false otherwise. If the setting does not have a boolean value type, this method will return false as well. More...
 
void enableSystemPrints (bool _bSystemPrints=true)
 Enables or disables the system printing functionality. This is a convenience wrapper for the direct map access. More...
 
void setDefaultPlotFont (const std::string &plotFont)
 Update the default plotting font. This member function evaluates first, whether the selected font actually exists. More...
 
bool isDeveloperMode () const
 Returns, whether the developer mode is currently enabled. More...
 
bool isDraftMode () const
 Returns, whether the plotting draft mode is enabled. More...
 
bool createCompactTables () const
 Returns, whether tables shall be displayed in a more compact way (does nothing in the external table viewer). More...
 
bool showGreeting () const
 Returns, whether NumeRe shall greet the user with a funny message at application start-up. More...
 
bool showHints () const
 Returns, whether the tip-of-the-day shall be displayed to the user at application start-up. More...
 
bool useEscInScripts () const
 Returns, whether ESC key presses shall be handled, when scripts are being executed. More...
 
bool controlDefinitions () const
 Returns, whether NumeRe shall load and save custom functions automatically. More...
 
bool showExtendedFileInfo () const
 Returns, whether the file tree or the terminal file explorer shall display extended file information for NumeRe data files. More...
 
bool useLogFile () const
 Returns, whether the terminal inputs shall be protocoled in a dedicated logfile. This setting does not modify the history functionality. More...
 
bool loadEmptyCols () const
 Returns, whether NumeRe shall keep empty columns when loading a file to memory. More...
 
size_t getPrecision () const
 Returns the precision for displaying floating numbers in the terminal. This value determines the number of valid numbers, which shall be displayed. More...
 
std::string getExePath () const
 Returns the current application root folder path. More...
 
std::string getWorkPath () const
 Returns the current working path (connected to the <wp> token). More...
 
std::string getSavePath () const
 Returns the current saving path. More...
 
std::string getLoadPath () const
 Returns the current loading path. More...
 
std::string getPlotPath () const
 Returns the current plotting path (plot storing location). More...
 
std::string getScriptPath () const
 Returns the current script import folder path. More...
 
std::string getProcPath () const
 Returns the current procedure root import path. More...
 
size_t getAutoSaveInterval () const
 Returns the timespan for the autosave interval in seconds. More...
 
size_t getBuffer () const
 Returns the current terminal buffer size. More...
 
size_t getWindow (int nWindow=0) const
 Returns the current window size of the terminal. More...
 
std::string getDefaultPlotFont () const
 Returns the current plotting font name. More...
 
std::string getTokenPaths () const
 Returns a semicolon-separated list of the current defined path placeholders and their values. More...
 
bool systemPrints () const
 Returns, whether system messages shall be printed to the terminal. More...
 
bool useDebugger () const
 Returns, whether the debugger is currently active. More...
 
bool useCustomLangFiles () const
 Returns, whether user language files shall be used to override internal language strings. More...
 
bool useExternalDocWindow () const
 Returns, whether documentations shall be displayed in external windows. More...
 
bool executeEnabled () const
 Returns, whether the user enabled the execute command. More...
 
bool useMaskDefault () const
 Returns, whether loop flow control statements shall use the mask option automatically. More...
 
bool decodeArguments () const
 Returns, whether the debugger shall try to decode procedure arguments. More...
 
- Public Member Functions inherited from Documentation
 Documentation ()
 The default constructor. More...
 
 ~Documentation ()
 The destructor closes the internal file stream, if it is still open. More...
 
void createDocumentationIndex (bool bLoadUserLangFiles=true)
 This member function loads the index files to memory. More...
 
void addFileToDocumentationIndex (const std::string &sFileName)
 This member function is used to add documentation index entries to the index during a plugin or package installation. More...
 
void removeFromDocIndex (const std::string &_sID)
 This member function removes the index entry passed to the function from the documentation index. More...
 
std::vector< std::string > getHelpArticle (const std::string &sTopic)
 This member function returns the documentation article, which corresponds to the passed documentation topic of the the whole documentation index in readable form. More...
 
std::vector< std::string > getDocIndex () const
 This member function returns the key list for the documentation index prepared for the corresponding tree in the documentation browser. More...
 
std::string getHelpIdxKey (const std::string &sTopic)
 This member function returns an index key, which corresponds to the queried topic. More...
 
std::string getHelpArticleID (const std::string &sTopic)
 This member function returns the article ID corresponding to the queried topic. More...
 
std::string getHelpArticleTitle (const std::string &_sIdxKey)
 This member function returns the documentation article title corresponding to the queried index key. More...
 
- Public Member Functions inherited from FileSystem
 FileSystem ()
 Default constructor. More...
 
FileSystemassign (const FileSystem &_fSys)
 Assignment member function to copy the settings from another FileSystem instance. More...
 
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 preferred filename extension. More...
 
std::string ValidFolderName (std::string _sFileName, bool doCleanPath=true, bool appendTrailingSeparator=true) const
 This member function evaluates, whether the passed foldername is a valid foldername. More...
 
std::string ValidizeAndPrepareName (const std::string &_sFileName, const std::string &sExtension=".dat") const
 This member function validizes the passed file name and creates the needed folders on-the-fly. More...
 
int setPath (std::string _sPath, bool bMkDir, std::string _sExePath)
 This member function may be used to set the preferred file path of the current FileSystem instance. More...
 
void createRevisionsFolder ()
 This member function creates the hidden revisions folders for the version control system. More...
 
std::string getPath () const
 Returns the default path of this FileSystem instance. More...
 
std::vector< std::string > getFileParts (const std::string &sFilePath) const
 This member function separates all path parts into single strings: the drive letter, the path, the name and the extension. This function may also handle folder paths and network paths. More...
 
FileInfo getFileInfo (const std::string &sFilePath) const
 Return the file information about the passed file path. More...
 
void setTokens (std::string _sTokens)
 This member function may be used to update the path placeholders of the current FileSystem instance. More...
 
bool isFile (const std::string &_sPath) const
 This function determines, whether a path name indicates a file or a folder. More...
 
void initializeFromKernel ()
 Member function to remote-initialize the class from the kernel. Cannot be used during kernel start-up. More...
 
void setProgramPath (std::string _sExePath)
 
std::string getProgramPath () const
 
void declareFileType (const std::string &sFileType)
 

Protected Attributes

std::map< std::string, SettingsValuem_settings
 
- Protected Attributes inherited from FileSystem
std::string sPath
 
std::string sExecutablePath
 
std::string sTokens [7][2]
 
std::string sValidExtensions
 

Private Member Functions

void import_v1x (const std::string &sSettings)
 Imports a setting value string from a v1.x configuration file. More...
 
bool set (const std::string &)
 Imports a setting value from a v0.9x configuration file. More...
 
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 with the <> path token. More...
 
void prepareFilePaths (const std::string &_sExePath)
 This member function is a helper, which will replace the <> path token in all default file paths with the corresponding executable path. More...
 

Private Attributes

std::string sSettings_ini
 

Additional Inherited Members

- Static Public Member Functions inherited from Documentation
static std::string getArgAtPos (const std::string &sCmd, unsigned int pos)
 This static member is a fallback for the XML-parsing logic-stuff. More...
 
- Protected Member Functions inherited from FileSystem
int createFolders (const std::string &_sPath) const
 This member function creates all missing directories in the passed path. More...
 

Detailed Description

This class manages the setting values of the internal (kernel) settings of this application.

Definition at line 662 of file settings.hpp.

Constructor & Destructor Documentation

◆ Settings() [1/2]

Settings::Settings ( )

Settings class default constructor. Creates and fills the internal setting value map with their default values.

Definition at line 39 of file settings.cpp.

References DEFAULT_ST_ACTIVELINE, DEFAULT_ST_CLUSTER, DEFAULT_ST_COMMAND, DEFAULT_ST_COMMENT, DEFAULT_ST_CONSOLESTD, DEFAULT_ST_CONSTANT, DEFAULT_ST_CUSTOMFUNC, DEFAULT_ST_DEFVARS, DEFAULT_ST_DOCCOMMENT, DEFAULT_ST_DOCKEYWORD, DEFAULT_ST_FUNCTION, DEFAULT_ST_INCLUDES, DEFAULT_ST_INSTALL, DEFAULT_ST_METHODS, DEFAULT_ST_NUMBER, DEFAULT_ST_OPERATOR, DEFAULT_ST_OPTION, DEFAULT_ST_PROCCOMMAND, DEFAULT_ST_PROCEDURE, DEFAULT_ST_SPECIALVAL, DEFAULT_ST_STANDARD, DEFAULT_ST_STRING, DEFAULT_ST_STRINGPARSER, SettingsValue::HIDDEN, SettingsValue::IMMUTABLE, m_settings, SettingsValue::NONE, SettingsValue::PATH, SettingsValue::SAVE, SETTING_B_AN_ALWAYSMETRICS, SETTING_B_AN_COMMENTDENS, SETTING_B_AN_COMPLEXITY, SETTING_B_AN_CONSTANTS, SETTING_B_AN_FALLTHROUGH, SETTING_B_AN_GLOBALVARS, SETTING_B_AN_INLINEIF, SETTING_B_AN_LOC, SETTING_B_AN_MAGICNUMBERS, SETTING_B_AN_MISLEADINGTYPE, SETTING_B_AN_PROCLENGTH, SETTING_B_AN_PROGRESS, SETTING_B_AN_RESULTASS, SETTING_B_AN_RESULTSUP, SETTING_B_AN_START, SETTING_B_AN_THISFILE, SETTING_B_AN_TYPING, SETTING_B_AN_UNDERSCOREARGS, SETTING_B_AN_UNUSEDVARS, SETTING_B_AN_USEERRORS, SETTING_B_AN_USENOTES, SETTING_B_AN_USEWARNINGS, SETTING_B_AN_VARLENGTH, SETTING_B_AUTOSAVEEXECUTION, SETTING_B_BLOCKAUTOCOMP, SETTING_B_BRACEAUTOCOMP, SETTING_B_COMPACT, SETTING_B_DEBUGGER, SETTING_B_DECODEARGUMENTS, SETTING_B_DEFCONTROL, SETTING_B_DEVELOPERMODE, SETTING_B_DRAFTMODE, SETTING_B_ENABLEEXECUTE, SETTING_B_EXTENDEDFILEINFO, SETTING_B_EXTERNALDOCWINDOW, SETTING_B_FLASHTASKBAR, SETTING_B_FOLDLOADEDFILE, SETTING_B_FORMATBEFORESAVING, SETTING_B_GLOBALVARS, SETTING_B_GREETING, SETTING_B_HIGHLIGHTLOCALS, SETTING_B_HOMEENDCANCELS, SETTING_B_ICONSONTABS, SETTING_B_LINELENGTH, SETTING_B_LINESINSTACK, SETTING_B_LOADEMPTYCOLS, SETTING_B_LOGFILE, SETTING_B_MASKDEFAULT, SETTING_B_MODULESINSTACK, SETTING_B_PATHSONTABS, SETTING_B_PRINTINCOLOR, SETTING_B_PRINTLINENUMBERS, SETTING_B_PROCEDUREARGS, SETTING_B_QUOTEAUTOCOMP, SETTING_B_SAVEBOOKMARKS, SETTING_B_SAVESASHS, SETTING_B_SAVESESSION, SETTING_B_SAVEWINDOWSIZE, SETTING_B_SHOWHINTS, SETTING_B_SMARTSENSE, SETTING_B_SYSTEMPRINTS, SETTING_B_TABLEREFS, SETTING_B_TOOLBARTEXT, SETTING_B_USECUSTOMLANG, SETTING_B_USEESCINSCRIPTS, SETTING_B_USEREVISIONS, SETTING_B_USETABS, SETTING_S_EDITORFONT, SETTING_S_EXEPATH, SETTING_S_HISTORYFONT, SETTING_S_LATEXROOT, SETTING_S_LOADPATH, SETTING_S_PLOTFONT, SETTING_S_PLOTPATH, SETTING_S_PROCPATH, SETTING_S_SAVEPATH, SETTING_S_SCRIPTPATH, SETTING_S_ST_ACTIVELINE, SETTING_S_ST_CLUSTER, SETTING_S_ST_COMMAND, SETTING_S_ST_COMMENT, SETTING_S_ST_CONSOLESTD, SETTING_S_ST_CONSTANT, SETTING_S_ST_CUSTOMFUNC, SETTING_S_ST_DEFVARS, SETTING_S_ST_DOCCOMMENT, SETTING_S_ST_DOCKEYWORD, SETTING_S_ST_FUNCTION, SETTING_S_ST_INCLUDES, SETTING_S_ST_INSTALL, SETTING_S_ST_METHODS, SETTING_S_ST_NUMBER, SETTING_S_ST_OPERATOR, SETTING_S_ST_OPTION, SETTING_S_ST_PROCCOMMAND, SETTING_S_ST_PROCEDURE, SETTING_S_ST_SPECIALVAL, SETTING_S_ST_STANDARD, SETTING_S_ST_START, SETTING_S_ST_STRING, SETTING_S_ST_STRINGPARSER, SETTING_S_TERMINALFONT, SETTING_S_WINDOWSIZE, SETTING_S_WORKPATH, SETTING_V_AUTOSAVE, SETTING_V_BUFFERSIZE, SETTING_V_CARETBLINKTIME, SETTING_V_FOCUSEDLINE, SETTING_V_POS_SASH_H, SETTING_V_POS_SASH_T, SETTING_V_POS_SASH_V, SETTING_V_PRECISION, SETTING_V_WINDOW_X, SETTING_V_WINDOW_Y, sSettings_ini, and SettingsValue::UIREFRESH.

◆ Settings() [2/2]

Settings::Settings ( const Settings _settings)

Settings class copy constructor. Delegates the initialization to the default constructor.

Parameters
_settingsconst Settings&

Definition at line 170 of file settings.cpp.

References copySettings().

Here is the call graph for this function:

Member Function Documentation

◆ controlDefinitions()

bool Settings::controlDefinitions ( ) const
inline

Returns, whether NumeRe shall load and save custom functions automatically.

Returns
bool

Definition at line 955 of file settings.hpp.

References m_settings, and SETTING_B_DEFCONTROL.

Referenced by NumeReKernel::CloseSession(), and NumeReKernel::StartUp().

◆ copySettings()

void Settings::copySettings ( const Settings _settings)

This member function is an alias for the assignment operator overload.

Parameters
_settingsconst Settings&
Returns
void

Definition at line 740 of file settings.cpp.

References getTokenPaths(), m_settings, and FileSystem::setTokens().

Referenced by NumeReWindow::OnClose(), NumeReWindow::OnOptions(), NumeReTerminal::OnThreadUpdate(), operator=(), NumeReKernel::setKernelSettings(), and Settings().

Here is the call graph for this function:

◆ createCompactTables()

bool Settings::createCompactTables ( ) const
inline

Returns, whether tables shall be displayed in a more compact way (does nothing in the external table viewer).

Returns
bool

Definition at line 913 of file settings.hpp.

References m_settings, and SETTING_B_COMPACT.

Referenced by cmd_show(), createOutputForHist1D(), and createOutputForHist2D().

◆ decodeArguments()

bool Settings::decodeArguments ( ) const
inline

Returns, whether the debugger shall try to decode procedure arguments.

Returns
bool

Definition at line 1202 of file settings.hpp.

References m_settings, and SETTING_B_DECODEARGUMENTS.

◆ disable()

void Settings::disable ( const std::string &  option)
inline

Disables a setting with boolean value type. If the setting does not have this type, nothing happens.

Parameters
optionconst std::string&
Returns
void

Definition at line 791 of file settings.hpp.

References SettingsValue::BOOL, and m_settings.

◆ enable()

void Settings::enable ( const std::string &  option)
inline

Enables a setting with boolean value type. If the setting does not have this type, nothing happens.

Parameters
optionconst std::string&
Returns
void

Definition at line 774 of file settings.hpp.

References SettingsValue::BOOL, and m_settings.

◆ enableSystemPrints()

void Settings::enableSystemPrints ( bool  _bSystemPrints = true)
inline

Enables or disables the system printing functionality. This is a convenience wrapper for the direct map access.

Parameters
_bSystemPrintsbool
Returns
void

Definition at line 829 of file settings.hpp.

References m_settings, and SETTING_B_SYSTEMPRINTS.

Referenced by Procedure::execute(), NumeReKernel::executePlugins(), NumeReKernel::MainLoop(), and Procedure::procedureInterface().

◆ executeEnabled()

bool Settings::executeEnabled ( ) const
inline

Returns, whether the user enabled the execute command.

Returns
bool

Definition at line 1181 of file settings.hpp.

References m_settings, and SETTING_B_ENABLEEXECUTE.

Referenced by executeCommand().

◆ getAutoSaveInterval()

size_t Settings::getAutoSaveInterval ( ) const
inline

Returns the timespan for the autosave interval in seconds.

Returns
size_t

Definition at line 1078 of file settings.hpp.

References m_settings, and SETTING_V_AUTOSAVE.

Referenced by NumeReKernel::getAutosaveInterval().

◆ getBuffer()

size_t Settings::getBuffer ( ) const
inline

Returns the current terminal buffer size.

Returns
size_t

Definition at line 1088 of file settings.hpp.

References m_settings, and SETTING_V_BUFFERSIZE.

◆ getDefaultPlotFont()

std::string Settings::getDefaultPlotFont ( ) const
inline

Returns the current plotting font name.

Returns
std::string

Definition at line 1111 of file settings.hpp.

References m_settings, and SETTING_S_PLOTFONT.

Referenced by PlotData::reset(), and NumeReKernel::StartUp().

◆ getExePath()

◆ getLoadPath()

std::string Settings::getLoadPath ( ) const
inline

◆ getPlotPath()

std::string Settings::getPlotPath ( ) const
inline

Returns the current plotting path (plot storing location).

Returns
std::string

Definition at line 1048 of file settings.hpp.

References m_settings, and SETTING_S_PLOTPATH.

Referenced by doc_ReplaceTokensForHTML(), editObject(), NumeReKernel::getPathSettings(), initializeFileHandle(), listDirectory(), listFiles(), NumeRe::StringParser::numToString(), and NumeReKernel::StartUp().

◆ getPrecision()

◆ getProcPath()

◆ getSavePath()

std::string Settings::getSavePath ( ) const
inline

◆ getScriptPath()

std::string Settings::getScriptPath ( ) const
inline

Returns the current script import folder path.

Returns
std::string

Definition at line 1058 of file settings.hpp.

References m_settings, and SETTING_S_SCRIPTPATH.

Referenced by doc_ReplaceTokensForHTML(), editObject(), NumeReKernel::getPathSettings(), initializeFileHandle(), listDirectory(), listFiles(), NumeRe::StringParser::numToString(), and NumeReKernel::StartUp().

◆ getSetting() [1/2]

◆ getSetting() [2/2]

const SettingsValue & Settings::getSetting ( const std::string &  value) const
inline

Returns a const reference to the setting value, which corresponds to the passed string. Throws an exception, if the setting does not exist.

Parameters
valueconst std::string&
Returns
const SettingsValue&

Definition at line 731 of file settings.hpp.

References SyntaxError::INVALID_SETTING, and m_settings.

◆ getSettings() [1/2]

std::map< std::string, SettingsValue > & Settings::getSettings ( )
inline

Returns a reference to the internal map of setting values.

Returns
std::map<std::string, SettingsValue>&

Definition at line 748 of file settings.hpp.

References m_settings.

Referenced by cmd_get(), cmd_set(), OptionsDialog::EvaluateOptions(), OptionsDialog::InitializeDialog(), and NumeReWindow::InitializeProgramOptions().

◆ getSettings() [2/2]

const std::map< std::string, SettingsValue > & Settings::getSettings ( ) const
inline

Returns a const reference to the internal map of setting values.

Returns
const std::map<std::string, SettingsValue>&

Definition at line 760 of file settings.hpp.

References m_settings.

◆ getTokenPaths()

std::string Settings::getTokenPaths ( ) const
inline

Returns a semicolon-separated list of the current defined path placeholders and their values.

Returns
std::string

Definition at line 1122 of file settings.hpp.

References m_settings, SETTING_S_EXEPATH, SETTING_S_LOADPATH, SETTING_S_PLOTPATH, SETTING_S_PROCPATH, SETTING_S_SAVEPATH, SETTING_S_SCRIPTPATH, and SETTING_S_WORKPATH.

Referenced by cmd_set(), copySettings(), editObject(), executeCommand(), extractFirstParameterStringValue(), saveDataObject(), NumeReKernel::StartUp(), and strfnc_findfile().

◆ getWindow()

size_t Settings::getWindow ( int  nWindow = 0) const
inline

Returns the current window size of the terminal.

Parameters
nWindowint
Returns
size_t
Note
The y value might not be updated if the user changes the height of the terminal.

Definition at line 1101 of file settings.hpp.

References m_settings, SETTING_V_WINDOW_X, and SETTING_V_WINDOW_Y.

Referenced by fitDataSet(), Output::format(), formatMatrixRow(), LineBreak(), listConstants(), listDeclaredVariables(), listDirectory(), listFiles(), listInstalledPlugins(), listUnitConversions(), showMatrixResult(), and NumeReKernel::StartUp().

◆ getWorkPath()

std::string Settings::getWorkPath ( ) const
inline

Returns the current working path (connected to the <wp> token).

Returns
std::string

Definition at line 1020 of file settings.hpp.

References m_settings, and SETTING_S_WORKPATH.

Referenced by editObject(), NumeReKernel::getPathSettings(), initializeFileHandle(), listDirectory(), listFiles(), and NumeRe::StringParser::numToString().

◆ import_v1x()

void Settings::import_v1x ( const std::string &  sSettings)
private

Imports a setting value string from a v1.x configuration file.

Parameters
sSettingsconst std::string&
Returns
void

Definition at line 267 of file settings.cpp.

References SettingsValue::BOOL, m_settings, SettingsValue::STRING, StrToInt(), SettingsValue::TYPELESS, and SettingsValue::UINT.

Referenced by load().

Here is the call graph for this function:

◆ isDeveloperMode()

bool Settings::isDeveloperMode ( ) const
inline

Returns, whether the developer mode is currently enabled.

Returns
bool

Definition at line 892 of file settings.hpp.

References m_settings, and SETTING_B_DEVELOPERMODE.

Referenced by cmd_set(), and make_stringmatrix().

◆ isDraftMode()

bool Settings::isDraftMode ( ) const
inline

Returns, whether the plotting draft mode is enabled.

Returns
bool

Definition at line 902 of file settings.hpp.

References m_settings, and SETTING_B_DRAFTMODE.

Referenced by Plot::create3dPlot(), Plot::displayMessage(), and Plot::plot2d().

◆ isEnabled()

bool Settings::isEnabled ( const std::string &  option) const
inline

Returns true, if the setting with boolean value type is enabled, false otherwise. If the setting does not have a boolean value type, this method will return false as well.

Parameters
optionconst std::string&
Returns
bool

Definition at line 810 of file settings.hpp.

References SettingsValue::BOOL, and m_settings.

Referenced by NumeReWindow::EvaluateOptions(), and NumeReEditor::OnKeyDn().

◆ load()

void Settings::load ( const std::string &  _sWhere)

Opens the configuration file, identifies its version and imports the setting values.

Parameters
_sWhereconst std::string&
Returns
void

Definition at line 607 of file settings.cpp.

References import_v1x(), m_settings, prepareFilePaths(), NumeReKernel::printPreFmt(), save(), set(), SETTING_B_COMPACT, SETTING_S_LOADPATH, SETTING_S_PLOTPATH, SETTING_S_SAVEPATH, SETTING_V_AUTOSAVE, SETTING_V_PRECISION, FileSystem::sExecutablePath, sSettings_ini, and StrToInt().

Referenced by NumeReKernel::StartUp().

Here is the call graph for this function:

◆ loadEmptyCols()

bool Settings::loadEmptyCols ( ) const
inline

Returns, whether NumeRe shall keep empty columns when loading a file to memory.

Returns
bool

Definition at line 988 of file settings.hpp.

References m_settings, and SETTING_B_LOADEMPTYCOLS.

Referenced by NumeReKernel::StartUp().

◆ operator=()

Settings & Settings::operator= ( const Settings _settings)
inline

Assignment operator overload.

Parameters
_settingsconst Settings&
Returns
Settings&

Definition at line 691 of file settings.hpp.

References copySettings().

Here is the call graph for this function:

◆ prepareFilePaths()

void Settings::prepareFilePaths ( const std::string &  _sExePath)
private

This member function is a helper, which will replace the <> path token in all default file paths with the corresponding executable path.

Parameters
_sExePathconst std::string&
Returns
void

Definition at line 574 of file settings.cpp.

References m_settings, SETTING_S_EXEPATH, SETTING_S_LOADPATH, SETTING_S_PLOTPATH, SETTING_S_PROCPATH, SETTING_S_SAVEPATH, SETTING_S_SCRIPTPATH, and SETTING_S_WORKPATH.

Referenced by load().

◆ replaceExePath()

std::string Settings::replaceExePath ( const std::string &  _sPath)
private

This member function is a helper, which will replace the executable path part in the passed file path with the <> path token.

Parameters
_sPathconst std::string&
Returns
std::string

Definition at line 552 of file settings.cpp.

References m_settings, SETTING_S_EXEPATH, and FileSystem::sPath.

Referenced by save().

◆ save()

void Settings::save ( const std::string &  _sWhere,
bool  bMkBackUp = false 
)

Saves the setting values to the corresponding config file. Does only save the setting values, which are marked that they shall be saved.

Parameters
_sWhereconst std::string&
bMkBackUpbool
Returns
void

Definition at line 187 of file settings.cpp.

References _lang, SettingsValue::BOOL, Language::get(), m_settings, NumeReKernel::print(), replaceExePath(), FileSystem::sExecutablePath, sSettings_ini, SettingsValue::STRING, toSystemCodePage(), date::detail::trunc(), SettingsValue::TYPELESS, and SettingsValue::UINT.

Referenced by NumeReKernel::CloseSession(), cmd_save(), cmd_set(), load(), and Options::SetSaveBookmarksInSession().

Here is the call graph for this function:

◆ set()

bool Settings::set ( const std::string &  _sOption)
private

◆ setDefaultPlotFont()

void Settings::setDefaultPlotFont ( const std::string &  plotFont)
inline

Update the default plotting font. This member function evaluates first, whether the selected font actually exists.

Parameters
plotFontconst std::string&
Returns
void

Definition at line 843 of file settings.hpp.

References m_settings, and SETTING_S_PLOTFONT.

Referenced by cmd_set().

◆ showExtendedFileInfo()

bool Settings::showExtendedFileInfo ( ) const
inline

Returns, whether the file tree or the terminal file explorer shall display extended file information for NumeRe data files.

Returns
bool

Definition at line 966 of file settings.hpp.

References m_settings, and SETTING_B_EXTENDEDFILEINFO.

Referenced by NumeReWindow::getFileDetails(), and listDirectory().

◆ showGreeting()

bool Settings::showGreeting ( ) const
inline

Returns, whether NumeRe shall greet the user with a funny message at application start-up.

Returns
bool

Definition at line 924 of file settings.hpp.

References m_settings, and SETTING_B_GREETING.

Referenced by NumeReKernel::printVersionInfo().

◆ showHints()

bool Settings::showHints ( ) const
inline

Returns, whether the tip-of-the-day shall be displayed to the user at application start-up.

Returns
bool

Definition at line 935 of file settings.hpp.

References m_settings, and SETTING_B_SHOWHINTS.

Referenced by NumeReWindow::NumeReWindow().

◆ systemPrints()

◆ useCustomLangFiles()

bool Settings::useCustomLangFiles ( ) const
inline

◆ useDebugger()

◆ useEscInScripts()

bool Settings::useEscInScripts ( ) const
inline

Returns, whether ESC key presses shall be handled, when scripts are being executed.

Returns
bool

Definition at line 945 of file settings.hpp.

References m_settings, and SETTING_B_USEESCINSCRIPTS.

Referenced by NumeReKernel::MainLoop().

◆ useExternalDocWindow()

bool Settings::useExternalDocWindow ( ) const
inline

Returns, whether documentations shall be displayed in external windows.

Returns
bool

Definition at line 1171 of file settings.hpp.

References m_settings, and SETTING_B_EXTERNALDOCWINDOW.

Referenced by make_stringmatrix(), and show_data().

◆ useLogFile()

bool Settings::useLogFile ( ) const
inline

Returns, whether the terminal inputs shall be protocoled in a dedicated logfile. This setting does not modify the history functionality.

Returns
bool

Definition at line 978 of file settings.hpp.

References m_settings, and SETTING_B_LOGFILE.

Referenced by NumeReKernel::StartUp().

◆ useMaskDefault()

bool Settings::useMaskDefault ( ) const
inline

Returns, whether loop flow control statements shall use the mask option automatically.

Returns
bool

Definition at line 1192 of file settings.hpp.

References m_settings, and SETTING_B_MASKDEFAULT.

Referenced by FlowCtrl::eval().

Member Data Documentation

◆ m_settings

std::map<std::string, SettingsValue> Settings::m_settings
protected

Definition at line 676 of file settings.hpp.

Referenced by controlDefinitions(), copySettings(), createCompactTables(), decodeArguments(), disable(), enable(), enableSystemPrints(), executeEnabled(), Options::GetAnalyzerOption(), getAutoSaveInterval(), getBuffer(), Options::GetCaretBlinkTime(), Options::GetDebuggerFocusLine(), getDefaultPlotFont(), Options::GetEditorFont(), getExePath(), Options::GetFoldDuringLoading(), Options::GetFormatBeforeSaving(), Options::GetHighlightLocalVariables(), Options::GetKeepBackupFile(), Options::GetLaTeXRoot(), Options::GetLineNumberPrinting(), getLoadPath(), getPlotPath(), getPrecision(), Options::GetPrintStyle(), getProcPath(), Options::GetSaveBookmarksInSession(), getSavePath(), Options::GetSaveSession(), getScriptPath(), getSetting(), getSettings(), Options::GetShowGlobalVariables(), Options::GetShowLinesInStackTrace(), Options::GetShowModulesInStackTrace(), Options::GetShowPathOnTabs(), Options::GetShowProcedureArguments(), Options::GetShowToolbarText(), Options::GetSyntaxStyle(), Options::GetTerminalHistorySize(), getTokenPaths(), getWindow(), getWorkPath(), import_v1x(), isDeveloperMode(), isDraftMode(), isEnabled(), load(), loadEmptyCols(), prepareFilePaths(), Options::readColoursFromConfig(), replaceExePath(), save(), set(), Options::SetAnalyzerOption(), Options::SetCaretBlinkTime(), Options::SetDebuggerFocusLine(), setDefaultPlotFont(), Options::SetEditorFont(), Options::SetFoldDuringLoading(), Options::SetFormatBeforeSaving(), Options::SetHighlightLocalVariables(), Options::SetKeepBackupFile(), Options::SetLaTeXRoot(), Options::SetLineNumberPrinting(), Options::SetPrintStyle(), Options::SetSaveBookmarksInSession(), Options::SetSaveSession(), Options::SetShowGlobalVariables(), Options::SetShowLinesInStackTrace(), Options::SetShowModulesInStackTrace(), Options::SetShowPathOnTabs(), Options::SetShowProcedureArguments(), Options::SetShowToolbarText(), Options::SetSyntaxStyle(), Options::SetTerminalHistorySize(), Settings(), showExtendedFileInfo(), showGreeting(), showHints(), systemPrints(), useCustomLangFiles(), useDebugger(), useEscInScripts(), useExternalDocWindow(), useLogFile(), and useMaskDefault().

◆ sSettings_ini

std::string Settings::sSettings_ini
private

Definition at line 665 of file settings.hpp.

Referenced by load(), save(), and Settings().


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