aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigData.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-07 19:54:38 +0200
committerMax Kellermann <max@duempel.org>2013-08-07 19:59:09 +0200
commitb76a29a69ae5412c3c1d101eefa9562990e74407 (patch)
tree5c60aa1bb5e6a8d134707291d12fb4ebb77c06c8 /src/ConfigData.cxx
parentabe090ec1f2255ce422f74e5b59bffc83aaff875 (diff)
downloadmpd-b76a29a69ae5412c3c1d101eefa9562990e74407.tar.gz
mpd-b76a29a69ae5412c3c1d101eefa9562990e74407.tar.xz
mpd-b76a29a69ae5412c3c1d101eefa9562990e74407.zip
ConfigPath: return a Path object
Migrate all callers to use Path directly, instead of doing the conversion in each caller.
Diffstat (limited to 'src/ConfigData.cxx')
-rw-r--r--src/ConfigData.cxx12
1 files changed, 7 insertions, 5 deletions
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 <glib.h>
@@ -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);