Protocol

UnkeyedDecodingContainer

A type that provides a view into a decoder’s storage and is used to hold the encoded properties of a decodable type sequentially, without keys.

Declaration

protocol UnkeyedDecodingContainer

Overview

Decoders should provide types conforming to UnkeyedDecodingContainer for their format.

Topics

Instance Properties

var codingPath: [CodingKey]

The path of coding keys taken to get to this point in decoding.

Required.

var count: Int?

The number of elements contained within this container.

Required.

var currentIndex: Int

The current decoding index of the container (i.e. the index of the next element to be decoded.) Incremented after every successful decode call.

Required.

var isAtEnd: Bool

A Boolean value indicating whether there are no more elements left to be decoded in the container.

Required.

Instance Methods

func decode(Int64.Type) -> Int64

Decodes a value of the given type.

Required.

func decode(UInt64.Type) -> UInt64

Decodes a value of the given type.

Required.

func decode(UInt32.Type) -> UInt32

Decodes a value of the given type.

Required.

func decode<T>(T.Type) -> T

Decodes a value of the given type.

Required.

func decode(Double.Type) -> Double

Decodes a value of the given type.

Required.

func decode(String.Type) -> String

Decodes a value of the given type.

Required.

func decode(Int32.Type) -> Int32

Decodes a value of the given type.

Required.

func decode(Int.Type) -> Int

Decodes a value of the given type.

Required.

func decode(UInt8.Type) -> UInt8

Decodes a value of the given type.

Required.

func decode(UInt16.Type) -> UInt16

Decodes a value of the given type.

Required.

func decode(Int8.Type) -> Int8

Decodes a value of the given type.

Required.

func decode(UInt.Type) -> UInt

Decodes a value of the given type.

Required.

func decode(Int16.Type) -> Int16

Decodes a value of the given type.

Required.

func decode(Bool.Type) -> Bool

Decodes a value of the given type.

Required.

func decode(Float.Type) -> Float

Decodes a value of the given type.

Required.

func decodeIfPresent(String.Type) -> String?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(Bool.Type) -> Bool?

Decodes a value of the given type, if present.

Required. Default implementations provided.

func decodeIfPresent(Double.Type) -> Double?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(Float.Type) -> Float?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(Int.Type) -> Int?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(UInt.Type) -> UInt?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(Int8.Type) -> Int8?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(Int16.Type) -> Int16?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(Int32.Type) -> Int32?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(Int64.Type) -> Int64?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(UInt8.Type) -> UInt8?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(UInt16.Type) -> UInt16?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(UInt32.Type) -> UInt32?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent(UInt64.Type) -> UInt64?

Decodes a value of the given type, if present.

Required.

func decodeIfPresent<T>(T.Type) -> T?

Decodes a value of the given type, if present.

Required.

func decodeNil() -> Bool

Decodes a null value.

Required.

func nestedUnkeyedContainer() -> UnkeyedDecodingContainer

Decodes an unkeyed nested container.

Required.

func superDecoder() -> Decoder

Decodes a nested container and returns a Decoder instance for decoding super from that container.

Required.

See Also

Decoding Containers

struct KeyedDecodingContainer

A concrete container that provides a view into a decoder’s storage, making the encoded properties of a decodable type accessible by keys.

protocol SingleValueDecodingContainer

A container that can support the storage and direct decoding of a single nonkeyed value.

protocol KeyedDecodingContainerProtocol

A type that provides a view into a decoder’s storage and is used to hold the encoded properties of a decodable type in a keyed manner.