Skip to content

Latest commit

 

History

History
367 lines (285 loc) · 8.3 KB

File metadata and controls

367 lines (285 loc) · 8.3 KB
layout default
menu_item api
title Config
description Version 0.26.1
return_to
API Documentation Index
/api/
sections
findGlobal findProgramdata findSystem findXdg openDefault openOndisk #deleteEntry #deleteMultivar #getBool #getEntry #getInt32 #getInt64 #getPath #getStringBuf #lock #setBool #setInt32 #setInt64 #setMultivar #setString #snapshot LEVEL MAP
#findGlobal
#findProgramdata
#findSystem
#findXdg
#openDefault
#openOndisk
#deleteEntry
#deleteMultivar
#getBool
#getEntry
#getInt32
#getInt64
#getPath
#getStringBuf
#lock
#setBool
#setInt32
#setInt64
#setMultivar
#setString
#snapshot
#LEVEL
#MAP

Config.findGlobal Async

Config.findGlobal().then(function(buf) {
  // Use buf
});
Returns
Buf

Config.findProgramdata Async

Config.findProgramdata().then(function(buf) {
  // Use buf
});
Returns
Buf

Config.findSystem Async

Config.findSystem().then(function(buf) {
  // Use buf
});
Returns
Buf

Config.findXdg Async

Config.findXdg().then(function(buf) {
  // Use buf
});
Returns
Buf

Config.openDefault Async

Config.openDefault().then(function(config) {
  // Use config
});
Returns
Config

Config.openOndisk Async

Config.openOndisk(path).then(function(config) {
  // Use config
});
Parameters Type
path String Path to the on-disk file to open
Returns
Config The configuration instance to create

Config#deleteEntry Sync

var result = config.deleteEntry(name);

| Parameters | Type | | --- | --- | --- | | name | String | the variable to delete |

Returns
Number

Config#deleteMultivar Sync

var result = config.deleteMultivar(name, regexp);

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name | | regexp | String | a regular expression to indicate which values to delete |

Returns
Number 0 or an error code

Config#getBool Async

config.getBool(name).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name |

Returns
Number

Config#getEntry Async

config.getEntry(name).then(function(configEntry) {
  // Use configEntry
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name |

Returns
ConfigEntry

Config#getInt32 Async

config.getInt32(name).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name |

Returns
Number

Config#getInt64 Async

config.getInt64(name).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name |

Returns
Number

Config#getPath Async

config.getPath(name).then(function(buf) {
  // Use buf
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name |

Returns
Buf the buffer in which to store the result

Config#getStringBuf Async

config.getStringBuf(name).then(function(buf) {
  // Use buf
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name |

Returns
Buf buffer in which to store the string

Config#lock Async

config.lock().then(function(transaction) {
  // Use transaction
});
Returns
Transaction the resulting transaction, use this to commit or undo the
changes

Config#setBool Async

config.setBool(name, value).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name | | value | Number | the value to store |

Returns
Number 0 or an error code

Config#setInt32 Async

config.setInt32(name, value).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name | | value | Number | Integer value for the variable |

Returns
Number 0 or an error code

Config#setInt64 Async

config.setInt64(name, value).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name | | value | Number | Long integer value for the variable |

Returns
Number 0 or an error code

Config#setMultivar Async

config.setMultivar(name, regexp, value).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name | | regexp | String | a regular expression to indicate which values to replace | | value | String | the new value. |

Returns
Number

Config#setString Async

config.setString(name, value).then(function(result) {
  // Use result
});

| Parameters | Type | | --- | --- | --- | | name | String | the variable's name | | value | String | the string to store. |

Returns
Number 0 or an error code

Config#snapshot Async

config.snapshot().then(function(config) {
  // Use config
});
Returns
Config

Config.LEVEL ENUM

| Flag | Value | | --- | --- | --- | | Config.LEVEL.PROGRAMDATA | 1 | | Config.LEVEL.SYSTEM | 2 | | Config.LEVEL.XDG | 3 | | Config.LEVEL.GLOBAL | 4 | | Config.LEVEL.LOCAL | 5 | | Config.LEVEL.APP | 6 | | Config.LEVEL.HIGHEST_LEVEL | -1 |

Config.MAP ENUM

| Flag | Value | | --- | --- | --- | | Config.MAP.FALSE | 0 | | Config.MAP.TRUE | 1 | | Config.MAP.INT32 | 2 | | Config.MAP.STRING | 3 |