Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 979 Bytes

TemplateResultParser.md

File metadata and controls

46 lines (32 loc) · 979 Bytes

STRUCT

TemplateResultParser

public struct TemplateResultParser: TemplateResultParserProtocol

Based on the url, tries to decipher the resulting template.

Properties

parser

public let parser: TemplateDecoder

reader

public let reader: (URL) throws -> Data

Methods

init(parser:reader:)

public init(parser: TemplateDecoder? = nil, reader: ((URL) throws -> Data)? = nil)

template(fromURL:withType:)

public func template(fromURL url: URL, withType type: TemplateType?) -> TemplateResult

Based on the url, tries to decipher the resulting template or error.

  • Parameter url: Source file for the template.
  • Parameter type: Optional template type, otherwise both types will be attempted.

Parameters

Name Description
url Source file for the template.
type Optional template type, otherwise both types will be attempted.