X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=mdref%2FEntry.php;h=589cf412eb72b4093d485261cba99d9d33ac64e2;hb=687f5fcb8de9250739a01d5855faa868f593fb73;hp=9135dd788479e04d44e7510fee0cc668948ca95e;hpb=3dbead20601800ab6127df29ecee0227859bdc63;p=mdref%2Fmdref diff --git a/mdref/Entry.php b/mdref/Entry.php index 9135dd7..589cf41 100644 --- a/mdref/Entry.php +++ b/mdref/Entry.php @@ -105,7 +105,7 @@ class Entry implements \IteratorAggregate { } /** - * Read the description of the ref entry file + * Read the first line of the description of the ref entry file * @return string */ public function getDescription() { @@ -118,6 +118,20 @@ class Entry implements \IteratorAggregate { return $this; } + /** + * Read the full description of the ref entry file + * @return string + */ + public function getFullDescription() { + if ($this->isFile()) { + return trim($this->getFile()->readFullDescription()); + } + if ($this->isRoot()) { + return trim($this->repo->getRootEntry()->getFullDescription()); + } + return $this; + } + /** * Read the intriductory section of the refentry file * @return string @@ -192,6 +206,22 @@ class Entry implements \IteratorAggregate { return ctype_upper($base{0}); } + public function getEntryName() { + return end($this->list); + } + + public function getNsName() { + if ($this->isRoot()) { + return $this->getName(); + } elseif ($this->isFunction()) { + $parts = explode("/", trim($this->getName(), "/")); + $self = array_pop($parts); + return implode("\\", $parts) . "::" . $self; + } else { + return strtr($this->getName(), "/", "\\"); + } + } + /** * Display name * @return string @@ -266,4 +296,8 @@ class Entry implements \IteratorAggregate { function getIterator() { return new Tree($this->getBasename(), $this->repo); } + + function getStructure() { + return new Structure($this); + } }