mirror of
https://github.com/MillironX/XAM.jl.git
synced 2024-11-23 10:19:56 +00:00
Equality comparators
This commit is contained in:
parent
f6846edfb1
commit
e69c6de586
2 changed files with 13 additions and 0 deletions
|
@ -14,6 +14,10 @@ function Header()
|
||||||
return Header(MetaInfo[])
|
return Header(MetaInfo[])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function Base.:(==)(a::Header, b::Header)
|
||||||
|
return a.metainfo == b.metainfo
|
||||||
|
end
|
||||||
|
|
||||||
function Base.copy(header::Header)
|
function Base.copy(header::Header)
|
||||||
return Header(header.metainfo)
|
return Header(header.metainfo)
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,6 +12,15 @@ mutable struct MetaInfo
|
||||||
dictval::Vector{UnitRange{Int}}
|
dictval::Vector{UnitRange{Int}}
|
||||||
end
|
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[])
|
function MetaInfo(data::Vector{UInt8}=UInt8[])
|
||||||
metainfo = MetaInfo(data, 1:0, 1:0, 1:0, UnitRange{Int}[], UnitRange{Int}[])
|
metainfo = MetaInfo(data, 1:0, 1:0, 1:0, UnitRange{Int}[], UnitRange{Int}[])
|
||||||
if !isempty(data)
|
if !isempty(data)
|
||||||
|
|
Loading…
Reference in a new issue