Swift_StreamFilters_ByteArrayReplacementFilter
in package
implements
Swift_StreamFilter
Processes bytes as they pass through a buffer and replaces sequences in it.
This stream filter deals with Byte arrays rather than simple strings.
Tags
Interfaces, Classes and Traits
- Swift_StreamFilter
- Processes bytes as they pass through a stream and performs filtering.
Table of Contents
- $index : mixed
- The Index for searching
- $replace : mixed
- The replacement(s) to make
- $repSize : mixed
- $tree : mixed
- The Search Tree
- $treeMaxLen : mixed
- Gives the size of the largest search
- __construct() : mixed
- Create a new ByteArrayReplacementFilter with $search and $replace.
- filter() : array<string|int, mixed>
- Perform the actual replacements on $buffer and return the result.
- shouldBuffer() : bool
- Returns true if based on the buffer passed more bytes should be buffered.
Properties
$index
The Index for searching
private
mixed
$index
$replace
The replacement(s) to make
private
mixed
$replace
$repSize
private
mixed
$repSize
$tree
The Search Tree
private
mixed
$tree
= []
$treeMaxLen
Gives the size of the largest search
private
mixed
$treeMaxLen
= 0
Methods
__construct()
Create a new ByteArrayReplacementFilter with $search and $replace.
public
__construct(array<string|int, mixed> $search, array<string|int, mixed> $replace) : mixed
Parameters
- $search : array<string|int, mixed>
- $replace : array<string|int, mixed>
Return values
mixed —filter()
Perform the actual replacements on $buffer and return the result.
public
filter(array<string|int, mixed> $buffer[, int $minReplaces = -1 ]) : array<string|int, mixed>
Parameters
- $buffer : array<string|int, mixed>
- $minReplaces : int = -1
Return values
array<string|int, mixed> —shouldBuffer()
Returns true if based on the buffer passed more bytes should be buffered.
public
shouldBuffer(array<string|int, mixed> $buffer) : bool
Parameters
- $buffer : array<string|int, mixed>