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); } }
/// <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(); }
/// <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; }
/// <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(); }
public FixedLengthRecordWriter(TextWriter writer, FixedLengthSchema schema, FixedLengthOptions options) { this.writer = writer; this.schema = schema; this.options = options.Clone(); }
/// <summary> /// Initializes a new FixedLengthComplexColumn with the given schema and default options. /// </summary> /// <param name="columnName">The name of the column.</param> /// <param name="schema">The schema of the data embedded in the column.</param> public FixedLengthComplexColumn(string columnName, FixedLengthSchema schema) : this(columnName, schema, new FixedLengthOptions()) { }