Table of Contents

Class Iso8211DataDescriptiveRecordWriter

Namespace
EncDotNet.Iso8211
Assembly
EncDotNet.Iso8211.dll

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:

  1. 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.
  2. Field name (NAME) — variable-length, terminated by a unit terminator.
  3. Subfield labels (LBLS) — subfield names joined by !, with a * prefix marking the repeating group, terminated by a unit terminator.
  4. 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

int

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

fieldDefinitions IEnumerable<Iso8211FieldDefinition>

The field definitions to encode, in order.

fieldControlLength int

The DDR field control length (number of field-control bytes).

options Iso8211WriterOptions

Optional 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

definition Iso8211FieldDefinition

The field definition to encode.

fieldControlLength int

The DDR field control length (number of field-control bytes).

options Iso8211WriterOptions

Optional writer options. Defaults to Default.

Returns

Iso8211Field

The encoded DDR field. Its data excludes the trailing field terminator.