Exemplo n.º 1
0
        private RowEndingDetector(ReaderStateMachine stateMachine, Options options, MemoryPool <char> memPool, CharacterLookup charLookup, IReaderAdapter?inner, IAsyncReaderAdapter?innerAsync, ReadOnlyMemory <char> valueSeparatorMemory)
        {
            Inner.SetAllowNull(inner);
            InnerAsync.SetAllowNull(innerAsync);

            State = stateMachine;
            stateMachine.Initialize(
                charLookup,
                options.EscapedValueStartAndEnd,
                options.EscapedValueEscapeCharacter,
Exemplo n.º 2
0
        private HeadersReader(
            ReaderStateMachine stateMachine,
            BoundConfigurationBase <T> config,
            CharacterLookup charLookup,
            IReaderAdapter?inner,
            IAsyncReaderAdapter?innerAsync,
            BufferWithPushback buffer,
            ReadRowEnding rowEndingOverride
            )
        {
            LogHelper.StateTransition_NewHeadersReader();

            Configuration = config;

            Inner.SetAllowNull(inner);
            InnerAsync.SetAllowNull(innerAsync);

            var options = Configuration.Options;

            MemoryPool     = Configuration.MemoryPool;
            BufferSizeHint = options.ReadBufferSizeHint;
            Columns        = config.DeserializeColumns;

            StateMachine = stateMachine;
            stateMachine.Initialize(
                charLookup,
                options.EscapedValueStartAndEnd,
                options.EscapedValueEscapeCharacter,
                rowEndingOverride,                      // this can be something OTHER than what was provided, due to RowEnding.Detect
                ReadHeader.Never,
                false,
                options.WhitespaceTreatment.HasFlag(WhitespaceTreatments.TrimBeforeValues),
                options.WhitespaceTreatment.HasFlag(WhitespaceTreatments.TrimAfterValues)
                );

            Buffer = buffer;

            HeaderCount         = 0;
            PushBackLength      = 0;
            WhitespaceTreatment = options.WhitespaceTreatment;
        }