Commit 17ace952 authored by Max Kellermann's avatar Max Kellermann

tag/Generic: add overload with InputStream& parameter

parent 779d73f9
...@@ -22,6 +22,23 @@ ...@@ -22,6 +22,23 @@
#include "TagId3.hxx" #include "TagId3.hxx"
#include "ApeTag.hxx" #include "ApeTag.hxx"
#include "fs/Path.hxx" #include "fs/Path.hxx"
#include "input/InputStream.hxx"
#include "util/Error.hxx"
/**
* Attempts to scan APE or ID3 tags from the specified file.
*/
bool
ScanGenericTags(InputStream &is, const TagHandler &handler, void *ctx)
{
if (tag_ape_scan2(is, handler, ctx))
return true;
if (!is.Rewind(IgnoreError()))
return false;
return tag_id3_scan(is, handler, ctx);
}
/** /**
* Attempts to scan APE or ID3 tags from the specified file. * Attempts to scan APE or ID3 tags from the specified file.
......
...@@ -23,12 +23,19 @@ ...@@ -23,12 +23,19 @@
#include "check.h" #include "check.h"
struct TagHandler; struct TagHandler;
class InputStream;
class Path; class Path;
/** /**
* Attempts to scan APE or ID3 tags from the specified file. * Attempts to scan APE or ID3 tags from the specified file.
*/ */
bool bool
ScanGenericTags(InputStream &is, const TagHandler &handler, void *ctx);
/**
* Attempts to scan APE or ID3 tags from the specified file.
*/
bool
ScanGenericTags(Path path, const TagHandler &handler, void *ctx); ScanGenericTags(Path path, const TagHandler &handler, void *ctx);
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment