Codechange: make Write_ValidateSetting a function of StringSettingDesc

This commit is contained in:
rubidium42
2021-05-22 20:52:24 +02:00
committed by rubidium42
parent be28c95b30
commit 1f8ff0e4f9
2 changed files with 49 additions and 16 deletions

View File

@@ -111,7 +111,9 @@ struct SettingDesc {
bool IsEditable(bool do_command = false) const;
SettingType GetType() const;
bool IsIntSetting() const;
bool IsStringSetting() const;
const struct IntSettingDesc *AsIntSetting() const;
const struct StringSettingDesc *AsStringSetting() const;
/**
* Format the value of the setting associated with this object.
@@ -144,6 +146,9 @@ struct StringSettingDesc : SettingDesc {
SettingDesc(save, name, def, cmd, flags, 0, max_length, 0, nullptr, 0, 0, 0, proc, nullptr, SC_NONE, startup) {}
virtual ~StringSettingDesc() {}
void ChangeValue(const void *object, const char *newval) const;
void Write_ValidateSetting(const void *object, const char *str) const;
void FormatValue(char *buf, const char *last, const void *object) const override;
const std::string &Read(const void *object) const;
};