From 83f4c48c8aaa46bbede4447c95939af310ea28ad Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Aug 2013 12:03:56 +0200 Subject: ConfigData: move code to block_param, config_param methods --- src/ConfigData.hxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/ConfigData.hxx') diff --git a/src/ConfigData.hxx b/src/ConfigData.hxx index a70426f11..5e13d073c 100644 --- a/src/ConfigData.hxx +++ b/src/ConfigData.hxx @@ -42,6 +42,12 @@ struct block_param { gcc_nonnull_all block_param(const char *_name, const char *_value, int _line=-1) :name(_name), value(_value), line(_line), used(false) {} + + gcc_pure + unsigned GetUnsignedValue() const; + + gcc_pure + bool GetBoolValue() const; }; struct config_param { @@ -82,6 +88,27 @@ struct config_param { gcc_nonnull_all gcc_pure const block_param *GetBlockParam(const char *_name) const; + + gcc_pure + const char *GetBlockValue(const char *name, + const char *default_value=nullptr) const; + + gcc_malloc + char *DupBlockString(const char *name, + const char *default_value=nullptr) const; + + /** + * Same as config_dup_path(), but looks up the setting in the + * specified block. + */ + gcc_malloc + char *DupBlockPath(const char *name, GError **error_r) const; + + gcc_pure + unsigned GetBlockValue(const char *name, unsigned default_value) const; + + gcc_pure + bool GetBlockValue(const char *name, bool default_value) const; }; struct ConfigData { -- cgit v1.2.3