Skip to content

Swift 3 Darwin Parity PropertyListSerialization #573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Foundation/NSKeyedUnarchiver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ open class NSKeyedUnarchiver : NSCoder {

switch self._stream {
case .data(let data):
try plist = PropertyListSerialization.propertyList(from: data, options: PropertyListSerialization.MutabilityOptions.immutable, format: &format)
try plist = PropertyListSerialization.propertyList(from: data, options: [], format: &format)
break
case .stream(let inputStream):
try plist = PropertyListSerialization.propertyListWithStream(unsafeBitCast(inputStream, to: CFReadStream.self),
try plist = PropertyListSerialization.propertyList(with: unsafeBitCast(inputStream, to: CFReadStream.self),
length: 0,
options: PropertyListSerialization.MutabilityOptions.immutable,
options: [],
format: &format)
break
}
Expand Down
5 changes: 2 additions & 3 deletions Foundation/NSPropertyList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ extension PropertyListSerialization {
public struct MutabilityOptions : OptionSet {
public let rawValue : UInt
public init(rawValue: UInt) { self.rawValue = rawValue }

static let immutable = MutabilityOptions(rawValue: 0)

static let mutableContainers = MutabilityOptions(rawValue: 1)
static let mutableContainersAndLeaves = MutabilityOptions(rawValue: 2)
}
Expand Down Expand Up @@ -87,7 +86,7 @@ open class PropertyListSerialization : NSObject {
}
}

internal class func propertyListWithStream(_ stream: CFReadStream, length streamLength: Int, options opt: ReadOptions, format: UnsafeMutablePointer <PropertyListFormat>?) throws -> Any {
internal class func propertyList(with stream: CFReadStream, length streamLength: Int, options opt: ReadOptions, format: UnsafeMutablePointer <PropertyListFormat>?) throws -> Any {
var fmt = kCFPropertyListBinaryFormat_v1_0
var error: Unmanaged<CFError>? = nil
let decoded = withUnsafeMutablePointer(to: &fmt) { (outFmt: UnsafeMutablePointer<CFPropertyListFormat>) -> NSObject? in
Expand Down