openMSX
IntegerSetting.hh
Go to the documentation of this file.
1#ifndef INTEGERSETTING_HH
2#define INTEGERSETTING_HH
3
4#include "Setting.hh"
5
6namespace openmsx {
7
10class IntegerSetting final : public Setting
11{
12public:
13 IntegerSetting(CommandController& commandController,
14 std::string_view name, static_string_view description,
15 int initialValue, int minValue, int maxValue,
16 SaveSetting save = SAVE);
17
18 [[nodiscard]] std::string_view getTypeString() const override;
19 void additionalInfo(TclObject& result) const override;
20
21 [[nodiscard]] int getInt() const noexcept { return getValue().getInt(getInterpreter()); }
22 void setInt(int i);
23
24private:
25 const int minValue;
26 const int maxValue;
27};
28
29} // namespace openmsx
30
31#endif
A Setting with an integer value.
int getInt() const noexcept
IntegerSetting(CommandController &commandController, std::string_view name, static_string_view description, int initialValue, int minValue, int maxValue, SaveSetting save=SAVE)
void additionalInfo(TclObject &result) const override
Helper method for info().
std::string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
Interpreter & getInterpreter() const
Definition: Setting.cc:148
const TclObject & getValue() const final
Gets the current value of this setting as a TclObject.
Definition: Setting.hh:142
int getInt(Interpreter &interp) const
Definition: TclObject.cc:73
static_string_view
This file implemented 3 utility functions:
Definition: Autofire.cc:9