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

Public Member Functions

 __construct (Swift_KeyCache_KeyCacheInputStream $stream)
 
 setString ($nsKey, $itemKey, $string, $mode)
 
 importFromByteStream ($nsKey, $itemKey, Swift_OutputByteStream $os, $mode)
 
 getInputByteStream ($nsKey, $itemKey, Swift_InputByteStream $writeThrough=null)
 
 getString ($nsKey, $itemKey)
 
 exportToByteStream ($nsKey, $itemKey, Swift_InputByteStream $is)
 
 hasKey ($nsKey, $itemKey)
 
 clearKey ($nsKey, $itemKey)
 
 clearAll ($nsKey)
 

Private Member Functions

 _prepareCache ($nsKey)
 

Private Attributes

 $_contents = array()
 
 $_stream
 

Additional Inherited Members

- Public Attributes inherited from Swift_KeyCache
const MODE_WRITE = 1
 
const MODE_APPEND = 2
 

Detailed Description

A basic KeyCache backed by an array.

Author
Chris Corbyn

Definition at line 16 of file ArrayKeyCache.php.

Constructor & Destructor Documentation

__construct ( Swift_KeyCache_KeyCacheInputStream  $stream)

Create a new ArrayKeyCache with the given $stream for cloning to make InputByteStreams.

Parameters
Swift_KeyCache_KeyCacheInputStream$stream

Definition at line 38 of file ArrayKeyCache.php.

Member Function Documentation

_prepareCache (   $nsKey)
private

Initialize the namespace of $nsKey if needed.

Parameters
string$nsKey

Definition at line 200 of file ArrayKeyCache.php.

Referenced by exportToByteStream(), getString(), hasKey(), importFromByteStream(), and setString().

clearAll (   $nsKey)

Clear all data in the namespace $nsKey if it exists.

Parameters
string$nsKey

Implements Swift_KeyCache.

Definition at line 190 of file ArrayKeyCache.php.

clearKey (   $nsKey,
  $itemKey 
)

Clear data for $itemKey in the namespace $nsKey if it exists.

Parameters
string$nsKey
string$itemKey

Implements Swift_KeyCache.

Definition at line 180 of file ArrayKeyCache.php.

Referenced by importFromByteStream().

exportToByteStream (   $nsKey,
  $itemKey,
Swift_InputByteStream  $is 
)

Get data back out of the cache as a ByteStream.

Parameters
string$nsKey
string$itemKey
Swift_InputByteStream$isto write the data to

Implements Swift_KeyCache.

Definition at line 153 of file ArrayKeyCache.php.

References _prepareCache(), getString(), and Swift_InputByteStream\write().

getInputByteStream (   $nsKey,
  $itemKey,
Swift_InputByteStream  $writeThrough = null 
)

Provides a ByteStream which when written to, writes data to $itemKey.

NOTE: The stream will always write in append mode.

Parameters
string$nsKey
string$itemKey
Swift_InputByteStream$writeThrough
Returns
Swift_InputByteStream

Implements Swift_KeyCache.

Definition at line 117 of file ArrayKeyCache.php.

References $_stream.

getString (   $nsKey,
  $itemKey 
)

Get data back out of the cache as a string.

Parameters
string$nsKey
string$itemKey
Returns
string

Implements Swift_KeyCache.

Definition at line 138 of file ArrayKeyCache.php.

References _prepareCache(), and hasKey().

Referenced by exportToByteStream().

hasKey (   $nsKey,
  $itemKey 
)

Check if the given $itemKey exists in the namespace $nsKey.

Parameters
string$nsKey
string$itemKey
Returns
bool

Implements Swift_KeyCache.

Definition at line 167 of file ArrayKeyCache.php.

References _prepareCache().

Referenced by getString(), importFromByteStream(), and setString().

importFromByteStream (   $nsKey,
  $itemKey,
Swift_OutputByteStream  $os,
  $mode 
)

Set a ByteStream into the cache under $itemKey for the namespace $nsKey.

See Also
MODE_WRITE, MODE_APPEND
Parameters
string$nsKey
string$itemKey
Swift_OutputByteStream$os
int$mode

Implements Swift_KeyCache.

Definition at line 84 of file ArrayKeyCache.php.

References _prepareCache(), clearKey(), hasKey(), and Swift_OutputByteStream\read().

setString (   $nsKey,
  $itemKey,
  $string,
  $mode 
)

Set a string into the cache under $itemKey for the namespace $nsKey.

See Also
MODE_WRITE, MODE_APPEND
Parameters
string$nsKey
string$itemKey
string$string
int$mode

Implements Swift_KeyCache.

Definition at line 53 of file ArrayKeyCache.php.

References _prepareCache(), and hasKey().

Member Data Documentation

$_contents = array()
private

Definition at line 23 of file ArrayKeyCache.php.

$_stream
private

Definition at line 30 of file ArrayKeyCache.php.

Referenced by getInputByteStream().