Packages

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
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++(other: Str): Str

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

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(other: Any): Boolean
    Definition Classes
    Str → Equals → AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def getChar(i: Int): Char

    Retrieve the character of this string at the given character index

  11. def getChars: Array[Char]

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

  12. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def getColor(i: Int): State

    Retrieve the color of this string at the given character index

  14. def getColors: Array[State]

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

  15. def hashCode(): Int
    Definition Classes
    Str → AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. 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

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. def overlay(attrs: Attrs, start: Int = 0, end: Int = length): Str

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

  22. 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

  23. def plainText: String

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

  24. 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.

  25. def split(c: Char): Array[Str]
  26. 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.

  27. 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

  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    Str → AnyRef → Any
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped