Class Iso8211DataDescriptiveRecordReader
Parses the Data Descriptive Record (DDR) of an ISO 8211 document and produces a strongly-typed Iso8211DataDescriptiveRecord.
public static class Iso8211DataDescriptiveRecordReader
- Inheritance
-
Iso8211DataDescriptiveRecordReader
- Inherited Members
Remarks
The DDR is the first record in an ISO 8211 file and has a leader identifier of 'L'.
Each field in the DDR (except the reserved tag "0000") describes the structure and format
of a corresponding field in data records.
Each DDR field's data contains:
-
Field controls — The first bytes (length specified by the record leader's
FieldControlLength) contain the data structure code and data type code. -
Field name and subfield descriptors — Following the field controls, a unit-terminator-delimited
section contains the field name and subfield names (separated by
!for vectors or*for repeating groups). -
Format controls — After the subfield descriptors, a format string (e.g.,
(A,I(10),b11)) describes the encoding of each subfield.
Methods
GetDdrFieldDefinition(int)
Gets (or creates and caches) an Iso8211FieldDefinition that describes the internal structure of any DDR field entry for the given field control length.
public static Iso8211FieldDefinition GetDdrFieldDefinition(int fieldControlLength)
Parameters
fieldControlLengthintThe field control length from the DDR leader.
Returns
- Iso8211FieldDefinition
An Iso8211FieldDefinition describing the DDR's own field structure.
Remarks
Since the DDR is itself a standard ISO 8211 record, its fields follow a known structure defined by the ISO 8211 standard. This method returns a meta-DDR field definition — a single definition that describes the layout shared by all DDR fields — enabling the use of Iso8211FieldReader to parse DDR field data.
Every DDR field has the same internal layout, determined solely by
fieldControlLength:
- Field controls (fixed-width, size determined by
fieldControlLength): data structure code (1 byte) and data type code (1 byte), plus any additional control bytes. - Field name / descriptors (variable-length, unit-terminated).
- Subfield labels or array descriptor (variable-length, unit-terminated).
- Format controls (variable-length, terminated by end of field).
The returned definition is cached by fieldControlLength, so repeated
calls with the same value return the same instance without additional allocations.
Read(Iso8211Record)
Parses an Iso8211Record that represents a DDR and returns a strongly-typed Iso8211DataDescriptiveRecord.
public static Iso8211DataDescriptiveRecord Read(Iso8211Record record)
Parameters
recordIso8211RecordThe ISO 8211 record to parse. Must be a DDR (leader identifier
'L').
Returns
- Iso8211DataDescriptiveRecord
The parsed DDR containing all field definitions.
Exceptions
- ArgumentException
Thrown when the record is not a DDR.