mirror of
https://github.com/lil-org/wallet.git
synced 2024-12-28 23:14:11 +03:00
update pods
This commit is contained in:
parent
2f8c443dee
commit
ff6a87736f
@ -1,7 +1,7 @@
|
||||
PODS:
|
||||
- BigInt (5.2.0)
|
||||
- Kingfisher (7.9.1)
|
||||
- SwiftProtobuf (1.24.0)
|
||||
- Kingfisher (7.10.0)
|
||||
- SwiftProtobuf (1.25.1)
|
||||
- TrustWalletCore (4.0.1):
|
||||
- TrustWalletCore/Core (= 4.0.1)
|
||||
- TrustWalletCore/Core (4.0.1):
|
||||
@ -23,8 +23,8 @@ SPEC REPOS:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
BigInt: f668a80089607f521586bbe29513d708491ef2f7
|
||||
Kingfisher: 1d14e9f59cbe19389f591c929000332bf70efd32
|
||||
SwiftProtobuf: bcfd2bc231cf9ae552cdc7c4e877bd3b41fe57b1
|
||||
Kingfisher: a18f05d3b6d37d8650ee4a3e61d57a28fc6207f6
|
||||
SwiftProtobuf: 69f02cd54fb03201c5e6bf8b76f687c5ef7541a3
|
||||
TrustWalletCore: 77c78bda1d1a411390321b7d9f7b81bd1d547b71
|
||||
|
||||
PODFILE CHECKSUM: 63ae34d7b530436a1a7d72f33a0171a22f73d4ad
|
||||
|
34
Pods/Kingfisher/Sources/Cache/DiskStorage.swift
generated
34
Pods/Kingfisher/Sources/Cache/DiskStorage.swift
generated
@ -149,9 +149,21 @@ public enum DiskStorage {
|
||||
do {
|
||||
try data.write(to: fileURL, options: writeOptions)
|
||||
} catch {
|
||||
throw KingfisherError.cacheError(
|
||||
reason: .cannotCreateCacheFile(fileURL: fileURL, key: key, data: data, error: error)
|
||||
)
|
||||
if error.isFolderMissing {
|
||||
// The whole cache folder is deleted. Try to recreate it and write file again.
|
||||
do {
|
||||
try prepareDirectory()
|
||||
try data.write(to: fileURL, options: writeOptions)
|
||||
} catch {
|
||||
throw KingfisherError.cacheError(
|
||||
reason: .cannotCreateCacheFile(fileURL: fileURL, key: key, data: data, error: error)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
throw KingfisherError.cacheError(
|
||||
reason: .cannotCreateCacheFile(fileURL: fileURL, key: key, data: data, error: error)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
let now = Date()
|
||||
@ -586,3 +598,19 @@ extension DiskStorage {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate extension Error {
|
||||
var isFolderMissing: Bool {
|
||||
let nsError = self as NSError
|
||||
guard nsError.domain == NSCocoaErrorDomain, nsError.code == 4 else {
|
||||
return false
|
||||
}
|
||||
guard let underlyingError = nsError.userInfo[NSUnderlyingErrorKey] as? NSError else {
|
||||
return false
|
||||
}
|
||||
guard underlyingError.domain == NSPOSIXErrorDomain, underlyingError.code == 2 else {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,10 @@ public struct AVAssetImageDataProvider: ImageDataProvider {
|
||||
public let time: CMTime
|
||||
|
||||
private var internalKey: String {
|
||||
return (assetImageGenerator.asset as? AVURLAsset)?.url.absoluteString ?? UUID().uuidString
|
||||
guard let url = (assetImageGenerator.asset as? AVURLAsset)?.url else {
|
||||
return UUID().uuidString
|
||||
}
|
||||
return url.cacheKey
|
||||
}
|
||||
|
||||
/// The cache key used by `self`.
|
||||
|
@ -24,7 +24,11 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
import Foundation
|
||||
#if os(macOS)
|
||||
import AppKit
|
||||
#else
|
||||
import UIKit
|
||||
#endif
|
||||
|
||||
/// An `ImageModifier` can be used to change properties on an image between cache serialization and the actual use of
|
||||
/// the image. The `modify(_:)` method will be called after the image retrieved from its source and before it returned
|
||||
|
25
Pods/Kingfisher/Sources/PrivacyInfo.xcprivacy
generated
Normal file
25
Pods/Kingfisher/Sources/PrivacyInfo.xcprivacy
generated
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>C617.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>NSPrivacyTracking</key>
|
||||
<false/>
|
||||
<key>NSPrivacyTrackingDomains</key>
|
||||
<array>
|
||||
</array>
|
||||
<key>NSPrivacyCollectedDataTypes</key>
|
||||
<array>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
@ -268,7 +268,14 @@ open class AnimatedImageView: UIImageView {
|
||||
#if os(visionOS)
|
||||
let targetSize = bounds.scaled(UITraitCollection.current.displayScale).size
|
||||
#else
|
||||
let targetSize = bounds.scaled(UIScreen.main.scale).size
|
||||
var scale: CGFloat = 0
|
||||
|
||||
if #available(iOS 13.0, tvOS 13.0, *) {
|
||||
scale = UITraitCollection.current.displayScale
|
||||
} else {
|
||||
scale = UIScreen.main.scale
|
||||
}
|
||||
let targetSize = bounds.scaled(scale).size
|
||||
#endif
|
||||
let animator = Animator(
|
||||
frameSource: frameSource,
|
||||
|
8
Pods/Manifest.lock
generated
8
Pods/Manifest.lock
generated
@ -1,7 +1,7 @@
|
||||
PODS:
|
||||
- BigInt (5.2.0)
|
||||
- Kingfisher (7.9.1)
|
||||
- SwiftProtobuf (1.24.0)
|
||||
- Kingfisher (7.10.0)
|
||||
- SwiftProtobuf (1.25.1)
|
||||
- TrustWalletCore (4.0.1):
|
||||
- TrustWalletCore/Core (= 4.0.1)
|
||||
- TrustWalletCore/Core (4.0.1):
|
||||
@ -23,8 +23,8 @@ SPEC REPOS:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
BigInt: f668a80089607f521586bbe29513d708491ef2f7
|
||||
Kingfisher: 1d14e9f59cbe19389f591c929000332bf70efd32
|
||||
SwiftProtobuf: bcfd2bc231cf9ae552cdc7c4e877bd3b41fe57b1
|
||||
Kingfisher: a18f05d3b6d37d8650ee4a3e61d57a28fc6207f6
|
||||
SwiftProtobuf: 69f02cd54fb03201c5e6bf8b76f687c5ef7541a3
|
||||
TrustWalletCore: 77c78bda1d1a411390321b7d9f7b81bd1d547b71
|
||||
|
||||
PODFILE CHECKSUM: 63ae34d7b530436a1a7d72f33a0171a22f73d4ad
|
||||
|
5796
Pods/Pods.xcodeproj/project.pbxproj
generated
5796
Pods/Pods.xcodeproj/project.pbxproj
generated
File diff suppressed because it is too large
Load Diff
32
Pods/SwiftProtobuf/Sources/SwiftProtobuf/BinaryEncodingOptions.swift
generated
Normal file
32
Pods/SwiftProtobuf/Sources/SwiftProtobuf/BinaryEncodingOptions.swift
generated
Normal file
@ -0,0 +1,32 @@
|
||||
// Sources/SwiftProtobuf/BinaryEncodingOptions.swift - Binary encoding options
|
||||
//
|
||||
// Copyright (c) 2014 - 2023 Apple Inc. and the project authors
|
||||
// Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
//
|
||||
// See LICENSE.txt for license information:
|
||||
// https://github.com/apple/swift-protobuf/blob/main/LICENSE.txt
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
///
|
||||
/// Binary encoding options
|
||||
///
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/// Options for binary encoding.
|
||||
public struct BinaryEncodingOptions {
|
||||
/// Whether to use deterministic ordering when serializing.
|
||||
///
|
||||
/// Note that the deterministic serialization is NOT canonical across languages.
|
||||
/// It is NOT guaranteed to remain stable over time. It is unstable across
|
||||
/// different builds with schema changes due to unknown fields. Users who need
|
||||
/// canonical serialization (e.g., persistent storage in a canonical form,
|
||||
/// fingerprinting, etc.) should define their own canonicalization specification
|
||||
/// and implement their own serializer rather than relying on this API.
|
||||
///
|
||||
/// If deterministic serialization is requested, map entries will be sorted
|
||||
/// by keys in lexographical order. This is an implementation detail
|
||||
/// and subject to change.
|
||||
public var useDeterministicOrdering: Bool = false
|
||||
|
||||
public init() {}
|
||||
}
|
@ -17,6 +17,7 @@ import Foundation
|
||||
|
||||
/// Visitor that encodes a message graph in the protobuf binary wire format.
|
||||
internal struct BinaryEncodingVisitor: Visitor {
|
||||
private let options: BinaryEncodingOptions
|
||||
|
||||
var encoder: BinaryEncoder
|
||||
|
||||
@ -26,12 +27,14 @@ internal struct BinaryEncodingVisitor: Visitor {
|
||||
/// - Precondition: `pointer` must point to an allocated block of memory that
|
||||
/// is large enough to hold the entire encoded message. For performance
|
||||
/// reasons, the encoder does not make any attempts to verify this.
|
||||
init(forWritingInto pointer: UnsafeMutableRawPointer) {
|
||||
encoder = BinaryEncoder(forWritingInto: pointer)
|
||||
init(forWritingInto pointer: UnsafeMutableRawPointer, options: BinaryEncodingOptions) {
|
||||
self.encoder = BinaryEncoder(forWritingInto: pointer)
|
||||
self.options = options
|
||||
}
|
||||
|
||||
init(encoder: BinaryEncoder) {
|
||||
init(encoder: BinaryEncoder, options: BinaryEncodingOptions) {
|
||||
self.encoder = encoder
|
||||
self.options = options
|
||||
}
|
||||
|
||||
mutating func visitUnknown(bytes: Data) throws {
|
||||
@ -262,16 +265,16 @@ internal struct BinaryEncodingVisitor: Visitor {
|
||||
value: _ProtobufMap<KeyType, ValueType>.BaseType,
|
||||
fieldNumber: Int
|
||||
) throws {
|
||||
for (k,v) in value {
|
||||
encoder.startField(fieldNumber: fieldNumber, wireFormat: .lengthDelimited)
|
||||
var sizer = BinaryEncodingSizeVisitor()
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &sizer)
|
||||
try ValueType.visitSingular(value: v, fieldNumber: 2, with: &sizer)
|
||||
let entrySize = sizer.serializedSize
|
||||
encoder.putVarInt(value: entrySize)
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &self)
|
||||
try ValueType.visitSingular(value: v, fieldNumber: 2, with: &self)
|
||||
}
|
||||
try iterateAndEncode(
|
||||
map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan,
|
||||
encodeWithSizer: { sizer, key, value in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &sizer)
|
||||
try ValueType.visitSingular(value: value, fieldNumber: 2, with: &sizer)
|
||||
}, encodeWithVisitor: { visitor, key, value in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try ValueType.visitSingular(value: value, fieldNumber: 2, with: &visitor)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutating func visitMapField<KeyType, ValueType>(
|
||||
@ -279,16 +282,16 @@ internal struct BinaryEncodingVisitor: Visitor {
|
||||
value: _ProtobufEnumMap<KeyType, ValueType>.BaseType,
|
||||
fieldNumber: Int
|
||||
) throws where ValueType.RawValue == Int {
|
||||
for (k,v) in value {
|
||||
encoder.startField(fieldNumber: fieldNumber, wireFormat: .lengthDelimited)
|
||||
var sizer = BinaryEncodingSizeVisitor()
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &sizer)
|
||||
try sizer.visitSingularEnumField(value: v, fieldNumber: 2)
|
||||
let entrySize = sizer.serializedSize
|
||||
encoder.putVarInt(value: entrySize)
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &self)
|
||||
try visitSingularEnumField(value: v, fieldNumber: 2)
|
||||
}
|
||||
try iterateAndEncode(
|
||||
map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan,
|
||||
encodeWithSizer: { sizer, key, value in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &sizer)
|
||||
try sizer.visitSingularEnumField(value: value, fieldNumber: 2)
|
||||
}, encodeWithVisitor: { visitor, key, value in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try visitor.visitSingularEnumField(value: value, fieldNumber: 2)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
mutating func visitMapField<KeyType, ValueType>(
|
||||
@ -296,15 +299,45 @@ internal struct BinaryEncodingVisitor: Visitor {
|
||||
value: _ProtobufMessageMap<KeyType, ValueType>.BaseType,
|
||||
fieldNumber: Int
|
||||
) throws {
|
||||
for (k,v) in value {
|
||||
encoder.startField(fieldNumber: fieldNumber, wireFormat: .lengthDelimited)
|
||||
var sizer = BinaryEncodingSizeVisitor()
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &sizer)
|
||||
try sizer.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||
let entrySize = sizer.serializedSize
|
||||
encoder.putVarInt(value: entrySize)
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &self)
|
||||
try visitSingularMessageField(value: v, fieldNumber: 2)
|
||||
try iterateAndEncode(
|
||||
map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan,
|
||||
encodeWithSizer: { sizer, key, value in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &sizer)
|
||||
try sizer.visitSingularMessageField(value: value, fieldNumber: 2)
|
||||
}, encodeWithVisitor: { visitor, key, value in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try visitor.visitSingularMessageField(value: value, fieldNumber: 2)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/// Helper to encapsulate the common structure of iterating over a map
|
||||
/// and encoding the keys and values.
|
||||
private mutating func iterateAndEncode<K, V>(
|
||||
map: Dictionary<K, V>,
|
||||
fieldNumber: Int,
|
||||
isOrderedBefore: (K, K) -> Bool,
|
||||
encodeWithSizer: (inout BinaryEncodingSizeVisitor, K, V) throws -> (),
|
||||
encodeWithVisitor: (inout BinaryEncodingVisitor, K, V) throws -> ()
|
||||
) throws {
|
||||
if options.useDeterministicOrdering {
|
||||
for (k,v) in map.sorted(by: { isOrderedBefore( $0.0, $1.0) }) {
|
||||
encoder.startField(fieldNumber: fieldNumber, wireFormat: .lengthDelimited)
|
||||
var sizer = BinaryEncodingSizeVisitor()
|
||||
try encodeWithSizer(&sizer, k, v)
|
||||
let entrySize = sizer.serializedSize
|
||||
encoder.putVarInt(value: entrySize)
|
||||
try encodeWithVisitor(&self, k, v)
|
||||
}
|
||||
} else {
|
||||
for (k,v) in map {
|
||||
encoder.startField(fieldNumber: fieldNumber, wireFormat: .lengthDelimited)
|
||||
var sizer = BinaryEncodingSizeVisitor()
|
||||
try encodeWithSizer(&sizer, k, v)
|
||||
let entrySize = sizer.serializedSize
|
||||
encoder.putVarInt(value: entrySize)
|
||||
try encodeWithVisitor(&self, k, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -313,7 +346,7 @@ internal struct BinaryEncodingVisitor: Visitor {
|
||||
start: Int,
|
||||
end: Int
|
||||
) throws {
|
||||
var subVisitor = BinaryEncodingMessageSetVisitor(encoder: encoder)
|
||||
var subVisitor = BinaryEncodingMessageSetVisitor(encoder: encoder, options: options)
|
||||
try fields.traverse(visitor: &subVisitor, start: start, end: end)
|
||||
encoder = subVisitor.encoder
|
||||
}
|
||||
@ -323,9 +356,12 @@ extension BinaryEncodingVisitor {
|
||||
|
||||
// Helper Visitor to when writing out the extensions as MessageSets.
|
||||
internal struct BinaryEncodingMessageSetVisitor: SelectiveVisitor {
|
||||
private let options: BinaryEncodingOptions
|
||||
|
||||
var encoder: BinaryEncoder
|
||||
|
||||
init(encoder: BinaryEncoder) {
|
||||
init(encoder: BinaryEncoder, options: BinaryEncodingOptions) {
|
||||
self.options = options
|
||||
self.encoder = encoder
|
||||
}
|
||||
|
||||
@ -342,7 +378,7 @@ extension BinaryEncodingVisitor {
|
||||
let length = try value.serializedDataSize()
|
||||
encoder.putVarInt(value: length)
|
||||
// Create the sub encoder after writing the length.
|
||||
var subVisitor = BinaryEncodingVisitor(encoder: encoder)
|
||||
var subVisitor = BinaryEncodingVisitor(encoder: encoder, options: options)
|
||||
try value.traverse(visitor: &subVisitor)
|
||||
encoder = subVisitor.encoder
|
||||
|
||||
@ -351,5 +387,4 @@ extension BinaryEncodingVisitor {
|
||||
|
||||
// SelectiveVisitor handles the rest.
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,5 +22,19 @@ public struct JSONEncodingOptions {
|
||||
/// By default they are converted to JSON(lowerCamelCase) names.
|
||||
public var preserveProtoFieldNames: Bool = false
|
||||
|
||||
/// Whether to use deterministic ordering when serializing.
|
||||
///
|
||||
/// Note that the deterministic serialization is NOT canonical across languages.
|
||||
/// It is NOT guaranteed to remain stable over time. It is unstable across
|
||||
/// different builds with schema changes due to unknown fields. Users who need
|
||||
/// canonical serialization (e.g., persistent storage in a canonical form,
|
||||
/// fingerprinting, etc.) should define their own canonicalization specification
|
||||
/// and implement their own serializer rather than relying on this API.
|
||||
///
|
||||
/// If deterministic serialization is requested, map entries will be sorted
|
||||
/// by keys in lexographical order. This is an implementation detail
|
||||
/// and subject to change.
|
||||
public var useDeterministicOrdering: Bool = false
|
||||
|
||||
public init() {}
|
||||
}
|
||||
|
@ -340,39 +340,49 @@ internal struct JSONEncodingVisitor: Visitor {
|
||||
// Packed fields are handled the same as non-packed fields, so JSON just
|
||||
// relies on the default implementations in Visitor.swift
|
||||
|
||||
|
||||
|
||||
mutating func visitMapField<KeyType, ValueType: MapValueType>(fieldType: _ProtobufMap<KeyType, ValueType>.Type, value: _ProtobufMap<KeyType, ValueType>.BaseType, fieldNumber: Int) throws {
|
||||
try startField(for: fieldNumber)
|
||||
encoder.append(text: "{")
|
||||
var mapVisitor = JSONMapEncodingVisitor(encoder: encoder, options: options)
|
||||
for (k,v) in value {
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &mapVisitor)
|
||||
try ValueType.visitSingular(value: v, fieldNumber: 2, with: &mapVisitor)
|
||||
try iterateAndEncode(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
(visitor: inout JSONMapEncodingVisitor, key, value) throws -> () in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try ValueType.visitSingular(value: value, fieldNumber: 2, with: &visitor)
|
||||
}
|
||||
encoder = mapVisitor.encoder
|
||||
encoder.append(text: "}")
|
||||
}
|
||||
|
||||
mutating func visitMapField<KeyType, ValueType>(fieldType: _ProtobufEnumMap<KeyType, ValueType>.Type, value: _ProtobufEnumMap<KeyType, ValueType>.BaseType, fieldNumber: Int) throws where ValueType.RawValue == Int {
|
||||
try startField(for: fieldNumber)
|
||||
encoder.append(text: "{")
|
||||
var mapVisitor = JSONMapEncodingVisitor(encoder: encoder, options: options)
|
||||
for (k, v) in value {
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &mapVisitor)
|
||||
try mapVisitor.visitSingularEnumField(value: v, fieldNumber: 2)
|
||||
try iterateAndEncode(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
(visitor: inout JSONMapEncodingVisitor, key, value) throws -> () in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try visitor.visitSingularEnumField(value: value, fieldNumber: 2)
|
||||
}
|
||||
encoder = mapVisitor.encoder
|
||||
encoder.append(text: "}")
|
||||
}
|
||||
|
||||
mutating func visitMapField<KeyType, ValueType>(fieldType: _ProtobufMessageMap<KeyType, ValueType>.Type, value: _ProtobufMessageMap<KeyType, ValueType>.BaseType, fieldNumber: Int) throws {
|
||||
try iterateAndEncode(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
(visitor: inout JSONMapEncodingVisitor, key, value) throws -> () in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try visitor.visitSingularMessageField(value: value, fieldNumber: 2)
|
||||
}
|
||||
}
|
||||
|
||||
/// Helper to encapsulate the common structure of iterating over a map
|
||||
/// and encoding the keys and values.
|
||||
private mutating func iterateAndEncode<K, V>(
|
||||
map: Dictionary<K, V>,
|
||||
fieldNumber: Int,
|
||||
isOrderedBefore: (K, K) -> Bool,
|
||||
encode: (inout JSONMapEncodingVisitor, K, V) throws -> ()
|
||||
) throws {
|
||||
try startField(for: fieldNumber)
|
||||
encoder.append(text: "{")
|
||||
var mapVisitor = JSONMapEncodingVisitor(encoder: encoder, options: options)
|
||||
for (k,v) in value {
|
||||
try KeyType.visitSingular(value: k, fieldNumber: 1, with: &mapVisitor)
|
||||
try mapVisitor.visitSingularMessageField(value: v, fieldNumber: 2)
|
||||
if options.useDeterministicOrdering {
|
||||
for (k,v) in map.sorted(by: { isOrderedBefore( $0.0, $1.0) }) {
|
||||
try encode(&mapVisitor, k, v)
|
||||
}
|
||||
} else {
|
||||
for (k,v) in map {
|
||||
try encode(&mapVisitor, k, v)
|
||||
}
|
||||
}
|
||||
encoder = mapVisitor.encoder
|
||||
encoder.append(text: "}")
|
||||
|
@ -22,15 +22,37 @@ extension Message {
|
||||
/// - Parameters:
|
||||
/// - partial: If `false` (the default), this method will check
|
||||
/// `Message.isInitialized` before encoding to verify that all required
|
||||
/// fields are present. If any are missing, this method throws
|
||||
/// fields are present. If any are missing, this method throws.
|
||||
/// `BinaryEncodingError.missingRequiredFields`.
|
||||
/// - Returns: A `Data` value containing the binary serialization of the
|
||||
/// message.
|
||||
/// - Throws: `BinaryEncodingError` if encoding fails.
|
||||
public func serializedData(partial: Bool = false) throws -> Data {
|
||||
return try serializedData(partial: partial, options: BinaryEncodingOptions())
|
||||
}
|
||||
|
||||
/// Returns a `Data` value containing the Protocol Buffer binary format
|
||||
/// serialization of the message.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - partial: If `false` (the default), this method will check
|
||||
/// `Message.isInitialized` before encoding to verify that all required
|
||||
/// fields are present. If any are missing, this method throws.
|
||||
/// `BinaryEncodingError.missingRequiredFields`.
|
||||
/// - options: The `BinaryEncodingOptions` to use.
|
||||
/// - Returns: A `SwiftProtobufContiguousBytes` instance containing the binary serialization
|
||||
/// of the message.
|
||||
///
|
||||
/// - Throws: `BinaryEncodingError` if encoding fails.
|
||||
public func serializedData(
|
||||
partial: Bool = false,
|
||||
options: BinaryEncodingOptions
|
||||
) throws -> Data {
|
||||
if !partial && !isInitialized {
|
||||
throw BinaryEncodingError.missingRequiredFields
|
||||
}
|
||||
|
||||
// Note that this assumes `options` will not change the required size.
|
||||
let requiredSize = try serializedDataSize()
|
||||
|
||||
// Messages have a 2GB limit in encoded size, the upstread C++ code
|
||||
@ -48,7 +70,7 @@ extension Message {
|
||||
var data = Data(count: requiredSize)
|
||||
try data.withUnsafeMutableBytes { (body: UnsafeMutableRawBufferPointer) in
|
||||
if let baseAddress = body.baseAddress, body.count > 0 {
|
||||
var visitor = BinaryEncodingVisitor(forWritingInto: baseAddress)
|
||||
var visitor = BinaryEncodingVisitor(forWritingInto: baseAddress, options: options)
|
||||
try traverse(visitor: &visitor)
|
||||
// Currently not exposing this from the api because it really would be
|
||||
// an internal error in the library and should never happen.
|
||||
|
@ -504,16 +504,16 @@ internal struct TextFormatEncodingVisitor: Visitor {
|
||||
// fields (including proto3's default use of packed) without
|
||||
// introducing the baggage of a separate option.
|
||||
|
||||
private mutating func _visitPacked<T>(
|
||||
value: [T], fieldNumber: Int,
|
||||
private mutating func iterateAndEncode<T>(
|
||||
packedValue: [T], fieldNumber: Int,
|
||||
encode: (T, inout TextFormatEncoder) -> ()
|
||||
) throws {
|
||||
assert(!value.isEmpty)
|
||||
assert(!packedValue.isEmpty)
|
||||
emitFieldName(lookingUp: fieldNumber)
|
||||
encoder.startRegularField()
|
||||
var firstItem = true
|
||||
encoder.startArray()
|
||||
for v in value {
|
||||
for v in packedValue {
|
||||
if !firstItem {
|
||||
encoder.arraySeparator()
|
||||
}
|
||||
@ -525,42 +525,42 @@ internal struct TextFormatEncodingVisitor: Visitor {
|
||||
}
|
||||
|
||||
mutating func visitPackedFloatField(value: [Float], fieldNumber: Int) throws {
|
||||
try _visitPacked(value: value, fieldNumber: fieldNumber) {
|
||||
try iterateAndEncode(packedValue: value, fieldNumber: fieldNumber) {
|
||||
(v: Float, encoder: inout TextFormatEncoder) in
|
||||
encoder.putFloatValue(value: v)
|
||||
}
|
||||
}
|
||||
|
||||
mutating func visitPackedDoubleField(value: [Double], fieldNumber: Int) throws {
|
||||
try _visitPacked(value: value, fieldNumber: fieldNumber) {
|
||||
try iterateAndEncode(packedValue: value, fieldNumber: fieldNumber) {
|
||||
(v: Double, encoder: inout TextFormatEncoder) in
|
||||
encoder.putDoubleValue(value: v)
|
||||
}
|
||||
}
|
||||
|
||||
mutating func visitPackedInt32Field(value: [Int32], fieldNumber: Int) throws {
|
||||
try _visitPacked(value: value, fieldNumber: fieldNumber) {
|
||||
try iterateAndEncode(packedValue: value, fieldNumber: fieldNumber) {
|
||||
(v: Int32, encoder: inout TextFormatEncoder) in
|
||||
encoder.putInt64(value: Int64(v))
|
||||
}
|
||||
}
|
||||
|
||||
mutating func visitPackedInt64Field(value: [Int64], fieldNumber: Int) throws {
|
||||
try _visitPacked(value: value, fieldNumber: fieldNumber) {
|
||||
try iterateAndEncode(packedValue: value, fieldNumber: fieldNumber) {
|
||||
(v: Int64, encoder: inout TextFormatEncoder) in
|
||||
encoder.putInt64(value: v)
|
||||
}
|
||||
}
|
||||
|
||||
mutating func visitPackedUInt32Field(value: [UInt32], fieldNumber: Int) throws {
|
||||
try _visitPacked(value: value, fieldNumber: fieldNumber) {
|
||||
try iterateAndEncode(packedValue: value, fieldNumber: fieldNumber) {
|
||||
(v: UInt32, encoder: inout TextFormatEncoder) in
|
||||
encoder.putUInt64(value: UInt64(v))
|
||||
}
|
||||
}
|
||||
|
||||
mutating func visitPackedUInt64Field(value: [UInt64], fieldNumber: Int) throws {
|
||||
try _visitPacked(value: value, fieldNumber: fieldNumber) {
|
||||
try iterateAndEncode(packedValue: value, fieldNumber: fieldNumber) {
|
||||
(v: UInt64, encoder: inout TextFormatEncoder) in
|
||||
encoder.putUInt64(value: v)
|
||||
}
|
||||
@ -591,14 +591,14 @@ internal struct TextFormatEncodingVisitor: Visitor {
|
||||
}
|
||||
|
||||
mutating func visitPackedBoolField(value: [Bool], fieldNumber: Int) throws {
|
||||
try _visitPacked(value: value, fieldNumber: fieldNumber) {
|
||||
try iterateAndEncode(packedValue: value, fieldNumber: fieldNumber) {
|
||||
(v: Bool, encoder: inout TextFormatEncoder) in
|
||||
encoder.putBoolValue(value: v)
|
||||
}
|
||||
}
|
||||
|
||||
mutating func visitPackedEnumField<E: Enum>(value: [E], fieldNumber: Int) throws {
|
||||
try _visitPacked(value: value, fieldNumber: fieldNumber) {
|
||||
try iterateAndEncode(packedValue: value, fieldNumber: fieldNumber) {
|
||||
(v: E, encoder: inout TextFormatEncoder) in
|
||||
encoder.putEnumValue(value: v)
|
||||
}
|
||||
@ -606,17 +606,17 @@ internal struct TextFormatEncodingVisitor: Visitor {
|
||||
|
||||
/// Helper to encapsulate the common structure of iterating over a map
|
||||
/// and encoding the keys and values.
|
||||
private mutating func _visitMap<K, V>(
|
||||
private mutating func iterateAndEncode<K, V>(
|
||||
map: Dictionary<K, V>,
|
||||
fieldNumber: Int,
|
||||
isOrderedBefore: (K, K) -> Bool,
|
||||
coder: (inout TextFormatEncodingVisitor, K, V) throws -> ()
|
||||
encode: (inout TextFormatEncodingVisitor, K, V) throws -> ()
|
||||
) throws {
|
||||
for (k,v) in map.sorted(by: { isOrderedBefore( $0.0, $1.0) }) {
|
||||
emitFieldName(lookingUp: fieldNumber)
|
||||
encoder.startMessageField()
|
||||
var visitor = TextFormatEncodingVisitor(nameMap: nil, nameResolver: mapNameResolver, extensions: nil, encoder: encoder, options: options)
|
||||
try coder(&visitor, k, v)
|
||||
try encode(&visitor, k, v)
|
||||
encoder = visitor.encoder
|
||||
encoder.endMessageField()
|
||||
}
|
||||
@ -627,7 +627,7 @@ internal struct TextFormatEncodingVisitor: Visitor {
|
||||
value: _ProtobufMap<KeyType, ValueType>.BaseType,
|
||||
fieldNumber: Int
|
||||
) throws {
|
||||
try _visitMap(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
try iterateAndEncode(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
(visitor: inout TextFormatEncodingVisitor, key, value) throws -> () in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try ValueType.visitSingular(value: value, fieldNumber: 2, with: &visitor)
|
||||
@ -639,7 +639,7 @@ internal struct TextFormatEncodingVisitor: Visitor {
|
||||
value: _ProtobufEnumMap<KeyType, ValueType>.BaseType,
|
||||
fieldNumber: Int
|
||||
) throws where ValueType.RawValue == Int {
|
||||
try _visitMap(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
try iterateAndEncode(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
(visitor: inout TextFormatEncodingVisitor, key, value) throws -> () in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try visitor.visitSingularEnumField(value: value, fieldNumber: 2)
|
||||
@ -651,7 +651,7 @@ internal struct TextFormatEncodingVisitor: Visitor {
|
||||
value: _ProtobufMessageMap<KeyType, ValueType>.BaseType,
|
||||
fieldNumber: Int
|
||||
) throws {
|
||||
try _visitMap(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
try iterateAndEncode(map: value, fieldNumber: fieldNumber, isOrderedBefore: KeyType._lessThan) {
|
||||
(visitor: inout TextFormatEncodingVisitor, key, value) throws -> () in
|
||||
try KeyType.visitSingular(value: key, fieldNumber: 1, with: &visitor)
|
||||
try visitor.visitSingularMessageField(value: value, fieldNumber: 2)
|
||||
|
@ -19,9 +19,9 @@ public struct Version {
|
||||
/// Major version.
|
||||
public static let major = 1
|
||||
/// Minor version.
|
||||
public static let minor = 24
|
||||
public static let minor = 25
|
||||
/// Revision number.
|
||||
public static let revision = 0
|
||||
public static let revision = 1
|
||||
|
||||
/// String form of the version number.
|
||||
public static let versionString = "\(major).\(minor).\(revision)"
|
||||
|
@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>7.9.1</string>
|
||||
<string>7.10.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
24
Pods/Target Support Files/Kingfisher-iOS/ResourceBundle-Kingfisher-Kingfisher-iOS-Info.plist
generated
Normal file
24
Pods/Target Support Files/Kingfisher-iOS/ResourceBundle-Kingfisher-Kingfisher-iOS-Info.plist
generated
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>${PODS_DEVELOPMENT_LANGUAGE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>7.10.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>7.9.1</string>
|
||||
<string>7.10.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
24
Pods/Target Support Files/Kingfisher-macOS/ResourceBundle-Kingfisher-Kingfisher-macOS-Info.plist
generated
Normal file
24
Pods/Target Support Files/Kingfisher-macOS/ResourceBundle-Kingfisher-Kingfisher-macOS-Info.plist
generated
Normal file
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>${PODS_DEVELOPMENT_LANGUAGE}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>7.10.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.24.0</string>
|
||||
<string>1.25.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.24.0</string>
|
||||
<string>1.25.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
@ -1561,7 +1561,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = "Safari macOS/Safari.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 64;
|
||||
CURRENT_PROJECT_VERSION = 68;
|
||||
DEVELOPMENT_TEAM = XWNXDSM6BU;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@ -1595,7 +1595,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = "Safari macOS/Safari.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 64;
|
||||
CURRENT_PROJECT_VERSION = 68;
|
||||
DEVELOPMENT_TEAM = XWNXDSM6BU;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
@ -1748,7 +1748,7 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 64;
|
||||
CURRENT_PROJECT_VERSION = 68;
|
||||
DEVELOPMENT_TEAM = XWNXDSM6BU;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Tokenary macOS/Supporting Files/Info.plist";
|
||||
@ -1776,7 +1776,7 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 64;
|
||||
CURRENT_PROJECT_VERSION = 68;
|
||||
DEVELOPMENT_TEAM = XWNXDSM6BU;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
INFOPLIST_FILE = "$(SRCROOT)/Tokenary macOS/Supporting Files/Info.plist";
|
||||
@ -1802,7 +1802,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_ENTITLEMENTS = "Tokenary iOS/Tokenary iOS.entitlements";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 66;
|
||||
CURRENT_PROJECT_VERSION = 68;
|
||||
DEVELOPMENT_TEAM = XWNXDSM6BU;
|
||||
INFOPLIST_FILE = "Tokenary iOS/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
@ -1831,7 +1831,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_ENTITLEMENTS = "Tokenary iOS/Tokenary iOS.entitlements";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 66;
|
||||
CURRENT_PROJECT_VERSION = 68;
|
||||
DEVELOPMENT_TEAM = XWNXDSM6BU;
|
||||
INFOPLIST_FILE = "Tokenary iOS/Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
|
||||
@ -1858,7 +1858,7 @@
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||
CODE_SIGN_ENTITLEMENTS = "Safari iOS/Safari iOS.entitlements";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 66;
|
||||
CURRENT_PROJECT_VERSION = 68;
|
||||
DEVELOPMENT_TEAM = XWNXDSM6BU;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "Safari iOS/Info.plist";
|
||||
@ -1892,7 +1892,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = "Safari iOS/Safari iOS.entitlements";
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 66;
|
||||
CURRENT_PROJECT_VERSION = 68;
|
||||
DEVELOPMENT_TEAM = XWNXDSM6BU;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "Safari iOS/Info.plist";
|
||||
|
Loading…
Reference in New Issue
Block a user