예제 #1
0
        internal ReadContext GetReadContext()
        {
            var r = SafeRowGet();

            var name = r.Columns[ColumnNumber];

            var owner = r.Owner;

            return(ReadContext.ReadingColumn(owner.Options, r.RowNumber, name, owner.Context));
        }
예제 #2
0
        internal Parser?GetParser(TypeInfo forType, out ReadContext ctx)
        {
            var row   = SafeRowGet();
            var owner = row.Owner;
            var index = ColumnNumber;
            var converterInterface = Converter;

            var col = row.Columns[index];

            ctx = ReadContext.ConvertingColumn(owner.Options, row.RowNumber, col, owner.Context);

            var parser = converterInterface.GetDynamicCellParserFor(in ctx, forType);

            return(parser);
        }
예제 #3
0
        internal void GetDataSpanAndReadContext(out ReadOnlySpan <char> data, out ReadContext ctx)
        {
            var r = SafeRowGet();

            if (!r.TryGetDataSpan(ColumnNumber, out data))
            {
                data = default;
                ctx  = default;
                Throw.InvalidOperationException($"{nameof(DynamicCell)} unexpectedly backed by null span");
            }

            var name = r.Columns[ColumnNumber];

            var owner = r.Owner;

            ctx = ReadContext.ReadingColumn(owner.Options, r.RowNumber, name, owner.Context);
        }