TwigFormatting

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

Fields

DefaultIndexFormat

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

DefaultMetaCountFormat

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

DefaultMetaHintFormat

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

DefaultNullShortFormat

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

DefaultNullWithTypeFormat

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

Properties

IncludeIndices

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

IncludeMetaData

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

IncludeNullItems

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

Indentation

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

IndexFormat

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

LeadingSpaces

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

MaximumLines

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

MaximumWidth

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

MetaFormat

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

NullFormat

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

Style

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

Methods

CreateArrayFormatting

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

CreateArrayFormatting

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

CreateFullFormatting

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

CreateListFormatting

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

CreateListFormatting

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

CreateTopologicalFormatting

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

WithAdditionalIndent

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

WithAdditionalIndent

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

WithIndexing

#
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.
public TwigFormatting WithIndexing(
indexFormat
)

WithMaximumLines

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

WithMaximumWidth

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

WithMetaData

#
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.
public TwigFormatting WithMetaData(
metaFormat
)

WithNulls

#
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.
public TwigFormatting WithNulls(
nullFormat
)

WithoutIndexing

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

WithoutMetaData

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

WithoutNulls

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

WithWhitespace

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