aboutsummaryrefslogtreecommitdiffstats
path: root/src/ArchivePlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-29 21:21:07 +0100
committerMax Kellermann <max@duempel.org>2013-01-29 21:21:07 +0100
commit9f0fb8f6a8f58ff9a760d40bccfadd010b9ddef9 (patch)
treee8f5dc8f9e19cfb0873b2f761e26b8a9da7b5e36 /src/ArchivePlugin.cxx
parenta42f9fd4e2ccb164c0634571da9903e6a2aa507a (diff)
downloadmpd-9f0fb8f6a8f58ff9a760d40bccfadd010b9ddef9.tar.gz
mpd-9f0fb8f6a8f58ff9a760d40bccfadd010b9ddef9.tar.xz
mpd-9f0fb8f6a8f58ff9a760d40bccfadd010b9ddef9.zip
ArchivePlugin: replace scan_reset(), scan_next() with visit()
Add the interface ArchiveVisitor.
Diffstat (limited to 'src/ArchivePlugin.cxx')
-rw-r--r--src/ArchivePlugin.cxx20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/ArchivePlugin.cxx b/src/ArchivePlugin.cxx
index 55721efc3..95f49a2f8 100644
--- a/src/ArchivePlugin.cxx
+++ b/src/ArchivePlugin.cxx
@@ -38,8 +38,7 @@ archive_file_open(const struct archive_plugin *plugin, const char *path,
if (file != NULL) {
assert(file->plugin != NULL);
assert(file->plugin->close != NULL);
- assert(file->plugin->scan_reset != NULL);
- assert(file->plugin->scan_next != NULL);
+ assert(file->plugin->visit != nullptr);
assert(file->plugin->open_stream != NULL);
assert(error_r == NULL || *error_r == NULL);
} else {
@@ -60,24 +59,13 @@ archive_file_close(struct archive_file *file)
}
void
-archive_file_scan_reset(struct archive_file *file)
+archive_file_visit(archive_file *file, ArchiveVisitor &visitor)
{
assert(file != NULL);
assert(file->plugin != NULL);
- assert(file->plugin->scan_reset != NULL);
- assert(file->plugin->scan_next != NULL);
+ assert(file->plugin->visit != nullptr);
- file->plugin->scan_reset(file);
-}
-
-const char *
-archive_file_scan_next(struct archive_file *file)
-{
- assert(file != NULL);
- assert(file->plugin != NULL);
- assert(file->plugin->scan_next != NULL);
-
- return file->plugin->scan_next(file);
+ file->plugin->visit(file, visitor);
}
struct input_stream *