storage.mechanism.IEUserData Extends goog.storage.mechanism.IterableMechanism
Provides a storage mechanism using IE userData.

Inheritance

Constructor

goog.storage.mechanism.IEUserData(storageKeyopt_storageNodeId)

Parameters

storageKey : string
The key (store name) to store the data under.
opt_storageNodeId : string=
The ID of the associated HTML element, one will be created if not provided.

Instance Methods

Public Protected Private
__iterator__()
No description.
code »
clear()
No description.
code »
get()
No description.
code »
getCount()
No description.
code »
getNode_() !Element
Returns the storage node.
Returns: !Element  Storage DOM Element.
code »
isAvailable() boolean
Determines whether or not the mechanism is available.
Returns: boolean  True if the mechanism is available.
code »
loadNode_()
Loads the underlying storage node to the state we saved it to before.
code »
remove()
No description.
code »
saveNode_()
Saves the underlying storage node.
code »
set()
No description.
code »
__iterator__(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.
Arguments:
opt_keys : boolean=
True to iterate over the keys. False to iterate over the values. The default value is false.
Returns: !goog.iter.Iterator  The iterator.
code »
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.
code »
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.
Returns: number  Number of stored elements.
code »
get(key) ?string
Get the value stored under a key.
Arguments:
key : string
The key to get.
Returns: ?string  The corresponding value, null if not found.
code »
remove(key)
Remove a key and its value.
Arguments:
key : string
The key to remove.
code »
set(keyvalue)
Set a value for a key.
Arguments:
key : string
The key to set.
value : string
The string to save.
code »

Instance Properties

constructor :
No description.
Code »
storageKey_ :
The key to store the data under.
Code »
storageNode_ :
The document element used for storing data.
Code »
constructor :
No description.
Code »

Static Methods

goog.storage.mechanism.IEUserData.decodeKey_(key) string
Decodes a dot-encoded and character-prefixed key. See encodeKey_ documentation for encoding details.
Arguments:
key : string
The key to be decoded.
Returns: string  The decoded key.
code »
goog.storage.mechanism.IEUserData.encodeKey_(key) string
Encodes anything other than [-a-zA-Z0-9_] using a dot followed by hex, and prefixes with underscore to form a valid and safe HTML attribute name. We use URI encoding to do the initial heavy lifting, then escape the remaining characters that we can't use. Since a valid attribute name can't contain the percent sign (%), we use a dot (.) as an escape character.
Arguments:
key : string
The key to be encoded.
Returns: string  The encoded key.
code »

Static Properties

goog.storage.mechanism.IEUserData.ENCODE_MAP :
Encoding map for characters which are not encoded by encodeURIComponent(). See encodeKey_ documentation for encoding details.
Code »
goog.storage.mechanism.IEUserData.storageMap_ : goog.structs.Map
Global storageKey to storageNode map, so we save on reloading the storage.
Code »
goog.storage.mechanism.IEUserData.superClass_ :
No description.
Code »

Package storage.mechanism

Package Reference