Resets any indentation, causing new line writes to start at the first character position.
- Getting started
- Tutorial - Model driven basics
- Tutorial - Full stack Angular application
- Fundamentals
- How-to
- Modeler
- Reference
CodeWriter class
The abstract base class for all code writers. This writer implements the TextWriter interface by decorating the TextWriter provided in the constructor.
Interface Realizations
Attributes
Name | Type | Description |
---|---|---|
endOfLineString | void | Gets or sets the end of line string. The default value is platform dependent. |
indentString | void | Gets or sets the indent string. The default value is a '\t' (tab character). |
Operations
Name | Returns | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
clearIndent()CodeWriter.clearIndentX | this | Resets any indentation, causing new line writes to start at the first character position. | ||||||||||||
constructor(writer)CodeWriter.constructorXConstructor. Creates a new CodeWriter that uses the provided TextWriter internally. Parameters
Return valueType: CodeWriter | CodeWriter | Constructor. Creates a new CodeWriter that uses the provided TextWriter internally. | ||||||||||||
decreaseIndent()CodeWriter.decreaseIndentXDecreases the current indent, which is prefixed to each line of the output. Return valueType: this | this | Decreases the current indent, which is prefixed to each line of the output. | ||||||||||||
increaseIndent()CodeWriter.increaseIndentXIncreases the current indent, which is prefixed to each line of the output. Return valueType: this | this | Increases the current indent, which is prefixed to each line of the output. | ||||||||||||
write(value)CodeWriter.writeXWrites a string value to the output. Parameters
Return valueType: this | this | Writes a string value to the output. | ||||||||||||
writeEndOfLine(value)CodeWriter.writeEndOfLineXWrites the endOfLineString to the output. Parameters
Return valueType: this | this | Writes the endOfLineString to the output. | ||||||||||||
writeFile(path, encoding)CodeWriter.writeFileXWrites the contents of the specified file to the output. Parameters
Return valueType: this | this | Writes the contents of the specified file to the output. | ||||||||||||
writeFileRegion(regionName, path, encoding)CodeWriter.writeFileRegionXWrites the contents of the specified file region to the output. Parameters
Return valueType: boolean | boolean | Writes the contents of the specified file region to the output. | ||||||||||||
writeIndent()CodeWriter.writeIndentXWrites the current indentString to the output. Return valueType: this | this | Writes the current indentString to the output. | ||||||||||||
writeLine(value)CodeWriter.writeLineXWrites a new line to the output. The line is indented automatically. The line is ended with the endOfLineString. Parameters
Return valueType: this | this | Writes a new line to the output. The line is indented automatically. The line is ended with the endOfLineString. | ||||||||||||
writeLineIndented(value)CodeWriter.writeLineIndentedXWrites a new line to the output while temporarily increasing the indent. The line is ended with the endOfLineString. Parameters
Return valueType: this | this | Writes a new line to the output while temporarily increasing the indent. The line is ended with the endOfLineString. | ||||||||||||
writeLines(values, delimiter)CodeWriter.writeLinesXWrites a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString. Parameters
Return valueType: this | this | Writes a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString. | ||||||||||||
writeWhiteSpace()CodeWriter.writeWhiteSpaceXWrites a single whitespace character to the output. Return valueType: this | this | Writes a single whitespace character to the output. |