Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding individuals to a family should create corresponding FAMS/FAMC nodes. #309

Open
jazzboME opened this issue May 4, 2020 · 1 comment

Comments

@jazzboME
Copy link
Contributor

jazzboME commented May 4, 2020

I've been working on doing some simple GEDCOM file creation and I was noticing that with routines like AddFamilyWithHusbandAndWife() I wasn't ending up with FAMS nodes on the individuals. (Compare F6 at http://wiki-en.genealogy.net/GEDCOM/FAM-Tag#Agreements_for_FAM)

I'm working on a pull request to add that support initially to (node *FamilyNode) SetHusband() and (node *FamilyNode) SetWife() and I'll look at AddChild() after that.

While I'm working on this, I'm finding the need to duplicate the pattern of
fmt.Sprintf("@%s@", node.Pointer()) in various places.

So a) okay if I tackle this issue with adding the FAMS/FAMC in the individual nodes?

and b) I'm wondering as part of working on this, if it is worthwhile to add another method that return a node pointer pre-formatted with the @ signs? Something like:

// Identifier returns the "@...@" identifier for the node; empty string if the node is nil
func (node *SimpleNode) Identifier() string {
	if node == nil {
		return ""
	}
	
	return fmt.Sprintf("@%s@", node.pointer)
}
@elliotchance
Copy link
Owner

I suppose adding that method would be acceptable since it's part of the standard for all nodes.

Families are tricky, so you surely have found a bug. Any patch you can submit will be appreciated. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants