NAME
Gedcom::Record - a class to manipulate Gedcom records
Version 1.01 - 27th April 1999
SYNOPSIS
use Gedcom::Record;
return 0 unless $self->parse($record, $structures, $grammar, $callback)
$record->collect_xrefs($callback)
$record->resolve_xrefs($callback)
my $xref = $self->resolve_xref($self->{value})
my @famc = $self->resolve($self->child_values("FAMC"))
return 0 unless $child->validate($self->{record}, $callback);
$record->renumber($xrefs, $callback, $f, $i)
my $child = $record->child_value("NAME");
my @children = $record->child_values("CHIL");
print $record->summary, "\n";
DESCRIPTION
A selection of subroutines to handle records in a gedcom file.
Derived from Gedcom::Item.
HASH MEMBERS
Some of the more important hash members are:
$record->{new_xref}
The new xref of the record. Used by renumber().
METHODS
parse
return 0 unless $self->parse($record, $structures, $grammar, $callback)
Parse a Gedcom record.
Match a Gedcom::Record against a Gedcom::Grammar. Warn of any mismatches, and associate the Gedcom::Grammar with the Gedcom::Record as $self->{grammar}. Do this recursively.
collect_xrefs
$record->collect_xrefs($callback)
Recursively collect all the xrefs. Called by Gedcom::collect_xrefs. $callback is not used yet.
resolve_xrefs
$record->resolve_xrefs($callback)
Recursively changes all xrefs to reference the record they are pointing to. Like changing a soft link to a hard link on a Unix filesystem. Called by Gedcom::resolve_xrefs. $callback is not used yet.
resolve_xref
my $xref = $self->resolve_xref($value)
Return the record $value points to, or undef.
resolve
my @famc = $self->resolve $self->child_values("FAMC")
For each argument, either return it or, if it an xref, return the referenced record.
validate
return 0 unless $child->validate($self->{record}, $callback);
Validate the Gedcom::Record. This performs a number of consistency checks, but could do even more. $callback is not used yet.
Returns true iff the Record is valid.
renumber
$record->renumber($xrefs, $callback, $f, $i)
Renumber the record.
As a record is renumbered, it is assigned the next available number. Families start with the number $f. Individuals are assigned the number $i. $f and $i are passed by reference. The husband, wife and children are then renumbered. This helps to ensure that families are numerically close together.
child_value
my $child = $record->child_value("NAME");
Return the value of the specified child, or undef if the child could not be found. Calls get_child().
child_values
my @children = $record->child_values("CHIL");
Return a list of the values of the specified children. Calls get_children().
summary
print $record->summary, "\n";
Return a line of text summarising the record.