aboutsummaryrefslogtreecommitdiffstats
path: root/src/DatabaseVisitor.hxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/DatabaseVisitor.hxx (renamed from src/db_visitor.h)38
1 files changed, 11 insertions, 27 deletions
diff --git a/src/db_visitor.h b/src/DatabaseVisitor.hxx
index 6b90c1868..10f907cef 100644
--- a/src/db_visitor.h
+++ b/src/DatabaseVisitor.hxx
@@ -17,38 +17,22 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef MPD_DB_VISITOR_H
-#define MPD_DB_VISITOR_H
+#ifndef MPD_DATABASE_VISITOR_HXX
+#define MPD_DATABASE_VISITOR_HXX
+
+#include "gerror.h"
+
+#include <functional>
struct directory;
struct song;
struct playlist_metadata;
-struct db_visitor {
- /**
- * Visit a directory. Optional method.
- *
- * @return true to continue the operation, false on error (set error_r)
- */
- bool (*directory)(const struct directory *directory, void *ctx,
- GError **error_r);
-
- /**
- * Visit a song. Optional method.
- *
- * @return true to continue the operation, false on error (set error_r)
- */
- bool (*song)(struct song *song, void *ctx, GError **error_r);
+typedef std::function<bool(const directory &, GError **)> VisitDirectory;
+typedef std::function<bool(struct song &, GError **)> VisitSong;
+typedef std::function<bool(const playlist_metadata &, const directory &,
+ GError **)> VisitPlaylist;
- /**
- * Visit a playlist. Optional method.
- *
- * @param directory the directory the playlist resides in
- * @return true to continue the operation, false on error (set error_r)
- */
- bool (*playlist)(const struct playlist_metadata *playlist,
- const struct directory *directory, void *ctx,
- GError **error_r);
-};
+typedef std::function<bool(const char *, GError **)> VisitString;
#endif