Home

Awesome

SerDes

Serialize / de-serialize an AutoHotkey object structure.

Requires AHK v1.1+ OR v2.0-a049+

License: WTFPL


Serialize

Syntax

str   := SerDes( obj [ ,, indent := "" ] )
bytes := SerDes( obj, outfile [ , indent := "" ] )

Parameters

str      [retval]   - String representation of the object
bytes    [retval]   - Bytes written to 'outfile'.
obj      [in]       - AHK object to serialize.
outfile  [in, opt]  - The file to write to. If no absolute path is specified, %A_WorkingDir% is used.
indent   [in, opt]  - If indent is an integer or string, then array elements and object members will
                      be pretty-printed with that indent level. Blank(""), the default, OR 0, selects
                      the most compact representation. Using an integer indent indents that many spaces
                      per level. If indent is a string, (such as "`t"), that string is used to indent
                      each level. Negative integer is treated as positive.

Deserialize

Syntax

obj   := SerDes( src )

Parameters

obj      [retval]   - An AHK object
src      [in]       - Either a 'SerDes()' formatted string or the path to the file containing 'SerDes()' formatted text.

Remarks:

1         2
{ "key1": ["Hello World"], "key2": $2 } // -> $2 references the object stored in 'key1'