1 | <?php |
||
22 | class Directory extends Node |
||
23 | { |
||
24 | /** |
||
25 | * @see http://man7.org/linux/man-pages/man2/lstat.2.html |
||
26 | */ |
||
27 | const S_IFTYPE = 0040000; |
||
28 | |||
29 | protected $children = array(); |
||
30 | |||
31 | /** |
||
32 | * Class constructor. |
||
33 | * |
||
34 | * @param string $basename |
||
35 | * |
||
36 | * @throws \InvalidArgumentException |
||
37 | */ |
||
38 | public function __construct($basename) |
||
45 | |||
46 | /** |
||
47 | * Adds child Directory. |
||
48 | * |
||
49 | * @param Directory $directory |
||
50 | */ |
||
51 | public function addDirectory(Directory $directory) |
||
55 | |||
56 | /** |
||
57 | * Adds child File. |
||
58 | * |
||
59 | * @param File $file |
||
60 | */ |
||
61 | public function addFile(File $file) |
||
65 | |||
66 | /** |
||
67 | * Adds child Link. |
||
68 | * |
||
69 | * @param Link $link |
||
70 | */ |
||
71 | public function addLink(Link $link) |
||
75 | |||
76 | /** |
||
77 | * Adds child Node. |
||
78 | * |
||
79 | * @param Node $node |
||
80 | * |
||
81 | * @throws FileExistsException |
||
82 | */ |
||
83 | public function addNode(Node $node) |
||
92 | |||
93 | /** |
||
94 | * Returns size as the number of child elements. |
||
95 | * |
||
96 | * @return int |
||
97 | */ |
||
98 | public function size() |
||
102 | |||
103 | /** |
||
104 | * Returns child Node existing at path. |
||
105 | * |
||
106 | * @param string $path |
||
107 | * |
||
108 | * @return Node |
||
109 | * |
||
110 | * @throws \VirtualFileSystem\Exception\NotFoundException |
||
111 | */ |
||
112 | public function childAt($path) |
||
120 | |||
121 | /** |
||
122 | * Removes child Node |
||
123 | * |
||
124 | * @param string $basename |
||
125 | */ |
||
126 | public function remove($basename) |
||
130 | |||
131 | /** |
||
132 | * Returns children |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | public function children() |
||
140 | } |
||
141 |