From b76a29a69ae5412c3c1d101eefa9562990e74407 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 7 Aug 2013 19:54:38 +0200 Subject: ConfigPath: return a Path object Migrate all callers to use Path directly, instead of doing the conversion in each caller. --- src/ConfigData.cxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/ConfigData.cxx') diff --git a/src/ConfigData.cxx b/src/ConfigData.cxx index 7ac517935..12aa9f69f 100644 --- a/src/ConfigData.cxx +++ b/src/ConfigData.cxx @@ -17,9 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "config.h" #include "ConfigData.hxx" #include "ConfigParser.hxx" #include "ConfigPath.hxx" +#include "fs/Path.hxx" #include "mpd_error.h" #include @@ -92,18 +94,18 @@ config_param::DupBlockString(const char *name, const char *default_value) const return g_strdup(GetBlockValue(name, default_value)); } -char * -config_param::DupBlockPath(const char *name, GError **error_r) const +Path +config_param::GetBlockPath(const char *name, GError **error_r) const { assert(error_r != nullptr); assert(*error_r == nullptr); const block_param *bp = GetBlockParam(name); if (bp == nullptr) - return nullptr; + return Path::Null(); - char *path = parsePath(bp->value.c_str(), error_r); - if (G_UNLIKELY(path == nullptr)) + Path path = ParsePath(bp->value.c_str(), error_r); + if (gcc_unlikely(path.IsNull())) g_prefix_error(error_r, "Invalid path in \"%s\" at line %i: ", name, bp->line); -- cgit v1.2.3