TextWriter interface

Represents a writer that can write a sequential series of characters.

Attributes

NameTypeDescription
endOfLineStringstring Gets or sets the end of line string. The default value is platform dependent. 
indentStringstring Gets or sets the indent string. The default value is a '\t' (tab character). 

Operations

NameReturnsDescription
clearIndent()

TextWriter.clearIndent

X

Resets any indentation, causing new line writes to start at the first character position.

Return value
void
void Resets any indentation, causing new line writes to start at the first character position. 
decreaseIndent()

TextWriter.decreaseIndent

X

Decreases the current indent, which is prefixed to each line of the output.

Return value
void
void Decreases the current indent, which is prefixed to each line of the output. 
increaseIndent()

TextWriter.increaseIndent

X

Increases the current indent, which is prefixed to each line of the output.

Return value
void
void Increases the current indent, which is prefixed to each line of the output.  
write(value)

TextWriter.write

X

Writes a string value to the output.

Parameters
NameTypeDescription
valuestring The string value to be written.
Return value
void
void Writes a string value to the output. 
writeEndOfLine(value)

TextWriter.writeEndOfLine

X

Writes the endOfLineString to the output.

Parameters
NameTypeDescription
valuestring [0..1]Any value to write before the endOfLineString string is written.
Return value
void
void Writes the endOfLineString to the output. 
writeFile(path, encoding)

TextWriter.writeFile

X

Writes the contents of the specified file to the output.

Parameters
NameTypeDescription
pathstring 
encodingstring [0..1]Optional: the encoding that is used for the file. The default is 'utf-8'.
Return value
void
void Writes the contents of the specified file to the output.  
writeFileRegion(regionName, path, encoding)

TextWriter.writeFileRegion

X

Writes the contents of the specified file region to the output.

Parameters
NameTypeDescription
regionNamestring The name of the region to write. The current FileRegionMapper will be used to determine the format of the region marker (by default: "/// code goes here...").
pathstring 
encodingstring [0..1]The encoding that is used for the file. The default is 'utf-8'.
Return value
Type: boolean 
boolean Writes the contents of the specified file region to the output.  
writeIndent()

TextWriter.writeIndent

X

Writes the current indentString to the output.

Return value
void
void Writes the current indentString to the output.  
writeLine(value)

TextWriter.writeLine

X

Writes a new line to the output. The line is indented automatically. The line is ended with the endOfLineString.

Parameters
NameTypeDescription
valuestring [0..1]The line to write. When omitted, only the endOfLineString is written.
Return value
void
void Writes a new line to the output. The line is indented automatically. The line is ended with the endOfLineString. 
writeLineIndented(value)

TextWriter.writeLineIndented

X

Writes a new line to the output while temporarily increasing the indent. The line is ended with the endOfLineString.

Parameters
NameTypeDescription
valuestring The line to write.
Return value
void
void Writes a new line to the output while temporarily increasing the indent. The line is ended with the endOfLineString. 
writeLines(values, delimiter)

TextWriter.writeLines

X

Writes a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString.

Parameters
NameTypeDescription
valuesstring [*]The lines to write.
delimiterstring [0..1]An optional delimiter to be written at the end of each line, except for the last one.
Return value
void
void Writes a collection of lines to the output. Each line is indented automatically and ended with the endOfLineString. 
writeWhiteSpace()

TextWriter.writeWhiteSpace

X

Writes a single whitespace character to the output.

Return value
void
void Writes a single whitespace character to the output.