← back to roto on ba3a.dev

Template

class Template(val source: String)

A string with {variable} and {variable:format} placeholders, parsed and validated on construction: an unknown variable, a format that does not fit the variable, or an unbalanced brace fails here rather than at publish time.

Formats are lower and upper for text variables and a run of zeros for numbers ({frame:000} pads to at least three digits, never truncates). Case mapping is locale-independent, so expansion gives the same string on every machine. Equality is by source.

Constructors

Link copied to clipboard
constructor(source: String)

Properties

Link copied to clipboard

the template text, with its placeholders

Link copied to clipboard

Every variable a placeholder in this template refers to.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Equal when the source text is.

Link copied to clipboard

This template with each placeholder replaced from values; throws if a used value is missing.

Link copied to clipboard
open override fun hashCode(): Int

Consistent with equals.

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

The source text.