TwigFormatting

References
public sealed class TwigFormatting
Contains properties for formatting twig content as string.

Fields

DefaultIndexFormat

#
public const string DefaultIndexFormat = "{0}. "
Gets the default index format.

DefaultMetaCountFormat

#
public const string DefaultMetaCountFormat = " (meta: {0})"
Gets the default meta data topology format.

DefaultMetaHintFormat

#
public const string DefaultMetaHintFormat = "¹"
Gets the default meta data hinting format.

DefaultNullShortFormat

#
public const string DefaultNullShortFormat = "ₓ"
Gets the default format for short null codes.

DefaultNullWithTypeFormat

#
public const string DefaultNullWithTypeFormat = "null {0}"
Gets the default format for null entries with type.

Properties

IncludeIndices

#
public bool IncludeIndices { get; }
Gets whether indices ought to be included.

IncludeMetaData

#
public bool IncludeMetaData { get; }
Gets whether meta data ought to be included.

IncludeNullItems

#
public bool IncludeNullItems { get; }
Gets whether null items ought to be included.

Indentation

#
public int Indentation { get; }
Gets the number of spaces to use for indentations.

IndexFormat

#
public string IndexFormat { get; }
Gets the formatting template for indices. A null or empty string means no indices will be included.

LeadingSpaces

#
public int LeadingSpaces { get; }
Gets the number of spaces to prepend to each formatted line.

MaximumLines

#
public int MaximumLines { get; }
Gets the maximum allowed number of individual lines.

MaximumWidth

#
public int MaximumWidth { get; }
Gets the maximum number of characters per formatted line.

MetaFormat

#
public string MetaFormat { get; }
Gets the formatting pattern for meta data. A null or empty string means meta data is not included in the formatting.

NullFormat

#
public string NullFormat { get; }
Gets the format pattern for null items. A null or empty string means nulls will be skipped entirely.

Style

#
public TwigFormatStyle Style { get; }
Gets the formatting style.

Methods

CreateArrayFormatting

#
public static TwigFormatting CreateArrayFormatting()
Create a new default formatting style used for set formatting.
Twig formatting style.

CreateArrayFormatting

#
public static TwigFormatting CreateArrayFormatting(bool includeNulls, bool includeMetaData)
Create a new default formatting style used for set formatting.
includeNulls (bool)If true, null items will be included.
includeMetaData (bool)If true, meta data count will be included.
Twig formatting style.

CreateFullFormatting

#
public static TwigFormatting CreateFullFormatting()
Create a new formatting style used for exhaustive formatting.
Twig formatting style.

CreateListFormatting

#
public static TwigFormatting CreateListFormatting()
Create a new default formatting style used for list formatting.
Twig formatting style.

CreateListFormatting

#
public static TwigFormatting CreateListFormatting(bool includeNulls, bool includeMetaData)
Create a new formatting style used for list formatting.
includeNulls (bool)
includeMetaData (bool)
Twig formatting style.

CreateTopologicalFormatting

#
public static TwigFormatting CreateTopologicalFormatting()
Create a new default formatting style used for topological formatting.
Twig formatting style.

WithAdditionalIndent

#
public TwigFormatting WithAdditionalIndent()
Create a new formatting instance which is indented from the current one.
Indented format.

WithAdditionalIndent

#
public TwigFormatting WithAdditionalIndent(int amount)
Create a new formatting instance which is indented from the current one.
amount (int)Number of indentation steps.
Indented format.

WithIndexing

#
public TwigFormatting WithIndexing(string indexFormat)
Set a new indexing format. An empty or null string will omit indexing from this formatting. Use '{0}' to insert the index value into the format.
indexFormat (string)

WithMaximumLines

#
public TwigFormatting WithMaximumLines(int maximumLines)
Change the maximum number of lines.
maximumLines (int)

WithMaximumWidth

#
public TwigFormatting WithMaximumWidth(int maximumWidth)
Change the maximum number of characters per line.
maximumWidth (int)

WithMetaData

#
public TwigFormatting WithMetaData(string metaFormat)
Set a new meta data format. An empty or null string will omit meta data from this formatting. Use '{0}' to insert the meta data count into the format. Use '{1}' to insert comma separated meta data keys into the format. Use '{2}' to insert comma separated meta data keys-value pears into the format.
metaFormat (string)

WithNulls

#
public TwigFormatting WithNulls(string nullFormat)
Set a new indexing format. An empty or null string will omit indexing from this formatting. Use '{0}' to insert the type name into the format.
nullFormat (string)

WithoutIndexing

#
public TwigFormatting WithoutIndexing()
Remove indexing from this formatting.

WithoutMetaData

#
public TwigFormatting WithoutMetaData()
Remove meta data from this formatting.

WithoutNulls

#
public TwigFormatting WithoutNulls()
Remove null listing from this formatting.

WithWhitespace

#
public TwigFormatting WithWhitespace(int leadingSpaces, int indentation)
Modify the whitespace properties of this formatting.
leadingSpaces (int)New leading space count.
indentation (int)New indentation depth.