jaster.serialise.builder

Members

Aliases

CodeFunc
alias CodeFunc = void delegate(CodeBuilder)

A delegate that can be passed to functions such as addFuncDeclaration to allow flexible generation of code.

UseNewLines
alias UseNewLines = Flag!"newLines"

Passed to functions such as CodeBuilder.put to control automatic new lines.

UseTabs
alias UseTabs = Flag!"tabs"

Passed to functions such as CodeBuilder.put to control automatic tabbing.

Classes

CodeBuilder
class CodeBuilder

A glorified wrapper around an Appender which supports automatic tabbing and new lines.

Functions

addAlias
Variable addAlias(CodeBuilder builder, dstring name, CodeFunc valueFunc)

A helper function for addVariable which creates an alias.

addEnumValue
Variable addEnumValue(CodeBuilder builder, dstring name, CodeFunc valueFunc)

A helper function for addVariable which creates an enum value.

addFuncCall
CodeBuilder addFuncCall(CodeBuilder builder, dstring funcName, Params params)

Creates a call to a function.

addFuncDeclaration
CodeBuilder addFuncDeclaration(CodeBuilder builder, dstring returnType, dstring name, Variable[] params, CodeFunc body_)

Creates a function using the given data.

addFuncDeclaration
CodeBuilder addFuncDeclaration(CodeBuilder builder, dstring name, Variable[] params, CodeFunc body_)

Creates a function using the given data.

addImport
CodeBuilder addImport(CodeBuilder builder, dstring moduleName, dstring[] selection)

Creates an import statement.

addReturn
CodeBuilder addReturn(CodeBuilder builder, T code)

Creates a return statement.

addVariable
Variable addVariable(CodeBuilder builder, dstring type, dstring name, CodeFunc valueFunc)

Declares a variable, and returns a Variable which can be used to easily reference the variable.

addVariable
Variable addVariable(CodeBuilder builder, dstring name, CodeFunc valueFunc)

A helper function to more easily specify the variable's type.

putEntabbed
CodeBuilder putEntabbed(CodeBuilder builder, CodeFunc code)

A helper function that entabs the given CodeBuilder, calls a delegate to generate some code, and then detabs the CodeBuilder.

putExtended
CodeBuilder putExtended(CodeBuilder builder, T param)

A helper function which accepts a wide variety of parameters to pass to CodeBuilder.put.

putScope
CodeBuilder putScope(CodeBuilder builder, CodeFunc func)
putString
CodeBuilder putString(CodeBuilder builder, T str)

A helper function to write the given code in between two '"'s

putf
CodeBuilder putf(CodeBuilder builder, dstring formatStr, Params params)

Formatted version of CodeBuilder.put.

Imports

Flag (from std.typecons)
public import std.typecons : Flag, Yes, No;
Undocumented in source.
No (from std.typecons)
public import std.typecons : Flag, Yes, No;
Undocumented in source.
Yes (from std.typecons)
public import std.typecons : Flag, Yes, No;
Undocumented in source.

Structs

Variable
struct Variable

Describes a variable.

Meta