예제 #1
0
        /// <summary>
        /// Creates a new parser using the given <see cref="TextReader"/> and <see cref="CsvConfiguration"/>.
        /// </summary>
        /// <param name="reader">The <see cref="TextReader"/> with the CSV file data.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="leaveOpen">true to leave the reader open after the CsvReader object is disposed, otherwise false.</param>
        public CsvParser(TextReader reader, ICsvParserConfiguration configuration, bool leaveOpen)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            this.reader        = new FieldReader(reader, configuration);
            this.configuration = configuration;
            this.leaveOpen     = leaveOpen;
        }
예제 #2
0
 /// <summary>
 /// Creates a new <see cref="FieldReader"/> using the given
 /// <see cref="TextReader"/> and <see cref="CsvConfiguration"/>.
 /// </summary>
 /// <param name="reader"></param>
 /// <param name="configuration"></param>
 public FieldReader(TextReader reader, ICsvParserConfiguration configuration)
 {
     this.reader        = reader;
     buffer             = new char[configuration.BufferSize];
     this.configuration = configuration;
 }
예제 #3
0
 /// <summary>
 /// Creates a new parser using the given <see cref="TextReader"/> and <see cref="CsvConfiguration"/>.
 /// </summary>
 /// <param name="reader">The <see cref="TextReader"/> with the CSV file data.</param>
 /// <param name="configuration">The configuration.</param>
 public CsvParser(TextReader reader, ICsvParserConfiguration configuration) : this(reader, configuration, false)
 {
 }
예제 #4
0
 /// <summary>
 /// Creates a new parser using the given <see cref="TextReader"/> and <see cref="CsvConfiguration"/>.
 /// </summary>
 /// <param name="reader">The <see cref="TextReader"/> with the CSV file data.</param>
 /// <param name="configuration">The configuration.</param>
 public CsvParser( TextReader reader, ICsvParserConfiguration configuration )
     : this(reader, configuration, false)
 {
 }
예제 #5
0
        /// <summary>
        /// Creates a new parser using the given <see cref="TextReader"/> and <see cref="CsvConfiguration"/>.
        /// </summary>
        /// <param name="reader">The <see cref="TextReader"/> with the CSV file data.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="leaveOpen">true to leave the reader open after the CsvReader object is disposed, otherwise false.</param>
        public CsvParser( TextReader reader, ICsvParserConfiguration configuration, bool leaveOpen )
        {
            if( reader == null )
            {
                throw new ArgumentNullException( nameof( reader ) );
            }

            if( configuration == null )
            {
                throw new ArgumentNullException( nameof( configuration ) );
            }

            this.reader = new FieldReader( reader, configuration );
            this.configuration = configuration;
            this.leaveOpen = leaveOpen;
        }
예제 #6
0
 /// <summary>
 /// Creates a new <see cref="FieldReader"/> using the given
 /// <see cref="TextReader"/> and <see cref="CsvConfiguration"/>.
 /// </summary>
 /// <param name="reader"></param>
 /// <param name="configuration"></param>
 public FieldReader( TextReader reader, ICsvParserConfiguration configuration )
 {
     this.reader = reader;
     buffer = new char[configuration.BufferSize];
     this.configuration = configuration;
 }