The TreeItem mixin turns its target into a tree item.
Adds child to the back.
Constructs, adds to the back then returns a new child. This method should be prefered over addChild and insertChild if deleteChildren() is used.
Constructs, adds to the back then returns a new sibling. This method should be prefered over addChild and insertChild if deleteChildren() is used.
Adds an item at the end of list.
Returns an input range that allows to iterate the children. The array syntax is also supported.
Returns the children count.
Removes and deletes (destroy) the children.
Exchanges the position of two siblings.
Returns the index of sibling if it's found otherwise -1.
Returns the first child.
Returns the first item. The value returned is never null.
Indicates if the item has neighboors.
Inserts the first child.
Inserts a child.
Inserts an item at the beginning of the list.
Inserts a sibling.
Converts the node to a string. This is used to represent the whole tree in saveToStream().
Returns the last item. The value returned is never null.
Returns the distance to the root.
Returns the next TreeItem.
Returns the parent.
Returns the previous TreeItem.
Removes a child from the list.
Removes the nth child.
Removes the children, without destructing them. After the call, the links to the items siblings are also reset to null.
Removes an item.
Removes the nth sibling.
Returns the root.
Saves the textual representation of the tree to a Stream.
Returns this when mixed in a class or &this in a struct.
Returns the count of sibling in the branch. The value returned is always greater than 0.
Returns the item position in the list.
Sets the item position in the list. The new position of the previous item is undetermined.
Returns an input range that allows to iterate the siblings. The array syntax is also supported.