ApeTag: support multiple values per name

This commit is contained in:
Max Kellermann 2013-10-26 16:00:05 +02:00
parent a4d82cfe1e
commit 6f87164ad6

View File

@ -83,13 +83,18 @@ tag_ape_import_item(unsigned long flags,
if ((flags & (0x3 << 1)) != 0) if ((flags & (0x3 << 1)) != 0)
return false; return false;
tag_handler_invoke_pair(handler, handler_ctx, key, value); const char *const end = value + value_length;
if (handler->pair != nullptr)
ForEachValue(value, end, [handler, handler_ctx,
key](const char *_value) {
handler->pair(key, _value, handler_ctx);
});
TagType type = tag_ape_name_parse(key); TagType type = tag_ape_name_parse(key);
if (type == TAG_NUM_OF_ITEM_TYPES) if (type == TAG_NUM_OF_ITEM_TYPES)
return false; return false;
const char *end = value + value_length;
ForEachValue(value, end, [handler, handler_ctx, ForEachValue(value, end, [handler, handler_ctx,
type](const char *_value) { type](const char *_value) {
tag_handler_invoke_tag(handler, handler_ctx, tag_handler_invoke_tag(handler, handler_ctx,