Skip to content

IFileConfiguration

IFileConfiguration is the resolved, runtime layout contract consumed by FileReader<TRecord> and FileWriter<TRecord> to discover a record type's format, header handling, trim behavior, and per-property layouts (BR-001, BR-002, BR-003). Implementations are produced either by reflecting over FormatBase-derived attributes on a record type or by the fluent API on FileConfiguration<T>.

Purpose

  • Declares whether a configuration is the default one to use when a caller does not request a specific format (BR-001, BR-002).
  • Declares whether the first data row is a header row to be skipped on read (BR-006).
  • Declares the field-level trim behavior applied when reading values (BR-004).
  • Exposes the ordered, direction-filtered layout collections (Layouts, WritableLayouts, ReadableLayouts) that the reader/writer iterate to map file fields to/from record properties.

Context

  • Namespace: SAIF.Common.Files
  • Assembly/package: SAIF.Framework.Common.Files

Public members

Member Signature Purpose
IsDefault bool IsDefault { get; set; } Marks this configuration as the one used when a caller requests no specific format (BR-001).
HasHeaderRecord bool HasHeaderRecord { get; set; } Indicates the file's first record is a header line to be skipped on read and emitted on write (BR-006).
Format FileFormats Format { get; set; } The layout strategy (CSV, Fixed, TabDelimited, Delimited, MultipleRecord) this configuration represents.
Delimiter string Delimiter { get; set; } The field-separator string used for delimited/CSV/tab-delimited formats.
TrimAll bool TrimAll { get; set; } Controls whether parsed field values are trimmed of surrounding whitespace (BR-004).
RecordProperty PropertyInfo RecordProperty { get; set; } The property that receives the raw, unparsed line value, used for Record-derived types (BR-011).
IndexProperty PropertyInfo IndexProperty { get; set; } The property that receives the record's sequential position within the file.
IsRecordBase bool IsRecordBase { get; set; } Indicates the target record type derives from Record, driving raw-line binding instead of per-property layout mapping (BR-011).
Layouts List<FileRecordLayout> Layouts { get; } The full, unfiltered set of per-property layouts declared for this configuration.
WritableLayouts IEnumerable<FileRecordLayout> WritableLayouts { get; } The layouts eligible for output, ordered by position (fixed format) or element (delimited formats), consumed by FileWriter<TRecord> (BR-015).
ReadableLayouts IEnumerable<FileRecordLayout> ReadableLayouts { get; } The layouts eligible for input, ordered by position (fixed format) or element (delimited formats), consumed by FileReader<TRecord> (BR-012).

Behavioral notes

  • FileConfiguration is the concrete class implementing this interface for both attribute-discovered and fluent code-first configurations produced by FileConfiguration<T>.

Sources

  • Common\SAIF.Common.Files\Core\Configurations\IFileConfiguration.cs