Added ANSI parsers and rendering ANSI frames

This commit is contained in:
Deon George
2018-12-14 00:02:42 +11:00
parent e0306908bd
commit 6cc793c47f
14 changed files with 333 additions and 119 deletions

View File

@@ -15,4 +15,17 @@ class FrameFields
{
return array_get($this->fields,$key);
}
public function output(string $filler)
{
switch ($this->type) {
case 'd':
$out = date('D d M H:ia');
return substr($out.($this->length > strlen($out) ? str_repeat($filler,$this->length-strlen($out)) : ''),0,$this->length);
default:
return str_repeat($filler,$this->length);
}
}
}