StoredList:
Filter:
JITLibExtensions/Classes (extension) | Collection

StoredList
ExtensionExtension

store and recall named lists of settings in known locations

Description

A StoredList is typically used for storing settings to disk, and recalling them later. These are often parameter lists of processes like Ndefs, Pdefs, Tdefs. StoredList are used in PxChainPreset for now, and may be adapted for ProxyPreset as well.

First code examples:

Class Methods

.new

create a new storedList object, with

Arguments:

id

a symbol as id

list

an optional list of associations

suffix

a suffix used for storing as file

Instance Methods

.id

the id of the storedList

.list

the list of stored settings

.names

.values

get names and values of stored settings separately

.prettyList

readable post of list, as also used for storage

.at

Arguments:

nameOrIndex

access items in the list by name, index or array of names/indices

.add

add a setting to the list by name

.removeAt

Arguments:

name

remoce a setting by name or index

.indexOf

Arguments:

name

get index in list for given name

Storage

.addToDisk

get and set flag whether to write changes to disk

.write

write a setting to disk

Arguments:

path

an optional path - default is auto-created storePath.

.dir

the directory in which to write and read. consists of : dirpath +/+ dirname

.filename

the filename where settings list will be written and read. consists of : <id>.<suffix>.<fileExt>

.read

read settings list into the StoredList object.

Arguments:

path

(optional) path of stored file

keep

flag whether to append or clear list first

doneFunc

action to perform when read successfully

.storePath

dir +/+ filename

.backupDir

the directory where to put backups

.suffix

a suffix to append to the filename.

.fileExt

the file extension to use for filename.

.local

tell a StoredList to store locally.

.backup

Arguments:

path

move current stored file to backup folder; this happens automatically when saving.

.dirpath

.dirname

the constituents of .dir

.deleteDialog

open a dialog for deleting settings

.storeDialog

open a dialog for naming and storing a new setting

Examples