Korin API

RecordReader
in package

FinalYes

Splits a file read in chunks into the bytes of its records, without parsing them: where {@see Parser} would start a record, so each piece parses as that record. Lines before the first GEDCOM line are pieces of their own, as the parser makes them records. The encoding is detected on the first 64 KB, as {@see EncodingDetector} does on a whole file.

Table of Contents

Methods

__construct()  : mixed
detection()  : Detection
Detects the encoding on the first bytes, reading them if needed.
lineEnding()  : string
The dominant line terminator so far, decoded; "\n" before the first one.
records()  : Generator<int, array{string, int, int, ?string, string}>

Methods

lineEnding()

The dominant line terminator so far, decoded; "\n" before the first one.

public lineEnding() : string
Return values
string

records()

public records() : Generator<int, array{string, int, int, ?string, string}>
Return values
Generator<int, array{string, int, int, ?string, string}> —

bytes of a record, its offset from where the handle was (a BOM included), first line, xref and tag (decoded; tag '' for a line that is not a GEDCOM line)

On this page

Search results