hasmer
Public Member Functions | Properties | List of all members
Hasmer.SourceCodeBuilder Class Reference

Represents source code. Used for maintaining indentation and other source code syntax. More...

Public Member Functions

 SourceCodeBuilder (string indentationCharacter)
 Creates a new SourceCodeBuilder object given the indentation character. More...
 
void NewLine ()
 Appends a new line and puts the proper indentation on that line. More...
 
void Write (string code)
 Writes the given string to the stream. Does not append a new line. More...
 
void AddIndent (int amount)
 Modifies the indentation amount by the given level. More...
 
void RemoveLastIndent ()
 Deletes 1 level of indentation from the current line. More...
 
override string ToString ()
 

Properties

StringBuilder Builder [get]
 The StringBuilder used internally. More...
 

Detailed Description

Represents source code. Used for maintaining indentation and other source code syntax.

Constructor & Destructor Documentation

◆ SourceCodeBuilder()

Hasmer.SourceCodeBuilder.SourceCodeBuilder ( string  indentationCharacter)
inline

Creates a new SourceCodeBuilder object given the indentation character.

Parameters
indentationCharacterThe character (actually a string, not a single character) to use for indentation. This could be a tab or four spaces for example.

Member Function Documentation

◆ AddIndent()

void Hasmer.SourceCodeBuilder.AddIndent ( int  amount)
inline

Modifies the indentation amount by the given level.

◆ NewLine()

void Hasmer.SourceCodeBuilder.NewLine ( )
inline

Appends a new line and puts the proper indentation on that line.

◆ RemoveLastIndent()

void Hasmer.SourceCodeBuilder.RemoveLastIndent ( )
inline

Deletes 1 level of indentation from the current line.

◆ Write()

void Hasmer.SourceCodeBuilder.Write ( string  code)
inline

Writes the given string to the stream. Does not append a new line.

Property Documentation

◆ Builder

StringBuilder Hasmer.SourceCodeBuilder.Builder
get

The StringBuilder used internally.


The documentation for this class was generated from the following file: