var allowedClasses: [AnyClass]?
The array of coded classes allowed for secure coding.
var allowsKeyedCoding: Bool
A Boolean value that indicates whether the receiver supports keyed coding of objects.
var decodingFailurePolicy: NSCoder.DecodingFailurePolicy
var error: (any Error)?
var requiresSecureCoding: Bool
Boolean value that indicates whether the coder requires secure coding.
var systemVersion: UInt32
The system version in effect for the archive.
func containsValue(forKey: String) -> Bool
Returns a Boolean value that indicates whether an encoded value is available for a string.
func decodeArray(ofObjCType: UnsafePointer<Int8>, count: Int, at: UnsafeMutableRawPointer)
func decodeBool(forKey: String) -> Bool
Decodes and returns a Boolean value that was previously encoded with encode(_:forKey:)
and associated with the string key
.
func decodeCInt(forKey: String) -> Int32
Decodes and returns an int value that was previously encoded with encodeCInt(_:forKey:)
or encode(_:forKey:)
and associated with the string key
.
func decodeData() -> Data?
Decodes and returns a Data
object that was previously encoded with encode(_:)
. Subclasses must override this method.
func decodeDouble(forKey: String) -> Double
Decodes and returns a double value that was previously encoded with encodeCInt(_:forKey:)
or encode(_:forKey:)
and associated with the string key
.
func decodeFloat(forKey: String) -> Float
Decodes and returns a float value that was previously encoded with encodeCInt(_:forKey:)
or encode(_:forKey:)
and associated with the string key
.
func decodeInt32(forKey: String) -> Int32
Decodes and returns a 32-bit integer value that was previously encoded with encodeCInt(_:forKey:)
or encode(_:forKey:)
and associated with the string key
.
func decodeInt64(forKey: String) -> Int64
Decodes and returns a 64-bit integer value that was previously encoded with encodeCInt(_:forKey:)
or encode(_:forKey:)
and associated with the string key
.
func decodeInteger(forKey: String) -> Int
Decodes and returns an integer value that was previously encoded with encodeCInt(_:forKey:)
or encode(_:forKey:)
and associated with the string key
.
func decodeObject() -> Any?
Decodes an Objective-C object that was previously encoded with any of the encode...Object
methods.
func decodeObject(forKey: String) -> Any?
Decodes and returns an Objective-C object that was previously encoded with encode(_:forKey:)
or encodeConditionalObject(_:forKey:)
and associated with the string key
.
func decodeObject<DecodedObjectType>(of: DecodedObjectType.Type, forKey: String) -> DecodedObjectType?
func decodeObject(of: [AnyClass]?, forKey: String) -> Any?
Decodes an object for the key, restricted to the specified classes
.
func decodePoint() -> NSPoint
func decodePoint(forKey: String) -> NSPoint
func decodePropertyList() -> Any?
Decodes a property list that was previously encoded with encodePropertyList(_:)
.
func decodePropertyList(forKey: String) -> Any?
Returns a decoded property list for the specified key.
func decodeRect() -> NSRect
func decodeRect(forKey: String) -> NSRect
func decodeSize() -> NSSize
func decodeSize(forKey: String) -> NSSize
func decodeValue(ofObjCType: UnsafePointer<Int8>, at: UnsafeMutableRawPointer)
Decodes a single value, whose Objective-C type is given by type
.
func encode(Data)
Encodes a given Data
object.
func encode(NSRect)
func encode(NSSize)
func encode(NSPoint)
func encode(Any?)
Encodes object
.
func encode(NSRect, forKey: String)
func encode(NSSize, forKey: String)
func encode(NSPoint, forKey: String)
func encode(Bool, forKey: String)
Encodes boolv
and associates it with the string key
.
func encode(Double, forKey: String)
Encodes realv
and associates it with the string key
.
func encode(Float, forKey: String)
Encodes realv
and associates it with the string key
.
func encode(Int, forKey: String)
Encodes a given integer number and associates it with a given key.
func encode(Int32, forKey: String)
Encodes the 32-bit integer intv
and associates it with the string key
.
func encode(Int64, forKey: String)
Encodes the 64-bit integer intv
and associates it with the string key
.
func encode(Any?, forKey: String)
Encodes the object objv
and associates it with the string key
.
func encodeArray(ofObjCType: UnsafePointer<Int8>, count: Int, at: UnsafeRawPointer)
Encodes an array of count
items, whose Objective-C type is given by type
.
func encodeBycopyObject(Any?)
Can be overridden by subclasses to encode anObject
so that a copy, rather than a proxy, is created upon decoding.
func encodeByrefObject(Any?)
Can be overridden by subclasses to encode anObject
so that a proxy, rather than a copy, is created upon decoding.
func encodeBytes(UnsafeRawPointer?, length: Int)
Encodes a buffer of data whose types are unspecified.
func encodeBytes(UnsafePointer<UInt8>?, length: Int, forKey: String)
Encodes a buffer of data, bytesp
, whose length is specified by lenv
, and associates it with the string key
.
func encodeConditionalObject(Any?)
Can be overridden by subclasses to conditionally encode object
, preserving common references to that object.
func encodeConditionalObject(Any?, forKey: String)
Conditionally encodes a reference to objv
and associates it with the string key
only if objv
has been unconditionally encoded with encode(_:forKey:)
.
func encodePropertyList(Any)
Encodes the property list aPropertyList
.
func encodeRootObject(Any)
Can be overridden by subclasses to encode an interconnected group of Objective-C objects, starting with rootObject
.
func encodeValue(ofObjCType: UnsafePointer<Int8>, at: UnsafeRawPointer)
Must be overridden by subclasses to encode a single value residing at addr
, whose Objective-C type is given by type
.
func failWithError(any Error)
func version(forClassName: String) -> Int
This method is present for historical reasons and is not used with keyed archivers.
func withDecodedUnsafeBytes<ResultType>(forKey: String, body: (UnsafeRawBufferPointer?) throws -> ResultType) rethrows -> ResultType