Usage:
Code: Select all
#Include <KeyValStore> ; or call function KeyValStore() directly to auto-#Include
dat := new KeyValStore("test.xml") ; assumed in %A_WorkingDir%
dat.Set("foo", "Some value")
MsgBox % dat.Get("foo") ; displays 'Some value'
; use dot notation to access nested properties
; escape literal dot with '\' e.g.: 'foo.bar\.baz'
dat.Set("bar.baz", "Another value")
MsgBox % dat.Get("bar.baz") ; 'Another value'
bar := dat.Get("bar") ; {baz: "Another value"}
; get entire contents
all := dat[] ; {foo: "Some value", bar: {baz: "Another value"}}
; set new contents
dat[] := {hello: "Hello World", ahk: "AutoHotkey"}
dat.Del("ahk") ; delete an item, returns the removed item
dat.Clear() ; delete all items
MsgBox % dat.Path ; full path to file