AttributeWriter

open inner class AttributeWriter

An AttributeWriter provides the ability to write generally available dot elements, e.g., indentation, comments, identifiers, attributes, etc.

Author

Todd L Smith

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun adjust(rhs: String): String

Answer an adjusted rhs (right hand side), taking into account which format the rhs takes, and whether dark mode is active.

fun adjust(condition: Boolean, trueString: String, falseString: String): String

Answer an adjusted rhs (right hand side), taking into account which format the rhs takes, and whether dark mode is active. This method takes a boolean, which if true processes the second argument, otherwise the third.

Link copied to clipboard
fun attribute(lhs: String, rhs: String)

Emit a simple attribute statement.

Link copied to clipboard
fun blockComment(comment: String)

Emit a block comment. A best effort will be made to keep the lines of the block comment within the specified limit, accounting for indentation and comment overhead.

Link copied to clipboard
fun emit(text: String)

Emit arbitrary text. Updates justEmittedLinefeed appropriately, based on whether the last character of the specified text is a linefeed.

Link copied to clipboard
fun endOfLineComment(comment: String)

Emit an end-of-line comment.

Link copied to clipboard
fun indent()

Emit an appropriate amount of indentation, as horizontal tabs. It is assumed that the most recently written character is a line feed.