| 1 | package Ftree::FamilyTreeDataFactory; | ||||||||||
| 2 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use version; our $VERSION = qv('2.3.41'); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 4 | ▶ | use v5.10.1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 4 | ▶ | use experimental 'smartmatch'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 2 | ▶ | sub getFamilyTree { | ||||||||
|
Subroutine
getFamilyTree: called CC=2 SCAR=11.6
Pod
undocumented
| |||||||||||
| 9 | 2 | my ($config) = @_; | |||||||||
| 10 | 2 | my $type = $config->{type}; | |||||||||
| 11 | 2 | ▶ | $type = 'csv' if ( $type eq 'txt' ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | |||||||||||
| 13 | 2 | given ($type) { | |||||||||
| 14 | 2 | when (/\bcsv\b/) { | |||||||||
| 15 | 0 | require Ftree::DataParsers::ExtendedSimonWardFormat; | |||||||||
| 16 | return | ||||||||||
| 17 | Ftree::DataParsers::ExtendedSimonWardFormat::createFamilyTreeDataFromFile( | ||||||||||
| 18 | 0 | $config->{config} ); | |||||||||
| 19 | } | ||||||||||
| 20 | 2 | when (/\bexcel\b/) { | |||||||||
| 21 | 2 | require Ftree::DataParsers::ExcelFormat; | |||||||||
| 22 | return | ||||||||||
| 23 | Ftree::DataParsers::ExcelFormat::createFamilyTreeDataFromFile( | ||||||||||
| 24 | 2 | $config->{config} ); | |||||||||
| 25 | } | ||||||||||
| 26 | 0 | when (/\bexcelx\b/) { | |||||||||
| 27 | 0 | require Ftree::DataParsers::ExcelxFormat; | |||||||||
| 28 | return | ||||||||||
| 29 | Ftree::DataParsers::ExcelxFormat::createFamilyTreeDataFromFile( | ||||||||||
| 30 | 0 | $config->{config} ); | |||||||||
| 31 | } | ||||||||||
| 32 | 0 | when (/\bser\b/) { | |||||||||
| 33 | 0 | require Ftree::DataParsers::SerializerFormat; | |||||||||
| 34 | return | ||||||||||
| 35 | Ftree::DataParsers::SerializerFormat::createFamilyTreeDataFromFile( | ||||||||||
| 36 | 0 | $config->{config} ); | |||||||||
| 37 | } | ||||||||||
| 38 | 0 | when (/\bgedcom\b/) { | |||||||||
| 39 | 0 | require Ftree::DataParsers::GedcomFormat; | |||||||||
| 40 | return | ||||||||||
| 41 | Ftree::DataParsers::GedcomFormat::createFamilyTreeDataFromFile( | ||||||||||
| 42 | 0 | $config->{config} ); | |||||||||
| 43 | } | ||||||||||
| 44 | 0 | when (/\bdbi\b/) { | |||||||||
| 45 | 0 | require Ftree::DataParsers::DBIFormat; | |||||||||
| 46 | return Ftree::DataParsers::DBIFormat::getFamilyTreeData( | ||||||||||
| 47 | 0 | $config->{config} ); | |||||||||
| 48 | } | ||||||||||
| 49 | 0 | default { die "Unknown type: $type" } | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 0 | return; | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | 4 | 1; | |||||||||