aboutsummaryrefslogtreecommitdiffstats
path: root/src/Mapper.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-29 18:14:57 +0100
committerMax Kellermann <max@duempel.org>2014-02-05 10:04:03 +0100
commit9ae7f186bc43749383594807b1d751b5389161e7 (patch)
tree0cafbfde8316c4b1a9ded19060d3020977a604dd /src/Mapper.cxx
parentf8d114be42663006d162311c1ecaf4306e0b72e4 (diff)
downloadmpd-9ae7f186bc43749383594807b1d751b5389161e7.tar.gz
mpd-9ae7f186bc43749383594807b1d751b5389161e7.tar.xz
mpd-9ae7f186bc43749383594807b1d751b5389161e7.zip
LocalStorage: new API abstracting filesystem walk
Prepare to make this a new plugin API, for example to use a SMB share for the music_directory.
Diffstat (limited to '')
-rw-r--r--src/Mapper.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Mapper.cxx b/src/Mapper.cxx
index 60928dbb9..786634ebb 100644
--- a/src/Mapper.cxx
+++ b/src/Mapper.cxx
@@ -193,7 +193,8 @@ map_uri_fs(const char *uri)
return AllocatedPath::Build(music_dir_fs, uri_fs);
}
-AllocatedPath
+gcc_pure
+static AllocatedPath
map_directory_fs(const Directory &directory)
{
assert(!music_dir_fs.IsNull());
@@ -204,7 +205,15 @@ map_directory_fs(const Directory &directory)
return map_uri_fs(directory.GetPath());
}
-AllocatedPath
+/**
+ * Determines the file system path of a directory's child (may be a
+ * sub directory or a song).
+ *
+ * @param directory the parent directory object
+ * @param name the child's name in UTF-8
+ * @return the path in file system encoding, or nullptr if mapping failed
+ */
+static AllocatedPath
map_directory_child_fs(const Directory &directory, const char *name)
{
assert(!music_dir_fs.IsNull());