Exemple #1
0
 public SeparatedValueRecordParser(RetryReader reader, SeparatedValueOptions options)
 {
     this.reader            = reader;
     Options                = options.Clone();
     separatorMatcher       = SeparatorMatcher.GetMatcher(reader, options.Separator);
     recordSeparatorMatcher = SeparatorMatcher.GetMatcher(reader, options.RecordSeparator);
     if (options.RecordSeparator != null && options.RecordSeparator.StartsWith(options.Separator))
     {
         string postfix = options.RecordSeparator.Substring(options.Separator.Length);
         postfixMatcher = SeparatorMatcher.GetMatcher(reader, postfix);
     }
     separatorLength = Math.Max(Options.RecordSeparator?.Length ?? 2, Options.Separator.Length);
 }
Exemple #2
0
 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();
 }
Exemple #3
0
 public SeparatorRecordReader(TextReader reader, string separator)
 {
     this.reader  = new RetryReader(reader);
     this.matcher = SeparatorMatcher.GetMatcher(this.reader, separator);
     this.builder = new StringBuilder();
 }