summaryrefslogtreecommitdiffhomepage
path: root/dlang/src/ocda/dump.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2026-09-29 14:07:32 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2026-10-02 21:38:40 -0400
commit597d73db60679b8ed13524f9dd3832bb7476038f (patch)
tree8f2dd7a6fcdb0cd5c3e341cfcbda73e0a8a4a1df /dlang/src/ocda/dump.d
parentimages from the source, and the epub segment fields (diff)
model 2.1: ocn_range, the verses a poem holds
The format now states, for a container, the first and last ocn of what it holds: .ocn_range in the .ssp, ocn_range_first and ocn_range_last in the .ocda.db. A poem is the one container, and since 2.1 it carries ocn 0 and comes before its verses. Both fields in the model, read by both loaders, in both languages, and written by the dump. A 2.0 database has neither column, so each loader asks sqlite whether it is there and reads a 2.0 file as having no ranges, which is what 2.0 meant; checked on a published 2.0 database, D and Gleam giving the same dump. Over the 36 document-languages written by spine at 2.1, the four dumps (D and Gleam, .ssp and .ocda.db) are byte identical, 36 of 36. (assisted by Claude-Code)
Diffstat (limited to 'dlang/src/ocda/dump.d')
-rw-r--r--dlang/src/ocda/dump.d2
1 files changed, 2 insertions, 0 deletions
diff --git a/dlang/src/ocda/dump.d b/dlang/src/ocda/dump.d
index 7a4f11a..58d87ff 100644
--- a/dlang/src/ocda/dump.d
+++ b/dlang/src/ocda/dump.d
@@ -83,6 +83,8 @@ string dumpDocument(ref OcdaDocument doc) {
kv("segment_epub_is", obj.segment_epub_is);
kn("parent", obj.parent_ocn);
kn("last_descendant", obj.last_descendant_ocn);
+ kn("ocn_range_first", obj.ocn_range_first);
+ kn("ocn_range_last", obj.ocn_range_last);
kv("children", ints(obj.children));
kv("ancestors", ints(obj.ancestors));
kb("dummy", obj.dummy_heading);