TYPO3  7.6
Public Member Functions | Private Attributes | List of all members
Swift_StreamFilters_ByteArrayReplacementFilter Class Reference
Inheritance diagram for Swift_StreamFilters_ByteArrayReplacementFilter:
Swift_StreamFilter

Public Member Functions

 __construct ($search, $replace)
 
 shouldBuffer ($buffer)
 
 filter ($buffer, $_minReplaces=-1)
 
- Public Member Functions inherited from Swift_StreamFilter
 filter ($buffer)
 

Private Attributes

 $_search
 
 $_replace
 
 $_index
 
 $_tree = array()
 
 $_treeMaxLen = 0
 
 $_repSize
 

Detailed Description

Processes bytes as they pass through a buffer and replaces sequences in it.

This stream filter deals with Byte arrays rather than simple strings.

Author
Chris Corbyn

Definition at line 18 of file ByteArrayReplacementFilter.php.

Constructor & Destructor Documentation

__construct (   $search,
  $replace 
)

Create a new ByteArrayReplacementFilter with $search and $replace.

Parameters
array$search
array$replace

Definition at line 43 of file ByteArrayReplacementFilter.php.

References $_tree, and filter().

Member Function Documentation

filter (   $buffer,
  $_minReplaces = -1 
)

Perform the actual replacements on $buffer and return the result.

Parameters
array$buffer
int$_minReplaces
Returns
array

Definition at line 119 of file ByteArrayReplacementFilter.php.

References $_tree, $_treeMaxLen, and elseif.

Referenced by __construct().

shouldBuffer (   $buffer)

Returns true if based on the buffer passed more bytes should be buffered.

Parameters
array$buffer
Returns
bool

Implements Swift_StreamFilter.

Definition at line 104 of file ByteArrayReplacementFilter.php.

Member Data Documentation

$_index
private

The Index for searching

Definition at line 27 of file ByteArrayReplacementFilter.php.

$_replace
private

The replacement(s) to make

Definition at line 24 of file ByteArrayReplacementFilter.php.

$_repSize
private

Definition at line 35 of file ByteArrayReplacementFilter.php.

$_search
private

The needle(s) to search for

Definition at line 21 of file ByteArrayReplacementFilter.php.

$_tree = array()
private

The Search Tree

Definition at line 30 of file ByteArrayReplacementFilter.php.

Referenced by __construct(), and filter().

$_treeMaxLen = 0
private

Gives the size of the largest search

Definition at line 33 of file ByteArrayReplacementFilter.php.

Referenced by filter().