diff options
author | Max Kellermann <max@duempel.org> | 2014-01-29 18:14:57 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-05 10:04:03 +0100 |
commit | 9ae7f186bc43749383594807b1d751b5389161e7 (patch) | |
tree | 0cafbfde8316c4b1a9ded19060d3020977a604dd /src/db/update/UpdateIO.hxx | |
parent | f8d114be42663006d162311c1ecaf4306e0b72e4 (diff) | |
download | mpd-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/db/update/UpdateIO.hxx | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/db/update/UpdateIO.hxx b/src/db/update/UpdateIO.hxx index c33b79dc0..d5cbb2a5b 100644 --- a/src/db/update/UpdateIO.hxx +++ b/src/db/update/UpdateIO.hxx @@ -23,24 +23,32 @@ #include "check.h" #include "Compiler.h" -#include <sys/stat.h> - struct Directory; +struct FileInfo; +class LocalStorage; +class LocalDirectoryReader; -int -stat_directory(const Directory &directory, struct stat *st); +/** + * Wrapper for LocalStorage::GetInfo() that logs errors instead of + * returning them. + */ +bool +GetInfo(LocalStorage &storage, const char *uri_utf8, FileInfo &info); -int -stat_directory_child(const Directory &parent, const char *name, - struct stat *st); +/** + * Wrapper for LocalDirectoryReader::GetInfo() that logs errors + * instead of returning them. + */ +bool +GetInfo(LocalDirectoryReader &reader, FileInfo &info); gcc_pure bool -directory_exists(const Directory &directory); +DirectoryExists(LocalStorage &storage, const Directory &directory); gcc_pure bool -directory_child_is_regular(const Directory &directory, +directory_child_is_regular(LocalStorage &storage, const Directory &directory, const char *name_utf8); /** @@ -48,7 +56,7 @@ directory_child_is_regular(const Directory &directory, */ gcc_pure bool -directory_child_access(const Directory &directory, +directory_child_access(LocalStorage &storage, const Directory &directory, const char *name, int mode); #endif |