10f471f91SGreg Roach<?php 20f471f91SGreg Roach/** 30f471f91SGreg Roach * webtrees: online genealogy 40f471f91SGreg Roach * Copyright (C) 2018 webtrees development team 50f471f91SGreg Roach * This program is free software: you can redistribute it and/or modify 60f471f91SGreg Roach * it under the terms of the GNU General Public License as published by 70f471f91SGreg Roach * the Free Software Foundation, either version 3 of the License, or 80f471f91SGreg Roach * (at your option) any later version. 90f471f91SGreg Roach * This program is distributed in the hope that it will be useful, 100f471f91SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 110f471f91SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 120f471f91SGreg Roach * GNU General Public License for more details. 130f471f91SGreg Roach * You should have received a copy of the GNU General Public License 140f471f91SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 150f471f91SGreg Roach */ 16e7f56f2aSGreg Roachdeclare(strict_types=1); 17e7f56f2aSGreg Roach 180f471f91SGreg Roachnamespace Fisharebest\Webtrees; 190f471f91SGreg Roach 200f471f91SGreg Roach/** 210f471f91SGreg Roach * GEDCOM 5.5.1 specification 220f471f91SGreg Roach */ 23c1010edaSGreg Roachclass Gedcom 24c1010edaSGreg Roach{ 250f471f91SGreg Roach // Use MSDOS style line endings, for maximum compatibility. 260f471f91SGreg Roach const EOL = "\r\n"; 270f471f91SGreg Roach 280f471f91SGreg Roach // 255 less the EOL character. 290f471f91SGreg Roach const LINE_LENGTH = 253; 30*8d0ebef0SGreg Roach 31*8d0ebef0SGreg Roach // Gedcom tags which indicate the start of life. 32*8d0ebef0SGreg Roach const BIRTH_EVENTS = ['BIRT', 'CHR', 'BAPM', 'ADOP']; 33*8d0ebef0SGreg Roach 34*8d0ebef0SGreg Roach // Gedcom tags which indicate the end of life. 35*8d0ebef0SGreg Roach const DEATH_EVENTS = ['DEAT', 'BURI', 'CREM']; 36*8d0ebef0SGreg Roach 37*8d0ebef0SGreg Roach // Gedcom tags which indicate the start of a relationship. 38*8d0ebef0SGreg Roach const MARRIAGE_EVENTS = ['MARR', '_NMR']; 39*8d0ebef0SGreg Roach 40*8d0ebef0SGreg Roach // Gedcom tags which indicate the end of a relationship. 41*8d0ebef0SGreg Roach const DIVORCE_EVENTS = ['DIV', 'ANUL', '_SEPR']; 42*8d0ebef0SGreg Roach 43*8d0ebef0SGreg Roach // Regular expression to match a GEDCOM tag. 44*8d0ebef0SGreg Roach const REGEX_TAG = '[_A-Z][_A-Z0-9]*'; 45*8d0ebef0SGreg Roach 46*8d0ebef0SGreg Roach // Regular expression to match a GEDCOM XREF. 47*8d0ebef0SGreg Roach const REGEX_XREF = '[A-Za-z0-9:_-]+'; 48*8d0ebef0SGreg Roach 49*8d0ebef0SGreg Roach // UTF-8 encoded files may begin with an optional byte-order-mark (U+FEFF). 50*8d0ebef0SGreg Roach const UTF8_BOM = "\xEF\xBB\xBF"; 51*8d0ebef0SGreg Roach 520f471f91SGreg Roach} 53