← back to roto on ba3a.dev

PathTemplate

class PathTemplate(val source: String)

A Template that expands to a RelativePath inside the consuming project, such as raw-art/{profile}/{action}_{facing:lower}/{frame:000}.png.

The literal parts are checked on construction. On expansion every substituted value must fit inside one path segment — a value can never add a directory or climb out with .. — and the expanded path is checked again as a whole. Equality is by source.

Constructors

Link copied to clipboard
constructor(source: String)

Properties

Link copied to clipboard

the template text, as written in roto.json

Link copied to clipboard

The parsed template.

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

The relative path for values.

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

Consistent with equals.

Link copied to clipboard
fun resolve(root: Path, values: TemplateValues): Path

The file for values under root.

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

The source text.