Class TokenizedAttributedString
Extends AttributedString to support a tokenized string.
You can mix working with tokens with working on string ranges using the AttributedString methods. The original string is preserved.
- apemsel\AttributedString\AttributedString implements Countable, ArrayAccess
-
apemsel\AttributedString\TokenizedAttributedString
Author: Adrian Pemsel apemsel@gmail.com
Located at TokenizedAttributedString.php
Methods summary
public
|
#
__construct( string|
|
public
string[]
|
|
public
int[]
|
|
public
integer
|
|
public
string
|
|
public
integer
|
|
public
|
#
setTokenAttribute( integer $i, string $attribute, boolean $state = true )
Set a token to a given attribute and state |
public
|
#
setTokenRangeAttribute( integer $from, integer $to, string $attribute, boolean $state = true )
Set a range of tokens to a given attribute and state |
public
|
#
setTokenDictionaryAttribute( string[] $dictionary, string $attribute, boolean $state = true )
Set all tokens matching given dictionary to attribute and state |
public
string[]
|
|
public
|
|
public static
array
|
|
public static
array
|
|
public static
array
|
|
public
boolean
|
|
public
string
|
Methods inherited from apemsel\AttributedString\AttributedString
__toString(),
attributeToString(),
attributesAt(),
byteToCharOffset(),
byteToCharOffsetString(),
charToByteOffset(),
combineAttributes(),
count(),
createAttribute(),
deleteAttribute(),
enablebyteToCharCache(),
filter(),
hasAttribute(),
is(),
offsetSet(),
offsetUnset(),
searchAttribute(),
setLength(),
setPattern(),
setRange(),
setSubstring(),
substrings(),
toHtml(),
utf8CharLen()
Properties summary
protected
|
$tokens
|
|
protected
|
$tokenOffsets
|