public CsvFileReader(CsvSource csvSource, CsvDefinition csvDefinition)
        {
            var streamReader = csvSource.TextReader as StreamReader;

            if (streamReader != null)
            {
                BaseStream = streamReader.BaseStream;
            }

            if (csvDefinition == null)
            {
                csvDefinition = DefaultCsvDefinition;
            }

            fieldSeparator = csvDefinition.FieldSeparator;
            textQualifier  = csvDefinition.TextQualifier;

            textReader = csvSource.TextReader;// new FileStream(csvSource.TextReader, FileMode.Open);
            ReadHeader(csvDefinition.Header);
        }
Esempio n. 2
0
        public static IEnumerable <T> Read <T>(CsvSource csvSource) where T : new()
        {
            var csvFileReader = new CsvFileReader <T>(csvSource);

            return((IEnumerable <T>)csvFileReader);
        }
 public CsvFileReader(CsvSource csvSource)
     : this(csvSource, null)
 {
 }