User Tools

Site Tools


en:code:data:registry

This is an old revision of the document!


Registry

This object allows you to have access to the system's registry. It only works under Windows.

Functions

Registry

Constructor function.

Syntax

var myObject = new Registry();

Example

Create a Registry object.

var myObject = new Registry();

Methods

openKey

Opens a registry key.

Syntax

myObject.openKey(key, subkey);

Arguments

  1. key - (Key) the root key to use
  2. subkey - (string) the subkey to open

Returns

  • (Registry) this Registry

Exceptions

  • (OpenKeyError) unable to open the key

createKey

Creates a registry key.

Syntax

myObject.createKey(key, subkey);

Arguments

  1. key - (Key) the root key to use
  2. subkey - (string) the subkey to create

Returns

  • (Registry) this Registry

Exceptions

  • (CreateKeyError) unable to create the key

setValue

Sets the value of the current key.

Syntax

myObject.setValue(value, data);

Arguments

  1. value - (string) the value to write to
  2. data - (mixed) the data to write

Returns

  • (Registry) this Registry

Exceptions

  • (SetValueError) cannot set the value data

value

Returns the data contained in a registry value.

Syntax

myObject.value(value);
myObject.value();

Arguments

  1. value - (string) the value to read

Returns

  • (mixed) the data contained in a registry value

Exceptions

  • (FindValueError) cannot find the value to read
  • (InvalidValueError) invalid value type

valueNames

Returns all the value names contained in the current key.

Syntax

myObject.valueNames();

Returns

  • (array) an array containing all the value names contained in the current key

Exceptions

  • (InvalidKeyError) unable to query informations about this key

keys

Returns all the keys contained in the current key.

Syntax

myObject.keys();

Returns

  • (array) an array containing all the keys contained in the current key

Exceptions

  • (InvalidKeyError) unable to query informations about this key

deleteValue

Deletes a value contained in the current key.

Syntax

myObject.deleteValue(value);
myObject.deleteValue();

Arguments

  1. value - (string) the value to delete

Returns

  • (Registry) this Registry

Exceptions

  • (InvalidKeyError) unable to delete the key

deleteKey

Deletes a registry key, or deletes the current key.

Syntax

myObject.deleteKey(key, subkey);
myObject.deleteKey();

Arguments

  1. key - (Key) the root key to use
  2. subkey - (string) the subkey to delete

Returns

  • (Registry) this Registry

Exceptions

  • (InvalidKeyError) unable to create the key

closeKey

Closes the current key.

Syntax

myObject.closeKey();

Returns

  • (Registry) this Registry

Enumerations

Key

Root keys.

Values

  1. ClassesRoot: classes root
  2. CurrentConfig: current config
  3. CurrentUser: current user
  4. Users: users
  5. LocalMachine: local machine
en/code/data/registry.1295986294.txt.gz · Last modified: 2021/02/13 11:23 (external edit)