TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Swift_ByteStream_AbstractFilterableInputStream Class Reference
Inheritance diagram for Swift_ByteStream_AbstractFilterableInputStream:
Swift_InputByteStream Swift_Filterable Swift_ByteStream_FileByteStream Swift_Transport_StreamBuffer Swift_ByteStream_TemporaryFileByteStream

Public Member Functions

 addFilter (Swift_StreamFilter $filter, $key)
 
 removeFilter ($key)
 
 write ($bytes)
 
 commit ()
 
 bind (Swift_InputByteStream $is)
 
 unbind (Swift_InputByteStream $is)
 
 flushBuffers ()
 

Protected Member Functions

 _commit ($bytes)
 
 _flush ()
 

Protected Attributes

 $_sequence = 0
 

Private Member Functions

 _filter ($bytes)
 
 _doWrite ($bytes)
 

Private Attributes

 $_filters = array()
 
 $_writeBuffer = ''
 
 $_mirrors = array()
 

Detailed Description

Provides the base functionality for an InputStream supporting filters.

Author
Chris Corbyn

Definition at line 16 of file AbstractFilterableInputStream.php.

Member Function Documentation

_commit (   $bytes)
abstractprotected

Commit the given bytes to the storage medium immediately.

Parameters
string$bytes

Referenced by _doWrite().

_doWrite (   $bytes)
private

Just write the bytes to the stream

Definition at line 169 of file AbstractFilterableInputStream.php.

References _commit(), and _filter().

Referenced by commit(), flushBuffers(), and write().

_filter (   $bytes)
private

Run $bytes through all filters

Definition at line 159 of file AbstractFilterableInputStream.php.

Referenced by _doWrite().

_flush ( )
abstractprotected

Flush any buffers/content with immediate effect.

Referenced by flushBuffers().

addFilter ( Swift_StreamFilter  $filter,
  $key 
)

Add a StreamFilter to this InputByteStream.

Parameters
Swift_StreamFilter$filter
string$key

Implements Swift_Filterable.

Definition at line 58 of file AbstractFilterableInputStream.php.

Referenced by Swift_Transport_StreamBuffer\setWriteTranslations().

bind ( Swift_InputByteStream  $is)

Attach $is to this stream.

The stream acts as an observer, receiving all data that is written. All write() and flushBuffers() operations will be mirrored.

Parameters
Swift_InputByteStream$is

Implements Swift_InputByteStream.

Definition at line 114 of file AbstractFilterableInputStream.php.

commit ( )

For any bytes that are currently buffered inside the stream, force them off the buffer.

Exceptions
Swift_IoException

Implements Swift_InputByteStream.

Definition at line 101 of file AbstractFilterableInputStream.php.

References _doWrite().

flushBuffers ( )

Flush the contents of the stream (empty it) and set the internal pointer to the beginning.

Exceptions
Swift_IoException

Implements Swift_InputByteStream.

Definition at line 146 of file AbstractFilterableInputStream.php.

References _doWrite(), and _flush().

removeFilter (   $key)

Remove an already present StreamFilter based on its $key.

Parameters
string$key

Implements Swift_Filterable.

Definition at line 68 of file AbstractFilterableInputStream.php.

Referenced by Swift_Transport_StreamBuffer\setWriteTranslations().

unbind ( Swift_InputByteStream  $is)

Remove an already bound stream.

If $is is not bound, no errors will be raised. If the stream currently has any buffered data it will be written to $is before unbinding occurs.

Parameters
Swift_InputByteStream$is

Implements Swift_InputByteStream.

Definition at line 128 of file AbstractFilterableInputStream.php.

write (   $bytes)

Writes $bytes to the end of the stream.

Parameters
string$bytes
Exceptions
Swift_IoException
Returns
int

Implements Swift_InputByteStream.

Definition at line 82 of file AbstractFilterableInputStream.php.

References $_sequence, and _doWrite().

Member Data Documentation

$_filters = array()
private

StreamFilters.

Definition at line 26 of file AbstractFilterableInputStream.php.

$_mirrors = array()
private

Definition at line 38 of file AbstractFilterableInputStream.php.

$_sequence = 0
protected

Write sequence.

Definition at line 21 of file AbstractFilterableInputStream.php.

Referenced by Swift_Transport_StreamBuffer\_commit(), and write().

$_writeBuffer = ''
private

A buffer for writing.

Definition at line 31 of file AbstractFilterableInputStream.php.