Swift_CharacterReader_GenericFixedWidthReader
in package
implements
Swift_CharacterReader
Provides fixed-width byte sizes for reading fixed-width character sets.
Tags
Interfaces, Classes and Traits
- Swift_CharacterReader
- Analyzes characters for a specific character set.
Table of Contents
- $width : int
- The number of bytes in a single character.
- __construct() : mixed
- Creates a new GenericFixedWidthReader using $width bytes per character.
- 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.
- validateByteSequence() : int
- Returns an integer which specifies how many more bytes to read.
Properties
$width
The number of bytes in a single character.
private
int
$width
Methods
__construct()
Creates a new GenericFixedWidthReader using $width bytes per character.
public
__construct(int $width) : mixed
Parameters
- $width : int
Return values
mixed —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
Return values
int —getMapType()
Returns the mapType.
public
getMapType() : int
Return values
int —validateByteSequence()
Returns an integer which specifies how many more bytes to read.
public
validateByteSequence(string $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 : string
- $size : int