Documentation

Swift_KeyCache_ArrayKeyCache
in package
implements Swift_KeyCache

A basic KeyCache backed by an array.

Tags
author

Chris Corbyn

Interfaces, Classes and Traits

Swift_KeyCache
Provides a mechanism for storing data using two keys.

Table of Contents

$contents  : array<string|int, mixed>
Cache contents.
$stream  : Swift_KeyCache_KeyCacheInputStream
An InputStream for cloning.
__construct()  : mixed
Create a new ArrayKeyCache with the given $stream for cloning to make InputByteStreams.
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.
prepareCache()  : mixed
Initialize the namespace of $nsKey if needed.

Properties

$contents

Cache contents.

private array<string|int, mixed> $contents = []

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

to write the data to

Return values
mixed

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
see

MODE_WRITE, MODE_APPEND

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
Tags
see

MODE_WRITE, MODE_APPEND

Return values
mixed

prepareCache()

Initialize the namespace of $nsKey if needed.

private prepareCache(string $nsKey) : mixed
Parameters
$nsKey : string
Return values
mixed

Search results