diff options
author | alois31 <alois1@gmx-topmail.de> | 2024-10-23 15:20:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-10-23 15:20:51 +0000 |
commit | 2734a9cf94debc6baef4e7d4d9fa28cc28f5b31d (patch) | |
tree | ba6be97cc5ac268941b1c8ac10507786a720357c /src/libutil/config.hh | |
parent | 5f1344dd8aec59ce654a0fac30b1842e2e68299c (diff) | |
parent | 689eb45630a183f0fbbd8864cb7a3c7cb1704451 (diff) |
* changes:
treewide: make more settings conditionally available
libstore/build: only send overridden settings to the build hook
treewide: consistently mark overridden settings as such
Diffstat (limited to 'src/libutil/config.hh')
-rw-r--r-- | src/libutil/config.hh | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/libutil/config.hh b/src/libutil/config.hh index 59cc281c5..b3dcc122f 100644 --- a/src/libutil/config.hh +++ b/src/libutil/config.hh @@ -218,6 +218,7 @@ protected: virtual void convertToArg(Args & args, const std::string & category); bool isOverridden() const; + }; /** @@ -267,16 +268,12 @@ public: { } operator const T &() const { return value; } - operator T &() { return value; } const T & get() const { return value; } template<typename U> bool operator ==(const U & v2) const { return value == v2; } template<typename U> bool operator !=(const U & v2) const { return value != v2; } template<typename U> - void operator =(const U & v) { assign(v); } - virtual void assign(const T & v) { value = v; } - template<typename U> void setDefault(const U & v) { if (!overridden) value = v; } /** @@ -287,6 +284,8 @@ public: */ void set(const std::string & str, bool append = false, const ApplyConfigOptions & options = {}) override final; + void override(const T & v); + /** * C++ trick; This is template-specialized to compile-time indicate whether * the type is appendable. @@ -299,12 +298,6 @@ public: */ bool isAppendable() override final; - virtual void override(const T & v) - { - overridden = true; - value = v; - } - std::string to_string() const override; void convertToArg(Args & args, const std::string & category) override; @@ -349,8 +342,6 @@ public: : Setting(options, def, name, description, aliases, documentDefault, std::move(experimentalFeature), true) { } - - void operator =(const T & v) { this->assign(v); } }; /** @@ -375,8 +366,6 @@ public: } T parse(const std::string & str, const ApplyConfigOptions & options) const override; - - void operator =(const T & v) { this->assign(v); } }; |