TextTree

izumi.fundamentals.platform.strings.TextTree
See theTextTree companion object
sealed trait TextTree[+T]

This is a convenience utility allowing to build trees of plain text and typed values.

This utility is extremely useful for various template engines, query builders and transpilers

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Node[T]
class Shift[T]
class StringNode
class Trim[T]
class ValueNode[T]
class VerbatimNode
Show all

Members list

Value members

Concrete methods

def as[W](implicit conv: T => W): TextTree[W]
Implicitly added by TextTreeGenericOps

Convert tree values using an implicit conversion

Convert tree values using an implicit conversion

Attributes

def dump: String
Implicitly added by TextTreeGenericOps

Render tree to string using .toString on values

Render tree to string using .toString on values

Attributes

def flatten: TextTree[T]
Implicitly added by TextTreeGenericOps

Flatten nested Node structures into a single-level Node

Flatten nested Node structures into a single-level Node

Attributes

def foreach(f: T => Unit): Unit
Implicitly added by TextTreeGenericOps

Apply a side-effecting function to all typed values

Apply a side-effecting function to all typed values

Attributes

def isEmpty: Boolean
Implicitly added by TextTreeGenericOps

Check if tree is empty (no values and only empty text)

Check if tree is empty (no values and only empty text)

Attributes

def last: Option[Char]
Implicitly added by TextTreeGenericOps

Get the last character from string nodes, if any

Get the last character from string nodes, if any

Attributes

def map[U](f: T => U): TextTree[U]
Implicitly added by TextTreeGenericOps

Transform all typed values in the tree

Transform all typed values in the tree

Attributes

def mapRender(f: T => String): String
Implicitly added by TextTreeGenericOps

Render tree to string, converting values with provided function

Render tree to string, converting values with provided function

Attributes

def nonEmpty: Boolean
Implicitly added by TextTreeGenericOps

Check if tree is non-empty

Check if tree is non-empty

Attributes

def rawChunks: Seq[String]
Implicitly added by TextTreeGenericOps

Get a list of string nodes (values ingored)

Get a list of string nodes (values ingored)

Attributes

def render(implicit ev: T =:= Nothing): String
Implicitly added by TextTreeGenericOps

Render tree to string (only for trees without typed values)

Render tree to string (only for trees without typed values)

Attributes

def shift(pad: Int): TextTree[T]
Implicitly added by TextTreeGenericOps

Wrap tree in Shift node to indent by specified spaces when rendering

Wrap tree in Shift node to indent by specified spaces when rendering

Attributes

def stripMargin(marginChar: Char): TextTree[T]
Implicitly added by TextTreeGenericOps

Strip margin from string nodes using custom margin character

Strip margin from string nodes using custom margin character

Attributes

Implicitly added by TextTreeGenericOps

Strip margin from string nodes using default '|' margin character

Strip margin from string nodes using default '|' margin character

Attributes

def trim: TextTree[T]
Implicitly added by TextTreeGenericOps

Wrap tree in Trim node to trim whitespace when rendering

Wrap tree in Trim node to trim whitespace when rendering

Attributes

def values: Seq[T]
Implicitly added by TextTreeGenericOps

Extract all typed values from the tree

Extract all typed values from the tree

Attributes