1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-12-23 13:28:16 +00:00

Equality comparators

This commit is contained in:
Ciarán O'Mara 2020-03-21 17:18:34 +11:00
parent f6846edfb1
commit e69c6de586
2 changed files with 13 additions and 0 deletions

View file

@ -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

View file

@ -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)