TreeFormatter

An indentation and tree formatter utility class.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun append(line: String, lastChild: Boolean = false)

Appends a line to the tree with indentation.

Link copied to clipboard
fun indent()

Indents the following lines by 1.

fun indent(function: TreeFormatter.() -> Unit)

Indents all code ran inside function by 1, then resets the indentation to the previous one.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun unindent()

Unindents the following lines by 1.