Crate gedcom

Source
Expand description

A parser for GEDCOM files

use gedcom::parser::Parser;

// the parser takes the gedcom file contents as a chars iterator
let gedcom_source = std::fs::read_to_string("./tests/fixtures/sample.ged").unwrap();

let mut parser = Parser::new(gedcom_source.chars());
let gedcom_data = parser.parse_record();

// output some stats on the gedcom contents
gedcom_data.stats();

This crate contains an optional "json" feature that implements serialization & deserialization to json with serde.

Modules§

parser
The state machine that parses a char iterator of the gedcom’s contents
tokenizer
Handles the tokenization of a GEDCOM file
types
Structs and datatypes used to represent facts and data in a Gedcom file

Macros§

fmt_optional_value
Macro for displaying Options in debug mode without the text wrapping.

Structs§

GedcomData
The data structure representing all the data within a gedcom file

Functions§

parse
Helper function for converting GEDCOM file content stream to parsed data.