\Swift_KeyCache_ArrayKeyCache
A basic KeyCache backed by an array.
- Author: Chris Corbyn
Synopsis
class Swift_KeyCache_ArrayKeyCache
implements
Swift_KeyCache
{
- // members
- private array $_contents;
- private Swift_KeyCache_KeyCacheInputStream $_stream;
- // methods
- public void __construct()
- public void setString()
- public void importFromByteStream()
- public Swift_InputByteStream getInputByteStream()
- public string getString()
- public void exportToByteStream()
- public boolean hasKey()
- public void clearKey()
- public void clearAll()
- private void _prepareCache()
Hierarchy
Implements
Constants
Name | Value |
---|---|
MODE_WRITE | 1 |
MODE_APPEND | 2 |
Members
private
- $_contents
—
array
Cache contents. - $_stream
—
Swift_KeyCache_KeyCacheInputStream
An InputStream for cloning.
Methods
private
- _prepareCache() — Initialize the namespace of $nsKey if needed.
public
- __construct() — Create a new ArrayKeyCache with the given $stream for cloning to make InputByteStreams.
- clearAll() — Clear all data in the namespace $nsKey if it exists.
- clearKey() — Clear data for $itemKey in the namespace $nsKey if it exists.
- exportToByteStream() — Get data back out of the cache as a ByteStream.
- getInputByteStream() — Provides a ByteStream which when written to, writes data to $itemKey.
- getString() — Get data back out of the cache as a string.
- hasKey() — Check if the given $itemKey exists in the namespace $nsKey.
- importFromByteStream() — Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
- setString() — Set a string into the cache under $itemKey for the namespace $nsKey.