Node

public enum Node : Hashable
extension Node: Comparable
extension Node: ExpressibleByArrayLiteral
extension Node: ExpressibleByDictionaryLiteral
extension Node: ExpressibleByFloatLiteral
extension Node: ExpressibleByIntegerLiteral
extension Node: ExpressibleByStringLiteral
extension Node: NodeRepresentable

YAML Node.

Node+Scalar

Node+Sequence

  • Sequence node.

    See more

    Declaration

    Swift

    public struct Sequence
    extension Node.Sequence: Comparable
    extension Node.Sequence: Equatable
    extension Node.Sequence: Hashable
    extension Node.Sequence: ExpressibleByArrayLiteral
    extension Node.Sequence: MutableCollection
    extension Node.Sequence: RandomAccessCollection
    extension Node.Sequence: RangeReplaceableCollection
  • Get or set the Node.Sequence value if this node is a Node.sequence.

    Declaration

    Swift

    public var sequence: Sequence? { get set }
  • Create a Node.scalar with a string, tag & scalar style.

    Declaration

    Swift

    public init(_ string: String, _ tag: Tag = .implicit, _ style: Scalar.Style = .any)

    Parameters

    string

    String value for this node.

    tag

    Tag for this node.

    style

    Style to use when emitting this node.

  • Create a Node.mapping with a sequence of node pairs, tag & scalar style.

    Declaration

    Swift

    public init(_ pairs: [(Node, Node)], _ tag: Tag = .implicit, _ style: Mapping.Style = .any)

    Parameters

    pairs

    Pairs of nodes to use for this node.

    tag

    Tag for this node.

    style

    Style to use when emitting this node.

  • Create a Node.sequence with a sequence of nodes, tag & scalar style.

    Declaration

    Swift

    public init(_ nodes: [Node], _ tag: Tag = .implicit, _ style: Sequence.Style = .any)

    Parameters

    nodes

    Sequence of nodes to use for this node.

    tag

    Tag for this node.

    style

    Style to use when emitting this node.

Public Node Members

  • tag

    The tag for this node.

    Note

    Accessing this property causes the tag to be resolved by tag.resolver.

    Declaration

    Swift

    public var tag: Tag { get }
  • The location for this node.

    Declaration

    Swift

    public var mark: Mark? { get }

Typed accessor properties

  • any

    This node as an Any, if convertible.

    Declaration

    Swift

    public var any: Any { get }
  • This node as a String, if convertible.

    Declaration

    Swift

    public var string: String? { get }
  • This node as a Bool, if convertible.

    Declaration

    Swift

    public var bool: Bool? { get }
  • This node as a Double, if convertible.

    Declaration

    Swift

    public var float: Double? { get }
  • This node as an NSNull, if convertible.

    Declaration

    Swift

    public var null: NSNull? { get }
  • int

    This node as an Int, if convertible.

    Declaration

    Swift

    public var int: Int? { get }
  • This node as a Data, if convertible.

    Declaration

    Swift

    public var binary: Data? { get }
  • This node as a Date, if convertible.

    Declaration

    Swift

    public var timestamp: Date? { get }
  • This node as a UUID, if convertible.

    Declaration

    Swift

    public var uuid: UUID? { get }

Typed accessor methods

Comparable

  • Returns true if lhs is ordered before rhs.

    Declaration

    Swift

    public static func < (lhs: Node, rhs: Node) -> Bool

    Parameters

    lhs

    The left hand side Node to compare.

    rhs

    The right hand side Node to compare.

    Return Value

    True if lhs is ordered before rhs.

ExpressibleBy*Literal

NodeRepresentable