Options

public struct Options

Configuration options to use when emitting YAML.

Options Initializer

  • Create Emitter.Options with the specified values.

    Declaration

    Swift

    public init(canonical: Bool = false, indent: Int = 0, width: Int = 0, allowUnicode: Bool = false,
                lineBreak: Emitter.LineBreak = .ln, version: (major: Int, minor: Int)? = nil,
                sortKeys: Bool = false, sequenceStyle: Node.Sequence.Style = .any,
                mappingStyle: Node.Mapping.Style = .any, newLineScalarStyle: Node.Scalar.Style = .any)

    Parameters

    canonical

    Set if the output should be in the “canonical” format described in the YAML specification.

    indent

    Set the indentation value.

    width

    Set the preferred line width. -1 means unlimited.

    allowUnicode

    Set if unescaped non-ASCII characters are allowed.

    lineBreak

    Set the preferred line break.

    explicitStart

    Explicit document start ---.

    explicitEnd

    Explicit document end ....

    version

    The %YAML directive value or nil.

    sortKeys

    Set if emitter should sort keys in lexicographic order.

    sequenceStyle

    Set the style for sequences (arrays / lists)

    mappingStyle

    Set the style for mappings (dictionaries)