diff --git a/src/sam/header.jl b/src/sam/header.jl index 1369e37..668cb59 100644 --- a/src/sam/header.jl +++ b/src/sam/header.jl @@ -14,6 +14,10 @@ function Header() return Header(MetaInfo[]) end +function Base.:(==)(a::Header, b::Header) + return a.metainfo == b.metainfo +end + function Base.copy(header::Header) return Header(header.metainfo) end diff --git a/src/sam/metainfo.jl b/src/sam/metainfo.jl index f40e6ae..f99c952 100644 --- a/src/sam/metainfo.jl +++ b/src/sam/metainfo.jl @@ -12,6 +12,15 @@ mutable struct MetaInfo dictval::Vector{UnitRange{Int}} end +function Base.:(==)(a::MetaInfo, b::MetaInfo) + return a.data == b.data && + a.filled == b.filled && + a.tag == b.tag && + a.val == b.val && + a.dictkey == b.dictkey && + a.dictval == b.dictval +end + function MetaInfo(data::Vector{UInt8}=UInt8[]) metainfo = MetaInfo(data, 1:0, 1:0, 1:0, UnitRange{Int}[], UnitRange{Int}[]) if !isempty(data)