decode(_:from:)
decode a Codable class from XML
func decode<T>(_ type: T.Type, from xml: XML.Node) throws -> T where T : Decodable
decode a Codable class from XML
func decode<T>(_ type: T.Type, from xml: XML.Node) throws -> T where T : Decodable
s7SotoXML10XMLDecoderV6decode_4fromxxm_AA0B0O4NodeCtKSeRzlF
What are these?8D72H
import SotoXML
struct XMLDecoder
The wrapper class for decoding Codable classes from XMLNodes
enum XML
Implemented to replace the XML Foundation classes. This was initially required as there is no implementation of the Foundation XMLNode classes in iOS. This is also here because the implementation of XMLNode in Linux Swift 4.2 was causing crashes. Whenever an XMLDocument was deleted all the underlying CoreFoundation objects were deleted. This meant if you still had a reference to a XMLElement from that document, while it was still valid the underlying CoreFoundation object had been deleted.
class Node
base class for all types of XML.Node
protocol Decodable
A type that can decode itself from an external representation.
init()
var dataDecodingStrategy: DataDecodingStrategy
The strategy to use in decoding binary data. Defaults to .raw
.
var nonConformingFloatDecodingStrategy: NonConformingFloatDecodingStrategy
The strategy to use in decoding non-conforming numbers. Defaults to .throw
.
var userInfo: [CodingUserInfoKey : Any]
Contextual user-provided information for use during decoding.
enum DataDecodingStrategy
The strategy to use for decoding Data
values.
enum NonConformingFloatDecodingStrategy
The strategy to use for non-JSON-conforming floating-point values (IEEE 754 infinity and NaN).