|
NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
This class represents a single abstract settings value implemented as void*. We're using asserts to avoid memory issues. Those won't trigger in release mode, of course. A setting value might either be a boolean, a unsigned int or a std::string. More...
#include <settings.hpp>
Public Types | |
| enum | SettingsValueType { TYPELESS , BOOL , UINT , STRING } |
| The type of the setting value. More... | |
| enum | SettingsValueProperties { NONE = 0x0 , SAVE = 0x1 , HIDDEN = 0x2 , PATH = 0x4 , IMMUTABLE = 0x8 , UIREFRESH = 0x10 } |
| Additional setting value properties. More... | |
Public Member Functions | |
| SettingsValue () | |
| Default constructor. Creates an empty and typeless setting value. More... | |
| SettingsValue (bool value, int properties=SettingsValue::SAVE) | |
| Create a setting value from a boolean. More... | |
| 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. More... | |
| SettingsValue (const char *value, int properties=SettingsValue::SAVE) | |
| Create a setting value from a const char*, represented as a std::string internally. More... | |
| SettingsValue (const std::string &value, int properties=SettingsValue::SAVE) | |
| Create a setting value from a std::string. More... | |
| ~SettingsValue () | |
| Destructor. Will free the allocated memory. More... | |
| SettingsValue (const SettingsValue &value) | |
| Copy constructor. Creates a new instance and copies all contents. (Does not copy the pointers themselves, of course.) More... | |
| SettingsValue & | operator= (const SettingsValue &value) |
| Assignment operator overload. Clears the contents of the assignee and takes the value and the type of the assigned value. More... | |
| SettingsValueType | getType () const |
| Get the internal value type. More... | |
| bool | shallSave () const |
| Returns, whether this is a setting value, which shall be saved to the configuration file. More... | |
| bool | isHidden () const |
| Returns, whether this setting value is an internal-only setting and should not be presented to and modified by the user. More... | |
| bool | isPath () const |
| Returns, whether this setting value represents a file path and a corresponding validation is necessary. More... | |
| bool | isMutable () const |
| Returns, whether this setting value is mutable by the user in the terminal. More... | |
| bool | isUiModifying () const |
| Returns true, when a setting modifies the graphical user interface and therefore needs to refresh it. More... | |
| size_t | min () const |
| Returns the minimal value of an unsigned int value type. More... | |
| size_t | max () const |
| Returns the maximal value of an unsigned int value type. More... | |
| bool & | active () |
| Returns a reference to a boolean value type setting. More... | |
| size_t & | value () |
| Returns a reference to an unsigned int value type setting. More... | |
| std::string & | stringval () |
| Returns a reference to a std::string value type setting. More... | |
| bool | active () const |
| Returns the value of a boolean value type setting. More... | |
| size_t | value () const |
| Returns the value of an unsigned int value type setting. More... | |
| std::string | stringval () const |
| Returns the value of a std::string value type setting. More... | |
Private Member Functions | |
| void | assign (bool value) |
| Assign a new boolean value to the internal memory. More... | |
| void | assign (size_t value) |
| Assign a new unsigned int value to the internal memory. More... | |
| void | assign (const std::string &value) |
| Assign a new std::string value to the internal memory. More... | |
| void | clear () |
| Clear the internal memory (called by the destructor, for example). More... | |
Private Attributes | |
| void * | m_value |
| SettingsValueType | m_type |
| int | m_valueProperties |
| size_t | m_min |
| size_t | m_max |
This class represents a single abstract settings value implemented as void*. We're using asserts to avoid memory issues. Those won't trigger in release mode, of course. A setting value might either be a boolean, a unsigned int or a std::string.
Definition at line 192 of file settings.hpp.
Additional setting value properties.
| Enumerator | |
|---|---|
| NONE | |
| SAVE | |
| HIDDEN | |
| PATH | |
| IMMUTABLE | |
| UIREFRESH | |
Definition at line 209 of file settings.hpp.
The type of the setting value.
| Enumerator | |
|---|---|
| TYPELESS | |
| BOOL | |
| UINT | |
| STRING | |
Definition at line 198 of file settings.hpp.
|
inline |
Default constructor. Creates an empty and typeless setting value.
Definition at line 304 of file settings.hpp.
|
inlineexplicit |
Create a setting value from a boolean.
| value | bool |
| properties | int |
Definition at line 313 of file settings.hpp.
References assign(), m_valueProperties, and value().
|
inline |
Create a setting value from an unsigned integer and define its minimal and maximal possible values.
| value | size_t |
| _min | size_t |
| _max | size_t |
| properties | int |
Definition at line 330 of file settings.hpp.
References assign(), m_max, m_min, m_valueProperties, and value().
|
inlineexplicit |
Create a setting value from a const char*, represented as a std::string internally.
| value | const char* |
| properties | int |
Definition at line 346 of file settings.hpp.
References assign(), m_valueProperties, and value().
|
inline |
Create a setting value from a std::string.
| value | const std::string& |
| properties | int |
Definition at line 360 of file settings.hpp.
References assign(), m_valueProperties, and value().
|
inline |
Destructor. Will free the allocated memory.
Definition at line 370 of file settings.hpp.
References clear().
|
inline |
Copy constructor. Creates a new instance and copies all contents. (Does not copy the pointers themselves, of course.)
| value | const SettingsValue& |
Definition at line 383 of file settings.hpp.
References assign(), BOOL, m_max, m_min, m_valueProperties, STRING, TYPELESS, UINT, and value().
|
inline |
Returns a reference to a boolean value type setting.
Definition at line 556 of file settings.hpp.
References BOOL, m_type, m_value, and TYPELESS.
Referenced by CodeAnalyzer::analyseIdentifiers(), NumeReWindow::EvaluateOptions(), ProcedureVarFactory::evaluateProcedureArguments(), NumeReEditor::generateAutoCompList(), NumeReWindow::HandleModifiedFile(), NumeReWindow::NumeReWindow(), NumeReEditor::OnAutoCompletion(), NumeReEditor::OnChar(), NumeReWindow::OnClose(), NumeReWindow::OnExecuteFile(), MyApp::OnInit(), NumeReWindow::OnMenuEvent(), DebugViewer::setDebugInfo(), NumeReTerminal::setKernelSettings(), NumeReEditor::updateDefaultHighlightSettings(), and NumeReWindow::updateTipAtStartupSetting().
|
inline |
|
inlineprivate |
Assign a new boolean value to the internal memory.
| value | bool |
Definition at line 234 of file settings.hpp.
References BOOL, m_type, m_value, and value().
Referenced by operator=(), and SettingsValue().
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Clear the internal memory (called by the destructor, for example).
Definition at line 278 of file settings.hpp.
References BOOL, m_type, m_value, STRING, TYPELESS, and UINT.
Referenced by operator=(), and ~SettingsValue().
|
inline |
Get the internal value type.
Definition at line 447 of file settings.hpp.
References m_type.
|
inline |
Returns, whether this setting value is an internal-only setting and should not be presented to and modified by the user.
Definition at line 473 of file settings.hpp.
References HIDDEN, and m_valueProperties.
|
inline |
Returns, whether this setting value is mutable by the user in the terminal.
Definition at line 501 of file settings.hpp.
References HIDDEN, IMMUTABLE, and m_valueProperties.
|
inline |
Returns, whether this setting value represents a file path and a corresponding validation is necessary.
Definition at line 486 of file settings.hpp.
References m_type, m_valueProperties, PATH, and STRING.
|
inline |
Returns true, when a setting modifies the graphical user interface and therefore needs to refresh it.
Definition at line 514 of file settings.hpp.
References m_valueProperties, and UIREFRESH.
|
inline |
Returns the maximal value of an unsigned int value type.
Definition at line 541 of file settings.hpp.
|
inline |
Returns the minimal value of an unsigned int value type.
Definition at line 526 of file settings.hpp.
|
inline |
Assignment operator overload. Clears the contents of the assignee and takes the value and the type of the assigned value.
| value | const SettingsValue& |
Definition at line 416 of file settings.hpp.
References assign(), BOOL, clear(), m_max, m_min, m_valueProperties, STRING, TYPELESS, UINT, and value().
|
inline |
Returns, whether this is a setting value, which shall be saved to the configuration file.
Definition at line 460 of file settings.hpp.
References m_valueProperties, and SAVE.
|
inline |
Returns a reference to a std::string value type setting.
Definition at line 590 of file settings.hpp.
References m_type, m_value, STRING, and TYPELESS.
Referenced by NumeReKernel::CloseSession(), cmd_workpath(), createCssString(), NumeReKernel::MainLoop(), NumeReWindow::OnClose(), MyApp::OnInit(), NumeReWindow::OnOptions(), NumeReKernel::StartUp(), and NumeReHistory::UpdateSyntaxHighlighting().
|
inline |
|
inline |
Returns a reference to an unsigned int value type setting.
Definition at line 573 of file settings.hpp.
References m_type, m_value, TYPELESS, and UINT.
Referenced by assign(), NumeReWindow::EvaluateOptions(), NumeReWindow::NumeReWindow(), NumeReWindow::OnClose(), operator=(), SettingsValue(), NumeReWindow::toggleConsole(), NumeReWindow::toggleFiletree(), NumeReWindow::toggleHistory(), NumeReKernel::updateLineLenght(), and NumeReWindow::UpdateTerminalNotebook().
|
inline |
|
private |
Definition at line 224 of file settings.hpp.
Referenced by max(), operator=(), and SettingsValue().
|
private |
Definition at line 223 of file settings.hpp.
Referenced by min(), operator=(), and SettingsValue().
|
private |
|
private |
Definition at line 220 of file settings.hpp.
Referenced by active(), assign(), clear(), stringval(), and value().
|
private |
Definition at line 222 of file settings.hpp.
Referenced by isHidden(), isMutable(), isPath(), isUiModifying(), operator=(), SettingsValue(), and shallSave().