aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigData.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-04 12:03:56 +0200
committerMax Kellermann <max@duempel.org>2013-08-04 12:03:56 +0200
commit83f4c48c8aaa46bbede4447c95939af310ea28ad (patch)
tree7eb8c9f826d8508dba93875a1d91531d69e2fee1 /src/ConfigData.hxx
parentacd742d22593a52d2e5f5bcdb2c81175d61c9b11 (diff)
downloadmpd-83f4c48c8aaa46bbede4447c95939af310ea28ad.tar.gz
mpd-83f4c48c8aaa46bbede4447c95939af310ea28ad.tar.xz
mpd-83f4c48c8aaa46bbede4447c95939af310ea28ad.zip
ConfigData: move code to block_param, config_param methods
Diffstat (limited to '')
-rw-r--r--src/ConfigData.hxx27
1 files changed, 27 insertions, 0 deletions
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 {