Functions
The following functions are available globally.
-
Executes the program file at the specified path.
Declaration
func execute(_ path: String)
Parameters
pathThe 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
pathThe relative path to the template file within the module.
moduleThe module containing the template file to insert.
indentationAn 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
pathThe relative path to the template file within the template.
indentationAn 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
valueA 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
valueA 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 notnil
.Declaration
func process(_ path: String, from module: Module, into output: String, indentation: Double) -> String
Parameters
pathThe relative path to the template file within the module.
moduleThe module containing the template file to process.
outputA 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 theoutputFolderPath
. Providing the valuenil
skips writing to an output file.indentationAn 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 notnil
.Declaration
func process(_ path: String, into output: String, indentation: Double) -> String
Parameters
pathThe relative path to the template file within the template.
outputA 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 theoutputFolderPath
. Providing the valuenil
skips writing to an output file.indentationAn optional number of indentations to prepend to each line, defaults to 0.
Return Value
Returns the string generated by processing the template file.