Class ExportStreamWriter
An extended StreamWriter implementation to simplify language export writing.
Inheritance
Namespace: Microsoft.Health.Fhir.SpecManager.Language
Assembly: Microsoft.Health.Fhir.SpecManager.dll
Syntax
public class ExportStreamWriter : StreamWriter
Constructors
| Improve this Doc View SourceExportStreamWriter(Stream)
Initializes a new instance of the Export
Declaration
public ExportStreamWriter(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
ExportStreamWriter(Stream, Encoding)
Initializes a new instance of the Export
Declaration
public ExportStreamWriter(Stream stream, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
Encoding | encoding | The encoding. |
ExportStreamWriter(Stream, Encoding, Int32)
Initializes a new instance of the Export
Declaration
public ExportStreamWriter(Stream stream, Encoding encoding, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
Encoding | encoding | The encoding. |
System. |
bufferSize | Size of the buffer. |
ExportStreamWriter(Stream, Encoding, Int32, Boolean)
Initializes a new instance of the Export
Declaration
public ExportStreamWriter(Stream stream, Encoding encoding, int bufferSize, bool leaveOpen)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream. |
Encoding | encoding | The encoding. |
System. |
bufferSize | Size of the buffer. |
System. |
leaveOpen | True to leave open. |
ExportStreamWriter(String)
Initializes a new instance of the Export
Declaration
public ExportStreamWriter(string path)
Parameters
Type | Name | Description |
---|---|---|
System. |
path | Full pathname of the file. |
ExportStreamWriter(String, Boolean)
Initializes a new instance of the Export
Declaration
public ExportStreamWriter(string path, bool append)
Parameters
Type | Name | Description |
---|---|---|
System. |
path | Full pathname of the file. |
System. |
append | True to append. |
ExportStreamWriter(String, Boolean, Encoding)
Initializes a new instance of the Export
Declaration
public ExportStreamWriter(string path, bool append, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System. |
path | Full pathname of the file. |
System. |
append | True to append. |
Encoding | encoding | The encoding. |
ExportStreamWriter(String, Boolean, Encoding, Int32)
Initializes a new instance of the Export
Declaration
public ExportStreamWriter(string path, bool append, Encoding encoding, int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
System. |
path | Full pathname of the file. |
System. |
append | True to append. |
Encoding | encoding | The encoding. |
System. |
bufferSize | Size of the buffer. |
Properties
| Improve this Doc View SourceCharactersPerIndentation
Gets the characters per indentation level.
Declaration
public int CharactersPerIndentation { get; }
Property Value
Type | Description |
---|---|
System. |
Indentation
Gets the current level of indentation.
Declaration
public int Indentation { get; }
Property Value
Type | Description |
---|---|
System. |
IndentationChar
Gets the indentation character.
Declaration
public char IndentationChar { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceCloseScope(String)
Closes a scope (decreases indent, then writes literal on a line).
Declaration
public void CloseScope(string closeLiteral = "}")
Parameters
Type | Name | Description |
---|---|---|
System. |
closeLiteral | (Optional) The close literal. |
DecreaseIndent()
Decrease indent.
Declaration
public void DecreaseIndent()
IncreaseIndent()
Increase indent.
Declaration
public void IncreaseIndent()
OpenScope(String)
Opens a scope (writes literal on a line, then indents).
Declaration
public void OpenScope(string openLiteral = "{")
Parameters
Type | Name | Description |
---|---|---|
System. |
openLiteral | (Optional) The scope open literal. |
SetCharsPerIndentation(Int32)
Sets characters per indentation.
Declaration
public void SetCharsPerIndentation(int charsPerIndentLevel)
Parameters
Type | Name | Description |
---|---|---|
System. |
charsPerIndentLevel | The characters per indent level. |
SetIndent(Int32)
Sets an indent.
Declaration
public void SetIndent(int level)
Parameters
Type | Name | Description |
---|---|---|
System. |
level | The level. |
SetIndentationChar(Char)
Sets indentation character.
Declaration
public void SetIndentationChar(char indentChar)
Parameters
Type | Name | Description |
---|---|---|
System. |
indentChar | The indent character. |
WriteIndented(String)
Writes a value, indented.
Declaration
public void WriteIndented(string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The value. |
WriteLineIndented(String)
Writes a line, indented per current indentation level.
Declaration
public void WriteLineIndented(string value)
Parameters
Type | Name | Description |
---|---|---|
System. |
value | The value. |