addFuncCall

Creates a call to a function.

Notes: params can be made up of any combination of values supported by putExtended.

Strings won't be automatically enclosed between speech marks('"').

addFuncCall
(
Flag!"semicolon" semicolon = Yes.semicolon
Params...
)

Parameters

semicolon

If Yes.semicolon, then a ';' is inserted at the end of the function call.

builder CodeBuilder

The CodeBuilder to use.

funcName dstring

The name of the function to call.

params Params

The parameters to pass to the function.

Return Value

builder

Examples

auto builder = new CodeBuilder();

// DStrings(Including input ranges of them), CodeFuncs, built-in types(int, bool, float, etc.), and Variables can all be passed as parameters.
dstring  str  = "\"Hello\""d;
CodeFunc func = (b){b.putString("World!");};
Variable vari = Variable("int", "someVar");

builder.addFuncCall("writeln", str, func, vari);

builder.data.should.equal("writeln(\"Hello\", \"World!\", someVar);\n");

Meta