blob: 2569af5d9298035a72acc2ead4e7e5a3fa794a30 [file] [log] [blame] [view]
# addNode method
*[<Null safety>](https://dart.dev/null-safety)*
- @override
int addNode
(String name, [Vnode](../../package-fuchsia_vfs_vfs/Vnode-class.md) node)
_<span class="feature override">override</span>_
<p>Adds a directory entry associating the given <code>name</code> with <code>node</code>.
It is ok to add the same Vnode multiple times with different names.</p>
<p>Returns <code>ZX.OK</code> on success.
Returns <code>ZX.ERR_INVALID_ARGS</code> if name is illegal object name.
Returns <code>ZX.ERR_ALREADY_EXISTS</code> if there is already a node with the
given name.</p>
## Implementation
```dart
@override
int addNode(String name, Vnode node) {
if (_inheritedNodes.contains(name)) {
return ZX.ERR_ALREADY_EXISTS;
} else {
return super.addNode(name, node);
}
}
```