Functions

The following functions are available globally.

  • Executes the program file at the specified path.

    Declaration

    func execute(_ path: String)

    Parameters

    path

    The relative path to the pogram file within the template.

  • Processes the template file contained in the Flood module at the specified path and prints the resulting string to current output file.

    Declaration

    func insert(_ path: String, from module: Module, indentation: Double)

    Parameters

    path

    The relative path to the template file within the module.

    module

    The module containing the template file to insert.

    indentation

    An optional number of indentations to prepend to each line, defaults to 0.

  • Processes the template file at the specified path and prints the resulting string to current output file.

    Declaration

    func insert(_ path: String, indentation: Double?)

    Parameters

    path

    The relative path to the template file within the template.

    indentation

    An optional number of indentations to prepend to each line, defaults to 0.

  • Generates a universally unique identifier (UUID).

    Declaration

    func makeUUID() -> String

    Return Value

    String representation of a UUID.

  • Prints a description of value to the current output file.

    Declaration

    func print(_ value: Any)

    Parameters

    value

    A value of any type that you wish to print.

  • Prints a description of value to the current output file with a new line.

    Declaration

    func println(_ value: Any)

    Parameters

    value

    A value of any type that you wish to print.

  • Processes the template file contained in the Flood module at the specified path and optionally writes the resulting string to an output file if output is not nil.

    Declaration

    func process(_ path: String, from module: Module, into output: String, indentation: Double) -> String

    Parameters

    path

    The relative path to the template file within the module.

    module

    The module containing the template file to process.

    output

    A path to the output file to write to. If this path begins with a / it is interpreted as an absolute path, otherwise it is interpreted relative to the outputFolderPath. Providing the value nil skips writing to an output file.

    indentation

    An optional number of indentations to prepend to each line, defaults to 0.

    Return Value

    Returns the string generated by processing the template file.

  • Processes the template file at the specified path and optionally writes the resulting string to an output file if output is not nil.

    Declaration

    func process(_ path: String, into output: String, indentation: Double) -> String

    Parameters

    path

    The relative path to the template file within the template.

    output

    A path to the output file to write to. If this path begins with a / it is interpreted as an absolute path, otherwise it is interpreted relative to the outputFolderPath. Providing the value nil skips writing to an output file.

    indentation

    An optional number of indentations to prepend to each line, defaults to 0.

    Return Value

    Returns the string generated by processing the template file.