![]() |
NDEVR
API Documentation
|
Stores a generic option of any type as well as some information about how the user might interact with that type. More...
Public Member Functions | |
| GenericOption () | |
| Constructs a default GenericOption with no values set. | |
| GenericOption (const GenericOption &option) | |
| Copy constructor. | |
| GenericOption (const StringView &id, const TranslatedString &name, const StringView &value) | |
| Constructs a GenericOption with the given identifier, display name, and string value. | |
| template<class t_type> | |
| GenericOption (const StringView &id, const TranslatedString &name, const t_type &value) | |
| Constructs a GenericOption with the given identifier, display name, and typed value. | |
| template<class t_type> | |
| t_type | getAs () const |
| Retrieves the current value converted to the requested type. | |
| bool | operator!= (const GenericOption &option) const |
| Checks inequality by comparing the current string values of two options. | |
| GenericOption & | operator= (const GenericOption &option) |
| Copy assignment operator. | |
| bool | operator== (const GenericOption &option) const |
| Checks equality by comparing the current string values of two options. | |
| void | set (const String &new_value) |
| Sets the option value from a String. | |
| void | set (const StringView &new_value) |
| Sets the option value from a StringView. | |
| template<class t_type> | |
| void | set (const t_type &new_value) |
| Sets the option value from the given typed value by converting it to a String. | |
| void | setToDefault () |
| Resets the option value back to its default. | |
| void | setupForDelimiter () |
| Sets this option up for being a delimiter, commas, tabs, etc or custom. | |
| void | setupForFile (const StringView &extensions=StringView()) |
| Sets this option up for being a file, including the regax and extension. | |
| void | setupForFolder () |
| Sets this option up for being a folder, including the regax and extension. | |
Public Attributes | |
| bool | allow_custom_option = false |
| Whether the user may enter a custom value outside the predefined choices. | |
| bool | allow_multi_line = false |
| Whether the option value supports multi-line text input. | |
| Buffer< std::pair< TranslatedString, StringAllocatingView > > | available_options |
| The set of predefined choices available for this option. | |
| String | default_value |
| The default value to revert to when resetting the option. | |
| TranslatedString | description |
| A user-facing description of what this option controls. | |
| String | file_extensions |
| Allowed file extensions for file-type options. If blank, the option is not a file. | |
| String | icon |
| The icon name associated with this option for display purposes. | |
| String | id |
| A unique identifier string for this option. | |
| bool | is_create_file = false |
| Whether this option represents a file path for creating a new file. | |
| bool | is_editable = true |
| Whether the user is allowed to edit this option. | |
| bool | is_password = false |
| Whether this option represents a password and should be masked. | |
| bool | is_viewable = true |
| Whether this option is visible in the user interface. | |
| TranslatedString | name |
| The user-facing display name of the option. | |
| TypeInfo | parameter_type |
| The type information describing the underlying data type of this option. | |
| String | password_encode_key |
| The key used for password encoding when this option is a password. | |
| String | regex |
| A regular expression used to validate the option value. | |
| bool | show_resolved_links = false |
| Whether to display resolved link paths instead of raw values. | |
| ConstPointer< Unit > | unit |
| The unit of measurement associated with this option value. | |
| Resource< String > | value |
| The current value of the option stored as a string Resource. | |
| Bounds< 1, fltp08 > | value_bounds = Constant<Bounds<1, fltp08>>::Invalid |
| The numeric bounds constraining valid values for this option. | |
Stores a generic option of any type as well as some information about how the user might interact with that type.
Definition at line 57 of file GenericOptions.h.
| GenericOption::GenericOption | ( | const StringView & | id, |
| const TranslatedString & | name, | ||
| const StringView & | value ) |
|
inline |
Constructs a GenericOption with the given identifier, display name, and typed value.
| [in] | id | The unique identifier for this option. |
| [in] | name | The user-facing display name. |
| [in] | value | The initial value, which is converted to a String for storage. |
Definition at line 97 of file GenericOptions.h.
References default_value, GetTypeInfo(), id, name, parameter_type, and value.
| GenericOption::GenericOption | ( | const GenericOption & | option | ) |
Copy constructor.
Creates a GenericOption by copying another.
| [in] | option | The GenericOption to copy from. |
References GenericOption().
|
inlinenodiscard |
Retrieves the current value converted to the requested type.
Definition at line 114 of file GenericOptions.h.
References value.
|
inline |
Checks inequality by comparing the current string values of two options.
| [in] | option | The GenericOption to compare against. |
Definition at line 186 of file GenericOptions.h.
References GenericOption(), and value.
| GenericOption & GenericOption::operator= | ( | const GenericOption & | option | ) |
Copy assignment operator.
| [in] | option | The GenericOption to copy from. |
References GenericOption().
|
inline |
Checks equality by comparing the current string values of two options.
| [in] | option | The GenericOption to compare against. |
Definition at line 177 of file GenericOptions.h.
References GenericOption(), and value.
|
inline |
Sets the option value from a String.
| [in] | new_value | The new string value to set. |
Definition at line 139 of file GenericOptions.h.
References value.
|
inline |
Sets the option value from a StringView.
| [in] | new_value | The new string value to set. |
Definition at line 131 of file GenericOptions.h.
References value.
|
inline |
Sets the option value from the given typed value by converting it to a String.
| [in] | new_value | The new value to set. |
Definition at line 123 of file GenericOptions.h.
References value.
| void GenericOption::setupForFile | ( | const StringView & | extensions = StringView() | ) |
Sets this option up for being a file, including the regax and extension.
| [in] | extensions | and extensions, seperated by a comma, for example .wav or .wav,.frag |