User Tools

Site Tools


en:code:data:registry

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:code:data:registry [2016/10/09 09:10]
en:code:data:registry [2020/02/09 13:26] (current)
Line 1: Line 1:
 +====== Registry ======
 +This object allows you to have access to the system'​s registry.
 +It only works under Windows.
  
 +===== Functions =====
 +
 +==== Registry ====
 +Constructor function.
 +
 +=== Syntax ===
 +<code javascript>​
 +var myObject = new Registry();
 +</​code>​
 +
 +=== Example ===
 +Create a Registry object.
 +<code javascript>​
 +var myObject = new Registry();
 +</​code>​
 +
 +===== Methods =====
 +
 +==== openKey ====
 +Opens a registry key.
 +
 +=== Syntax ===
 +<code javascript>​
 +myObject.openKey(key,​ subkey);
 +</​code>​
 +
 +=== Arguments ===
 +  - key - ([[#​key|Key]]) the root key to use
 +  - subkey - (string) the subkey to open
 +
 +=== Returns ===
 +  * (Registry) this Registry
 +
 +=== Exceptions ===
 +  * (OpenKeyError) unable to open the key
 +
 +==== createKey ====
 +Creates a registry key.
 +
 +=== Syntax ===
 +<code javascript>​
 +myObject.createKey(key,​ subkey);
 +</​code>​
 +
 +=== Arguments ===
 +  - key - ([[#​key|Key]]) the root key to use
 +  - 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 ===
 +<code javascript>​
 +myObject.setValue(value,​ data);
 +</​code>​
 +
 +=== Arguments ===
 +  - value - (string) the value to write to
 +  - 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 ===
 +<code javascript>​
 +myObject.value(value);​
 +</​code>​
 +<code javascript>​
 +myObject.value();​
 +</​code>​
 +
 +=== Arguments ===
 +  - 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 ===
 +<code javascript>​
 +myObject.valueNames();​
 +</​code>​
 +
 +=== 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 ===
 +<code javascript>​
 +myObject.keys();​
 +</​code>​
 +
 +=== 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 ===
 +<code javascript>​
 +myObject.deleteValue(value);​
 +</​code>​
 +<code javascript>​
 +myObject.deleteValue();​
 +</​code>​
 +
 +=== Arguments ===
 +  - 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 ===
 +<code javascript>​
 +myObject.deleteKey(key,​ subkey);
 +</​code>​
 +<code javascript>​
 +myObject.deleteKey();​
 +</​code>​
 +
 +=== Arguments ===
 +  - key - ([[#​key|Key]]) the root key to use
 +  - subkey - (string) the subkey to delete
 +
 +=== Returns ===
 +  * (Registry) this Registry
 +
 +=== Exceptions ===
 +  * (InvalidKeyError) unable to create the key
 +
 +==== closeKey ====
 +Closes the current key.
 +
 +=== Syntax ===
 +<code javascript>​
 +myObject.closeKey();​
 +</​code>​
 +
 +=== Returns ===
 +  * (Registry) this Registry
 +
 +===== Enumerations =====
 +
 +==== Key ====
 +Root keys.
 +
 +=== Values ===
 +  - ClassesRoot:​ classes root
 +  - CurrentConfig:​ current config
 +  - CurrentUser:​ current user
 +  - Users: users
 +  - LocalMachine:​ local machine