| e8555c89 Andy McCall |
1 |
#ifndef INTEGERSETTING_HH |
| 2 |
#define INTEGERSETTING_HH |
| 3 |
|
| 4 |
#include "Setting.hh" |
| 5 |
|
| 6 |
namespace openmsx { |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
class IntegerSetting final : public Setting |
| 11 |
{ |
| 12 |
public: |
| 13 |
IntegerSetting(CommandController& commandController, |
| 14 |
std::string_view name, static_string_view description, |
| 15 |
int initialValue, int minValue, int maxValue, |
| 16 |
Save save = Save::YES); |
| 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 |
|
| 24 |
[[nodiscard]] int getMinValue() const { return minValue; } |
| 25 |
[[nodiscard]] int getMaxValue() const { return maxValue; } |
| 26 |
|
| 27 |
private: |
| 28 |
const int minValue; |
| 29 |
const int maxValue; |
| 30 |
}; |
| 31 |
|
| 32 |
} |
| 33 |
|
| 34 |
#endif |