struct
TermBuf::Unicode::Grapheme
- TermBuf::Unicode::Grapheme
- Struct
- Value
- Object
Overview
One extended grapheme cluster, located by byte offset within its source string so that scanning a string allocates nothing.
Defined in:
termbuf/unicode/grapheme.crConstructors
Instance Method Summary
-
#bytesize : Int32
Length of the cluster in bytes.
-
#char : Char | Nil
The cluster's only character, when it consists of a single code point.
-
#start : Int32
Byte offset of the cluster within the string it was scanned from.
-
#text(source : String) : String
Extracts the cluster from the string it was scanned from.
-
#width : Int32
Terminal cells the cluster occupies: zero, one, or two.
Constructor Detail
Instance Method Detail
def char : Char | Nil
#
The cluster's only character, when it consists of a single code point.
nil for multi-code-point clusters, which the buffer keeps in its
cluster pool rather than inline in a cell.