The CodeBuilder to use.
The parameter to put.
builder
InputRanges of characters (dstring, for example) - Written in as-is, with no modification.
CodeFunc - The CodeFunc is called with builder as it's parameter.
Variable - The name of the variable is written.
Any built-in D type - The result of passing the parameter to std.conv.to!string is written.
auto builder = new CodeBuilder(); builder.putExtended("Hello"d) // strings .putExtended((CodeBuilder b) => b.put("World!")) // CodeFuncs .putExtended(Variable("int", "myVar", null)) // Variables (only their names are written) .putExtended(true); // Built-in D types (bools, ints, floats, etc.) builder.data.should.equal("Hello\nWorld!\nmyVar\ntrue\n"d);
A helper function which accepts a wide variety of parameters to pass to CodeBuilder.put.