From d6553fc6a73ce458aa1fabe78dbb45b5b6a1ac12 Mon Sep 17 00:00:00 2001 From: Sebastian Thorarensen Date: Sat, 19 Oct 2013 15:38:50 +0200 Subject: ConfigData: Add support for signed integers Now config_param::GetBlockValue() can be used to get signed integers from the configuration. --- src/ConfigData.hxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ConfigData.hxx') diff --git a/src/ConfigData.hxx b/src/ConfigData.hxx index d85228cc3..b41b27420 100644 --- a/src/ConfigData.hxx +++ b/src/ConfigData.hxx @@ -45,6 +45,9 @@ struct block_param { block_param(const char *_name, const char *_value, int _line=-1) :name(_name), value(_value), line(_line), used(false) {} + gcc_pure + int GetIntValue() const; + gcc_pure unsigned GetUnsignedValue() const; @@ -114,6 +117,9 @@ struct config_param { AllocatedPath GetBlockPath(const char *name, Error &error) const; + gcc_pure + int GetBlockValue(const char *name, int default_value) const; + gcc_pure unsigned GetBlockValue(const char *name, unsigned default_value) const; -- cgit v1.2.3