Class/Object

fansi

Str

Related Docs: object Str | package fansi

Permalink

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink

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

  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. def getChars: Array[Char]

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getColors: Array[State]

    Permalink

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

  13. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  15. def length: Int

    Permalink

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

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

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

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

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

    Permalink

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

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

    Permalink

    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

  21. lazy val plainText: String

    Permalink

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

  22. def render: String

    Permalink

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

    Converts this fansi.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.

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

    Permalink

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

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

    index

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

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

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped