wv-settings
1 Overview
2 Class:   wv-settings%
wv-settings%
new
get
set!
get/  global
set/  global!
clone
context
9.1

wv-settings🔗ℹ

Hans Dijkema <hans@dijkewijk.nl>

 (require wv-settings)

Settings wrapper used by the webview library.

This module exports the wv-settings% class, which provides a small object-oriented interface over an ini settings backend. Settings are accessed relative to a context.

1 Overview🔗ℹ

A wv-settings% object combines:

  • an ini settings object

  • a symbol identifying the settings context

Keys used in this class are symbols.

2 Class: wv-settings%🔗ℹ

class

wv-settings% : class?

  superclass: object%

Wraps an ini settings object for one context.
The class delegates all reads and writes to the supplied ini object.

constructor

(new wv-settings% 
    [ini ini] 
    [wv-context wv-context]) 
  (is-a?/c wv-settings%)
  ini : (is-a?/c ini%)
  wv-context : symbol?
Creates a settings wrapper.

ini must provide compatible get and set! methods. wv-context is the context symbol used for contextual settings access.

method

(send a-wv-settings get key    
  default-value ...)  any/c
  key : symbol?
  default-value : any/c
Returns the value associated with key in the current context.

If no default value is supplied, the call delegates to:

(send ini get wv-context key)

If a default value is supplied, only the first extra argument is used, and the call delegates to:

(send ini get wv-context key default)

method

(send a-wv-settings set! key value)  any/c

  key : symbol?
  value : any/c
Stores value under key in the current context.

Delegates to:

(send ini set! wv-context key value)

method

(send a-wv-settings get/global key    
  default-value ...)  any/c
  key : symbol?
  default-value : any/c
Returns the value associated with key in the global settings section.

If no default value is supplied, the call delegates to:

(send ini get 'global key)

If a default value is supplied, only the first extra argument is used, and the call delegates to:

(send ini get 'global key default)

method

(send a-wv-settings set/global! key value)  any/c

  key : symbol?
  value : any/c
Stores value under key in the global settings section.

Delegates to:

(send ini set! 'global key value)

method

(send a-wv-settings clone context)  wv-settings%

  context : symbol?
Creates a new wv-settings% object sharing the same ini backend but using context as its context.

method

(send a-wv-settings context)  symbol?

Returns the current context symbol.