public static CsvDocument CreateFrom(TextReader reader, CsvParsingOptions options = null) { if (null == reader) { throw new ArgumentNullException(nameof(reader)); } var document = new CsvDocument(); using (var tokenizer = new CsvTokenizer(reader)) { try { var parser = new CsvParser(tokenizer); parser.Parse(document, options ?? DefaultOptions.Value); } catch (Exception e) { Console.WriteLine(e); throw; } } return(document); }
public CsvParser(CsvTokenizer tokenizer) { if (null == tokenizer) { throw new ArgumentNullException(nameof(tokenizer)); } this.tokenizer = tokenizer; }