forked from oguz463/php-gedcom
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
392 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/** | ||
* php-gedcom | ||
* | ||
* php-gedcom is a library for parsing, manipulating, importing and exporting | ||
* GEDCOM 5.5 files in PHP 5.3+. | ||
* | ||
* @author Xiang Ming <wenqiangliu344@gmail.com> | ||
* @copyright Copyright (c) 2010-2013, Xiang Ming | ||
* @package php-gedcom | ||
* @license GPL-3.0 | ||
* @link http://github.com/mrkrstphr/php-gedcom | ||
*/ | ||
|
||
namespace PhpGedcom\Writer\Head; | ||
|
||
/** | ||
* | ||
*/ | ||
class Char | ||
{ | ||
/** | ||
* @param \PhpGedcom\Record\Head\Char $char | ||
* @param string $format | ||
* @param int $level | ||
* @return string | ||
*/ | ||
public static function convert(\PhpGedcom\Record\Head\Char &$char, $level) | ||
{ | ||
$output =""; | ||
// char | ||
$_char = $char->getChar(); | ||
if($_char){ | ||
$output.=$level." CHAR ".$_char."\n"; | ||
}else{ | ||
return $output; | ||
} | ||
|
||
// level up | ||
$level++; | ||
// VERS | ||
$vers = $char->getVersion(); | ||
if($vers){ | ||
$output.=$level." VERS ".$vers."\n"; | ||
} | ||
|
||
|
||
return $output; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
/** | ||
* php-gedcom | ||
* | ||
* php-gedcom is a library for parsing, manipulating, importing and exporting | ||
* GEDCOM 5.5 files in PHP 5.3+. | ||
* | ||
* @author Xiang Ming <wenqiangliu344@gmail.com> | ||
* @copyright Copyright (c) 2010-2013, Xiang Ming | ||
* @package php-gedcom | ||
* @license GPL-3.0 | ||
* @link http://github.com/mrkrstphr/php-gedcom | ||
*/ | ||
|
||
namespace PhpGedcom\Writer\Head; | ||
|
||
/** | ||
* | ||
*/ | ||
class Date | ||
{ | ||
/** | ||
* @param \PhpGedcom\Record\Head\Date $date | ||
* @param string $format | ||
* @param int $level | ||
* @return string | ||
*/ | ||
public static function convert(\PhpGedcom\Record\Head\Date &$date, $level) | ||
{ | ||
$output = ""; | ||
$_date = $date->getDate(); | ||
if($_date){ | ||
$output .=$level." DATE ".$_date."\n"; | ||
}else{ | ||
return $output; | ||
} | ||
|
||
// level up | ||
$level++; | ||
// Time | ||
$time = $date->getTime(); | ||
if($time){ | ||
$output.=$level." TIME ".$time."\n"; | ||
} | ||
|
||
return $output; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* php-gedcom | ||
* | ||
* php-gedcom is a library for parsing, manipulating, importing and exporting | ||
* GEDCOM 5.5 files in PHP 5.3+. | ||
* | ||
* @author Xiang Ming <wenqiangliu344@gmail.com> | ||
* @copyright Copyright (c) 2010-2013, Xiang Ming | ||
* @package php-gedcom | ||
* @license GPL-3.0 | ||
* @link http://github.com/mrkrstphr/php-gedcom | ||
*/ | ||
|
||
namespace PhpGedcom\Writer\Head; | ||
|
||
/** | ||
* | ||
*/ | ||
class Gedc | ||
{ | ||
/** | ||
* @param \PhpGedcom\Record\Head\Gedc $gedc | ||
* @param string $format | ||
* @param int $level | ||
* @return string | ||
*/ | ||
public static function convert(\PhpGedcom\Record\Head\Gedc &$gedc, $level) | ||
{ | ||
$output = $level." GEDC \n"; | ||
|
||
// level up | ||
$level++; | ||
// VERS | ||
$vers = $gedc->getVersion(); | ||
if($vers){ | ||
$output.=$level." VERS ".$vers."\n"; | ||
} | ||
|
||
// FORM | ||
$form = $gedc->getForm(); | ||
if($form){ | ||
$output.=$level." FORM ".$form."\n"; | ||
} | ||
return $output; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/** | ||
* php-gedcom | ||
* | ||
* php-gedcom is a library for parsing, manipulating, importing and exporting | ||
* GEDCOM 5.5 files in PHP 5.3+. | ||
* | ||
* @author Xiang Ming <wenqiangliu344@gmail.com> | ||
* @copyright Copyright (c) 2010-2013, Xiang Ming | ||
* @package php-gedcom | ||
* @license GPL-3.0 | ||
* @link http://github.com/mrkrstphr/php-gedcom | ||
*/ | ||
|
||
namespace PhpGedcom\Writer\Head; | ||
|
||
/** | ||
* | ||
*/ | ||
class Plac | ||
{ | ||
/** | ||
* @param \PhpGedcom\Record\Head\Plac $plac | ||
* @param string $format | ||
* @param int $level | ||
* @return string | ||
*/ | ||
public static function convert(\PhpGedcom\Record\Head\Plac &$plac, $level) | ||
{ | ||
$output = $level." PLAC \n"; | ||
|
||
// level up | ||
$level++; | ||
// FORM | ||
$form = $plac->getForm(); | ||
if($form){ | ||
$output.=$level." FORM ".$form."\n"; | ||
} | ||
|
||
return $output; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.