C# Class ServiceClientGenerator.CodeBuilder

Wrapper around string builder to help emit properly indented code
Afficher le fichier Open project: aws/aws-sdk-net Class Usage Examples

Méthodes publiques

Méthode Description
Append ( string s ) : CodeBuilder

Append a string at the current location

AppendFormat ( string format ) : CodeBuilder

Append a formatted string at the current location.

AppendLine ( ) : CodeBuilder

Add a newline, and indent to the current indent

AppendLine ( string line ) : CodeBuilder

Append a string at the current location, add a newline and indent to the current indent.

AppendQuote ( string s, string open = @"""", string close = null ) : CodeBuilder

Append a string with quotes around it.

CloseBlock ( ) : CodeBuilder

Add a newline, reduce the indent by the tab width, and add a '}'

CodeBuilder ( StringBuilder sb, int startingIndent, int tabWidth = 4 ) : System

Constructor.

OpenBlock ( ) : CodeBuilder

Increase the indent and open a block, adding a '{' and a newline and indent.

The current position will be on a new line at the newly increased indent.

Method Details

Append() public méthode

Append a string at the current location
public Append ( string s ) : CodeBuilder
s string a string
Résultat CodeBuilder

AppendFormat() public méthode

Append a formatted string at the current location.
public AppendFormat ( string format ) : CodeBuilder
format string Format string
Résultat CodeBuilder

AppendLine() public méthode

Add a newline, and indent to the current indent
public AppendLine ( ) : CodeBuilder
Résultat CodeBuilder

AppendLine() public méthode

Append a string at the current location, add a newline and indent to the current indent.
public AppendLine ( string line ) : CodeBuilder
line string
Résultat CodeBuilder

AppendQuote() public méthode

Append a string with quotes around it.
public AppendQuote ( string s, string open = @"""", string close = null ) : CodeBuilder
s string The string
open string The opening quote character. Defaults to double quotes.
close string The closing quote character. Defaults to the open character.
Résultat CodeBuilder

CloseBlock() public méthode

Add a newline, reduce the indent by the tab width, and add a '}'
public CloseBlock ( ) : CodeBuilder
Résultat CodeBuilder

CodeBuilder() public méthode

Constructor.
public CodeBuilder ( StringBuilder sb, int startingIndent, int tabWidth = 4 ) : System
sb StringBuilder StringBuilder instance to wrap
startingIndent int Staring indent width (in spaces)
tabWidth int Additional indent width (in spaces)
Résultat System

OpenBlock() public méthode

Increase the indent and open a block, adding a '{' and a newline and indent.
The current position will be on a new line at the newly increased indent.
public OpenBlock ( ) : CodeBuilder
Résultat CodeBuilder