Properties Methods Events Config Options Direct Link

    Provider
      FileProvider

# Class Ext.air.FileProvider

Package: | Ext.air
Defined In: | FileProvider.js
Class: | FileProvider
Extends: | Provider

An Ext state provider implementation for Adobe AIR that stores state in the application storage directory.

## Config Options

Config Options | Defined By
--- | ---
| defaultState : Object The default state if no state file can be found | FileProvider
| file : String The file name to use for the state file in the application storage directory | FileProvider

## Public Properties

This class has no public properties.

## Public Methods

Method | Defined By
--- | ---

FileProvider( `Object config` )
Parameters:

- `config` : Object

Returns:

- ``

FileProvider

clear( `String name` ) : void
Clears a value from the state
Clears a value from the state
Parameters:

- `name` : String
  The key name

Returns:

- `void`

Provider

decodeValue( `String value` ) : Mixed
Decodes a string previously encoded with encodeValue.
Decodes a string previously encoded with encodeValue.
Parameters:

- `value` : String
  The value to decode

Returns:

- `Mixed`
  The decoded value

Provider

encodeValue( `Mixed value` ) : String
Encodes a value including type information. Decode with decodeValue.
Encodes a value including type information. Decode with decodeValue.
Parameters:

- `value` : Mixed
  The value to encode

Returns:

- `String`
  The encoded value

Provider

get( `String name`, `Mixed defaultValue` ) : Mixed
Returns the current value for a key
Returns the current value for a key
Parameters:

- `name` : String
  The key name
- `defaultValue` : Mixed
  A default value to return if the key's value is not found

Returns:

- `Mixed`
  The state data

Provider

set( `String name`, `Mixed value` ) : void
Sets the value for a key
Sets the value for a key
Parameters:

- `name` : String
  The key name
- `value` : Mixed
  The value to set

Returns:

- `void`

Provider

## Public Events

Event | Defined By
--- | ---

statechange : ( `Provider this`, `String key`, `String value` )
Fires when a state change occurs.
Fires when a state change occurs.
Listeners will be called with the following arguments:

- `this` : Provider
  This state provider
- `key` : String
  The state key which was changed
- `value` : String
  The encoded value for the state

Provider