Class Iso8211DataDescriptiveRecordWriter
Encodes Data Descriptive Record (DDR) field definitions into ISO 8211 field data.
public static class Iso8211DataDescriptiveRecordWriter
- Inheritance
-
Iso8211DataDescriptiveRecordWriter
- Inherited Members
Remarks
This type is the symmetric inverse of Iso8211DataDescriptiveRecordReader. It emits each field definition using the canonical two-unit-terminator layout that the reader parses back into an equivalent Iso8211FieldDefinition:
- Field controls — the data structure code and data type code as single digits, followed by filler bytes up to the DDR's field control length.
- Field name (
NAME) — variable-length, terminated by a unit terminator. - Subfield labels (
LBLS) — subfield names joined by!, with a*prefix marking the repeating group, terminated by a unit terminator. - Format controls (
FMTS) — the format controls string (e.g.(b11,b14)).
The resulting fields are assembled into a DDR record (leader identifier 'L') that can be
serialized with Iso8211DocumentWriter.
Fields
DefaultFieldControlLength
The default field control length used for DDR records when none is specified.
public const int DefaultFieldControlLength = 6
Field Value
Methods
BuildDdr(IEnumerable<Iso8211FieldDefinition>, int, Iso8211WriterOptions?)
Builds a complete DDR Iso8211Record from a set of field definitions.
public static Iso8211Record BuildDdr(IEnumerable<Iso8211FieldDefinition> fieldDefinitions, int fieldControlLength = 6, Iso8211WriterOptions? options = null)
Parameters
fieldDefinitionsIEnumerable<Iso8211FieldDefinition>The field definitions to encode, in order.
fieldControlLengthintThe DDR field control length (number of field-control bytes).
optionsIso8211WriterOptionsOptional writer options. Defaults to Default.
Returns
- Iso8211Record
A DDR record (leader identifier
'L').
EncodeFieldDefinition(Iso8211FieldDefinition, int, Iso8211WriterOptions?)
Encodes a single field definition into a DDR Iso8211Field.
public static Iso8211Field EncodeFieldDefinition(Iso8211FieldDefinition definition, int fieldControlLength = 6, Iso8211WriterOptions? options = null)
Parameters
definitionIso8211FieldDefinitionThe field definition to encode.
fieldControlLengthintThe DDR field control length (number of field-control bytes).
optionsIso8211WriterOptionsOptional writer options. Defaults to Default.
Returns
- Iso8211Field
The encoded DDR field. Its data excludes the trailing field terminator.