public static NormalizeOrder ( IEnumerable |
||
modifiers | IEnumerable |
|
return | IEnumerable |
public static IEnumerable<CppModifiers> NormalizeOrder (IEnumerable<CppModifiers> modifiers)
{
var parts = modifiers.Transform (
For.AllInputsIn (CppModifiers.Unsigned, CppModifiers.Long).InAnyOrder ().Emit (new CppModifiers [] { CppModifiers.Unsigned, CppModifiers.Long }),
For.AllInputsIn (CppModifiers.Signed, CppModifiers.Long).InAnyOrder ().Emit (new CppModifiers [] { CppModifiers.Signed, CppModifiers.Long }),
For.AllInputsIn (CppModifiers.Unsigned, CppModifiers.Short).InAnyOrder ().Emit (new CppModifiers [] { CppModifiers.Unsigned, CppModifiers.Short }),
For.AllInputsIn (CppModifiers.Signed, CppModifiers.Short).InAnyOrder ().Emit (new CppModifiers [] { CppModifiers.Signed, CppModifiers.Short }),
For.UnmatchedInput<CppModifiers> ().Emit (cppmod => new CppModifiers [] { cppmod })
);
foreach (var array in parts)
foreach (var item in array)
yield return item;
}
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj.GetType() == typeof(CppTypes)) { return(Equals(new CppType(obj))); } if (obj.GetType() != typeof(CppType)) { return(false); } CppType other = (CppType)obj; return((((internalModifiers == null || !internalModifiers.Any()) && (other.internalModifiers == null || !other.internalModifiers.Any())) || (internalModifiers != null && other.internalModifiers != null && CppModifiers.NormalizeOrder(internalModifiers).SequenceEqual(CppModifiers.NormalizeOrder(other.internalModifiers)))) && (((Namespaces == null || !Namespaces.Any()) && (other.Namespaces == null || !other.Namespaces.Any())) || (Namespaces != null && other.Namespaces != null && Namespaces.SequenceEqual(other.Namespaces))) && ElementType == other.ElementType && ElementTypeName == other.ElementTypeName); }