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/Walk.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 'src/db/update/Walk.hxx')
-rw-r--r-- | src/db/update/Walk.hxx | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/db/update/Walk.hxx b/src/db/update/Walk.hxx index aa4516917..c465ea7e1 100644 --- a/src/db/update/Walk.hxx +++ b/src/db/update/Walk.hxx @@ -22,10 +22,12 @@ #include "check.h" #include "Editor.hxx" +#include "storage/LocalStorage.hxx" #include <sys/stat.h> struct stat; +struct FileInfo; struct Directory; struct archive_plugin; class ExcludeList; @@ -46,6 +48,8 @@ class UpdateWalk final { bool walk_discard; bool modified; + LocalStorage storage; + DatabaseEditor editor; public: @@ -68,15 +72,15 @@ private: void UpdateSongFile2(Directory &directory, const char *name, const char *suffix, - const struct stat *st); + const FileInfo &info); bool UpdateSongFile(Directory &directory, const char *name, const char *suffix, - const struct stat *st); + const FileInfo &info); bool UpdateContainerFile(Directory &directory, const char *name, const char *suffix, - const struct stat *st); + const FileInfo &info); #ifdef ENABLE_ARCHIVE @@ -84,10 +88,10 @@ private: bool UpdateArchiveFile(Directory &directory, const char *name, const char *suffix, - const struct stat *st); + const FileInfo &info); void UpdateArchiveFile(Directory &directory, const char *name, - const struct stat *st, + const FileInfo &info, const archive_plugin &plugin); @@ -95,22 +99,22 @@ private: bool UpdateArchiveFile(gcc_unused Directory &directory, gcc_unused const char *name, gcc_unused const char *suffix, - gcc_unused const struct stat *st) { + gcc_unused const FileInfo &info) { return false; } #endif bool UpdatePlaylistFile(Directory &directory, const char *name, const char *suffix, - const struct stat *st); + const FileInfo &info); bool UpdateRegularFile(Directory &directory, - const char *name, const struct stat *st); + const char *name, const FileInfo &info); void UpdateDirectoryChild(Directory &directory, - const char *name, const struct stat *st); + const char *name, const FileInfo &info); - bool UpdateDirectory(Directory &directory, const struct stat *st); + bool UpdateDirectory(Directory &directory, const FileInfo &info); /** * Create the specified directory object if it does not exist @@ -121,9 +125,10 @@ private: * The caller must lock the database. */ Directory *MakeDirectoryIfModified(Directory &parent, const char *name, - const struct stat *st); + const FileInfo &info); Directory *DirectoryMakeChildChecked(Directory &parent, + const char *uri_utf8, const char *name_utf8); Directory *DirectoryMakeUriParentChecked(Directory &root, |