SyncParser

public final class SyncParser

A synchronous wrapper for the Parser type for parsing whole CSV documents at once.

  • The struct configures parsing options

    Declaration

    Swift

    public var configuration: Config
  • Creates a new SyncParser instance

    Declaration

    Swift

    public init(configuration: Config = Config.default )

    Parameters

    configuration

    The struct configures parsing options

  • Parses a whole CSV document at once.

    Declaration

    Swift

    public func parse(_ data: [UInt8]) -> [[UInt8]: [[UInt8]?]]

    Parameters

    data

    The CSV data to parse.

    Return Value

    A dictionary containing the parsed CSV data. The keys are the column names and the values are the column cells. A nil value is an empty cell.

  • Parses a whole CSV document at once from a String.

    Declaration

    Swift

    public func parse(_ data: String) -> [String: [String?]]

    Parameters

    data

    The CSV data to parse.

    Return Value

    A dictionary containing the parsed CSV data. The keys are the column names and the values are the column cells. A nil value is an empty cell.