Swift_KeyCache
in
Provides a mechanism for storing data using two keys.
Tags
Table of Contents
- MODE_APPEND = 2
- Mode for appending data to the end of existing cached data
- MODE_WRITE = 1
- Mode for replacing existing cached data
- clearAll() : mixed
- Clear all data in the namespace $nsKey if it exists.
- clearKey() : mixed
- Clear data for $itemKey in the namespace $nsKey if it exists.
- exportToByteStream() : mixed
- Get data back out of the cache as a ByteStream.
- getInputByteStream() : Swift_InputByteStream
- Provides a ByteStream which when written to, writes data to $itemKey.
- getString() : string
- Get data back out of the cache as a string.
- hasKey() : bool
- Check if the given $itemKey exists in the namespace $nsKey.
- importFromByteStream() : mixed
- Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
- setString() : mixed
- Set a string into the cache under $itemKey for the namespace $nsKey.
Constants
MODE_APPEND
Mode for appending data to the end of existing cached data
public
mixed
MODE_APPEND
= 2
MODE_WRITE
Mode for replacing existing cached data
public
mixed
MODE_WRITE
= 1
Methods
clearAll()
Clear all data in the namespace $nsKey if it exists.
public
clearAll(string $nsKey) : mixed
Parameters
- $nsKey : string
Return values
mixed —clearKey()
Clear data for $itemKey in the namespace $nsKey if it exists.
public
clearKey(string $nsKey, string $itemKey) : mixed
Parameters
- $nsKey : string
- $itemKey : string
Return values
mixed —exportToByteStream()
Get data back out of the cache as a ByteStream.
public
exportToByteStream(string $nsKey, string $itemKey, Swift_InputByteStream $is) : mixed
Parameters
- $nsKey : string
- $itemKey : string
- $is : Swift_InputByteStream
-
stream to write the data to
Return values
mixed —getInputByteStream()
Provides a ByteStream which when written to, writes data to $itemKey.
public
getInputByteStream(string $nsKey, string $itemKey[, Swift_InputByteStream $is = null ]) : Swift_InputByteStream
NOTE: The stream will always write in append mode. If the optional third parameter is passed all writes will go through $is.
Parameters
- $nsKey : string
- $itemKey : string
- $is : Swift_InputByteStream = null
-
optional input stream
Return values
Swift_InputByteStream —getString()
Get data back out of the cache as a string.
public
getString(string $nsKey, string $itemKey) : string
Parameters
- $nsKey : string
- $itemKey : string
Return values
string —hasKey()
Check if the given $itemKey exists in the namespace $nsKey.
public
hasKey(string $nsKey, string $itemKey) : bool
Parameters
- $nsKey : string
- $itemKey : string
Return values
bool —importFromByteStream()
Set a ByteStream into the cache under $itemKey for the namespace $nsKey.
public
importFromByteStream(string $nsKey, string $itemKey, Swift_OutputByteStream $os, int $mode) : mixed
Parameters
- $nsKey : string
- $itemKey : string
- $os : Swift_OutputByteStream
- $mode : int
Tags
Return values
mixed —setString()
Set a string into the cache under $itemKey for the namespace $nsKey.
public
setString(string $nsKey, string $itemKey, string $string, int $mode) : mixed
Parameters
- $nsKey : string
- $itemKey : string
- $string : string
- $mode : int