PrettyPrinter¶
class PrettyPrinter(val indentSize: Int = 2) : Appendable
Constructors¶
PrettyPrinter¶
constructor(indentSize: Int = 2)
Properties¶
indentSize¶
val indentSize: Int
Functions¶
append¶
open override fun append(nullableSeq: CharSequence?): Appendable
open override fun append(
nullableSeq: CharSequence?,
start: Int,
end: Int
): Appendable
open override fun append(c: Char): Appendable
checkIfPrinted¶
fun checkIfPrinted(render: () -> Unit): Boolean
invoke¶
inline operator fun invoke(print: PrettyPrinter.() -> Unit)
printCharIfNotThere¶
fun printCharIfNotThere(char: Char)
printCollection¶
inline fun <T> printCollection(
collection: Iterable<T>,
separator: String = ", ",
prefix: String = "",
postfix: String = "",
renderItem: PrettyPrinter.(T) -> Unit
)
printCollectionIfNotEmpty¶
inline fun <T> printCollectionIfNotEmpty(
collection: Iterable<T>,
separator: String = ", ",
prefix: String = "",
postfix: String = "",
renderItem: PrettyPrinter.(T) -> Unit
)
separated¶
toString¶
withIndent¶
fun withIndent(block: PrettyPrinter.() -> Unit)
withIndentInBraces¶
fun withIndentInBraces(block: PrettyPrinter.() -> Unit)
withIndentInSquareBrackets¶
fun withIndentInSquareBrackets(block: PrettyPrinter.() -> Unit)
withIndents¶
fun withIndents(indentCount: Int, block: PrettyPrinter.() -> Unit)
withIndentWrapped¶
fun withIndentWrapped(
before: String,
after: String,
block: PrettyPrinter.() -> Unit
)
withPrefix¶
fun withPrefix(prefix: String, print: () -> Unit)
withSuffix¶
fun withSuffix(suffix: String, p1: () -> Unit)