aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigGlobal.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-17 21:59:35 +0200
committerMax Kellermann <max@duempel.org>2013-10-17 23:43:46 +0200
commitabfbd55305587306730d5419b8a3b09e6a43abcb (patch)
tree2a195220d79efe195f3beacb7dd3a226a3341ad6 /src/ConfigGlobal.cxx
parentb3611524f45c2a478f9decd6d22ecd1dbbbb64b9 (diff)
downloadmpd-abfbd55305587306730d5419b8a3b09e6a43abcb.tar.gz
mpd-abfbd55305587306730d5419b8a3b09e6a43abcb.tar.xz
mpd-abfbd55305587306730d5419b8a3b09e6a43abcb.zip
fs/Path: rename to AllocatedPath
The new class Path only holds a string pointer without being responsible for allocation/deallocation. The FileSystem.hxx library accepts Path arguments instead of AllocatedPath, to avoid forcing callers to allocate another string object.
Diffstat (limited to '')
-rw-r--r--src/ConfigGlobal.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ConfigGlobal.cxx b/src/ConfigGlobal.cxx
index e23462e94..99932f621 100644
--- a/src/ConfigGlobal.cxx
+++ b/src/ConfigGlobal.cxx
@@ -25,6 +25,7 @@
#include "ConfigPath.hxx"
#include "ConfigError.hxx"
#include "fs/Path.hxx"
+#include "fs/AllocatedPath.hxx"
#include "util/Error.hxx"
#include "system/FatalError.hxx"
#include "Log.hxx"
@@ -45,7 +46,7 @@ void config_global_init(void)
}
bool
-ReadConfigFile(const Path &path, Error &error)
+ReadConfigFile(Path path, Error &error)
{
return ReadConfigFile(config_data, path, error);
}
@@ -96,20 +97,20 @@ config_get_string(ConfigOption option, const char *default_value)
return param->value.c_str();
}
-Path
+AllocatedPath
config_get_path(ConfigOption option, Error &error)
{
const struct config_param *param = config_get_param(option);
if (param == nullptr)
- return Path::Null();
+ return AllocatedPath::Null();
return config_parse_path(param, error);
}
-Path
+AllocatedPath
config_parse_path(const struct config_param *param, Error & error)
{
- Path path = ParsePath(param->value.c_str(), error);
+ AllocatedPath path = ParsePath(param->value.c_str(), error);
if (gcc_unlikely(path.IsNull()))
error.FormatPrefix("Invalid path at line %i: ",
param->line);