Internal rework pending editframe

This commit is contained in:
Deon George
2019-07-12 10:42:01 +07:00
parent 4f79a1a997
commit 264747e2f3
14 changed files with 611 additions and 428 deletions

View File

@@ -2,12 +2,14 @@
namespace App\Classes\Frame;
use App\Classes\Parser;
use Illuminate\Support\Facades\Log;
use App\Classes\Frame as AbstractFrame;
use App\Classes\Frame;
use App\Classes\Parser\Ansi as AnsiParser;
use App\Models\Frame as FrameModel;
class Ansi extends AbstractFrame
class Ansi extends Frame
{
public static $frame_length = 22;
public static $frame_width = 80;
@@ -19,7 +21,7 @@ class Ansi extends AbstractFrame
public static $if_filler = '.';
public function __construct(\App\Models\Frame $o,string $msg='')
public function __construct(FrameModel $o,string $msg='')
{
parent::__construct($o);
@@ -28,15 +30,12 @@ class Ansi extends AbstractFrame
$this->output .= ESC.'[24;0f'.$msg.HOME;
}
public function fields($startline=1)
protected function parser(int $startline): Parser
{
$o = new AnsiParser($this->frame->content,$startline);
$this->output .= (string)$o;
$this->fields = $o->fields;
return new AnsiParser($this->fo->content,self::$frame_width,$startline);
}
public function strlenv($text):int {
public static function strlenv($text):int {
return strlen($text ? preg_replace('/'.ESC.'\[[0-9;?]+[a-zA-Z]/','',$text) : $text);
}
}