From abfbd55305587306730d5419b8a3b09e6a43abcb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Oct 2013 21:59:35 +0200 Subject: 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. --- src/CommandLine.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/CommandLine.cxx') diff --git a/src/CommandLine.cxx b/src/CommandLine.cxx index b55f2bec4..1f39e47aa 100644 --- a/src/CommandLine.cxx +++ b/src/CommandLine.cxx @@ -31,7 +31,7 @@ #include "InputPlugin.hxx" #include "PlaylistRegistry.hxx" #include "PlaylistPlugin.hxx" -#include "fs/Path.hxx" +#include "fs/AllocatedPath.hxx" #include "fs/Traits.hxx" #include "fs/FileSystem.hxx" #include "util/Error.hxx" @@ -136,13 +136,13 @@ static const char *summary = "Music Player Daemon - a daemon for playing music."; gcc_pure -static Path -PathBuildChecked(const Path &a, PathTraits::const_pointer b) +static AllocatedPath +PathBuildChecked(const AllocatedPath &a, PathTraits::const_pointer b) { if (a.IsNull()) - return Path::Null(); + return AllocatedPath::Null(); - return Path::Build(a, b); + return AllocatedPath::Build(a, b); } bool @@ -206,7 +206,7 @@ parse_cmdline(int argc, char **argv, struct options *options, /* default configuration file path */ #ifdef WIN32 - Path path = PathBuildChecked(Path::FromUTF8(g_get_user_config_dir()), + AllocatedPath path = PathBuildChecked(AllocatedPath::FromUTF8(g_get_user_config_dir()), CONFIG_FILE_LOCATION); if (!path.IsNull() && FileExists(path)) return ReadConfigFile(path, error); @@ -215,28 +215,28 @@ parse_cmdline(int argc, char **argv, struct options *options, g_get_system_config_dirs(); for (unsigned i = 0; system_config_dirs[i] != nullptr; ++i) { - path = PathBuildChecked(Path::FromUTF8(system_config_dirs[i]), + path = PathBuildChecked(AllocatedPath::FromUTF8(system_config_dirs[i]), CONFIG_FILE_LOCATION); if (!path.IsNull() && FileExists(path)) return ReadConfigFile(path, error); } #else - Path path = PathBuildChecked(Path::FromUTF8(g_get_user_config_dir()), - USER_CONFIG_FILE_LOCATION_XDG); + AllocatedPath path = PathBuildChecked(AllocatedPath::FromUTF8(g_get_user_config_dir()), + USER_CONFIG_FILE_LOCATION_XDG); if (!path.IsNull() && FileExists(path)) return ReadConfigFile(path, error); - path = PathBuildChecked(Path::FromUTF8(g_get_home_dir()), + path = PathBuildChecked(AllocatedPath::FromUTF8(g_get_home_dir()), USER_CONFIG_FILE_LOCATION1); if (!path.IsNull() && FileExists(path)) return ReadConfigFile(path, error); - path = PathBuildChecked(Path::FromUTF8(g_get_home_dir()), + path = PathBuildChecked(AllocatedPath::FromUTF8(g_get_home_dir()), USER_CONFIG_FILE_LOCATION2); if (!path.IsNull() && FileExists(path)) return ReadConfigFile(path, error); - path = Path::FromUTF8(SYSTEM_CONFIG_FILE_LOCATION); + path = AllocatedPath::FromUTF8(SYSTEM_CONFIG_FILE_LOCATION); if (!path.IsNull() && FileExists(path)) return ReadConfigFile(path, error); #endif -- cgit v1.2.3