Expand description
dBASE III+/IV table reader for .dbf attribute sidecars.
§Layout (header)
| Bytes | Field |
|---|---|
| 0 | Version flags |
| 1..4 | Last-update YY MM DD |
| 4..8 | Number of records (u32 LE) |
| 8..10 | Header length in bytes (u16 LE) |
| 10..12 | Record length in bytes (u16 LE) |
| 29 | Language Driver ID (codepage hint) |
Then (header_length - 32 - 1) / 32 field descriptors of 32 bytes each,
terminated by 0x0D. Each record starts with a 1-byte deletion flag
(0x20 active, 0x2A deleted) and is followed by fixed-width field
values.
§v0.1 field type coverage
CCharacter — UTF-8/ASCII trimmed, →Value::StringNNumeric (ASCII digits) — parsed toValue::Int64if no decimals, elseValue::Float64FFloat (ASCII) —Value::Float64DDate (YYYYMMDD) —Value::DateTime(days since 1899-12-30)LLogical (T/F/Y/N/?) —Value::Bool, blank or?→Value::Null- Anything else (
Mmemo,B,G,OLE, …) →Value::Null
§Encoding
v0.1 assumes ASCII / UTF-8 input. Real .cpg / LDID handling is
deferred to v0.2 — until then non-UTF-8 strings come through with
invalid bytes replaced.
Structs§
Functions§
- build_
schema - Build a
Schemafrom the DBF header + a geometry-column descriptor for the companion.shp. - decode_
field - Decode the value of a single field within a record.
record_bytesincludes the 1-byte deletion flag at index 0. - field_
to_ def - Map a DBF field to a core
FieldDef. - parse_
header