Functions

The following functions are available globally.

  • Serializes a Flood object into a JSON string.

    The object passed into this function can be either a Dictionary, Array, String, Bool or Double. The keys of the Dictionaries must be of type String. The values of the Arrays and Dictionaries must of type Dictionary, Array, String, Bool or Double.

    Declaration

    func json(from value: String, prioritizedEntries: String) -> String

    Parameters

    value

    The object to serialize into a JSON sttring.

    prioritizedEntries

    The list of dictionary keys which should appear above other dictionary keys in the outputed string. Entries appearing earlier in the list will appear earlier in the outputed string.

    Return Value

    A string whose contents is the serialized JSON data.

  • Deserializes the contents of the JSON file at the specified path.

    Declaration

    func loadJSON(_ path: String) -> Dictionary

    Parameters

    path

    The relative path to the JSON file within the template.

    Return Value

    A dictionary containing the deserialized JSON data.