diff options
author | Max Kellermann <max@duempel.org> | 2013-10-17 21:59:35 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-17 23:43:46 +0200 |
commit | abfbd55305587306730d5419b8a3b09e6a43abcb (patch) | |
tree | 2a195220d79efe195f3beacb7dd3a226a3341ad6 /src/CommandLine.cxx | |
parent | b3611524f45c2a478f9decd6d22ecd1dbbbb64b9 (diff) |
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 'src/CommandLine.cxx')
-rw-r--r-- | src/CommandLine.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
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 |