XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
Swift_CharacterStream_ArrayCharacterStream Class Reference
Inheritance diagram for Swift_CharacterStream_ArrayCharacterStream:
Inheritance graph

Public Member Functions

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

Private Member Functions

 _reloadBuffer ($fp, $len)
 

Static Private Member Functions

static _initializeMaps ()
 

Private Attributes

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

Static Private Attributes

static $_byteMap
 
static $_charMap
 

Detailed Description

Definition at line 21 of file ArrayCharacterStream.php.

Constructor & Destructor Documentation

Swift_CharacterStream_ArrayCharacterStream::__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 54 of file ArrayCharacterStream.php.

References setCharacterReaderFactory(), and setCharacterSet().

Here is the call graph for this function:

Member Function Documentation

static Swift_CharacterStream_ArrayCharacterStream::_initializeMaps ( )
staticprivate

Definition at line 307 of file ArrayCharacterStream.php.

Swift_CharacterStream_ArrayCharacterStream::_reloadBuffer (   $fp,
  $len 
)
private

Definition at line 293 of file ArrayCharacterStream.php.

References $i.

Referenced by write().

Here is the caller graph for this function:

Swift_CharacterStream_ArrayCharacterStream::flushContents ( )

Empty the stream and reset the internal pointer.

Implements Swift_CharacterStream.

Definition at line 286 of file ArrayCharacterStream.php.

Referenced by importString().

Here is the caller graph for this function:

Swift_CharacterStream_ArrayCharacterStream::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 86 of file ArrayCharacterStream.php.

References $_array_size, $i, and Swift_OutputByteStream\read().

Here is the call graph for this function:

Swift_CharacterStream_ArrayCharacterStream::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 123 of file ArrayCharacterStream.php.

References flushContents(), and write().

Here is the call graph for this function:

Swift_CharacterStream_ArrayCharacterStream::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 135 of file ArrayCharacterStream.php.

References $_offset, and $i.

Swift_CharacterStream_ArrayCharacterStream::readBytes (   $length)

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

Parameters
int$length
Returns
int[]

Implements Swift_CharacterStream.

Definition at line 168 of file ArrayCharacterStream.php.

References $_offset, and $i.

Swift_CharacterStream_ArrayCharacterStream::setCharacterReaderFactory ( Swift_CharacterReaderFactory  $factory)

Set the CharacterReaderFactory for multi charset support.

Parameters
Swift_CharacterReaderFactory$factory

Implements Swift_CharacterStream.

Definition at line 76 of file ArrayCharacterStream.php.

Referenced by __construct().

Here is the caller graph for this function:

Swift_CharacterStream_ArrayCharacterStream::setCharacterSet (   $charset)

Set the character set used in this CharacterStream.

Parameters
string$charset

Implements Swift_CharacterStream.

Definition at line 66 of file ArrayCharacterStream.php.

Referenced by __construct().

Here is the caller graph for this function:

Swift_CharacterStream_ArrayCharacterStream::setPointer (   $charOffset)

Move the internal pointer to $charOffset in the stream.

Parameters
int$charOffset

Implements Swift_CharacterStream.

Definition at line 270 of file ArrayCharacterStream.php.

References $_array_size, and elseif().

Here is the call graph for this function:

Swift_CharacterStream_ArrayCharacterStream::write (   $chars)

Write $chars to the end of the stream.

Parameters
string$chars

Implements Swift_CharacterStream.

Definition at line 192 of file ArrayCharacterStream.php.

References $_array_size, $i, and _reloadBuffer().

Referenced by importString().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Swift_CharacterStream_ArrayCharacterStream::$_array = array()
private

Array of characters

Definition at line 41 of file ArrayCharacterStream.php.

Swift_CharacterStream_ArrayCharacterStream::$_array_size = array()
private

Size of the array of character

Definition at line 44 of file ArrayCharacterStream.php.

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

Swift_CharacterStream_ArrayCharacterStream::$_byteMap
staticprivate

A map of characters and their derivative byte values

Definition at line 29 of file ArrayCharacterStream.php.

Swift_CharacterStream_ArrayCharacterStream::$_charMap
staticprivate

A map of byte values and their respective characters

Definition at line 26 of file ArrayCharacterStream.php.

Swift_CharacterStream_ArrayCharacterStream::$_charReader
private

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

Definition at line 32 of file ArrayCharacterStream.php.

Swift_CharacterStream_ArrayCharacterStream::$_charReaderFactory
private

A factory for creatiing CharacterReader instances

Definition at line 35 of file ArrayCharacterStream.php.

Swift_CharacterStream_ArrayCharacterStream::$_charset
private

The character set this stream is using

Definition at line 38 of file ArrayCharacterStream.php.

Swift_CharacterStream_ArrayCharacterStream::$_offset = 0
private

The current character offset in the stream

Definition at line 47 of file ArrayCharacterStream.php.

Referenced by read(), and readBytes().


The documentation for this class was generated from the following file: