5 class RefListing
implements \Countable
, \Iterator
18 * @param \mdref\Path $path
21 function __construct(Path
$path, array $files) {
23 $this->entries
= array_map(function($fn) {
24 return substr(trim($fn, DIRECTORY_SEPARATOR
), 0, -3);
29 return count($this->entries
);
33 reset($this->entries
);
37 return null !== key($this->entries
);
41 return $this->path
->getSubPath(current($this->entries
));
49 return new RefEntry($this->path
, $this->key());//$this->format($this->key());
52 function getParent() {
53 switch ($parent = dirname($this->path
->getPathName())) {
58 return new RefEntry($this->path
, $parent);
63 return new RefEntry($this->path
);