Code Monkey home page Code Monkey logo

ahk.v1-2serdes's Introduction

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:

  • Serilaized output is similar to JSON except for escape sequences which follows AHK's specification. Also, strings, numbers and objects are allowed as object/{} keys unlike JSON which restricts it to string data type only.
  • Non-standard AHK objects such as COM, Func, FileObject, RegExMatchObject are not supported.
  • Object references, including circular ones, are supported and notated as $n, where n is the 1-based index of the referenced object in the heirarchy tree when encountered during enumeration (for-loop) OR as it appears from left to right (for string representation) as marked by an opening brace{ or bracket[.
1         2
{ "key1": ["Hello World"], "key2": $2 } // -> $2 references the object stored in 'key1'

ahk.v1-2serdes's People

Contributors

cocobelgica avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.