ABT.MemberIterator.Status.GetOffset C# (CSharp) Method

GetOffset() public static method

public static GetOffset ( ExprType from_type, Int32 to_index ) : Int32
from_type ExprType
to_index System.Int32
return System.Int32
            public static Int32 GetOffset(ExprType from_type, Int32 to_index) {
                switch (from_type.Kind) {
                    case ExprTypeKind.ARRAY:
                        return to_index * ((ArrayType)from_type).ElemType.SizeOf;

                    case ExprTypeKind.INCOMPLETE_ARRAY:
                        return to_index * ((IncompleteArrayType)from_type).ElemType.SizeOf;

                    case ExprTypeKind.STRUCT_OR_UNION:
                        return ((StructOrUnionType)from_type).Attribs[to_index].offset;

                    default:
                        throw new InvalidProgramException("Not an aggregate Type.");
                }
            }

Same methods

MemberIterator.Status::GetOffset ( ExprType base_type, IReadOnlyList indices ) : Int32