diff --git a/Source/Core/Core/IOS/ES/Formats.cpp b/Source/Core/Core/IOS/ES/Formats.cpp index aa71ad32ee..0f5af9833c 100644 --- a/Source/Core/Core/IOS/ES/Formats.cpp +++ b/Source/Core/Core/IOS/ES/Formats.cpp @@ -67,6 +67,17 @@ bool Content::IsOptional() const return (type & 0x4000) != 0; } +bool operator==(const Content& lhs, const Content& rhs) +{ + auto fields = [](const Content& c) { return std::tie(c.id, c.index, c.type, c.size, c.sha1); }; + return fields(lhs) == fields(rhs); +} + +bool operator!=(const Content& lhs, const Content& rhs) +{ + return !operator==(lhs, rhs); +} + SignedBlobReader::SignedBlobReader(const std::vector& bytes) : m_bytes(bytes) { } diff --git a/Source/Core/Core/IOS/ES/Formats.h b/Source/Core/Core/IOS/ES/Formats.h index cbacb6cfcb..51d67f91d3 100644 --- a/Source/Core/Core/IOS/ES/Formats.h +++ b/Source/Core/Core/IOS/ES/Formats.h @@ -93,6 +93,8 @@ struct Content std::array sha1; }; static_assert(sizeof(Content) == 36, "Content has the wrong size"); +bool operator==(const Content&, const Content&); +bool operator!=(const Content&, const Content&); struct TimeLimit {