class ParsedText

Properties

bool $decodeHtmlEntities
protected bool $hasEscapedChars
bool $hasReferences
array $linkReferences
protected string $text

Methods

__construct(string $text)

No description

string
__toString()

No description

string
charAt(int $pos)

Return the character at given position

string
decode(string $str)

Decode a chunk of encoded text to be used as an attribute value

bool|int
indexOf(string $str, int $pos = 0)

Find the first occurence of given substring starting at given position

bool
isAfterWhitespace(int $pos)

Test whether given position is preceded by whitespace

bool
isAlnum(string $chr)

Test whether given character is alphanumeric

bool
isBeforeWhitespace(int $pos)

Test whether given position is followed by whitespace

bool
isSurroundedByAlnum(int $pos, int $len)

Test whether a length of text is surrounded by alphanumeric characters

bool
isWhitespace(string $chr)

Test whether given character is an ASCII whitespace character

void
markBoundary(int $pos)

Mark the boundary of a block in the original text

void
overwrite(int $pos, int $len)

Overwrite part of the text with substitution characters ^Z (0x1A)

Details

at line 40
__construct(string $text)

No description

Parameters

string $text

Original text

at line 67
string __toString()

No description

Return Value

string

at line 78
string charAt(int $pos)

Return the character at given position

Parameters

int $pos

Return Value

string

at line 91
string decode(string $str)

Decode a chunk of encoded text to be used as an attribute value

Decodes escaped literals and removes slashes and 0x1A characters

Parameters

string $str

Encoded text

Return Value

string

Decoded text

at line 122
bool|int indexOf(string $str, int $pos = 0)

Find the first occurence of given substring starting at given position

Parameters

string $str
int $pos

Return Value

bool|int

at line 133
bool isAfterWhitespace(int $pos)

Test whether given position is preceded by whitespace

Parameters

int $pos

Return Value

bool

at line 144
bool isAlnum(string $chr)

Test whether given character is alphanumeric

Parameters

string $chr

Return Value

bool

at line 155
bool isBeforeWhitespace(int $pos)

Test whether given position is followed by whitespace

Parameters

int $pos

Return Value

bool

at line 167
bool isSurroundedByAlnum(int $pos, int $len)

Test whether a length of text is surrounded by alphanumeric characters

Parameters

int $pos

Start of the text

int $len

Length of the text

Return Value

bool

at line 180
bool isWhitespace(string $chr)

Test whether given character is an ASCII whitespace character

NOTE: newlines are normalized to LF before parsing so we don't have to check for CR

Parameters

string $chr

Return Value

bool

at line 191
void markBoundary(int $pos)

Mark the boundary of a block in the original text

Parameters

int $pos

Return Value

void

at line 203
void overwrite(int $pos, int $len)

Overwrite part of the text with substitution characters ^Z (0x1A)

Parameters

int $pos

Start of the range

int $len

Length of text to overwrite

Return Value

void