コード例 #1
0
 public FixedLengthRecordParser(TextReader reader, FixedLengthSchema schema, FixedLengthOptions options)
 {
     if (options.HasRecordSeparator)
     {
         this.recordReader = new SeparatorRecordReader(reader, options.RecordSeparator);
     }
     else
     {
         this.recordReader = new FixedLengthRecordReader(reader, schema.TotalWidth);
     }
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new FixedLengthComplexColumn with the given schema and options.
 /// </summary>
 /// <param name="columnName">The name of the column.</param>
 /// <param name="schema">The schema of the data embedded in the column.</param>
 /// <param name="options">The options to use when parsing the embedded data.</param>
 public FixedLengthComplexColumn(string columnName, FixedLengthSchema schema, FixedLengthOptions options)
     : base(columnName)
 {
     if (schema == null)
     {
         throw new ArgumentNullException("schema");
     }
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     this.schema  = schema;
     this.options = options.Clone();
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new FixedLengthBuilder with the given schema.
 /// </summary>
 /// <param name="writer">A writer over the fixed-length document.</param>
 /// <param name="schema">The schema of the fixed-length document.</param>
 /// <param name="options">The options used to format the output.</param>
 /// <exception cref="ArgumentNullException">The writer is null.</exception>
 /// <exception cref="ArgumentNullException">The schema is null.</exception>
 public FixedLengthWriter(TextWriter writer, FixedLengthSchema schema, FixedLengthOptions options = null)
 {
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     if (schema == null)
     {
         throw new ArgumentNullException("schema");
     }
     if (options == null)
     {
         options = new FixedLengthOptions();
     }
     this.recordWriter = new FixedLengthRecordWriter(writer, schema, options);
     this.isFirstLine  = true;
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new FixedLengthReader with the given schema.
 /// </summary>
 /// <param name="reader">A reader over the fixed-length document.</param>
 /// <param name="schema">The schema of the fixed-length document.</param>
 /// <param name="options">The options controlling how the fixed-length document is read.</param>
 /// <exception cref="ArgumentNullException">The reader is null.</exception>
 /// <exception cref="ArgumentNullException">The schema is null.</exception>
 public FixedLengthReader(TextReader reader, FixedLengthSchema schema, FixedLengthOptions options = null)
 {
     if (reader == null)
     {
         throw new ArgumentNullException("reader");
     }
     if (schema == null)
     {
         throw new ArgumentNullException("schema");
     }
     if (options == null)
     {
         options = new FixedLengthOptions();
     }
     parser       = new FixedLengthRecordParser(reader, schema, options);
     this.schema  = schema;
     this.options = options.Clone();
 }
コード例 #5
0
 public FixedLengthRecordWriter(TextWriter writer, FixedLengthSchema schema, FixedLengthOptions options)
 {
     this.writer  = writer;
     this.schema  = schema;
     this.options = options.Clone();
 }