Logo GenPRES

Json Module

Serializes a value to JSON text and back, and writes, reads and deletes the JSON cache files.

Functions and values

Function or value Description

cache p o

Full Usage: cache p o

Parameters:
    p : string - The path to the file
    o : 'a - The object to serialize

Type parameters: 'a

Serialize an object to a JSON string and write it to a file

p : string

The path to the file

o : 'a

The object to serialize

clearCache useDemo

Full Usage: clearCache useDemo

Parameters:
    useDemo : bool - Whether to clear the demo cache files

Clear the cache files for either a product or a demo version of the cache.

useDemo : bool

Whether to clear the demo cache files

deSerialize s

Full Usage: deSerialize s

Parameters:
    s : string - The JSON string to deserialize

Returns: 'T
Type parameters: 'T

Deserializes a JSON string to an object

s : string

The JSON string to deserialize

Returns: 'T

getCache p

Full Usage: getCache p

Parameters:
    p : string - The path to the file

Returns: 'T
Type parameters: 'T

Read a cache file and deserialize it to an object

p : string

The path to the file

Returns: 'T

serialize x

Full Usage: serialize x

Parameters:
    x : 'a - The object to serialize

Returns: string
Type parameters: 'a

Serializes an object to a JSON string

x : 'a

The object to serialize

Returns: string

Type something to start searching.