Skip to content

Commit a59a97a

Browse files
authored
NSData options should typealias to Data options (#4968)
1 parent 0f1a45b commit a59a97a

File tree

1 file changed

+5
-41
lines changed

1 file changed

+5
-41
lines changed

Sources/Foundation/NSData.swift

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,11 @@ import Dispatch
1313
#endif
1414

1515
extension NSData {
16-
public struct ReadingOptions : OptionSet {
17-
public let rawValue : UInt
18-
public init(rawValue: UInt) { self.rawValue = rawValue }
19-
20-
public static let mappedIfSafe = ReadingOptions(rawValue: UInt(1 << 0))
21-
public static let uncached = ReadingOptions(rawValue: UInt(1 << 1))
22-
public static let alwaysMapped = ReadingOptions(rawValue: UInt(1 << 2))
23-
}
24-
25-
public struct WritingOptions : OptionSet {
26-
public let rawValue : UInt
27-
public init(rawValue: UInt) { self.rawValue = rawValue }
28-
29-
public static let atomic = WritingOptions(rawValue: UInt(1 << 0))
30-
public static let withoutOverwriting = WritingOptions(rawValue: UInt(1 << 1))
31-
}
32-
33-
public struct SearchOptions : OptionSet {
34-
public let rawValue : UInt
35-
public init(rawValue: UInt) { self.rawValue = rawValue }
36-
37-
public static let backwards = SearchOptions(rawValue: UInt(1 << 0))
38-
public static let anchored = SearchOptions(rawValue: UInt(1 << 1))
39-
}
40-
41-
public struct Base64EncodingOptions : OptionSet {
42-
public let rawValue : UInt
43-
public init(rawValue: UInt) { self.rawValue = rawValue }
44-
45-
public static let lineLength64Characters = Base64EncodingOptions(rawValue: UInt(1 << 0))
46-
public static let lineLength76Characters = Base64EncodingOptions(rawValue: UInt(1 << 1))
47-
public static let endLineWithCarriageReturn = Base64EncodingOptions(rawValue: UInt(1 << 4))
48-
public static let endLineWithLineFeed = Base64EncodingOptions(rawValue: UInt(1 << 5))
49-
}
50-
51-
public struct Base64DecodingOptions : OptionSet {
52-
public let rawValue : UInt
53-
public init(rawValue: UInt) { self.rawValue = rawValue }
54-
55-
public static let ignoreUnknownCharacters = Base64DecodingOptions(rawValue: UInt(1 << 0))
56-
}
16+
public typealias ReadingOptions = Data.ReadingOptions
17+
public typealias WritingOptions = Data.WritingOptions
18+
public typealias SearchOptions = Data.SearchOptions
19+
public typealias Base64EncodingOptions = Data.Base64EncodingOptions
20+
public typealias Base64DecodingOptions = Data.Base64DecodingOptions
5721
}
5822

5923
private final class _NSDataDeallocator {

0 commit comments

Comments
 (0)