Class IndentedStringBuilder
A thin wrapper over System.Text.StringBuilder that adds indentation to each line built.
This type is typically used by database providers (and other extensions). It is generally not used in application code.
Inheritance
Inherited Members
Namespace: FFXIVClientStructs.InteropGenerator
Assembly: FFXIVClientStructs.InteropSourceGenerators.dll
Syntax
public class IndentedStringBuilder
Remarks
See Implementation of database providers and extensions for more information and examples.
Properties
| Improve this Doc View SourceIndentCount
Gets the current indent level.
Declaration
public virtual int IndentCount { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The current indent level. |
Length
The current length of the built string.
Declaration
public virtual int Length { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceAppend(Char)
Appends the current indent and then the given char to the string being built.
Declaration
public virtual IndentedStringBuilder Append(char value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Char | value | The char to append. |
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
Append(IEnumerable<Char>)
Appends the current indent and then the given chars to the string being built.
Declaration
public virtual IndentedStringBuilder Append(IEnumerable<char> value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.Char> | value | The chars to append. |
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
Append(IEnumerable<String>)
Appends the current indent and then the given strings to the string being built.
Declaration
public virtual IndentedStringBuilder Append(IEnumerable<string> value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<System.String> | value | The strings to append. |
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
Append(String)
Appends the current indent and then the given string to the string being built.
Declaration
public virtual IndentedStringBuilder Append(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The string to append. |
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
AppendLine()
Appends a new line to the string being built.
Declaration
public virtual IndentedStringBuilder AppendLine()
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
AppendLine(String)
Appends the current indent, the given string, and a new line to the string being built.
Declaration
public virtual IndentedStringBuilder AppendLine(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The string to append. |
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
Remarks
If the given string itself contains a new line, the part of the string after that new line will not be indented.
AppendLines(String, Boolean)
Separates the given string into lines, and then appends each line, prefixed by the current indent and followed by a new line, to the string being built.
Declaration
public virtual IndentedStringBuilder AppendLines(string value, bool skipFinalNewline = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | value | The string to append. |
| System.Boolean | skipFinalNewline | If true, then the terminating new line is not added after the last line. |
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
Clear()
Resets this builder ready to build a new string.
Declaration
public virtual IndentedStringBuilder Clear()
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
DecrementIndent()
Decrements the indent.
Declaration
public virtual IndentedStringBuilder DecrementIndent()
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
IncrementIndent()
Increments the indent.
Declaration
public virtual IndentedStringBuilder IncrementIndent()
Returns
| Type | Description |
|---|---|
| IndentedStringBuilder | This builder so that additional calls can be chained. |
Indent()
Creates a scoped indenter that will increment the indent, then decrement it when disposed.
Declaration
public virtual IDisposable Indent()
Returns
| Type | Description |
|---|---|
| System.IDisposable | An indenter. |
SuspendIndent()
Temporarily disables all indentation. Restores the original indentation when the returned object is disposed.
Declaration
public virtual IDisposable SuspendIndent()
Returns
| Type | Description |
|---|---|
| System.IDisposable | An object that restores the original indentation when disposed. |
ToString()
Returns the built string.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | The built string. |