C# Class SilentOrbit.Code.CodeWriter

Static and instance helpers for code generation
Inheritance: IDisposable
Show file Open project: hultqvist/protobuf

Public Properties

Property Type Description
DefaultIndentPrefix string
DefaultNewLine string
IndentPrefix string
NewLine string

Public Methods

Method Description
Attribute ( string attributeConstructor ) : void
Bracket ( ) : void

Write leading bracket and indent

Bracket ( string str ) : void

Write leading bracket and indent

Case ( int id ) : void
Case ( string str ) : void
CaseDefault ( ) : void
CodeWriter ( ) : System

Writes to memory, get the code using the "Code" property

CodeWriter ( string csPath ) : System

Writes code directly to file

Comment ( string code ) : void
Dedent ( ) : void
Dispose ( ) : void
ElseBracket ( ) : void

Close a previous IfBracket and start an else

ElseIfBracket ( string str ) : void

Close a previous Bracket and start an "else if"

EndBracket ( ) : void
EndBracketSpace ( ) : void
Flush ( ) : void
ForeachBracket ( string str ) : void
IfBracket ( string str ) : void
Indent ( ) : void
Summary ( string summary ) : void
SummaryParam ( string name, string description ) : void

Switch ( string str ) : void
SwitchEnd ( ) : void
Using ( string str ) : void
WhileBracket ( string str ) : void
WriteIndent ( string str ) : void

Writes a singe line indented.

WriteLine ( ) : void
WriteLine ( string line ) : void
WritePragma ( string line ) : void

Private Methods

Method Description
SplitTrimEnd ( string text ) : string[]

Split string into an array of lines and trim whitespace at the end

Method Details

Attribute() public method

public Attribute ( string attributeConstructor ) : void
attributeConstructor string
return void

Bracket() public method

Write leading bracket and indent
public Bracket ( ) : void
return void

Bracket() public method

Write leading bracket and indent
public Bracket ( string str ) : void
str string Line before bracket
return void

Case() public method

public Case ( int id ) : void
id int
return void

Case() public method

public Case ( string str ) : void
str string
return void

CaseDefault() public method

public CaseDefault ( ) : void
return void

CodeWriter() public method

Writes to memory, get the code using the "Code" property
public CodeWriter ( ) : System
return System

CodeWriter() public method

Writes code directly to file
public CodeWriter ( string csPath ) : System
csPath string
return System

Comment() public method

public Comment ( string code ) : void
code string
return void

Dedent() public method

public Dedent ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

ElseBracket() public method

Close a previous IfBracket and start an else
public ElseBracket ( ) : void
return void

ElseIfBracket() public method

Close a previous Bracket and start an "else if"
public ElseIfBracket ( string str ) : void
str string
return void

EndBracket() public method

public EndBracket ( ) : void
return void

EndBracketSpace() public method

public EndBracketSpace ( ) : void
return void

Flush() public method

public Flush ( ) : void
return void

ForeachBracket() public method

public ForeachBracket ( string str ) : void
str string
return void

IfBracket() public method

public IfBracket ( string str ) : void
str string
return void

Indent() public method

public Indent ( ) : void
return void

Summary() public method

public Summary ( string summary ) : void
summary string
return void

SummaryParam() public method

public SummaryParam ( string name, string description ) : void
name string
description string
return void

Switch() public method

public Switch ( string str ) : void
str string
return void

SwitchEnd() public method

public SwitchEnd ( ) : void
return void

Using() public method

public Using ( string str ) : void
str string
return void

WhileBracket() public method

public WhileBracket ( string str ) : void
str string
return void

WriteIndent() public method

Writes a singe line indented.
public WriteIndent ( string str ) : void
str string
return void

WriteLine() public method

public WriteLine ( ) : void
return void

WriteLine() public method

public WriteLine ( string line ) : void
line string
return void

WritePragma() public method

public WritePragma ( string line ) : void
line string
return void

Property Details

DefaultIndentPrefix public static property

public static string DefaultIndentPrefix
return string

DefaultNewLine public static property

public static string DefaultNewLine
return string

IndentPrefix public property

public string IndentPrefix
return string

NewLine public property

public string NewLine
return string