Class Swift_KeyCache_DiskKeyCache
Inheritance | Swift_KeyCache_DiskKeyCache |
---|---|
Implements | Swift_KeyCache |
A KeyCache which streams to and from disk.
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Create a new DiskKeyCache with the given $stream for cloning to make InputByteStreams, and the given $path to save to. | Swift_KeyCache_DiskKeyCache |
__destruct() | Destructor. | Swift_KeyCache_DiskKeyCache |
clearAll() | Clear all data in the namespace $nsKey if it exists. | Swift_KeyCache_DiskKeyCache |
clearKey() | Clear data for $itemKey in the namespace $nsKey if it exists. | Swift_KeyCache_DiskKeyCache |
exportToByteStream() | Get data back out of the cache as a ByteStream. | Swift_KeyCache_DiskKeyCache |
getInputByteStream() | Provides a ByteStream which when written to, writes data to $itemKey. | Swift_KeyCache_DiskKeyCache |
getString() | Get data back out of the cache as a string. | Swift_KeyCache_DiskKeyCache |
hasKey() | Check if the given $itemKey exists in the namespace $nsKey. | Swift_KeyCache_DiskKeyCache |
importFromByteStream() | Set a ByteStream into the cache under $itemKey for the namespace $nsKey. | Swift_KeyCache_DiskKeyCache |
setString() | Set a string into the cache under $itemKey for the namespace $nsKey. | Swift_KeyCache_DiskKeyCache |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
POSITION_CURRENT | 2 | Signal to leave pointer in whatever position it currently is | Swift_KeyCache_DiskKeyCache |
POSITION_END | 1 | Signal to place pointer at end of file | Swift_KeyCache_DiskKeyCache |
POSITION_START | 0 | Signal to place pointer at start of file | Swift_KeyCache_DiskKeyCache |
Method Details
Create a new DiskKeyCache with the given $stream for cloning to make InputByteStreams, and the given $path to save to.
public void __construct ( Swift_KeyCache_KeyCacheInputStream $stream, $path ) | ||
$stream | Swift_KeyCache_KeyCacheInputStream | |
$path | string | To save to |
Destructor.
public void __destruct ( ) |
Clear all data in the namespace $nsKey if it exists.
public void clearAll ( $nsKey ) | ||
$nsKey | string |
Clear data for $itemKey in the namespace $nsKey if it exists.
public void clearKey ( $nsKey, $itemKey ) | ||
$nsKey | string | |
$itemKey | string |
Get data back out of the cache as a ByteStream.
public void exportToByteStream ( $nsKey, $itemKey, Swift_InputByteStream $is ) | ||
$nsKey | string | |
$itemKey | string | |
$is | Swift_InputByteStream | To write the data to |
Provides a ByteStream which when written to, writes data to $itemKey.
NOTE: The stream will always write in append mode.
public Swift_InputByteStream getInputByteStream ( $nsKey, $itemKey, Swift_InputByteStream $writeThrough = null ) | ||
$nsKey | string | |
$itemKey | string | |
$writeThrough | Swift_InputByteStream |
Get data back out of the cache as a string.
public string getString ( $nsKey, $itemKey ) | ||
$nsKey | string | |
$itemKey | string | |
throws | Swift_IoException |
---|
Check if the given $itemKey exists in the namespace $nsKey.
public bool hasKey ( $nsKey, $itemKey ) | ||
$nsKey | string | |
$itemKey | string |
Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
See also [[MODE_WRITE,]] MODE_APPEND.
public void importFromByteStream ( $nsKey, $itemKey, Swift_OutputByteStream $os, $mode ) | ||
$nsKey | string | |
$itemKey | string | |
$os | Swift_OutputByteStream | |
$mode | int | |
throws | Swift_IoException |
---|
Set a string into the cache under $itemKey for the namespace $nsKey.
See also [[MODE_WRITE,]] MODE_APPEND.
public void setString ( $nsKey, $itemKey, $string, $mode ) | ||
$nsKey | string | |
$itemKey | string | |
$string | string | |
$mode | int | |
throws | Swift_IoException |
---|