Home

Awesome

README

Note: Functionality is basically all there, but API is not frozen yet, so be careful if you use it, and let me know if certain methods are needed.

A number of classes to ease GEDCOM 5.5-manipulation in Cocoa through layers of abstraction. The intent is to hide the GEDCOM specifics, but to allow access if required.

A short summary of the functionality follows:

Additionally two application targets are included:

Version history

0 HEAD
1 SOUR Gedcom.framework
2 VERS 0.9.4
2 NAME Gedcom.framework
2 CORP Mikkel Eide Eriksen
3 ADDR http://github.com/mikkelee/Gedcom-Framework

TODO

The most important remaining issues, loosely prioritized in order of importance:

Additionally there are at times a few minor TODOs scattered around the source files.

Examples

Showing some different ways to add attributes to an object:

    // Create a context.
	GCContext *ctx = [GCContext context];
	
    // Create an individual entity in the context.
    GCIndividualRecord *indi = [GCIndividualRecord individualInContext:ctx];
    
    // Create an array of names and add them to the individual under "personalNames".
    [indi addAttributeWithType:@"personalNames" values:
     [GCNamestring valueWithGedcomString:@"Jens /Hansen/"],
     [GCNamestring valueWithGedcomString:@"Jens /Hansen/ Smed"],
     nil];
    
    // Create a birth attribute, give it a date attribute and add it to the individual.
	GCBirthAttribute *birt = [GCBirthAttribute birth];
    
	[birt addAttributeWithType:@"date" value:[GCDate valueWithGedcomString:@"1 JAN 1901"]];
    
    [indi.mutableProperties addObject:birt];
    
    [indi addAttributeWithType:@"deaths" value:[GCBool yes]];

The above is equivalent to the following GCNode:

    GCNode *node = [GCNode nodeWithTag:@"INDI"
                                  xref:@"@INDI1@"
                              subNodes:@[
                                        [GCNode nodeWithTag:@"NAME"
                                                      value:@"Jens /Hansen/"],
                                        [GCNode nodeWithTag:@"NAME"
                                                      value:@"Jens /Hansen/ Smed"],
                                        [GCNode nodeWithTag:@"BIRT"
                                                      value:nil
                                                   subNodes:@[ [GCNode nodeWithTag:@"DATE"
                                                                             value:@"1 JAN 1901"] ]],
                                        [GCNode nodeWithTag:@"DEAT" 
                                                      value:@"Y"],
                                        ]];

And both are equivalent to the following Gedcom string:

0 @INDI1@ INDI
1 NAME Jens /Hansen/
1 NAME Jens /Hansen/ Smed
1 BIRT
2 DATE 1 JAN 1901
1 DEAT Y

Similarly, for relationships, the following:

	GCContext *ctx = [GCContext context];
	
	GCIndividualRecord *husb = [GCIndividualRecord individualInContext:ctx];
	[husb addAttributeWithType:@"personalName" value:[GCNamestring valueWithGedcomString:@"Jens /Hansen/"]];
	[husb addAttributeWithType:@"sex" value:[GCGender maleGender]];
	
	GCIndividualRecord *wife = [GCIndividualRecord individualInContext:ctx];
	[wife addAttributeWithType:@"personalName" value:[GCNamestring valueWithGedcomString:@"Anne /Larsdatter/"]];
	[wife addAttributeWithType:@"sex" value:[GCGender femaleGender]];
	
	GCIndividualRecord *chil = [GCIndividualRecord individualInContext:ctx];
	[chil addAttributeWithType:@"personalName" value:[GCNamestring valueWithGedcomString:@"Hans /Jensen/"]];
	[chil addAttributeWithType:@"sex" value:[GCGender maleGender]];
	
    GCFamilyRecord *fam = [GCFamilyRecord familyInContext:ctx];
    
	[fam addRelationshipWithType:@"husband" target:husb];
	[fam addRelationshipWithType:@"wife" target:wife];
	[fam addRelationshipWithType:@"child" target:chil];
    
    // alternately:
	// [husb addRelationshipWithType:@"spouseInFamily" target:fam];
	// [wife addRelationshipWithType:@"spouseInFamily" target:fam];
	// [chil addRelationshipWithType:@"childInFamily" target:fam];

is equivalent to:

0 @FAM1@ FAM
1 HUSB @INDI1@
1 WIFE @INDI2@
1 CHIL @INDI3@
0 @INDI1@ INDI
1 NAME Jens /Hansen/
1 SEX M
1 FAMS @FAM1@
0 @INDI2@ INDI
1 NAME Anne /Larsdatter/
1 SEX F
1 FAMS @FAM1@
0 @INDI3@ INDI
1 NAME Hans /Jensen/
1 SEX M
1 FAMC @FAM1@

======

Test files used to verify GEDCOM compliance are from Heiner Eichmann's GEDCOM 5.5 Sample Page and GEDitCOM's GEDCOM 5.5 Torture Test Files page — with minor modifications to facilitate testing: