-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSemanticFlagClass.cs
More file actions
99 lines (80 loc) · 1.77 KB
/
Copy pathSemanticFlagClass.cs
File metadata and controls
99 lines (80 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
namespace BinaryNinja
{
public sealed class SemanticFlagClass : IEquatable<SemanticFlagClass>,
IComparable<SemanticFlagClass>
{
internal Architecture Architecture { get; }
public SemanticFlagClassIndex Index { get; }
internal SemanticFlagClass(Architecture arch , SemanticFlagClassIndex index)
{
this.Architecture = arch;
this.Index = index;
}
internal SemanticFlagClass(SemanticFlagClass other)
{
this.Architecture = other.Architecture;
this.Index = other.Index;
}
public override bool Equals(object? other)
{
return Equals(other as SemanticFlagClass);
}
public bool Equals(SemanticFlagClass? other)
{
if (other is null)
{
return false;
}
if (ReferenceEquals(this , other))
{
return true;
}
if (this.Architecture != other.Architecture)
{
return false;
}
return this.Index == other.Index;
}
public override int GetHashCode()
{
return HashCode.Combine<int,uint>(this.Architecture.GetHashCode(), (uint)this.Index);
}
public static bool operator ==(SemanticFlagClass? left, SemanticFlagClass? right)
{
if (left is null)
{
return right is null;
}
return left.Equals(right);
}
public static bool operator !=(SemanticFlagClass? left, SemanticFlagClass? right)
{
return !(left == right);
}
public int CompareTo(SemanticFlagClass? other)
{
if (other is null)
{
return 1;
}
int result = this.Architecture.CompareTo(other.Architecture);
if (0 == result)
{
result = this.Index.CompareTo(other.Index);
}
return result;
}
public override string ToString()
{
return this.Name;
}
public string Name
{
get
{
return this.Architecture.GetSemanticFlagClassName(this.Index);
}
}
}
}