Documentation

Swift_CharacterReader

Analyzes characters for a specific character set.

Tags
author

Chris Corbyn

author

Xavier De Cock xdecock@gmail.com

Table of Contents

MAP_TYPE_FIXED_LEN  = 0x2
MAP_TYPE_INVALID  = 0x1
MAP_TYPE_POSITIONS  = 0x3
getCharPositions()  : int
Returns the complete character map.
getInitialByteSize()  : int
Returns the number of bytes which should be read to start each character.
getMapType()  : int
Returns the mapType, see constants.
validateByteSequence()  : int
Returns an integer which specifies how many more bytes to read.

Constants

Methods

getCharPositions()

Returns the complete character map.

public getCharPositions(string $string, int $startOffset, array<string|int, mixed> &$currentMap, mixed &$ignoredChars) : int
Parameters
$string : string
$startOffset : int
$currentMap : array<string|int, mixed>
$ignoredChars : mixed
Return values
int

getInitialByteSize()

Returns the number of bytes which should be read to start each character.

public getInitialByteSize() : int

For fixed width character sets this should be the number of octets-per-character. For multibyte character sets this will probably be 1.

Return values
int

getMapType()

Returns the mapType, see constants.

public getMapType() : int
Return values
int

validateByteSequence()

Returns an integer which specifies how many more bytes to read.

public validateByteSequence(array<string|int, int> $bytes, int $size) : int

A positive integer indicates the number of more bytes to fetch before invoking this method again.

A value of zero means this is already a valid character. A value of -1 means this cannot possibly be a valid character.

Parameters
$bytes : array<string|int, int>
$size : int
Return values
int

Search results