Home

# Class goog.storage.mechanism.HTML5WebStorage

Provides a storage mechanism that uses HTML5 Web storage.

extends goog.storage.mechanism.IterableMechanism

Instance Method Summary
| `__iterator__(boolean= opt_keys) ⇒ !goog.iter.Iterator` Returns an iterator that iterates over the elements in the storage. Will throw goog.iter.StopIteration after the last element.
| `clear()` Remove all key-value pairs. Could be overridden in a subclass, as the default implementation is not very efficient - it iterates over all keys.
| `get(string key) ⇒ ?string` Get the value stored under a key.
| `getCount() ⇒ number` Get the number of stored key-value pairs. Could be overridden in a subclass, as the default implementation is not very efficient - it iterates over all keys.
| `isAvailable() ⇒ boolean` Determines whether or not the mechanism is available. It works only if the provided web storage object exists and is enabled.
| `remove(string key)` Remove a key and its value.
| `set(string key, string value)` Set a value for a key.