aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/update/Editor.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/db/update/Editor.hxx (renamed from src/db/update/UpdateDatabase.hxx)48
1 files changed, 29 insertions, 19 deletions
diff --git a/src/db/update/UpdateDatabase.hxx b/src/db/update/Editor.hxx
index bd7c395f2..a9093d662 100644
--- a/src/db/update/UpdateDatabase.hxx
+++ b/src/db/update/Editor.hxx
@@ -21,30 +21,40 @@
#define MPD_UPDATE_DATABASE_HXX
#include "check.h"
+#include "Remove.hxx"
struct Directory;
struct Song;
+class UpdateRemoveService;
-/**
- * Caller must lock the #db_mutex.
- */
-void
-delete_song(Directory &parent, Song *song);
+class DatabaseEditor final {
+ UpdateRemoveService remove;
-/**
- * Recursively free a directory and all its contents.
- *
- * Caller must lock the #db_mutex.
- */
-void
-delete_directory(Directory *directory);
+public:
+ DatabaseEditor(EventLoop &_loop)
+ :remove(_loop) {}
-/**
- * Caller must NOT lock the #db_mutex.
- *
- * @return true if the database was modified
- */
-bool
-delete_name_in(Directory &parent, const char *name);
+ /**
+ * Caller must lock the #db_mutex.
+ */
+ void DeleteSong(Directory &parent, Song *song);
+
+ /**
+ * Recursively free a directory and all its contents.
+ *
+ * Caller must lock the #db_mutex.
+ */
+ void DeleteDirectory(Directory *directory);
+
+ /**
+ * Caller must NOT lock the #db_mutex.
+ *
+ * @return true if the database was modified
+ */
+ bool DeleteNameIn(Directory &parent, const char *name);
+
+private:
+ void ClearDirectory(Directory &directory);
+};
#endif