Ferreteria/v0.6/clade/Sys/FileSys/Aspect/Ident/stringer/Chain/@removed/Nested/Named
< Ferreteria | v0.6 | clade | Sys | FileSys | Aspect | Ident | stringer | Chain | @removed | Nested
Jump to navigation
Jump to search
|
Retired Clade:
Sys\FileSys\Aspect\Ident\stringer\Chain\Nested\Named |
History
- 2023-11-03 moved from ...\File\caPathNamed -> ...\File\Path\caNamed
- 2023-12-13 now descends from Based
- 2024-12-24 moved from [WF]Data/Stored/File/Path -> [WF]IO/fsys/Path/Piece/Based
- 2024-12-31 moved again, renamed, reparented; see Chain.
- 2025-11-03 iStatus is now in another folder, so have to reference it with a full path
2025-12-15
namespace Woozalia\Ferret\Sys\FileSys\Aspect\Ident\stringer\Chain\Nested;
/* BaseClass */ use Woozalia\Ferret\Sys\FileSys\Aspect\Ident\stringer\Chain\caNested as BaseClass;
/* BaseIface */ use Woozalia\Ferret\Sys\FileSys\Aspect\Ident\stringer\Chain\iNested as BaseIface;
/* SelfIface */ use Woozalia\Ferret\Sys\FileSys\Aspect\Ident\stringer\Chain\Nested\iNamed as SelfIface;
/* StatusClass */ use Woozalia\Ferret\Sys\FileSys\Aspect\Ident\stringer\aux\cStatus as StatusClass;
/* StatusIface */ use Woozalia\Ferret\Sys\FileSys\Aspect\Ident\stringer\aux\iStatus as StatusIface;
/* QStrClass */ use Woozalia\Ferret\Data\Mem\QVar\cStr as QStrClass;
/* QStrIface */ use Woozalia\Ferret\Data\Mem\QVar\iStr as QStrIface;
/* QSpecClass */ #use Woozalia\Ferret\Sys\FileSys\Aspect\Ident\stringer\aux\cQSpec as QSpecClass;
/* QSpecIface */ #use Woozalia\Ferret\Sys\FileSys\Aspect\Ident\stringer\aux\iQSpec as QSpecIface;
// 2025-11-06 retiring, probably
interface iNamed extends BaseIface {
#function SetName(string $fn);
#function GetName() : string;
function QSName() : QStrIface;
function QSPath() : QStrIface;
function PathStatus() : StatusIface;
}
class cNamed extends BaseClass implements SelfIface {
// ++ VALUE ++ //
private $qsName = NULL;
public function QSName() : QStrIface { return $this->qsName ?? ($this->qsName = QStrClass::AsNew()); }
private $qsPath = NULL;
public function QSPath() : QSpecIface {
$qsName = $this->QSName();
if (is_null($this->qsPath)) {
$this->AmHere();
$this->qsPath = QSpecClass::AsNew();
}
$qsPath = $this->qsPath;
if ($qsName->HasIt()) {
$qoNest = $this->QOBase();
if ($qoNest->HasIt()) {
$qsPath = $qoNest->QSPath();
$this->AmHere();
$qsPath->AddIt('/'.$qsName->GetIt());
} else {
$qsPath->SetIt($qsName->GetIt());
}
}
return $qsPath;
}
// -- VALUE -- //
// ++ PATH ++ //
/*----
CEMENT caPathHandler
INSTAR: non-base piece, no numbering
RETURNS: PathStatus
HISTORY:
2022-09-29 revised how cPathStatus (now Path\cStatus) works
*/
public function PathStatus() : StatusIface {
$qoBase = $this->QOBase();
if ($qoBase->HasIt()) {
$oStat = $qoBase->GetIt()->PathStatus();
$sName = $this->GetName();
$oStat->AddRelPath($sName);
} else {
$oStat = new StatusClass;
$oStat->QSRoot()->SetIt($this->QSName()->GetIt());
}
return $oStat;
}
// -- PATH -- //
}