tag/ApeLoader: use class InputStream instead of FILE*

Prepare for APE tag support on userspace NFS/SMB/CIFS mounts.
This commit is contained in:
Max Kellermann
2016-02-22 13:31:03 +01:00
parent 8a86460b8f
commit cc5443c38e
5 changed files with 67 additions and 14 deletions

View File

@@ -105,6 +105,23 @@ tag_ape_import_item(unsigned long flags,
return true;
}
bool
tag_ape_scan2(InputStream &is,
const struct tag_handler *handler, void *handler_ctx)
{
bool recognized = false;
auto callback = [handler, handler_ctx, &recognized]
(unsigned long flags, const char *key,
StringView value) {
recognized |= tag_ape_import_item(flags, key, value,
handler, handler_ctx);
return true;
};
return tag_ape_scan(is, callback) && recognized;
}
bool
tag_ape_scan2(Path path_fs,
const struct tag_handler *handler, void *handler_ctx)