Skip to content

ArmidaleSoftware/gedcom7

Repository files navigation

GEDCOM 7 Library

This repository contains code for doing FamilySearch GEDCOM 7 operations on Windows. It contains:

  • Gedcom7 - a project that builds a GEDCOM parser library.
  • GedCompare - a project that builds a command-line interface that uses the above library to do file comparison.
  • GedValidate - a project that builds a command-line interface that uses the above library to do file validation.

The same Gedcom7 library is used by the online web site tools:

Prerequisites

  • Windows 10 or above
  • Visual Studio 2022, any edition (the free Community edition will do)

GedValidate Command-line Tool Usage

GedValidate.exe is a command-line tool usable as follows.

usage: GedValidate <filename>
          to check a file as being a valid FamilySearch GEDCOM 7 or GEDZIP file

The filename should end in .ged or .gdz.

GedCompare Command-line Tool Usage

GedCompare.exe is a command-line tool usable as follows.

usage: GedCompare <filename1> <filename2>
          to simply compare two GEDCOM files
       GedCompare <filename>
          to generate a FamilySearch GEDCOM 7 compatibility report

For example to check GEDCOM 7 compatibility, filename1 should be the maximal70.ged file from the Tests/samples directory, and filename2 should be a file generated by importing maximal70.ged into some other program and then exporting it as FamilySearch GEDCOM 7.

Gedcom7 library Usage

The GEDCOM7 parser library can be used as follows.

Loading a GEDCOM file from disk

GedcomFile gedcomFile = new GedcomFile();
List<string> errors = gedcomFile.LoadFromPath(fileName);
if (errors.Count > 0) {
    // ... handle file errors ...
}

Loading a GEDCOM file from memory

GedcomFile gedcomFile = new GedcomFile();
List<string> errors = gedcomFile.LoadFromString(text);
if (errors.Count > 0) {
    // ... handle file errors ...
}

Validating a GEDCOM file according to the FamilySearch GEDCOM 7 schema

List<string> errors = file.Validate();
if (errors.Count > 0) {
    // ... handle validation errors ...
}

Compare two GEDCOM files

GedcomFile gedcomFile1 = ...
GedcomFile gedcomFile2 = ...
GedcomComparisonReport report = gedcomFile1.Compare(gedcomFile2);
// ... use report.StructuresAdded, report.StructuresRemoved, etc. ...

Test GEDCOM 7 compatibility

GedcomFile gedcomFile = ...
GedcomCompatibilityReport report = new GedcomCompatibilityReport(gedcomFile);
// ... use various members of report ...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors