object Str extends Serializable
- Alphabetic
- By Inheritance
- Str
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
State = Long
An ufansi.Str's
color
s array is filled with Long, each representing the ANSI state of one character encoded in its bits.An ufansi.Str's
color
s array is filled with Long, each representing the ANSI state of one character encoded in its bits. Each Attr belongs to a Category that occupies a range of bits within each long:61... 55 54 53 52 51 .... 31 30 29 28 27 26 25 ..... 6 5 4 3 2 1 0 \|--------| |-----------------------| |-----------------------| | | |bold \| | \| | |reversed \| | | |underlined \| | |foreground-color \| |background-color \|unused
The
0000 0000 0000 0000
long corresponds to plain text with no decoration
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
ansiRegex: Pattern
Regex that can be used to identify Ansi escape patterns in a string.
Regex that can be used to identify Ansi escape patterns in a string.
Found from: http://stackoverflow.com/a/33925425/871202
Which references:
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
Section 5.4: Control Sequences
-
def
apply(raw: CharSequence, errorMode: ErrorMode = ErrorMode.Throw): Str
Creates an ufansi.Str from a non-fansi
java.lang.String
or otherCharSequence
.Creates an ufansi.Str from a non-fansi
java.lang.String
or otherCharSequence
.Note that this method is implicit, meaning you can pass in a
java.lang.String
anywhere anfansi.Str
is required and it will be automatically parsed and converted for you.- errorMode
Used to control what kind of behavior you get if the input
CharSequence
contains an Ansi escape not recognized by Fansi as a valid color.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fromArrays(chars: Array[Char], colors: Array[State]): Str
Constructs a ufansi.Str from an array of characters and an array of colors.
Constructs a ufansi.Str from an array of characters and an array of colors. Performs a defensive copy of the arrays, and validates that they both have the same length
Useful together with
getChars
andgetColors
if you want to do manual work on the two mutable arrays before stitching them back together into one immutable ufansi.Str -
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
implicit
def
implicitApply(raw: CharSequence): Str
Make the construction of ufansi.Strs from
String
s and otherCharSequence
s automatic -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def join(args: Str*): Str
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()