utest.ufansi

Str

case class Str extends Product with Serializable

Encapsulates a string with associated ANSI colors and text decorations.

This is your primary data-type when you are dealing with colored fansi strings.

Contains some basic string methods, as well as some ansi methods to e.g. apply particular colors or other decorations to particular sections of the ufansi.Str. render flattens it out into a java.lang.String with all the colors present as ANSI escapes.

Avoids using Scala collections operations in favor of util.Arrays, giving 20% (on ++) to >1000% (on splitAt, subString and Str.parse) speedups

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Str
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++(other: Str): Str

    Concatenates two ufansi.Strs, preserving the colors in each one and avoiding any interference between them

  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(other: Any): Boolean

    Definition Classes
    Str → Equals → AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def getChar(i: Int): Char

    Retrieve the character of this string at the given character index

  13. def getChars: Array[Char]

    Returns a copy of the character array backing this fansi.Str, in case you want to use it to

  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def getColor(i: Int): State

    Retrieve the color of this string at the given character index

  16. def getColors: Array[State]

    Returns a copy of the colors array backing this fansi.Str, in case you want to use it to

  17. def hashCode(): Int

    Definition Classes
    Str → AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. def length: Int

    The plain-text length of this ufansi.Str, in UTF-16 characters (same as .length on a java.lang.String).

    The plain-text length of this ufansi.Str, in UTF-16 characters (same as .length on a java.lang.String). If you want fancy UTF-8 lengths, use .plainText

  20. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  21. final def notify(): Unit

    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  23. def overlay(attrs: Attrs, start: Int = 0, end: Int = length): Str

    Overlays the desired color over the specified range of the ufansi.Str.

  24. def overlayAll(overlays: Seq[(Attrs, Int, Int)]): Str

    Batch version of overlay, letting you apply a bunch of Attrs onto various parts of the same string in one operation, avoiding the unnecessary copying that would happen if you applied them with overlay one by one.

    Batch version of overlay, letting you apply a bunch of Attrs onto various parts of the same string in one operation, avoiding the unnecessary copying that would happen if you applied them with overlay one by one.

    The input sequence of overlay-tuples is applied from left to right

  25. def plainText: String

    The plain-text java.lang.String represented by this ufansi.Str, without all the fansi colors or other decorations

  26. def render: String

    Converts this ufansi.Str into a java.lang.String, including all the fancy fansi colors or decorations as fansi escapes embedded within the string.

    Converts this ufansi.Str into a java.lang.String, including all the fancy fansi colors or decorations as fansi escapes embedded within the string. "Terminates" colors at the right-most end of the resultant java.lang.String, making it safe to concat-with or embed-inside other java.lang.String without worrying about fansi colors leaking out of it.

  27. def split(c: Char): Array[Str]

  28. def splitAt(index: Int): (Str, Str)

    Splits an ufansi.Str into two sub-strings, preserving the colors in each one.

    Splits an ufansi.Str into two sub-strings, preserving the colors in each one.

    index

    the plain-text index of the point within the ufansi.Str you want to use to split it.

  29. def substring(start: Int = 0, end: Int = length): Str

    Returns an ufansi.Str which is a substring of this string, and has the same colors as the original section of this string did

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def toString(): String

    Definition Classes
    Str → AnyRef → Any
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped