Internal rework pending editframe
This commit is contained in:
@@ -2,11 +2,22 @@
|
||||
|
||||
namespace App\Classes;
|
||||
|
||||
/**
|
||||
* The Frame Parser looks into frames for ESC codes that renders dynamic information
|
||||
*/
|
||||
abstract class Parser
|
||||
{
|
||||
protected $content = '';
|
||||
protected $startline = 0;
|
||||
public $fields = NULL;
|
||||
// Fields in the frame
|
||||
public $fields = [];
|
||||
|
||||
// Parsed frame, ready to send to client
|
||||
public $output = '';
|
||||
|
||||
// Position array of frame control chars
|
||||
protected $frame_data = [];
|
||||
|
||||
// Position array of frame chars
|
||||
protected $frame_content = [];
|
||||
|
||||
// Magic Fields that are pre-filled
|
||||
protected $fieldmap = [
|
||||
@@ -14,17 +25,16 @@ abstract class Parser
|
||||
'd'=>'%date',
|
||||
];
|
||||
|
||||
public function __construct(string $content,int $startline=1)
|
||||
public function __construct(string $content,int $width,int $startline=1)
|
||||
{
|
||||
$this->content = $content;
|
||||
$this->startline = $startline;
|
||||
$this->fields = collect();
|
||||
$this->output = $this->parse($startline,$content,$width);
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->parse($this->startline);
|
||||
return $this->output;
|
||||
}
|
||||
|
||||
abstract protected function parse($startline): string;
|
||||
abstract protected function parse(int $startline,string $content,int $width): string;
|
||||
}
|
Reference in New Issue
Block a user