Table of Contents

Class GeneratorCodeAbstract

Namespace
SunamoDevCode
Assembly
SunamoDevCode.dll

Abstract base class for code generators providing common indentation, braces, and string building functionality.

public abstract class GeneratorCodeAbstract
Inheritance
GeneratorCodeAbstract
Derived
Inherited Members
Extension Methods

Constructors

GeneratorCodeAbstract()

Initializes the code generator with a space-delimited InstantSB and XmlDoc helper.

public GeneratorCodeAbstract()

Fields

Final

Use ToString() instead of public access

protected string Final

Field Value

string

sb

String builder used for assembling the generated code output.

protected InstantSB sb

Field Value

InstantSB

xmlDoc

XML documentation helper for generating doc comments in code output.

public XmlDoc xmlDoc

Field Value

XmlDoc

Methods

AddTab(int)

Appends the specified number of tab characters to the output.

public void AddTab(int tabCount)

Parameters

tabCount int

Number of tabs to add.

AddTab(int, string)

EN: Adds tabs to each line of the text CZ: Přidá tabulátory na začátek každého řádku textu

public static string AddTab(int tabCount, string text)

Parameters

tabCount int

Number of tabs to add

text string

Text to process

Returns

string

Text with tabs added

AddTab2(int, string)

Adds indented text as an item to the string builder.

public void AddTab2(int tabCount, string text)

Parameters

tabCount int

Number of tabs for indentation.

text string

Text to add.

Append(int, string, params object[])

EN: Appends formatted text with tabs (without newline) CZ: Přidá formátovaný text s tabulátory (bez nového řádku)

public void Append(int tabCount, string format, params object[] args)

Parameters

tabCount int

Number of tabs for indentation

format string

Format string or plain text

args object[]

Format arguments

AppendLine()

Appends an empty line to the output.

public void AppendLine()

AppendLine(int, string, params object[])

EN: Appends a formatted line with tabs CZ: Přidá formátovaný řádek s tabulátory

public void AppendLine(int tabCount, string format, params object[] args)

Parameters

tabCount int

Number of tabs for indentation

format string

Format string or plain text

args object[]

Format arguments

AssignValue(int, string, string, object, bool)

EN: Assigns a value to a property/field, converting it to string CZ: Přiřadí hodnotu vlastnosti/poli, převádí na string

public void AssignValue(int tabCount, string objectName, string variableName, object value, bool addToHyphens)

Parameters

tabCount int

Number of tabs for indentation

objectName string

Name of the object

variableName string

Name of the variable/property

value object

Value to assign

addToHyphens bool

Whether to add quotes

EndBrace(int)

EN: Ends a brace and adds a new line. After calling this method for elements like methods, properties, or constructors, it's recommended to also call sb.AppendLine(). CZ: Ukončí složenou závorku a přidá nový řádek. Za voláním této metody pokud ukončuje nějaký celek jako jsou metody, vlastnosti nebo konstruktor je vhodné volat ještě sb.AppendLine().

public void EndBrace(int tabCount)

Parameters

tabCount int

Number of tabs for indentation

EndParenthesis()

Appends a closing parenthesis to the output.

public void EndParenthesis()

StartBrace(int)

EN: Starts a brace. This is the only method here that adds a new line at the beginning. CZ: Přidá nový řádek, složenou závorku. Je to jediná zdejší metoda která na začátku přidává nový řádek.

public void StartBrace(int tabCount)

Parameters

tabCount int

Number of tabs for indentation

StartParenthesis()

Appends an opening parenthesis to the output.

public void StartParenthesis()

ToString()

EN: Returns the generated code and resets the string builder CZ: Vrátí vygenerovaný kód a resetuje string builder

public override string ToString()

Returns

string

Generated code