Amplication AST Libraries Documentation
    Preparing search index...

    A writer class that handles the generation of C# code with proper formatting and indentation. This class implements the IWriter interface and provides methods for writing code with automatic indentation, newline handling, and reference tracking.

    Implements

    Index

    Constructors

    Methods

    • Writes text to the buffer with proper indentation. Handles newlines and ensures proper indentation at the start of each line.

      Parameters

      • text: string

        The text to write

      Returns void

    • Writes a line of text to the buffer, adding a newline character.

      Parameters

      • text: string = ""

        The text to write (defaults to empty string)

      Returns void

    • Adds a newline character to the buffer.

      Returns void

    • Increases the indentation level.

      Returns void

    • Decreases the indentation level.

      Returns void

    • Adds a class reference to the writer's reference collection.

      Parameters

      Returns void

    • Returns the complete string representation of the written content, including any necessary using statements for references.

      Returns string

      The complete string representation