aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/update/Archive.cxx4
-rw-r--r--src/db/update/Container.cxx4
-rw-r--r--src/db/update/UpdateIO.cxx10
-rw-r--r--src/db/update/UpdateIO.hxx6
-rw-r--r--src/db/update/UpdateSong.cxx4
-rw-r--r--src/db/update/Walk.cxx20
-rw-r--r--src/db/update/Walk.hxx26
7 files changed, 38 insertions, 36 deletions
diff --git a/src/db/update/Archive.cxx b/src/db/update/Archive.cxx
index 6119f3233..e818ab279 100644
--- a/src/db/update/Archive.cxx
+++ b/src/db/update/Archive.cxx
@@ -104,7 +104,7 @@ class UpdateArchiveVisitor final : public ArchiveVisitor {
*/
void
UpdateWalk::UpdateArchiveFile(Directory &parent, const char *name,
- const FileInfo &info,
+ const StorageFileInfo &info,
const ArchivePlugin &plugin)
{
db_lock();
@@ -156,7 +156,7 @@ UpdateWalk::UpdateArchiveFile(Directory &parent, const char *name,
bool
UpdateWalk::UpdateArchiveFile(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info)
+ const StorageFileInfo &info)
{
const ArchivePlugin *plugin = archive_plugin_from_suffix(suffix);
if (plugin == nullptr)
diff --git a/src/db/update/Container.cxx b/src/db/update/Container.cxx
index b51a80431..e2f814eee 100644
--- a/src/db/update/Container.cxx
+++ b/src/db/update/Container.cxx
@@ -36,7 +36,7 @@
Directory *
UpdateWalk::MakeDirectoryIfModified(Directory &parent, const char *name,
- const FileInfo &info)
+ const StorageFileInfo &info)
{
Directory *directory = parent.FindChild(name);
@@ -69,7 +69,7 @@ SupportsContainerSuffix(const DecoderPlugin &plugin, const char *suffix)
bool
UpdateWalk::UpdateContainerFile(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info)
+ const StorageFileInfo &info)
{
const DecoderPlugin *_plugin = decoder_plugins_find([suffix](const DecoderPlugin &plugin){
return SupportsContainerSuffix(plugin, suffix);
diff --git a/src/db/update/UpdateIO.cxx b/src/db/update/UpdateIO.cxx
index 0fd46f1db..1a0f318c3 100644
--- a/src/db/update/UpdateIO.cxx
+++ b/src/db/update/UpdateIO.cxx
@@ -33,7 +33,7 @@
#include <unistd.h>
bool
-GetInfo(Storage &storage, const char *uri_utf8, FileInfo &info)
+GetInfo(Storage &storage, const char *uri_utf8, StorageFileInfo &info)
{
Error error;
bool success = storage.GetInfo(uri_utf8, true, info, error);
@@ -43,7 +43,7 @@ GetInfo(Storage &storage, const char *uri_utf8, FileInfo &info)
}
bool
-GetInfo(StorageDirectoryReader &reader, FileInfo &info)
+GetInfo(StorageDirectoryReader &reader, StorageFileInfo &info)
{
Error error;
bool success = reader.GetInfo(true, info, error);
@@ -55,7 +55,7 @@ GetInfo(StorageDirectoryReader &reader, FileInfo &info)
bool
DirectoryExists(Storage &storage, const Directory &directory)
{
- FileInfo info;
+ StorageFileInfo info;
if (!storage.GetInfo(directory.GetPath(), true, info, IgnoreError()))
return false;
@@ -67,7 +67,7 @@ DirectoryExists(Storage &storage, const Directory &directory)
static bool
GetDirectoryChildInfo(Storage &storage, const Directory &directory,
- const char *name_utf8, FileInfo &info, Error &error)
+ const char *name_utf8, StorageFileInfo &info, Error &error)
{
const auto uri_utf8 = PathTraitsUTF8::Build(directory.GetPath(),
name_utf8);
@@ -78,7 +78,7 @@ bool
directory_child_is_regular(Storage &storage, const Directory &directory,
const char *name_utf8)
{
- FileInfo info;
+ StorageFileInfo info;
return GetDirectoryChildInfo(storage, directory, name_utf8, info,
IgnoreError()) &&
info.IsRegular();
diff --git a/src/db/update/UpdateIO.hxx b/src/db/update/UpdateIO.hxx
index cf6cdd37d..0223cb62c 100644
--- a/src/db/update/UpdateIO.hxx
+++ b/src/db/update/UpdateIO.hxx
@@ -24,7 +24,7 @@
#include "Compiler.h"
struct Directory;
-struct FileInfo;
+struct StorageFileInfo;
class Storage;
class StorageDirectoryReader;
@@ -33,14 +33,14 @@ class StorageDirectoryReader;
* returning them.
*/
bool
-GetInfo(Storage &storage, const char *uri_utf8, FileInfo &info);
+GetInfo(Storage &storage, const char *uri_utf8, StorageFileInfo &info);
/**
* Wrapper for LocalDirectoryReader::GetInfo() that logs errors
* instead of returning them.
*/
bool
-GetInfo(StorageDirectoryReader &reader, FileInfo &info);
+GetInfo(StorageDirectoryReader &reader, StorageFileInfo &info);
gcc_pure
bool
diff --git a/src/db/update/UpdateSong.cxx b/src/db/update/UpdateSong.cxx
index 61c4db0d1..e6ed5643a 100644
--- a/src/db/update/UpdateSong.cxx
+++ b/src/db/update/UpdateSong.cxx
@@ -33,7 +33,7 @@
inline void
UpdateWalk::UpdateSongFile2(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info)
+ const StorageFileInfo &info)
{
db_lock();
Song *song = directory.FindSong(name);
@@ -93,7 +93,7 @@ UpdateWalk::UpdateSongFile2(Directory &directory,
bool
UpdateWalk::UpdateSongFile(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info)
+ const StorageFileInfo &info)
{
if (!decoder_plugins_supports_suffix(suffix))
return false;
diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx
index 152971677..af039ee48 100644
--- a/src/db/update/Walk.cxx
+++ b/src/db/update/Walk.cxx
@@ -67,7 +67,7 @@ UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener,
}
static void
-directory_set_stat(Directory &dir, const FileInfo &info)
+directory_set_stat(Directory &dir, const StorageFileInfo &info)
{
dir.inode = info.inode;
dir.device = info.device;
@@ -140,7 +140,7 @@ UpdateWalk::PurgeDeletedFromDirectory(Directory &directory)
static bool
update_directory_stat(Storage &storage, Directory &directory)
{
- FileInfo info;
+ StorageFileInfo info;
if (!GetInfo(storage, directory.GetPath(), info))
return false;
@@ -190,7 +190,7 @@ FindAncestorLoop(Storage &storage, Directory *parent,
inline bool
UpdateWalk::UpdatePlaylistFile(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info)
+ const StorageFileInfo &info)
{
if (!playlist_suffix_supported(suffix))
return false;
@@ -206,7 +206,7 @@ UpdateWalk::UpdatePlaylistFile(Directory &directory,
inline bool
UpdateWalk::UpdateRegularFile(Directory &directory,
- const char *name, const FileInfo &info)
+ const char *name, const StorageFileInfo &info)
{
const char *suffix = uri_get_suffix(name);
if (suffix == nullptr)
@@ -219,7 +219,7 @@ UpdateWalk::UpdateRegularFile(Directory &directory,
void
UpdateWalk::UpdateDirectoryChild(Directory &directory,
- const char *name, const FileInfo &info)
+ const char *name, const StorageFileInfo &info)
{
assert(strchr(name, '/') == nullptr);
@@ -327,7 +327,7 @@ UpdateWalk::SkipSymlink(const Directory *directory,
}
bool
-UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info)
+UpdateWalk::UpdateDirectory(Directory &directory, const StorageFileInfo &info)
{
assert(info.IsDirectory());
@@ -370,7 +370,7 @@ UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info)
continue;
}
- FileInfo info2;
+ StorageFileInfo info2;
if (!GetInfo(*reader, info2)) {
modified |= editor.DeleteNameIn(directory, name_utf8);
continue;
@@ -400,7 +400,7 @@ UpdateWalk::DirectoryMakeChildChecked(Directory &parent,
return directory;
}
- FileInfo info;
+ StorageFileInfo info;
if (!GetInfo(storage, uri_utf8, info) ||
FindAncestorLoop(storage, &parent, info.inode, info.device))
return nullptr;
@@ -462,7 +462,7 @@ UpdateWalk::UpdateUri(Directory &root, const char *uri)
return;
}
- FileInfo info;
+ StorageFileInfo info;
if (!GetInfo(storage, uri, info)) {
modified |= editor.DeleteNameIn(*parent, name);
return;
@@ -480,7 +480,7 @@ UpdateWalk::Walk(Directory &root, const char *path, bool discard)
if (path != nullptr && !isRootDirectory(path)) {
UpdateUri(root, path);
} else {
- FileInfo info;
+ StorageFileInfo info;
if (!GetInfo(storage, "", info))
return false;
diff --git a/src/db/update/Walk.hxx b/src/db/update/Walk.hxx
index 94db4dbee..d9fe7c84c 100644
--- a/src/db/update/Walk.hxx
+++ b/src/db/update/Walk.hxx
@@ -27,7 +27,7 @@
#include <sys/stat.h>
struct stat;
-struct FileInfo;
+struct StorageFileInfo;
struct Directory;
struct ArchivePlugin;
class Storage;
@@ -89,15 +89,15 @@ private:
void UpdateSongFile2(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info);
+ const StorageFileInfo &info);
bool UpdateSongFile(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info);
+ const StorageFileInfo &info);
bool UpdateContainerFile(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info);
+ const StorageFileInfo &info);
#ifdef ENABLE_ARCHIVE
@@ -105,10 +105,10 @@ private:
bool UpdateArchiveFile(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info);
+ const StorageFileInfo &info);
void UpdateArchiveFile(Directory &directory, const char *name,
- const FileInfo &info,
+ const StorageFileInfo &info,
const ArchivePlugin &plugin);
@@ -116,22 +116,24 @@ private:
bool UpdateArchiveFile(gcc_unused Directory &directory,
gcc_unused const char *name,
gcc_unused const char *suffix,
- gcc_unused const FileInfo &info) {
+ gcc_unused const StorageFileInfo &info) {
return false;
}
#endif
bool UpdatePlaylistFile(Directory &directory,
const char *name, const char *suffix,
- const FileInfo &info);
+ const StorageFileInfo &info);
bool UpdateRegularFile(Directory &directory,
- const char *name, const FileInfo &info);
+ const char *name, const StorageFileInfo &info);
void UpdateDirectoryChild(Directory &directory,
- const char *name, const FileInfo &info);
+ const char *name,
+ const StorageFileInfo &info);
- bool UpdateDirectory(Directory &directory, const FileInfo &info);
+ bool UpdateDirectory(Directory &directory,
+ const StorageFileInfo &info);
/**
* Create the specified directory object if it does not exist
@@ -142,7 +144,7 @@ private:
* The caller must lock the database.
*/
Directory *MakeDirectoryIfModified(Directory &parent, const char *name,
- const FileInfo &info);
+ const StorageFileInfo &info);
Directory *DirectoryMakeChildChecked(Directory &parent,
const char *uri_utf8,