Ferreteria/v0.6/clade/Sys/FileSys/Aspect/Ident/stringer/aux/QSpec

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | FileSys‎ | Aspect‎ | Ident‎ | stringer‎ | aux
Jump to navigation Jump to search
clade: Sys\FileSys\Aspect\Ident\stringer\aux\QSpec
Clade Family
Str QSpec (none)
Clade Aliases
Alias Clade
Base* [c,i] Data\Mem\QVar\Str
QObj* [c,i] Data\Mem\QVar\Obj
ChainIface Sys\FileSys\Aspect\Ident\stringer\Chain
Subpages

Code

as of 2025-11-05

interface iQSpec extends BaseIface {
    static function FromChain(ChainIface $o) : self;
}
class cQSpec extends BaseClass implements iQSpec {

    // ++ SETUP ++ //

    public static function FromChain(ChainIface $o) : iQSpec {
        $oThis = static::AsNew();
        $oThis->QOChain()->SetIt($o);
        return $oThis;
    }

    // ++ SETUP: dynamic ++ //

    private $qoChain = NULL;
    public function QOChain() : QObjIface { return $this->qoChain ?? ($this->qoChain = QObjClass::AsNew()); }

    // -- SETUP -- //
    // ++ ACCESS ++ //

    // OVERRIDE
    public function SetStr(string $s)    {
        $this->QOChain()->GetIt()->ParsePath($s);
    }
    public function &GetStr() : string   {
        $qoChain = $this->QOChain();
        if ($qoChain->HasIt()) {
            $oPath = $qoChain->GetIt();
            $qsSpec = $oPath->QSPath();
            #echo $oPath->ReflectThis()->Report();
            $sSpec = $qsSpec->GetIt();
        } else {
            echo $this->CoderPrompt('String not available -- call HasStr() first!');
        }
        return $qsSpec->GetIt();
    }

    // -- ACCESS -- //
}