public SeparatedValueRecordWriter(TextWriter writer, SeparatedValueSchema schema, SeparatedValueOptions options) { this.writer = writer; this.schema = schema; this.options = options.Clone(); this.quoteString = String.Empty + options.Quote; this.doubleQuoteString = String.Empty + options.Quote + options.Quote; }
public SeparatedValueRecordParser(RetryReader reader, SeparatedValueOptions options) { this.reader = reader; this.options = options.Clone(); this.separatorMatcher = SeparatorMatcher.GetMatcher(reader, options.Separator); this.recordSeparatorMatcher = SeparatorMatcher.GetMatcher(reader, options.RecordSeparator); if (options.RecordSeparator != null && options.RecordSeparator.StartsWith(options.Separator)) { string postfix = options.RecordSeparator.Substring(options.Separator.Length); this.postfixMatcher = SeparatorMatcher.GetMatcher(reader, postfix); } this.separatorLength = Math.Max(this.options.RecordSeparator?.Length ?? 2, this.options.Separator.Length); this.tokens = new List <string>(); this.token = new StringBuilder(); }