aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/config.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-10-29 18:17:39 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-10-29 18:17:39 +0100
commitff4dea63c9403880500f82ce273713ecf793d2d9 (patch)
treeaa565e5bd7bbaca2ab23b5e71cdac0c49e926937 /src/libutil/config.hh
parentbb8e837e4ca95321141ad62fb3b2114310f2b24b (diff)
Generalize extra-* settings
This removes the extra-substituters and extra-sandbox-paths settings and instead makes every array setting extensible by setting "extra-<name> = <value>" in the configuration file or passing "--<name> <value>" on the command line.
Diffstat (limited to 'src/libutil/config.hh')
-rw-r--r--src/libutil/config.hh11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libutil/config.hh b/src/libutil/config.hh
index 1f5f4e7b9..71e31656d 100644
--- a/src/libutil/config.hh
+++ b/src/libutil/config.hh
@@ -202,7 +202,10 @@ protected:
assert(created == 123);
}
- virtual void set(const std::string & value) = 0;
+ virtual void set(const std::string & value, bool append = false) = 0;
+
+ virtual bool isAppendable()
+ { return false; }
virtual std::string to_string() const = 0;
@@ -243,7 +246,9 @@ public:
void operator =(const T & v) { assign(v); }
virtual void assign(const T & v) { value = v; }
- void set(const std::string & str) override;
+ void set(const std::string & str, bool append = false) override;
+
+ bool isAppendable() override;
virtual void override(const T & v)
{
@@ -305,7 +310,7 @@ public:
options->addSetting(this);
}
- void set(const std::string & str) override;
+ void set(const std::string & str, bool append = false) override;
Path operator +(const char * p) const { return value + p; }