TYPO3  7.6
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Swift_CharacterStream_ArrayCharacterStream Class Reference
Inheritance diagram for Swift_CharacterStream_ArrayCharacterStream:
Swift_CharacterStream

Public Member Functions

 __construct (Swift_CharacterReaderFactory $factory, $charset)
 
 setCharacterSet ($charset)
 
 setCharacterReaderFactory (Swift_CharacterReaderFactory $factory)
 
 importByteStream (Swift_OutputByteStream $os)
 
 importString ($string)
 
 read ($length)
 
 readBytes ($length)
 
 write ($chars)
 
 setPointer ($charOffset)
 
 flushContents ()
 

Private Member Functions

 _reloadBuffer ($fp, $len)
 

Static Private Member Functions

static _initializeMaps ()
 

Private Attributes

 $_charReader
 
 $_charReaderFactory
 
 $_charset
 
 $_array = array()
 
 $_array_size = array()
 
 $_offset = 0
 

Static Private Attributes

static $_charMap
 
static $_byteMap
 

Detailed Description

A CharacterStream implementation which stores characters in an internal array.

Author
Chris Corbyn

Definition at line 16 of file ArrayCharacterStream.php.

Constructor & Destructor Documentation

__construct ( Swift_CharacterReaderFactory  $factory,
  $charset 
)

Create a new CharacterStream with the given $chars, if set.

Parameters
Swift_CharacterReaderFactory$factoryfor loading validators
string$charsetused in the stream

Definition at line 48 of file ArrayCharacterStream.php.

References setCharacterReaderFactory(), and setCharacterSet().

Member Function Documentation

static _initializeMaps ( )
staticprivate

Definition at line 283 of file ArrayCharacterStream.php.

_reloadBuffer (   $fp,
  $len 
)
private

Definition at line 269 of file ArrayCharacterStream.php.

Referenced by write().

flushContents ( )

Empty the stream and reset the internal pointer.

Implements Swift_CharacterStream.

Definition at line 262 of file ArrayCharacterStream.php.

Referenced by importString().

importByteStream ( Swift_OutputByteStream  $os)

Overwrite this character stream using the byte sequence in the byte stream.

Parameters
Swift_OutputByteStream$osoutput stream to read from

Implements Swift_CharacterStream.

Definition at line 81 of file ArrayCharacterStream.php.

References $_array_size, and Swift_OutputByteStream\read().

importString (   $string)

Import a string a bytes into this CharacterStream, overwriting any existing data in the stream.

Parameters
string$string

Implements Swift_CharacterStream.

Definition at line 114 of file ArrayCharacterStream.php.

References flushContents(), and write().

read (   $length)

Read $length characters from the stream and move the internal pointer $length further into the stream.

Parameters
int$length
Returns
string

Implements Swift_CharacterStream.

Definition at line 128 of file ArrayCharacterStream.php.

References $_offset.

readBytes (   $length)

Read $length characters from the stream and return a 1-dimensional array containing there octet values.

Parameters
int$length
Returns
integer[]

Implements Swift_CharacterStream.

Definition at line 160 of file ArrayCharacterStream.php.

References $_offset.

setCharacterReaderFactory ( Swift_CharacterReaderFactory  $factory)

Set the CharacterReaderFactory for multi charset support.

Parameters
Swift_CharacterReaderFactory$factory

Implements Swift_CharacterStream.

Definition at line 71 of file ArrayCharacterStream.php.

Referenced by __construct().

setCharacterSet (   $charset)

Set the character set used in this CharacterStream.

Parameters
string$charset

Implements Swift_CharacterStream.

Definition at line 60 of file ArrayCharacterStream.php.

Referenced by __construct().

setPointer (   $charOffset)

Move the internal pointer to $charOffset in the stream.

Parameters
int$charOffset

Implements Swift_CharacterStream.

Definition at line 249 of file ArrayCharacterStream.php.

References $_array_size, and elseif.

write (   $chars)

Write $chars to the end of the stream.

Parameters
string$chars

Implements Swift_CharacterStream.

Definition at line 183 of file ArrayCharacterStream.php.

References $_array_size, and _reloadBuffer().

Referenced by importString().

Member Data Documentation

$_array = array()
private

Array of characters

Definition at line 34 of file ArrayCharacterStream.php.

$_array_size = array()
private

Size of the array of character

Definition at line 37 of file ArrayCharacterStream.php.

Referenced by importByteStream(), setPointer(), and write().

$_byteMap
staticprivate

A map of characters and their derivative byte values

Definition at line 22 of file ArrayCharacterStream.php.

$_charMap
staticprivate

A map of byte values and their respective characters

Definition at line 19 of file ArrayCharacterStream.php.

$_charReader
private

The char reader (lazy-loaded) for the current charset

Definition at line 25 of file ArrayCharacterStream.php.

$_charReaderFactory
private

A factory for creating CharacterReader instances

Definition at line 28 of file ArrayCharacterStream.php.

$_charset
private

The character set this stream is using

Definition at line 31 of file ArrayCharacterStream.php.

$_offset = 0
private

The current character offset in the stream

Definition at line 40 of file ArrayCharacterStream.php.

Referenced by read(), and readBytes().