summaryrefslogtreecommitdiff
path: root/src/tag
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-02-23 10:07:47 +0100
committerMax Kellermann <max@duempel.org>2016-02-23 10:18:07 +0100
commit17ace95268c93188891e85105eb51f0640526d66 (patch)
tree4dfee4ddf8c85c282027e6c0d9e77f29a0c803da /src/tag
parent779d73f94b3dba3e5c8124e8994e4c8a8fb6ece6 (diff)
tag/Generic: add overload with InputStream& parameter
Diffstat (limited to 'src/tag')
-rw-r--r--src/tag/Generic.cxx17
-rw-r--r--src/tag/Generic.hxx7
2 files changed, 24 insertions, 0 deletions
diff --git a/src/tag/Generic.cxx b/src/tag/Generic.cxx
index 27fd34684..a731fbe38 100644
--- a/src/tag/Generic.cxx
+++ b/src/tag/Generic.cxx
@@ -22,6 +22,23 @@
#include "TagId3.hxx"
#include "ApeTag.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.
diff --git a/src/tag/Generic.hxx b/src/tag/Generic.hxx
index 5bd9cc7cb..36473aa47 100644
--- a/src/tag/Generic.hxx
+++ b/src/tag/Generic.hxx
@@ -23,12 +23,19 @@
#include "check.h"
struct TagHandler;
+class InputStream;
class Path;
/**
* Attempts to scan APE or ID3 tags from the specified file.
*/
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);
#endif