浏览代码

Conflicts resolved

Marino Faggiana 6 年之前
父节点
当前提交
4faa0a2767
共有 100 个文件被更改,包括 17237 次插入818 次删除
  1. 9 0
      CODE_OF_CONDUCT.md
  2. 26 44
      File Provider Extension/FileProviderData.swift
  3. 33 36
      File Provider Extension/FileProviderEnumerator.swift
  4. 19 105
      File Provider Extension/FileProviderExtension+Actions.swift
  5. 235 0
      File Provider Extension/FileProviderExtension+Network.swift
  6. 36 24
      File Provider Extension/FileProviderExtension+Thumbnail.swift
  7. 0 0
      File Provider Extension/FileProviderExtension-Bridging-Header.h
  8. 331 0
      File Provider Extension/FileProviderExtension.swift
  9. 8 10
      File Provider Extension/FileProviderItem.swift
  10. 674 0
      LICENSE.txt
  11. 0 52
      Libraries external/Analytics/Firebase.h
  12. 0 1
      Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h
  13. 0 1
      Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRApp.h
  14. 0 1
      Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRConfiguration.h
  15. 0 1
      Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIROptions.h
  16. 二进制
      Libraries external/Analytics/FirebaseCore.framework/FirebaseCore
  17. 0 12
      Libraries external/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h
  18. 0 93
      Libraries external/Analytics/FirebaseCore.framework/Headers/FIROptions.h
  19. 0 5
      Libraries external/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h
  20. 二进制
      Libraries external/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID
  21. 二进制
      Libraries external/Analytics/FirebaseMessaging.framework/FirebaseMessaging
  22. 0 228
      Libraries external/Analytics/FirebaseMessaging.framework/Headers/FIRMessaging.h
  23. 0 1
      Libraries external/Analytics/FirebaseMessaging.framework/Headers/FirebaseMessaging.h
  24. 二进制
      Libraries external/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac
  25. 二进制
      Libraries external/Analytics/Protobuf.framework/Protobuf
  26. 二进制
      Libraries external/Fabric/Crashlytics.framework/Crashlytics
  27. 二进制
      Libraries external/Fabric/Crashlytics.framework/Info.plist
  28. 二进制
      Libraries external/Fabric/Crashlytics.framework/submit
  29. 二进制
      Libraries external/Fabric/Crashlytics.framework/uploadDSYM
  30. 二进制
      Libraries external/Fabric/Fabric.framework/Fabric
  31. 二进制
      Libraries external/Fabric/Fabric.framework/Info.plist
  32. 二进制
      Libraries external/Fabric/Fabric.framework/uploadDSYM
  33. 二进制
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics
  34. 6 1
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h
  35. 28 11
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h
  36. 13 0
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h
  37. 72 35
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h
  38. 114 48
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h
  39. 6 2
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h
  40. 1 4
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h
  41. 4 3
      Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap
  42. 二进制
      Libraries external/Firebase/Analytics/FirebaseCore.framework/FirebaseCore
  43. 22 8
      Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h
  44. 30 10
      Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIRApp.h
  45. 21 23
      Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h
  46. 35 0
      Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h
  47. 116 0
      Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h
  48. 21 0
      Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h
  49. 3 3
      Libraries external/Firebase/Analytics/FirebaseCore.framework/Modules/module.modulemap
  50. 二进制
      Libraries external/Firebase/Analytics/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics
  51. 6 0
      Libraries external/Firebase/Analytics/FirebaseCoreDiagnostics.framework/Modules/module.modulemap
  52. 二进制
      Libraries external/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID
  53. 108 49
      Libraries external/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h
  54. 0 0
      Libraries external/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h
  55. 2 2
      Libraries external/Firebase/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap
  56. 二进制
      Libraries external/Firebase/Analytics/FirebaseNanoPB.framework/FirebaseNanoPB
  57. 二进制
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac
  58. 100 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMDebugSelectorValidation.h
  59. 44 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMDebugThreadValidation.h
  60. 398 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMDefines.h
  61. 79 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMLocalizedString.h
  62. 508 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMLogger.h
  63. 69 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMMethodCheck.h
  64. 199 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMNSData+zlib.h
  65. 40 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMNSDictionary+URLArguments.h
  66. 45 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMNSString+URLArguments.h
  67. 112 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMStringEncoding.h
  68. 71 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMTypeCasting.h
  69. 73 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMURLBuilder.h
  70. 6 0
      Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Modules/module.modulemap
  71. 583 0
      Libraries external/Firebase/Analytics/nanopb.framework/Headers/pb.h
  72. 42 0
      Libraries external/Firebase/Analytics/nanopb.framework/Headers/pb_common.h
  73. 153 0
      Libraries external/Firebase/Analytics/nanopb.framework/Headers/pb_decode.h
  74. 154 0
      Libraries external/Firebase/Analytics/nanopb.framework/Headers/pb_encode.h
  75. 5 0
      Libraries external/Firebase/Analytics/nanopb.framework/Modules/module.modulemap
  76. 二进制
      Libraries external/Firebase/Analytics/nanopb.framework/nanopb
  77. 101 0
      Libraries external/Firebase/Firebase.h
  78. 二进制
      Libraries external/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging
  79. 527 0
      Libraries external/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h
  80. 17 0
      Libraries external/Firebase/Messaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h
  81. 2 5
      Libraries external/Firebase/Messaging/FirebaseMessaging.framework/Modules/module.modulemap
  82. 182 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/Any.pbobjc.h
  83. 311 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/Api.pbobjc.h
  84. 145 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/Duration.pbobjc.h
  85. 74 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/Empty.pbobjc.h
  86. 281 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/FieldMask.pbobjc.h
  87. 1967 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBArray.h
  88. 130 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBArray_PackagePrivate.h
  89. 123 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBBootstrap.h
  90. 253 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBCodedInputStream.h
  91. 112 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBCodedInputStream_PackagePrivate.h
  92. 748 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBCodedOutputStream.h
  93. 126 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBCodedOutputStream_PackagePrivate.h
  94. 288 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBDescriptor.h
  95. 325 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBDescriptor_PackagePrivate.h
  96. 5770 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBDictionary.h
  97. 488 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBDictionary_PackagePrivate.h
  98. 50 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBExtensionInternals.h
  99. 87 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBExtensionRegistry.h
  100. 470 0
      Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBMessage.h

+ 9 - 0
CODE_OF_CONDUCT.md

@@ -0,0 +1,9 @@
+In the Nextcloud community, participants from all over the world come together to create Free Software for a free internet. This is made possible by the support, hard work and enthusiasm of thousands of people, including those who create and use Nextcloud software.
+
+Our code of conduct offers some guidance to ensure Nextcloud participants can cooperate effectively in a positive and inspiring atmosphere, and to explain how together we can strengthen and support each other.
+
+The Code of Conduct is shared by all contributors and users who engage with the Nextcloud team and its community services. It presents a summary of the shared values and “common sense” thinking in our community.
+
+You can find our full code of conduct on our website: https://nextcloud.com/code-of-conduct/
+
+Please, keep our CoC in mind when you contribute! That way, everyone can be a part of our community in a productive, positive, creative and fun way.

+ 26 - 44
PickerFileProvider/FileProviderData.swift → File Provider Extension/FileProviderData.swift

@@ -33,14 +33,6 @@ class FileProviderData: NSObject {
     var accountPassword = ""
     var accountUrl = ""
     var homeServerUrl = ""
-    var directoryUser = ""
-    
-    // Directory
-    var fileProviderStorageURL: URL?
-    
-    // metadata Selector Post
-    let selectorPostImportDocument = "importDocument"
-    let selectorPostItemChanged = "itemChanged"
         
     // Max item for page
     let itemForPage = 20
@@ -62,9 +54,9 @@ class FileProviderData: NSObject {
     var fileProviderSignalUpdateContainerItem = [NSFileProviderItemIdentifier:FileProviderItem]()
     var fileProviderSignalDeleteWorkingSetItemIdentifier = [NSFileProviderItemIdentifier:NSFileProviderItemIdentifier]()
     var fileProviderSignalUpdateWorkingSetItem = [NSFileProviderItemIdentifier:FileProviderItem]()
-
-    // Reupload after error
-    let timeReupload: Double = 10
+    
+    // UserDefaults
+    var ncUserDefaults = UserDefaults(suiteName: NCBrandOptions.sharedInstance.capabilitiesGroups)
     
     // MARK: - 
     
@@ -86,12 +78,13 @@ class FileProviderData: NSObject {
                 accountPassword = activeAccount.password
                 accountUrl = activeAccount.url
                 homeServerUrl = CCUtility.getHomeServerUrlActiveUrl(activeAccount.url)
-                directoryUser = CCUtility.getDirectoryActiveUser(activeAccount.user, activeUrl: activeAccount.url)
             }
         } else if account != activeAccount.account {
             assert(false, "change user")
         }
         
+        CCNetworking.shared().settingAccount()
+        
         return true
     }
     
@@ -100,13 +93,13 @@ class FileProviderData: NSObject {
     func getAccountFromItemIdentifier(_ itemIdentifier: NSFileProviderItemIdentifier) -> String? {
         
         let fileID = itemIdentifier.rawValue
-        return NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID = %@", account, fileID))?.account
+        return NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", fileID))?.account
     }
     
     func getTableMetadataFromItemIdentifier(_ itemIdentifier: NSFileProviderItemIdentifier) -> tableMetadata? {
         
         let fileID = itemIdentifier.rawValue
-        return NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID = %@", account, fileID))
+        return NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", fileID))
     }
 
     func getItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier {
@@ -117,32 +110,22 @@ class FileProviderData: NSObject {
     func createFileIdentifierOnFileSystem(metadata: tableMetadata) {
         
         let itemIdentifier = getItemIdentifier(metadata: metadata)
-        let identifierPath = fileProviderStorageURL!.path + "/" + itemIdentifier.rawValue
-        let fileIdentifier = identifierPath + "/" + metadata.fileName
         
-        do {
-            try FileManager.default.createDirectory(atPath: identifierPath, withIntermediateDirectories: true, attributes: nil)
-        } catch { }
-        
-        if metadata.directory == false {
-            // If do not exists create file with size = 0
-            if FileManager.default.fileExists(atPath: fileIdentifier) == false {
-                FileManager.default.createFile(atPath: fileIdentifier, contents: nil, attributes: nil)
-            }
+        if metadata.directory {
+            CCUtility.getDirectoryProviderStorageFileID(itemIdentifier.rawValue)
+        } else {
+            CCUtility.getDirectoryProviderStorageFileID(itemIdentifier.rawValue, fileNameView: metadata.fileNameView)
         }
     }
     
     func getParentItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier? {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return NSFileProviderItemIdentifier("") }
-        
-        if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account = %@ AND directoryID = %@", account, metadata.directoryID))  {
+        if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "directoryID == %@", metadata.directoryID))  {
             if directory.serverUrl == homeServerUrl {
                 return NSFileProviderItemIdentifier(NSFileProviderItemIdentifier.rootContainer.rawValue)
             } else {
                 // get the metadata.FileID of parent Directory
-                if let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID = %@", account, directory.fileID))  {
+                if let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", directory.fileID))  {
                     let identifier = getItemIdentifier(metadata: metadata)
                     return identifier
                 }
@@ -154,21 +137,18 @@ class FileProviderData: NSObject {
     
     func getTableDirectoryFromParentItemIdentifier(_ parentItemIdentifier: NSFileProviderItemIdentifier) -> tableDirectory? {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return nil }
-        
         var predicate: NSPredicate
         
         if parentItemIdentifier == .rootContainer {
             
-            predicate = NSPredicate(format: "account = %@ AND serverUrl = %@", account, homeServerUrl)
+            predicate = NSPredicate(format: "account == %@ AND serverUrl == %@", account, homeServerUrl)
             
         } else {
             
             guard let metadata = getTableMetadataFromItemIdentifier(parentItemIdentifier) else {
                 return nil
             }
-            predicate = NSPredicate(format: "account = %@ AND fileID = %@", account, metadata.fileID)
+            predicate = NSPredicate(format: "fileID == %@", metadata.fileID)
         }
         
         guard let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: predicate) else {
@@ -182,9 +162,6 @@ class FileProviderData: NSObject {
     
     func updateFavoriteForWorkingSet() {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
         var updateWorkingSet = false
         let oldListFavoriteIdentifierRank = listFavoriteIdentifierRank
         listFavoriteIdentifierRank = NCManageDatabase.sharedInstance.getTableMetadatasDirectoryFavoriteIdentifierRank()
@@ -194,7 +171,7 @@ class FileProviderData: NSObject {
             
             if !oldListFavoriteIdentifierRank.keys.contains(identifier) {
                 
-                guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID = %@", account, identifier)) else {
+                guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", identifier)) else {
                     continue
                 }
                 guard let parentItemIdentifier = getParentItemIdentifier(metadata: metadata) else {
@@ -214,7 +191,7 @@ class FileProviderData: NSObject {
             
             if !listFavoriteIdentifierRank.keys.contains(identifier) {
                 
-                guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID = %@", account, identifier)) else {
+                guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", identifier)) else {
                     continue
                 }
                 
@@ -236,10 +213,7 @@ class FileProviderData: NSObject {
     // Convinent method to signal the enumeration for containers.
     //
     func signalEnumerator(for containerItemIdentifiers: [NSFileProviderItemIdentifier]) {
-        
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
+                
         currentAnchor += 1
         
         for containerItemIdentifier in containerItemIdentifiers {
@@ -280,6 +254,10 @@ class FileProviderData: NSObject {
         
         var errorResult: Error?
         
+        if atPath == toPath {
+            return nil
+        }
+                
         if !fileManager.fileExists(atPath: atPath) {
             return NSError(domain: NSCocoaErrorDomain, code: NSFileNoSuchFileError, userInfo:[:])
         }
@@ -310,4 +288,8 @@ class FileProviderData: NSObject {
         
         return errorResult
     }
+    
+    func fileExists(atPath: String) -> Bool {
+        return fileManager.fileExists(atPath: atPath)
+    }
 }

+ 33 - 36
PickerFileProvider/FileProviderEnumerator.swift → File Provider Extension/FileProviderEnumerator.swift

@@ -35,17 +35,14 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
         self.providerData = providerData
         
         // Select ServerUrl
-        if #available(iOSApplicationExtension 11.0, *) {
-
-            if (enumeratedItemIdentifier == .rootContainer) {
-                serverUrl = providerData.homeServerUrl
-            } else {
+        if (enumeratedItemIdentifier == .rootContainer) {
+            serverUrl = providerData.homeServerUrl
+        } else {
                 
-                let metadata = providerData.getTableMetadataFromItemIdentifier(enumeratedItemIdentifier)
-                if metadata != nil  {
-                    if let directorySource = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account = %@ AND directoryID = %@", providerData.account, metadata!.directoryID))  {
-                        serverUrl = directorySource.serverUrl + "/" + metadata!.fileName
-                    }
+            let metadata = providerData.getTableMetadataFromItemIdentifier(enumeratedItemIdentifier)
+            if metadata != nil  {
+                if let directorySource = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "directoryID == %@", metadata!.directoryID))  {
+                    serverUrl = directorySource.serverUrl + "/" + metadata!.fileName
                 }
             }
         }
@@ -54,20 +51,13 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
     }
 
     func invalidate() {
-        // Update the WorkingSet -> Favorite
-        providerData.updateFavoriteForWorkingSet()
+       
     }
 
     func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {
         
         var items: [NSFileProviderItemProtocol] = []
         var metadatasFromDB: [tableMetadata]?
-
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else {
-            observer.finishEnumerating(upTo: nil)
-            return
-        }
         
         /*** WorkingSet ***/
         if enumeratedItemIdentifier == .workingSet {
@@ -75,10 +65,10 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
             var itemIdentifierMetadata = [NSFileProviderItemIdentifier:tableMetadata]()
             
             // ***** Tags *****
-            let tags = NCManageDatabase.sharedInstance.getTags(predicate: NSPredicate(format: "account = %@", providerData.account))
+            let tags = NCManageDatabase.sharedInstance.getTags(predicate: NSPredicate(format: "account == %@", providerData.account))
             for tag in tags {
                 
-                guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID = %@", providerData.account, tag.fileID))  else {
+                guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", tag.fileID))  else {
                     continue
                 }
                 
@@ -91,7 +81,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
             providerData.listFavoriteIdentifierRank = NCManageDatabase.sharedInstance.getTableMetadatasDirectoryFavoriteIdentifierRank()
             for (identifier, _) in providerData.listFavoriteIdentifierRank {
              
-                guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID = %@", providerData.account, identifier)) else {
+                guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", identifier)) else {
                     continue
                 }
                
@@ -120,8 +110,8 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
             }
             
             // Select items from database
-            if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account = %@ AND serverUrl = %@", providerData.account, serverUrl))  {
-                metadatasFromDB = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account = %@ AND directoryID = %@", providerData.account, directory.directoryID), sorted: "fileName", ascending: true)
+            if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", providerData.account, serverUrl))  {
+                metadatasFromDB = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "directoryID == %@", directory.directoryID), sorted: "fileName", ascending: true)
             }
             
             // Calculate current page
@@ -143,6 +133,9 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
                 return
             }
             
+            // Update the WorkingSet -> Favorite
+            providerData.updateFavoriteForWorkingSet()
+            
             // Read 
             var fileName: String?
             var serverUrlForFileName = self.providerData.homeServerUrl
@@ -159,25 +152,31 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
                     
                     ocNetworking?.readFolder(serverUrl, depth: "1", account: self.providerData.account, success: { (metadatas, metadataFolder, directoryID) in
                         
-                        // Save etag for this serverUrl
                         if metadataFolder != nil {
+                            // Update directory etag
+                            NCManageDatabase.sharedInstance.setDirectory(serverUrl: serverUrl, serverUrlTo: nil, etag: metadataFolder!.etag, fileID: metadataFolder!.fileID, encrypted: metadataFolder!.e2eEncrypted)
+                            // Save etag for this serverUrl
                             self.providerData.listServerUrlEtag[serverUrl] = metadataFolder!.etag
                         }
                         
                         if metadatas != nil {
                             
-                            // Insert metadata on DB
-                            NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "account = %@ AND directoryID = %@ AND session = ''", self.providerData.account, directoryID!), clearDateReadDirectoryID: directoryID!)
-                            _ = NCManageDatabase.sharedInstance.addMetadatas(metadatas as! [tableMetadata], serverUrl: serverUrl)
-                            
-                            metadatasFromDB = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account = %@ AND directoryID = %@", self.providerData.account, directoryID!), sorted: "fileName", ascending: true)
-                            self.selectFirstPageItems(metadatasFromDB, observer: observer)
+                            NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "directoryID == %@ AND (status == %d OR status == %d)", directoryID!, k_metadataStatusNormal, k_metadataStatusHide), clearDateReadDirectoryID: directoryID!)
                             
-                        } else {
+                            NCManageDatabase.sharedInstance.setDateReadDirectory(directoryID: directoryID!)
+
+                            let metadatasInDownload = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "directoryID == %@ AND (status == %d OR status == %d OR status == %d OR status == %d)", directoryID!, k_metadataStatusWaitDownload, k_metadataStatusInDownload, k_metadataStatusDownloading, k_metadataStatusDownloadError), sorted: nil, ascending: false)
                             
-                            self.selectFirstPageItems(metadatasFromDB, observer: observer)
+                            _ = NCManageDatabase.sharedInstance.addMetadatas(metadatas as! [tableMetadata], serverUrl: serverUrl)
+                            if metadatasInDownload != nil {
+                                _ = NCManageDatabase.sharedInstance.addMetadatas(metadatasInDownload!, serverUrl: serverUrl)
+                            }
                         }
                         
+                        metadatasFromDB = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "directoryID == %@", directoryID!), sorted: "fileName", ascending: true)
+                        
+                        self.selectFirstPageItems(metadatasFromDB, observer: observer)
+                        
                     }, failure: { (errorMessage, errorCode) in
                         
                         self.selectFirstPageItems(metadatasFromDB, observer: observer)
@@ -196,9 +195,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
     }
     
     func enumerateChanges(for observer: NSFileProviderChangeObserver, from anchor: NSFileProviderSyncAnchor) {
-        
-        guard #available(iOS 11, *) else { return }
-    
+            
         var itemsDelete = [NSFileProviderItemIdentifier]()
         var itemsUpdate = [FileProviderItem]()
         
@@ -300,7 +297,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
             for metadata in metadatas {
                 
                 // E2EE Remove
-                if metadata.e2eEncrypted || metadata.status == Double(k_metadataStatusHide) || (metadata.session != "" && metadata.session != k_download_session_extension && metadata.session != k_upload_session_extension) {
+                if metadata.e2eEncrypted || metadata.status == Int(k_metadataStatusHide) || (metadata.session != "" && metadata.session != k_download_session_extension && metadata.session != k_upload_session_extension) {
                     continue
                 }
                 

+ 19 - 105
PickerFileProvider/FileProviderExtension+Actions.swift → File Provider Extension/FileProviderExtension+Actions.swift

@@ -27,9 +27,6 @@ extension FileProviderExtension {
 
     override func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
         // Check account
         if providerData.setupActiveAccount() == false {
             completionHandler(nil, NSFileProviderError(.notAuthenticated))
@@ -93,9 +90,6 @@ extension FileProviderExtension {
     
     override func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
         // Check account
         if providerData.setupActiveAccount() == false {
             completionHandler(NSFileProviderError(.notAuthenticated))
@@ -116,10 +110,6 @@ extension FileProviderExtension {
             return
         }
         
-        // Delete queue upload for ImportDocument (if exists)
-        NCManageDatabase.sharedInstance.deleteQueueUpload(assetLocalIdentifier: metadata.assetLocalIdentifier, selector: metadata.sessionSelector)
-        
-        //
         deleteFile(withIdentifier: itemIdentifier, parentItemIdentifier: parentItemIdentifier, metadata: metadata, serverUrl: serverUrl)
        
         // return immediately
@@ -135,9 +125,6 @@ extension FileProviderExtension {
     
     override func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
         // Check account
         if providerData.setupActiveAccount() == false {
             completionHandler(nil, NSFileProviderError(.notAuthenticated))
@@ -184,7 +171,7 @@ extension FileProviderExtension {
                 NCManageDatabase.sharedInstance.moveMetadata(fileName: metadataFrom.fileName, directoryID: metadataFrom.directoryID, directoryIDTo: directoryIDTo)
             }
             
-            guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID = %@", self.providerData.account, fileIDFrom)) else {
+            guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", fileIDFrom)) else {
                 completionHandler(nil, NSFileProviderError(.noSuchItem))
                 return
             }
@@ -207,9 +194,6 @@ extension FileProviderExtension {
     
     override func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
         // Check account
         if providerData.setupActiveAccount() == false {
             completionHandler(nil, NSFileProviderError(.notAuthenticated))
@@ -226,7 +210,7 @@ extension FileProviderExtension {
             return
         }
         
-        guard let directoryTable = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "serverUrl = %@", serverUrl)) else {
+        guard let directoryTable = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "serverUrl == %@", serverUrl)) else {
             completionHandler(nil, NSFileProviderError(.noSuchItem))
             return
         }
@@ -252,9 +236,11 @@ extension FileProviderExtension {
                 
                 let itemIdentifier = self.providerData.getItemIdentifier(metadata: metadata)
                 
-                _ = self.providerData.moveFile(self.providerData.fileProviderStorageURL!.path + "/" + itemIdentifier.rawValue + "/" + fileNameFrom, toPath: self.providerData.fileProviderStorageURL!.path + "/" + itemIdentifier.rawValue + "/" + itemName)
-                
-                NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, date: nil, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: itemName, etag: nil, etagFPE: nil)
+                // rename file
+                _ = self.providerData.moveFile(CCUtility.getDirectoryProviderStorageFileID(itemIdentifier.rawValue, fileNameView: fileNameFrom), toPath: CCUtility.getDirectoryProviderStorageFileID(itemIdentifier.rawValue, fileNameView: itemName))
+                _ = self.providerData.moveFile(CCUtility.getDirectoryProviderStorageIconFileID(itemIdentifier.rawValue, fileNameView: fileNameFrom), toPath: CCUtility.getDirectoryProviderStorageIconFileID(itemIdentifier.rawValue, fileNameView: itemName))
+                                
+                NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, date: nil, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: itemName, etag: nil)
             }
             
             guard let parentItemIdentifier = self.providerData.getParentItemIdentifier(metadata: metadata) else {
@@ -280,9 +266,6 @@ extension FileProviderExtension {
     
     override func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
         // Check account
         if providerData.setupActiveAccount() == false {
             completionHandler(nil, NSFileProviderError(.notAuthenticated))
@@ -328,9 +311,6 @@ extension FileProviderExtension {
     
     override func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
         guard let metadata = providerData.getTableMetadataFromItemIdentifier(itemIdentifier) else {
             completionHandler(nil, NSFileProviderError(.noSuchItem))
             return
@@ -358,9 +338,6 @@ extension FileProviderExtension {
     
     override func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
         
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
         guard let metadata = providerData.getTableMetadataFromItemIdentifier(itemIdentifier) else {
             completionHandler(nil, NSFileProviderError(.noSuchItem))
             return
@@ -378,10 +355,7 @@ extension FileProviderExtension {
     }
     
     override func importDocument(at fileURL: URL, toParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
-        
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return }
-        
+                
         DispatchQueue.main.async {
             
             autoreleasepool {
@@ -394,7 +368,6 @@ extension FileProviderExtension {
                     completionHandler(nil, NSFileProviderError(.noSuchItem))
                     return
                 }
-                let serverUrl = tableDirectory.serverUrl
             
                 // --------------------------------------------- Copy file here with security access
             
@@ -417,15 +390,10 @@ extension FileProviderExtension {
                     return
                 }
             
-                let fileName = self.createFileName(fileURL.lastPathComponent, directoryID: tableDirectory.directoryID, serverUrl: serverUrl)
-                let fileNamePathDirectory = self.providerData.fileProviderStorageURL!.path + "/" + tableDirectory.directoryID + fileName
-            
-                do {
-                    try FileManager.default.createDirectory(atPath: fileNamePathDirectory, withIntermediateDirectories: true, attributes: nil)
-                } catch  { }
+                let fileName = NCUtility.sharedInstance.createFileName(fileURL.lastPathComponent, directoryID: tableDirectory.directoryID)
             
                 self.fileCoordinator.coordinate(readingItemAt: fileURL, options: .withoutChanges, error: &error) { (url) in
-                    _ = self.providerData.moveFile(url.path, toPath: fileNamePathDirectory + "/" + fileName)
+                    _ = self.providerData.moveFile(url.path, toPath: CCUtility.getDirectoryProviderStorageFileID(tableDirectory.directoryID + fileName, fileNameView: fileName))
                 }
             
                 fileURL.stopAccessingSecurityScopedResource()
@@ -434,42 +402,30 @@ extension FileProviderExtension {
             
                 // Metadata TEMP
                 metadata.account = self.providerData.account
-                metadata.assetLocalIdentifier = tableDirectory.directoryID + fileName
                 metadata.date = NSDate()
                 metadata.directory = false
                 metadata.directoryID = tableDirectory.directoryID
                 metadata.etag = ""
                 metadata.fileID = tableDirectory.directoryID + fileName
-                metadata.size = size
-                metadata.status = Double(k_metadataStatusHide)
                 metadata.fileName = fileName
                 metadata.fileNameView = fileName
+                metadata.size = size
+                metadata.status = Int(k_metadataStatusHide)
+               
                 CCUtility.insertTypeFileIconName(fileName, metadata: metadata)
-            
+
                 if (size > 0) {
                     
-                    let metadataNet = CCMetadataNet()
-                    
-                    metadataNet.account = self.providerData.account
-                    metadataNet.assetLocalIdentifier = tableDirectory.directoryID + fileName
-                    metadataNet.fileName = fileName
-                    metadataNet.path = fileNamePathDirectory
-                    metadataNet.selector = selectorUploadFile
-                    metadataNet.selectorPost = self.providerData.selectorPostImportDocument
-                    metadataNet.serverUrl = serverUrl
-                    metadataNet.session = k_upload_session_extension
-                    metadataNet.sessionError = ""
-                    metadataNet.sessionID = ""
-                    metadataNet.taskStatus = Int(k_taskStatusResume)
-                    
-                    _ = NCManageDatabase.sharedInstance.addQueueUpload(metadataNet: metadataNet)
+                    metadata.session = k_upload_session_extension
+                    metadata.sessionSelector = selectorUploadFile
+                    metadata.status = Int(k_metadataStatusWaitUpload)
                 }
-            
+                
                 guard let metadataDB = NCManageDatabase.sharedInstance.addMetadata(metadata) else {
                     completionHandler(nil, NSFileProviderError(.noSuchItem))
                     return
                 }
-            
+                            
                 let item = FileProviderItem(metadata: metadataDB, parentItemIdentifier: parentItemIdentifier, providerData: self.providerData)
             
                 completionHandler(item, nil)
@@ -478,46 +434,4 @@ extension FileProviderExtension {
             }
         }
     }
-    
-    func createFileName(_ fileName: String, directoryID: String, serverUrl: String) -> String {
-        
-        var resultFileName = fileName
-        
-        providerData.queueTradeSafe.sync {
-            
-            var exitLoop = false
-            
-            while exitLoop == false {
-                
-                if NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileNameView = %@ AND directoryID = %@", providerData.account, resultFileName, directoryID)) != nil {
-                    
-                    var name = NSString(string: resultFileName).deletingPathExtension
-                    let ext = NSString(string: resultFileName).pathExtension
-                    
-                    let characters = Array(name)
-                    
-                    if characters.count < 2 {
-                        resultFileName = name + " " + "1" + "." + ext
-                    } else {
-                        let space = characters[characters.count-2]
-                        let numChar = characters[characters.count-1]
-                        var num = Int(String(numChar))
-                        if (space == " " && num != nil) {
-                            name = String(name.dropLast())
-                            num = num! + 1
-                            resultFileName = name + "\(num!)" + "." + ext
-                        } else {
-                            resultFileName = name + " " + "1" + "." + ext
-                        }
-                    }
-                    
-                } else {
-                    exitLoop = true
-                }
-            }
-        }
-        
-        return resultFileName
-    }
-    
 }

+ 235 - 0
File Provider Extension/FileProviderExtension+Network.swift

@@ -0,0 +1,235 @@
+//
+//  FileProviderExtension+Network.swift
+//  PickerFileProvider
+//
+//  Created by Marino Faggiana on 28/05/18.
+//  Copyright © 2018 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import FileProvider
+
+extension FileProviderExtension {
+
+    // --------------------------------------------------------------------------------------------
+    //  MARK: - Delete
+    // --------------------------------------------------------------------------------------------
+    
+    func deleteFile(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, parentItemIdentifier: NSFileProviderItemIdentifier, metadata: tableMetadata, serverUrl: String) {
+        
+        let ocNetworking = OCnetworking.init(delegate: nil, metadataNet: nil, withUser: providerData.accountUser, withUserID: providerData.accountUserID, withPassword: providerData.accountPassword, withUrl: providerData.accountUrl)
+        ocNetworking?.deleteFileOrFolder(metadata.fileName, serverUrl: serverUrl, completion: { (message, errorCode) in
+            
+            if errorCode == 0 || errorCode == 404 {
+                self.deleteFileSystem(for: metadata, serverUrl: serverUrl, itemIdentifier: itemIdentifier)
+            }
+        })
+    }
+    
+    func deleteFileSystem(for metadata: tableMetadata, serverUrl: String, itemIdentifier: NSFileProviderItemIdentifier) {
+        
+        let fileNamePath = CCUtility.getDirectoryProviderStorageFileID(itemIdentifier.rawValue)!
+        do {
+            try self.providerData.fileManager.removeItem(atPath: fileNamePath)
+        } catch let error {
+            print("error: \(error)")
+        }
+        
+        if metadata.directory {
+            let dirForDelete = CCUtility.stringAppendServerUrl(serverUrl, addFileName: metadata.fileName)
+            NCManageDatabase.sharedInstance.deleteDirectoryAndSubDirectory(serverUrl: dirForDelete!)
+        }
+        
+        NCManageDatabase.sharedInstance.deleteMetadata(predicate: NSPredicate(format: "fileID == %@", metadata.fileID), clearDateReadDirectoryID: nil)
+        NCManageDatabase.sharedInstance.deleteLocalFile(predicate: NSPredicate(format: "fileID == %@", metadata.fileID))
+    }
+    
+    // --------------------------------------------------------------------------------------------
+    //  MARK: - Favorite
+    // --------------------------------------------------------------------------------------------
+    
+    func settingFavorite(_ favorite: Bool, withIdentifier itemIdentifier: NSFileProviderItemIdentifier, parentItemIdentifier: NSFileProviderItemIdentifier, metadata: tableMetadata) {
+        
+        guard let serverUrl = NCManageDatabase.sharedInstance.getServerUrl(metadata.directoryID) else {
+            return
+        }
+        
+        let fileNamePath = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: serverUrl, activeUrl: self.providerData.accountUrl)
+
+        let ocNetworking = OCnetworking.init(delegate: nil, metadataNet: nil, withUser: providerData.accountUser, withUserID: providerData.accountUserID, withPassword: providerData.accountPassword, withUrl: providerData.accountUrl)
+        ocNetworking?.settingFavorite(fileNamePath, favorite: favorite, completion: { (message, errorCode) in
+            if errorCode == 0 {
+                // Change DB
+                metadata.favorite = favorite
+                _ = NCManageDatabase.sharedInstance.addMetadata(metadata)
+            } else {
+                // Errore, remove from listFavoriteIdentifierRank
+                self.providerData.listFavoriteIdentifierRank.removeValue(forKey: itemIdentifier.rawValue)
+                
+                let item = FileProviderItem(metadata: metadata, parentItemIdentifier: parentItemIdentifier, providerData: self.providerData)
+                
+                self.providerData.queueTradeSafe.sync(flags: .barrier) {
+                    self.providerData.fileProviderSignalUpdateContainerItem[item.itemIdentifier] = item
+                    self.providerData.fileProviderSignalUpdateWorkingSetItem[item.itemIdentifier] = item
+                }
+                
+                self.providerData.signalEnumerator(for: [item.parentItemIdentifier, .workingSet])
+            }
+        })
+    }
+    
+    // --------------------------------------------------------------------------------------------
+    //  MARK: - Upload
+    // --------------------------------------------------------------------------------------------
+    
+    func uploadStart(_ fileID: String!, account: String!, task: URLSessionUploadTask!, serverUrl: String!) {
+        
+        guard let metadataUpload = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", fileID)) else {
+            return
+        }
+        
+        metadataUpload.status = Int(k_metadataStatusUploading)
+        guard let metadata = NCManageDatabase.sharedInstance.addMetadata(metadataUpload) else {
+            return
+        }
+        
+        guard let parentItemIdentifier = providerData.getParentItemIdentifier(metadata: metadata) else {
+            return
+        }
+        
+        let item = FileProviderItem(metadata: metadata, parentItemIdentifier: parentItemIdentifier, providerData: providerData)
+
+        // Register for bytesSent
+        NSFileProviderManager.default.register(task, forItemWithIdentifier: NSFileProviderItemIdentifier(item.itemIdentifier.rawValue)) { (error) in }
+        
+        providerData.queueTradeSafe.sync(flags: .barrier) {
+            self.providerData.fileProviderSignalUpdateContainerItem[item.itemIdentifier] = item
+            self.providerData.fileProviderSignalUpdateWorkingSetItem[item.itemIdentifier] = item
+        }
+        
+        self.providerData.signalEnumerator(for: [item.parentItemIdentifier, .workingSet])
+    }
+    
+    func uploadFileSuccessFailure(_ fileName: String!, fileID: String!, assetLocalIdentifier: String!, serverUrl: String!, selector: String!, errorMessage: String!, errorCode: Int) {
+                
+        guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", fileID)) else {
+            return
+        }
+        
+        guard let parentItemIdentifier = providerData.getParentItemIdentifier(metadata: metadata) else {
+            return
+        }
+        
+        // OK
+        if errorCode == 0 {
+            
+            // Remove temp fileID = directoryID + fileName
+            providerData.queueTradeSafe.sync(flags: .barrier) {
+                let itemIdentifier = NSFileProviderItemIdentifier(metadata.directoryID+fileName)
+                self.providerData.fileProviderSignalDeleteContainerItemIdentifier[itemIdentifier] = itemIdentifier
+                self.providerData.fileProviderSignalDeleteWorkingSetItemIdentifier[itemIdentifier] = itemIdentifier
+            }
+            
+            // Recreate ico
+            CCGraphics.createNewImage(from: fileName, fileID: fileID, extension: NSString(string: fileName).pathExtension, filterGrayScale: false, typeFile: metadata.typeFile, writeImage: true)
+            
+            // remove session data
+            metadata.session = ""
+            metadata.sessionSelector = ""
+            let metadata = NCManageDatabase.sharedInstance.addMetadata(metadata)
+            
+            let item = FileProviderItem(metadata: metadata!, parentItemIdentifier: parentItemIdentifier, providerData: providerData)
+
+            providerData.queueTradeSafe.sync(flags: .barrier) {
+                self.providerData.fileProviderSignalUpdateContainerItem[item.itemIdentifier] = item
+                self.providerData.fileProviderSignalUpdateWorkingSetItem[item.itemIdentifier] = item
+            }
+            
+            uploadFileImportDocument()
+            
+        } else {
+        
+            // Error
+            
+            metadata.status = Int(k_metadataStatusUploadError)
+            let metadata = NCManageDatabase.sharedInstance.addMetadata(metadata)
+            
+            let item = FileProviderItem(metadata: metadata!, parentItemIdentifier: parentItemIdentifier, providerData: providerData)
+            
+            providerData.queueTradeSafe.sync(flags: .barrier) {
+                providerData.fileProviderSignalUpdateContainerItem[item.itemIdentifier] = item
+                providerData.fileProviderSignalUpdateWorkingSetItem[item.itemIdentifier] = item
+            }
+        }
+        
+        self.providerData.signalEnumerator(for: [parentItemIdentifier, .workingSet])
+    }
+    
+    func uploadFileImportDocument() {
+        
+        let tableMetadatas = NCManageDatabase.sharedInstance.getMetadatas(predicate: NSPredicate(format: "account == %@ AND session == %@ AND (status == %d OR status == %d)", providerData.account, k_upload_session_extension, k_metadataStatusInUpload, k_metadataStatusUploading), sorted: "fileName", ascending: true)
+        
+        if (tableMetadatas == nil || (tableMetadatas!.count < Int(k_maxConcurrentOperationUpload))) {
+            
+            guard let metadataForUpload = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account == %@ AND session == %@ AND status == %d", providerData.account, k_upload_session_extension, k_metadataStatusWaitUpload)) else {
+                return
+            }
+            
+            CCNetworking.shared().delegate = self
+            CCNetworking.shared().uploadFile(metadataForUpload, taskStatus: Int(k_taskStatusResume))
+        }
+    }
+    
+    func uploadFileItemChanged(for itemIdentifier: NSFileProviderItemIdentifier, fileName: String, url: URL) {
+        
+        var itemIdentifierForUpload = itemIdentifier
+        
+        // Is itemIdentifier = directoryID+fileName [Apple Works and ... ?]
+        if itemIdentifier.rawValue.contains(fileName) && providerData.fileExists(atPath: CCUtility.getDirectoryProviderStorage()+"/"+itemIdentifier.rawValue) {
+            let directoryID = itemIdentifier.rawValue.replacingOccurrences(of: fileName, with: "")
+            guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "directoryID == %@ AND fileName == %@", directoryID, fileName)) else {
+                return
+            }
+            itemIdentifierForUpload = providerData.getItemIdentifier(metadata: metadata)
+            _ = providerData.moveFile(CCUtility.getDirectoryProviderStorage()+"/"+itemIdentifier.rawValue, toPath: CCUtility.getDirectoryProviderStorage()+"/"+itemIdentifierForUpload.rawValue)
+        }
+        
+        guard let metadata = providerData.getTableMetadataFromItemIdentifier(itemIdentifierForUpload) else {
+            return
+        }
+        
+        metadata.session = k_upload_session_extension
+        metadata.sessionSelector = selectorUploadFile
+        metadata.status = Int(k_metadataStatusWaitUpload)
+
+        guard let metadataForUpload = NCManageDatabase.sharedInstance.addMetadata(metadata) else {
+            return
+        }
+        
+        CCNetworking.shared().delegate = self
+        CCNetworking.shared().uploadFile(metadataForUpload, taskStatus: Int(k_taskStatusResume))
+    }
+    
+    func reUpload(_ metadata: tableMetadata) {
+        
+        metadata.status = Int(k_metadataStatusWaitUpload)
+        let metadataForUpload = NCManageDatabase.sharedInstance.addMetadata(metadata)
+        
+        CCNetworking.shared().delegate = self
+        CCNetworking.shared().uploadFile(metadataForUpload, taskStatus: Int(k_taskStatusResume))
+    }
+}

+ 36 - 24
PickerFileProvider/FileProviderExtension+Thumbnail.swift → File Provider Extension/FileProviderExtension+Thumbnail.swift

@@ -5,16 +5,28 @@
 //  Created by Marino Faggiana on 28/05/18.
 //  Copyright © 2018 TWS. All rights reserved.
 //
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
 
 import FileProvider
 
 extension FileProviderExtension {
 
     override func fetchThumbnails(for itemIdentifiers: [NSFileProviderItemIdentifier], requestedSize size: CGSize, perThumbnailCompletionHandler: @escaping (NSFileProviderItemIdentifier, Data?, Error?) -> Void, completionHandler: @escaping (Error?) -> Void) -> Progress {
-        
-        /* ONLY iOS 11*/
-        guard #available(iOS 11, *) else { return Progress(totalUnitCount:0) }
-        
+                
         let progress = Progress(totalUnitCount: Int64(itemIdentifiers.count))
         var counterProgress: Int64 = 0
         
@@ -31,31 +43,31 @@ extension FileProviderExtension {
                 
                 if (metadata!.typeFile == k_metadataTypeFile_image || metadata!.typeFile == k_metadataTypeFile_video) {
                     
-                    let serverUrl = NCManageDatabase.sharedInstance.getServerUrl(metadata!.directoryID)
-                    let fileName = CCUtility.returnFileNamePath(fromFileName: metadata!.fileName, serverUrl: serverUrl, activeUrl: providerData.accountUrl)
-                    let fileNameLocal = metadata!.fileID
+                    guard let serverUrl = NCManageDatabase.sharedInstance.getServerUrl(metadata!.directoryID) else {
+                        continue
+                    }
+                    
+                    
+                    let width = NCUtility.sharedInstance.getScreenWidthForPreview()
+                    let height = NCUtility.sharedInstance.getScreenHeightForPreview()
                     
                     let ocNetworking = OCnetworking.init(delegate: nil, metadataNet: nil, withUser: providerData.accountUser, withUserID: providerData.accountUserID, withPassword: providerData.accountPassword, withUrl: providerData.accountUrl)
-                    ocNetworking?.downloadThumbnail(withDimOfThumbnail: "m", fileName: fileName, fileNameLocal: fileNameLocal, success: {
+                    
+                    ocNetworking?.downloadPreview(with: metadata!, serverUrl: serverUrl, withWidth: width, andHeight: height, completion: { (message, errorCode) in
                         
-                        do {
-                            let url = URL.init(fileURLWithPath: self.providerData.directoryUser+"/"+metadata!.fileID+".ico")
-                            let data = try Data.init(contentsOf: url)
-                            perThumbnailCompletionHandler(itemIdentifier, data, nil)
-                        } catch let error {
-                            print("error: \(error)")
-                            perThumbnailCompletionHandler(itemIdentifier, nil, NSFileProviderError(.noSuchItem))
+                        if errorCode == 0 {
+                            do {
+                                let url = URL.init(fileURLWithPath: CCUtility.getDirectoryProviderStorageIconFileID(metadata!.fileID, fileNameView: metadata!.fileNameView))
+                                let data = try Data.init(contentsOf: url)
+                                perThumbnailCompletionHandler(itemIdentifier, data, nil)
+                            } catch let error {
+                                print("error: \(error)")
+                                perThumbnailCompletionHandler(itemIdentifier, nil, NSFileProviderError(.noSuchItem))
+                            }
+                        } else {
+                            perThumbnailCompletionHandler(itemIdentifier, nil, NSFileProviderError(.serverUnreachable))
                         }
                         
-                        counterProgress += 1
-                        if (counterProgress == progress.totalUnitCount) {
-                            completionHandler(nil)
-                        }
-                        
-                    }, failure: { (errorMessage, errorCode) in
-                        
-                        perThumbnailCompletionHandler(itemIdentifier, nil, NSFileProviderError(.serverUnreachable))
-                        
                         counterProgress += 1
                         if (counterProgress == progress.totalUnitCount) {
                             completionHandler(nil)

+ 0 - 0
PickerFileProvider/PickerFileProvider-Bridging-Header.h → File Provider Extension/FileProviderExtension-Bridging-Header.h


+ 331 - 0
File Provider Extension/FileProviderExtension.swift

@@ -0,0 +1,331 @@
+//
+//  FileProviderExtension.swift
+//  Files
+//
+//  Created by Marino Faggiana on 26/03/18.
+//  Copyright © 2018 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+import FileProvider
+
+/* -----------------------------------------------------------------------------------------------------------------------------------------------
+                                                            STRUCT item
+   -----------------------------------------------------------------------------------------------------------------------------------------------
+ 
+ 
+    itemIdentifier = NSFileProviderItemIdentifier.rootContainer.rawValue            --> root
+    parentItemIdentifier = NSFileProviderItemIdentifier.rootContainer.rawValue      --> root
+ 
+                                    ↓
+ 
+    itemIdentifier = metadata.fileID (ex. 00ABC1)                                   --> func getItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier
+    parentItemIdentifier = NSFileProviderItemIdentifier.rootContainer.rawValue      --> func getParentItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier?
+ 
+                                    ↓
+
+    itemIdentifier = metadata.fileID (ex. 00CCC)                                    --> func getItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier
+    parentItemIdentifier = parent itemIdentifier (00ABC1)                           --> func getParentItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier?
+ 
+                                    ↓
+ 
+    itemIdentifier = metadata.fileID (ex. 000DD)                                    --> func getItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier
+    parentItemIdentifier = parent itemIdentifier (00CCC)                            --> func getParentItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier?
+ 
+   -------------------------------------------------------------------------------------------------------------------------------------------- */
+
+class FileProviderExtension: NSFileProviderExtension, CCNetworkingDelegate {
+    
+    var providerData = FileProviderData()
+
+    var outstandingDownloadTasks = [URL: URLSessionTask]()
+    
+    lazy var fileCoordinator: NSFileCoordinator = {
+        
+        let fileCoordinator = NSFileCoordinator()
+        fileCoordinator.purposeIdentifier = NSFileProviderManager.default.providerIdentifier
+        return fileCoordinator
+    }()
+    
+    override init() {
+        
+        super.init()
+        
+        // Create directory File Provider Storage
+        CCUtility.getDirectoryProviderStorage()
+        
+        // Setup account
+        _ = providerData.setupActiveAccount()
+        
+        // Upload Imnport Document
+        self.uploadFileImportDocument()
+    }
+    
+    // MARK: - Enumeration
+    
+    override func enumerator(for containerItemIdentifier: NSFileProviderItemIdentifier) throws -> NSFileProviderEnumerator {
+        
+        var maybeEnumerator: NSFileProviderEnumerator? = nil
+        
+        // Check account
+        if (containerItemIdentifier != NSFileProviderItemIdentifier.workingSet) {
+            if providerData.setupActiveAccount() == false {
+                throw NSError(domain: NSFileProviderErrorDomain, code: NSFileProviderError.notAuthenticated.rawValue, userInfo:[:])
+            }
+        }
+
+        if (containerItemIdentifier == NSFileProviderItemIdentifier.rootContainer) {
+            maybeEnumerator = FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier, providerData: providerData)
+        } else if (containerItemIdentifier == NSFileProviderItemIdentifier.workingSet) {
+            maybeEnumerator = FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier, providerData: providerData)
+        } else {
+            // determine if the item is a directory or a file
+            // - for a directory, instantiate an enumerator of its subitems
+            // - for a file, instantiate an enumerator that observes changes to the file
+            let item = try self.item(for: containerItemIdentifier)
+            
+            if item.typeIdentifier == kUTTypeFolder as String {
+                maybeEnumerator = FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier, providerData: providerData)
+            } else {
+                maybeEnumerator = FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier, providerData: providerData)
+            }
+        }
+        
+        guard let enumerator = maybeEnumerator else {
+            throw NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:])
+        }
+       
+        return enumerator
+    }
+    
+    // MARK: - Item
+
+    override func item(for identifier: NSFileProviderItemIdentifier) throws -> NSFileProviderItem {
+        
+        if identifier == .rootContainer {
+            
+            if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", providerData.account, providerData.homeServerUrl)) {
+                    
+                let metadata = tableMetadata()
+                    
+                metadata.account = providerData.account
+                metadata.directory = true
+                metadata.directoryID = directory.directoryID
+                metadata.fileID = NSFileProviderItemIdentifier.rootContainer.rawValue
+                metadata.fileName = ""
+                metadata.fileNameView = ""
+                metadata.typeFile = k_metadataTypeFile_directory
+                    
+                return FileProviderItem(metadata: metadata, parentItemIdentifier: NSFileProviderItemIdentifier(NSFileProviderItemIdentifier.rootContainer.rawValue), providerData: providerData)
+            }
+            
+        } else {
+            
+            guard let metadata = providerData.getTableMetadataFromItemIdentifier(identifier) else {
+                throw NSFileProviderError(.noSuchItem)
+            }
+            
+            guard let parentItemIdentifier = providerData.getParentItemIdentifier(metadata: metadata) else {
+                throw NSFileProviderError(.noSuchItem)
+            }
+            
+            let item = FileProviderItem(metadata: metadata, parentItemIdentifier: parentItemIdentifier, providerData: providerData)
+            return item
+        }
+        
+        throw NSFileProviderError(.noSuchItem)
+    }
+    
+    override func urlForItem(withPersistentIdentifier identifier: NSFileProviderItemIdentifier) -> URL? {
+        
+        // resolve the given identifier to a file on disk
+        guard let item = try? item(for: identifier) else {
+            return nil
+        }
+            
+        // in this implementation, all paths are structured as <base storage directory>/<item identifier>/<item file name>
+            
+        let manager = NSFileProviderManager.default
+        var url = manager.documentStorageURL.appendingPathComponent(identifier.rawValue, isDirectory: true)
+            
+        if item.typeIdentifier == (kUTTypeFolder as String) {
+            url = url.appendingPathComponent(item.filename, isDirectory:true)
+        } else {
+            url = url.appendingPathComponent(item.filename, isDirectory:false)
+        }
+            
+        return url
+    }
+    
+    override func persistentIdentifierForItem(at url: URL) -> NSFileProviderItemIdentifier? {
+        
+        // resolve the given URL to a persistent identifier using a database
+        let pathComponents = url.pathComponents
+        
+        // exploit the fact that the path structure has been defined as
+        // <base storage directory>/<item identifier>/<item file name> above
+        assert(pathComponents.count > 2)
+        
+        let itemIdentifier = NSFileProviderItemIdentifier(pathComponents[pathComponents.count - 2])
+        return itemIdentifier
+    }
+    
+    // MARK: -
+    
+    override func providePlaceholder(at url: URL, completionHandler: @escaping (Error?) -> Void) {
+
+        guard let identifier = persistentIdentifierForItem(at: url) else {
+            completionHandler(NSFileProviderError(.noSuchItem))
+            return
+        }
+
+        do {
+            let fileProviderItem = try item(for: identifier)
+            let placeholderURL = NSFileProviderManager.placeholderURL(for: url)
+            try NSFileProviderManager.writePlaceholder(at: placeholderURL,withMetadata: fileProviderItem)
+            completionHandler(nil)
+        } catch let error {
+            print("error: \(error)")
+            completionHandler(error)
+        }
+    }
+
+    override func startProvidingItem(at url: URL, completionHandler: @escaping ((_ error: Error?) -> Void)) {
+        
+        let pathComponents = url.pathComponents
+        let identifier = NSFileProviderItemIdentifier(pathComponents[pathComponents.count - 2])
+            
+        // Check account
+        if providerData.setupActiveAccount() == false {
+            completionHandler(NSFileProviderError(.notAuthenticated))
+            return
+        }
+            
+        guard let metadata = providerData.getTableMetadataFromItemIdentifier(identifier) else {
+            completionHandler(NSFileProviderError(.noSuchItem))
+            return
+        }
+            
+        // Error ? reUpload when touch
+        if metadata.status == k_metadataStatusUploadError && metadata.session == k_upload_session_extension {
+            
+            if metadata.session == k_upload_session_extension {
+                self.reUpload(metadata)
+            }
+                
+            completionHandler(nil)
+            return
+        }
+            
+        // is Upload [Office 365 !!!]
+        if metadata.fileID.contains(metadata.directoryID + metadata.fileName) {
+            completionHandler(nil)
+            return
+        }
+            
+        let tableLocalFile = NCManageDatabase.sharedInstance.getTableLocalFile(predicate: NSPredicate(format: "fileID == %@", metadata.fileID))
+        if tableLocalFile != nil && CCUtility.fileProviderStorageExists(metadata.fileID, fileNameView: metadata.fileNameView) {
+            completionHandler(nil)
+            return
+        }
+            
+        guard let serverUrl = NCManageDatabase.sharedInstance.getServerUrl(metadata.directoryID) else {
+            completionHandler(NSFileProviderError(.noSuchItem))
+            return
+        }
+                        
+        let ocNetworking = OCnetworking.init(delegate: nil, metadataNet: nil, withUser: providerData.accountUser, withUserID: providerData.accountUserID, withPassword: providerData.accountPassword, withUrl: providerData.accountUrl)
+        let task = ocNetworking?.downloadFileNameServerUrl(serverUrl + "/" + metadata.fileName, fileNameLocalPath: url.path, communication: CCNetworking.shared().sharedOCCommunicationExtensionDownload(), success: { (lenght, etag, date) in
+                
+            // remove Task
+            self.outstandingDownloadTasks.removeValue(forKey: url)
+            
+            // update DB Local
+            metadata.date = date! as NSDate
+            metadata.etag = etag!
+            NCManageDatabase.sharedInstance.addLocalFile(metadata: metadata)
+            NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, date: date! as NSDate, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: nil, etag: etag)
+            
+            // Update DB Metadata
+            _ = NCManageDatabase.sharedInstance.addMetadata(metadata)
+
+            completionHandler(nil)
+            return
+                    
+        }, failure: { (errorMessage, errorCode) in
+                
+            // remove task
+            self.outstandingDownloadTasks.removeValue(forKey: url)
+            
+            if errorCode == Int(CFNetworkErrors.cfurlErrorCancelled.rawValue) {
+                completionHandler(NSFileProviderError(.noSuchItem))
+            } else {
+                completionHandler(NSFileProviderError(.serverUnreachable))
+            }
+            return
+        })
+            
+        // Add and register task
+        if task != nil {
+            outstandingDownloadTasks[url] = task
+            NSFileProviderManager.default.register(task!, forItemWithIdentifier: NSFileProviderItemIdentifier(identifier.rawValue)) { (error) in }
+        }
+    }
+    
+    override func itemChanged(at url: URL) {
+        
+        let pathComponents = url.pathComponents
+
+        assert(pathComponents.count > 2)
+
+        let itemIdentifier = NSFileProviderItemIdentifier(pathComponents[pathComponents.count - 2])
+        let fileName = pathComponents[pathComponents.count - 1]
+        
+        uploadFileItemChanged(for: itemIdentifier, fileName: fileName, url: url)
+    }
+    
+    override func stopProvidingItem(at url: URL) {
+        // Called after the last claim to the file has been released. At this point, it is safe for the file provider to remove the content file.
+        // Care should be taken that the corresponding placeholder file stays behind after the content file has been deleted.
+        
+        // Called after the last claim to the file has been released. At this point, it is safe for the file provider to remove the content file.
+        
+        // look up whether the file has local changes
+        let fileHasLocalChanges = false
+        
+        if !fileHasLocalChanges {
+            // remove the existing file to free up space
+            do {
+                _ = try providerData.fileManager.removeItem(at: url)
+            } catch let error {
+                print("error: \(error)")
+            }
+            
+            // write out a placeholder to facilitate future property lookups
+            self.providePlaceholder(at: url, completionHandler: { error in
+                // handle any error, do any necessary cleanup
+            })
+        }
+        
+        // Download task
+        if let downloadTask = outstandingDownloadTasks[url] {
+            downloadTask.cancel()
+            outstandingDownloadTasks.removeValue(forKey: url)
+        }
+    }
+
+}

+ 8 - 10
PickerFileProvider/FileProviderItem.swift → File Provider Extension/FileProviderItem.swift

@@ -91,7 +91,7 @@ class FileProviderItem: NSObject, NSFileProviderItem {
         // This is a file
         if (!metadata.directory) {
             
-            let fileIdentifier = providerData.fileProviderStorageURL!.path + "/" + self.itemIdentifier.rawValue + "/" + metadata.fileNameView
+            let fileIdentifier =  CCUtility.getDirectoryProviderStorageFileID(self.itemIdentifier.rawValue, fileNameView: metadata.fileNameView)!
             var fileSize = 0 as Double
          
             do {
@@ -112,7 +112,7 @@ class FileProviderItem: NSObject, NSFileProviderItem {
             }
             
             // Upload
-            if metadata.sessionSelectorPost == providerData.selectorPostImportDocument || metadata.sessionSelectorPost == providerData.selectorPostItemChanged {
+            if (metadata.session == k_upload_session_extension && metadata.status != k_metadataStatusUploadError) {
                 isUpload = true
                 self.isDownloaded = true
                 self.isMostRecentVersionDownloaded = true
@@ -128,18 +128,16 @@ class FileProviderItem: NSObject, NSFileProviderItem {
         } else {
             
             // Favorite directory
-            if #available(iOSApplicationExtension 11.0, *) {
-                let rank = providerData.listFavoriteIdentifierRank[metadata.fileID]
-                if (rank == nil) {
-                    favoriteRank = nil
-                } else {
-                    favoriteRank = providerData.listFavoriteIdentifierRank[metadata.fileID]
-                }
+            let rank = providerData.listFavoriteIdentifierRank[metadata.fileID]
+            if (rank == nil) {
+                favoriteRank = nil
+            } else {
+                favoriteRank = providerData.listFavoriteIdentifierRank[metadata.fileID]
             }
         }
         
         // Tag
-        if let tableTag = NCManageDatabase.sharedInstance.getTag(predicate: NSPredicate(format: "account = %@ AND fileID = %@", metadata.account, metadata.fileID)) {
+        if let tableTag = NCManageDatabase.sharedInstance.getTag(predicate: NSPredicate(format: "fileID == %@", metadata.fileID)) {
             tagData = tableTag.tagIOS
         }
     }

+ 674 - 0
LICENSE.txt

@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    {one line to give the program's name and a brief idea of what it does.}
+    Copyright (C) {year}  {name of author}
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    {project}  Copyright (C) {year}  {fullname}
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.

+ 0 - 52
Libraries external/Analytics/Firebase.h

@@ -1,52 +0,0 @@
-#import <FirebaseAnalytics/FirebaseAnalytics.h>
-#import <FirebaseCore/FirebaseCore.h>
-
-#if !defined(__has_include)
-  #error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \
-          import the headers individually."
-#else
-  #if __has_include(<FirebaseAppIndexing/FirebaseAppIndexing.h>)
-    #import <FirebaseAppIndexing/FirebaseAppIndexing.h>
-  #endif
-
-  #if __has_include(<FirebaseAuth/FirebaseAuth.h>)
-    #import <FirebaseAuth/FirebaseAuth.h>
-  #endif
-
-  #if __has_include(<FirebaseCrash/FirebaseCrash.h>)
-    #import <FirebaseCrash/FirebaseCrash.h>
-  #endif
-
-  #if __has_include(<FirebaseDatabase/FirebaseDatabase.h>)
-    #import <FirebaseDatabase/FirebaseDatabase.h>
-  #endif
-
-  #if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>)
-    #import <FirebaseDynamicLinks/FirebaseDynamicLinks.h>
-  #endif
-
-  #if __has_include(<FirebaseInstanceID/FirebaseInstanceID.h>)
-    #import <FirebaseInstanceID/FirebaseInstanceID.h>
-  #endif
-
-  #if __has_include(<FirebaseInvites/FirebaseInvites.h>)
-    #import <FirebaseInvites/FirebaseInvites.h>
-  #endif
-
-  #if __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
-    #import <FirebaseMessaging/FirebaseMessaging.h>
-  #endif
-
-  #if __has_include(<FirebaseRemoteConfig/FirebaseRemoteConfig.h>)
-    #import <FirebaseRemoteConfig/FirebaseRemoteConfig.h>
-  #endif
-
-  #if __has_include(<FirebaseStorage/FirebaseStorage.h>)
-    #import <FirebaseStorage/FirebaseStorage.h>
-  #endif
-
-  #if __has_include(<GoogleMobileAds/GoogleMobileAds.h>)
-    #import <GoogleMobileAds/GoogleMobileAds.h>
-  #endif
-
-#endif  // defined(__has_include)

+ 0 - 1
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h

@@ -1 +0,0 @@
-#import <FirebaseCore/FIRAnalyticsConfiguration.h>

+ 0 - 1
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRApp.h

@@ -1 +0,0 @@
-#import <FirebaseCore/FIRApp.h>

+ 0 - 1
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRConfiguration.h

@@ -1 +0,0 @@
-#import <FirebaseCore/FIRConfiguration.h>

+ 0 - 1
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIROptions.h

@@ -1 +0,0 @@
-#import <FirebaseCore/FIROptions.h>

二进制
Libraries external/Analytics/FirebaseCore.framework/FirebaseCore


+ 0 - 12
Libraries external/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h

@@ -1,12 +0,0 @@
-/**
- * The log levels used by internal logging.
- */
-typedef NS_ENUM(NSInteger, FIRLoggerLevel) {
-  FIRLoggerLevelError = 3 /*ASL_LEVEL_ERR*/,
-  FIRLoggerLevelWarning = 4 /*ASL_LEVEL_WARNING*/,
-  FIRLoggerLevelNotice = 5 /*ASL_LEVEL_NOTICE*/,
-  FIRLoggerLevelInfo = 6 /*ASL_LEVEL_INFO*/,
-  FIRLoggerLevelDebug = 7 /*ASL_LEVEL_DEBUG*/,
-  FIRLoggerLevelMin = FIRLoggerLevelError,
-  FIRLoggerLevelMax = FIRLoggerLevelDebug
-};

+ 0 - 93
Libraries external/Analytics/FirebaseCore.framework/Headers/FIROptions.h

@@ -1,93 +0,0 @@
-#import <Foundation/Foundation.h>
-
-/**
- * This class provides constant fields of Google APIs.
- */
-@interface FIROptions : NSObject<NSCopying>
-
-/**
- * Returns the default options.
- */
-+ (FIROptions *)defaultOptions;
-
-/**
- * An iOS API key used for authenticating requests from your app, e.g.
- * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers.
- */
-@property(nonatomic, readonly, copy) NSString *APIKey;
-
-/**
- * The OAuth2 client ID for iOS application used to authenticate Google users, for example
- * @"12345.apps.googleusercontent.com", used for signing in with Google.
- */
-@property(nonatomic, readonly, copy) NSString *clientID;
-
-/**
- * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics.
- */
-@property(nonatomic, readonly, copy) NSString *trackingID;
-
-/**
- * The Project Number from the Google Developer's console, for example @"012345678901", used to
- * configure Google Cloud Messaging.
- */
-@property(nonatomic, readonly, copy) NSString *GCMSenderID;
-
-/**
- * The Project ID from the Firebase console, for example @"abc-xyz-123". Currently only populated
- * when using [FIROptions defaultOptions].
- */
-@property(nonatomic, readonly, copy) NSString *projectID;
-
-/**
- * The Android client ID used in Google AppInvite when an iOS app has its Android version, for
- * example @"12345.apps.googleusercontent.com".
- */
-@property(nonatomic, readonly, copy) NSString *androidClientID;
-
-/**
- * The Google App ID that is used to uniquely identify an instance of an app.
- */
-@property(nonatomic, readonly, copy) NSString *googleAppID;
-
-/**
- * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com".
- */
-@property(nonatomic, readonly, copy) NSString *databaseURL;
-
-/**
- * The URL scheme used to set up Durable Deep Link service.
- */
-@property(nonatomic, readwrite, copy) NSString *deepLinkURLScheme;
-
-/**
- * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com".
- */
-@property(nonatomic, readonly, copy) NSString *storageBucket;
-
-/**
- * Initializes a customized instance of FIROptions with keys. googleAppID, bundleID and GCMSenderID
- * are required. Other keys may required for configuring specific services.
- */
-- (instancetype)initWithGoogleAppID:(NSString *)googleAppID
-                           bundleID:(NSString *)bundleID
-                        GCMSenderID:(NSString *)GCMSenderID
-                             APIKey:(NSString *)APIKey
-                           clientID:(NSString *)clientID
-                         trackingID:(NSString *)trackingID
-                    androidClientID:(NSString *)androidClientID
-                        databaseURL:(NSString *)databaseURL
-                      storageBucket:(NSString *)storageBucket
-                  deepLinkURLScheme:(NSString *)deepLinkURLScheme;
-
-/**
- * Initializes a customized instance of FIROptions from the file at the given plist file path.
- * For example,
- * NSString *filePath =
- *     [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
- * FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
- * Returns nil if the plist file does not exist or is invalid.
- */
-- (instancetype)initWithContentsOfFile:(NSString *)plistPath;
-
-@end

+ 0 - 5
Libraries external/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h

@@ -1,5 +0,0 @@
-#import "FIRAnalyticsConfiguration.h"
-#import "FIRApp.h"
-#import "FIRConfiguration.h"
-#import "FIRLoggerLevel.h"
-#import "FIROptions.h"

二进制
Libraries external/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID


二进制
Libraries external/Analytics/FirebaseMessaging.framework/FirebaseMessaging


+ 0 - 228
Libraries external/Analytics/FirebaseMessaging.framework/Headers/FIRMessaging.h

@@ -1,228 +0,0 @@
-#import <Foundation/Foundation.h>
-
-/**
- *  The completion handler invoked once the data connection with FIRMessaging is
- *  established.  The data connection is used to send a continous stream of
- *  data and all the FIRMessaging data notifications arrive through this connection.
- *  Once the connection is established we invoke the callback with `nil` error.
- *  Correspondingly if we get an error while trying to establish a connection
- *  we invoke the handler with an appropriate error object and do an
- *  exponential backoff to try and connect again unless successful.
- *
- *  @param error The error object if any describing why the data connection
- *               to FIRMessaging failed.
- */
-typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error);
-
-/**
- *  Notification sent when the upstream message has been delivered
- *  successfully to the server. The notification object will be the messageID
- *  of the successfully delivered message.
- */
-FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification;
-
-/**
- *  Notification sent when the upstream message was failed to be sent to the
- *  server.  The notification object will be the messageID of the failed
- *  message. The userInfo dictionary will contain the relevant error
- *  information for the failure.
- */
-FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification;
-
-/**
- *  Notification sent when the Firebase messaging server deletes pending
- *  messages due to exceeded storage limits. This may occur, for example, when
- *  the device cannot be reached for an extended period of time.
- *
- *  It is recommended to retrieve any missing messages directly from the
- *  server.
- */
-FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotification;
-
-/**
- *  @enum FIRMessagingError
- */
-typedef NS_ENUM(NSUInteger, FIRMessagingError) {
-  /// Unknown error.
-  FIRMessagingErrorUnknown = 0,
-
-  /// FIRMessaging couldn't validate request from this client.
-  FIRMessagingErrorAuthentication = 1,
-
-  /// InstanceID service cannot be accessed.
-  FIRMessagingErrorNoAccess = 2,
-
-  /// Request to InstanceID backend timed out.
-  FIRMessagingErrorTimeout = 3,
-
-  /// No network available to reach the servers.
-  FIRMessagingErrorNetwork = 4,
-
-  /// Another similar operation in progress, bailing this one.
-  FIRMessagingErrorOperationInProgress = 5,
-
-  /// Some parameters of the request were invalid.
-  FIRMessagingErrorInvalidRequest = 7,
-};
-
-/// Status for the downstream message received by the app.
-typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) {
-  /// Unknown status.
-  FIRMessagingMessageStatusUnknown,
-  /// New downstream message received by the app.
-  FIRMessagingMessageStatusNew,
-};
-
-/// Information about a downstream message received by the app.
-@interface FIRMessagingMessageInfo : NSObject
-
-/// The status of the downstream message
-@property(nonatomic, readonly, assign) FIRMessagingMessageStatus status;
-
-@end
-
-/**
- * A remote data message received by the app via FCM (not just the APNs interface).
- *
- * This is only for devices running iOS 10 or above. To support devices running iOS 9 or below, use
- * the local and remote notifications handlers defined in UIApplicationDelegate protocol.
- */
-@interface FIRMessagingRemoteMessage : NSObject
-
-/// The downstream message received by the application.
-@property(nonatomic, readonly, strong, nonnull) NSDictionary *appData;
-
-@end
-
-/**
- * A protocol to receive data message via FCM for devices running iOS 10 or above.
- *
- * To support devices running iOS 9 or below, use the local and remote notifications handlers
- * defined in UIApplicationDelegate protocol.
- */
-__IOS_AVAILABLE(10.0)
-@protocol FIRMessagingDelegate <NSObject>
-
-/// The callback to handle data message received via FCM for devices running iOS 10 or above.
-- (void)applicationReceivedRemoteMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage;
-
-@end
-
-/**
- *  Firebase Messaging lets you reliably deliver messages at no cost.
- *
- *  To send or receive messages, the app must get a
- *  registration token from FIRInstanceID. This token authorizes an
- *  app server to send messages to an app instance.
- *
- *  In order to receive FIRMessaging messages, declare `application:didReceiveRemoteNotification:`.
- *
- *
- */
-@interface FIRMessaging : NSObject
-
-/**
- * Delegate to handle remote data messages received via FCM for devices running iOS 10 or above.
- */
-@property(nonatomic, weak, nullable) id<FIRMessagingDelegate> remoteMessageDelegate;
-
-/**
- *  FIRMessaging
- *
- *  @return An instance of FIRMessaging.
- */
-+ (nonnull instancetype)messaging NS_SWIFT_NAME(messaging());
-
-/**
- *  Unavailable. Use +messaging instead.
- */
-- (nonnull instancetype)init __attribute__((unavailable("Use +messaging instead.")));
-
-#pragma mark - Connect
-
-/**
- *  Create a FIRMessaging data connection which will be used to send the data notifications
- *  sent by your server. It will also be used to send ACKS and other messages based
- *  on the FIRMessaging ACKS and other messages based  on the FIRMessaging protocol.
- *
- *
- *  @param handler  The handler to be invoked once the connection is established.
- *                  If the connection fails we invoke the handler with an
- *                  appropriate error code letting you know why it failed. At
- *                  the same time, FIRMessaging performs exponential backoff to retry
- *                  establishing a connection and invoke the handler when successful.
- */
-- (void)connectWithCompletion:(nonnull FIRMessagingConnectCompletion)handler;
-
-/**
- *  Disconnect the current FIRMessaging data connection. This stops any attempts to
- *  connect to FIRMessaging. Calling this on an already disconnected client is a no-op.
- *
- *  Call this before `teardown` when your app is going to the background.
- *  Since the FIRMessaging connection won't be allowed to live when in background it is
- *  prudent to close the connection.
- */
-- (void)disconnect;
-
-#pragma mark - Topics
-
-/**
- *  Asynchronously subscribes to a topic.
- *
- *  @param topic The name of the topic, for example, @"sports".
- */
-- (void)subscribeToTopic:(nonnull NSString *)topic;
-
-/**
- *  Asynchronously unsubscribe from a topic.
- *
- *  @param topic The name of the topic, for example @"sports".
- */
-- (void)unsubscribeFromTopic:(nonnull NSString *)topic;
-
-#pragma mark - Upstream
-
-/**
- *  Sends an upstream ("device to cloud") message.
- *
- *  The message is queued if we don't have an active connection.
- *  You can only use the upstream feature if your FCM implementation
- *  uses the XMPP server protocol.
- *
- *  @param message      Key/Value pairs to be sent. Values must be String, any
- *                      other type will be ignored.
- *  @param to           A string identifying the receiver of the message. For FCM
- *                      project IDs the value is `SENDER_ID@gcm.googleapis.com`.
- *  @param messageID    The ID of the message. This is generated by the application. It
- *                      must be unique for each message generated by this application.
- *                      It allows error callbacks and debugging, to uniquely identify
- *                      each message.
- *  @param ttl          The time to live for the message. In case we aren't able to
- *                      send the message before the TTL expires we will send you a
- *                      callback. If 0, we'll attempt to send immediately and return
- *                      an error if we're not connected.  Otherwise, the message will
- *                      be queued.  As for server-side messages, we don't return an error
- *                      if the message has been dropped because of TTL; this can happen
- *                      on the server side, and it would require extra communication.
- */
-- (void)sendMessage:(nonnull NSDictionary *)message
-                 to:(nonnull NSString *)receiver
-      withMessageID:(nonnull NSString *)messageID
-         timeToLive:(int64_t)ttl;
-
-#pragma mark - Analytics
-
-/**
- *  Use this to track message delivery and analytics for messages, typically
- *  when you receive a notification in `application:didReceiveRemoteNotification:`.
- *  However, you only need to call this if you set the `FirebaseAppDelegateProxyEnabled`
- *  flag to NO in your Info.plist. If `FirebaseAppDelegateProxyEnabled` is either missing
- *  or set to YES in your Info.plist, the library will call this automatically.
- *
- *  @param message The downstream message received by the application.
- *
- *  @return Information about the downstream message.
- */
-- (nonnull FIRMessagingMessageInfo *)appDidReceiveMessage:(nonnull NSDictionary *)message;
-
-@end

+ 0 - 1
Libraries external/Analytics/FirebaseMessaging.framework/Headers/FirebaseMessaging.h

@@ -1 +0,0 @@
-#import "FIRMessaging.h"

二进制
Libraries external/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac


二进制
Libraries external/Analytics/Protobuf.framework/Protobuf


二进制
Libraries external/Fabric/Crashlytics.framework/Crashlytics


二进制
Libraries external/Fabric/Crashlytics.framework/Info.plist


二进制
Libraries external/Fabric/Crashlytics.framework/submit


二进制
Libraries external/Fabric/Crashlytics.framework/uploadDSYM


二进制
Libraries external/Fabric/Fabric.framework/Fabric


二进制
Libraries external/Fabric/Fabric.framework/Info.plist


二进制
Libraries external/Fabric/Fabric.framework/uploadDSYM


二进制
Libraries external/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics → Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics


+ 6 - 1
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h → Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h

@@ -2,6 +2,8 @@
 
 #import "FIRAnalytics.h"
 
+NS_ASSUME_NONNULL_BEGIN
+
 /**
  * Provides App Delegate handlers to be used in your App Delegate.
  *
@@ -29,7 +31,7 @@
  *     updated and a new snapshot can be taken.
  */
 + (void)handleEventsForBackgroundURLSession:(NSString *)identifier
-                          completionHandler:(void (^)(void))completionHandler;
+                          completionHandler:(nullable void (^)(void))completionHandler;
 
 /**
  * Handles the event when the app is launched by a URL.
@@ -55,3 +57,6 @@
 + (void)handleUserActivity:(id)userActivity;
 
 @end
+
+NS_ASSUME_NONNULL_END
+

+ 28 - 11
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h → Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h

@@ -9,6 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
 /// The top level Firebase Analytics singleton that provides methods for logging events and setting
 /// user properties. See <a href="http://goo.gl/gz8SLz">the developer guides</a> for general
 /// information on using Firebase Analytics in your apps.
+NS_SWIFT_NAME(Analytics)
 @interface FIRAnalytics : NSObject
 
 /// Logs an app event. The event can have up to 25 parameters. Events with the same name must have
@@ -17,6 +18,12 @@ NS_ASSUME_NONNULL_BEGIN
 ///
 /// The following event names are reserved and cannot be used:
 /// <ul>
+///     <li>ad_activeview</li>
+///     <li>ad_click</li>
+///     <li>ad_exposure</li>
+///     <li>ad_impression</li>
+///     <li>ad_query</li>
+///     <li>adunit_exposure</li>
 ///     <li>app_clear_data</li>
 ///     <li>app_remove</li>
 ///     <li>app_update</li>
@@ -28,23 +35,26 @@ NS_ASSUME_NONNULL_BEGIN
 ///     <li>notification_open</li>
 ///     <li>notification_receive</li>
 ///     <li>os_update</li>
+///     <li>screen_view</li>
 ///     <li>session_start</li>
 ///     <li>user_engagement</li>
 /// </ul>
 ///
 /// @param name The name of the event. Should contain 1 to 40 alphanumeric characters or
 ///     underscores. The name must start with an alphabetic character. Some event names are
-///     reserved. See FIREventNames.h for the list of reserved event names. The "firebase_" prefix
-///     is reserved and should not be used. Note that event names are case-sensitive and that
-///     logging two events whose names differ only in case will result in two distinct events.
+///     reserved. See FIREventNames.h for the list of reserved event names. The "firebase_",
+///     "google_", and "ga_" prefixes are reserved and should not be used. Note that event names are
+///     case-sensitive and that logging two events whose names differ only in case will result in
+///     two distinct events.
 /// @param parameters The dictionary of event parameters. Passing nil indicates that the event has
 ///     no parameters. Parameter names can be up to 40 characters long and must start with an
 ///     alphabetic character and contain only alphanumeric characters and underscores. Only NSString
 ///     and NSNumber (signed 64-bit integer and 64-bit floating-point number) parameter types are
-///     supported. NSString parameter values can be up to 100 characters long. The "firebase_"
-///     prefix is reserved and should not be used for parameter names.
+///     supported. NSString parameter values can be up to 100 characters long. The "firebase_",
+///     "google_", and "ga_" prefixes are reserved and should not be used for parameter names.
 + (void)logEventWithName:(NSString *)name
-              parameters:(nullable NSDictionary<NSString *, id> *)parameters;
+              parameters:(nullable NSDictionary<NSString *, id> *)parameters
+    NS_SWIFT_NAME(logEvent(_:parameters:));
 
 /// Sets a user property to a given value. Up to 25 user property names are supported. Once set,
 /// user property values persist throughout the app lifecycle and across sessions.
@@ -59,26 +69,29 @@ NS_ASSUME_NONNULL_BEGIN
 /// @param value The value of the user property. Values can be up to 36 characters long. Setting the
 ///     value to nil removes the user property.
 /// @param name The name of the user property to set. Should contain 1 to 24 alphanumeric characters
-///     or underscores and must start with an alphabetic character. The "firebase_" prefix is
-///     reserved and should not be used for user property names.
-+ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name;
+///     or underscores and must start with an alphabetic character. The "firebase_", "google_", and
+///     "ga_" prefixes are reserved and should not be used for user property names.
++ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name
+    NS_SWIFT_NAME(setUserProperty(_:forName:));
 
 /// Sets the user ID property. This feature must be used in accordance with
 /// <a href="https://www.google.com/policies/privacy">Google's Privacy Policy</a>
 ///
 /// @param userID The user ID to ascribe to the user of this app on this device, which must be
-///     non-empty and no more than 36 characters long. Setting userID to nil removes the user ID.
+///     non-empty and no more than 256 characters long. Setting userID to nil removes the user ID.
 + (void)setUserID:(nullable NSString *)userID;
 
 /// Sets the current screen name, which specifies the current visual context in your app. This helps
 /// identify the areas in your app where users spend their time and how they interact with your app.
+/// Must be called on the main thread.
 ///
 /// Note that screen reporting is enabled automatically and records the class name of the current
 /// UIViewController for you without requiring you to call this method. If you implement
 /// viewDidAppear in your UIViewController but do not call [super viewDidAppear:], that screen class
 /// will not be automatically tracked. The class name can optionally be overridden by calling this
 /// method in the viewDidAppear callback of your UIViewController and specifying the
-/// screenClassOverride parameter.
+/// screenClassOverride parameter. setScreenName:screenClass: must be called after
+/// [super viewDidAppear:].
 ///
 /// If your app does not use a distinct UIViewController for each screen, you should call this
 /// method and specify a distinct screenName each time a new screen is presented to the user.
@@ -97,6 +110,10 @@ NS_ASSUME_NONNULL_BEGIN
 /// The unique ID for this instance of the application.
 + (NSString *)appInstanceID;
 
+/// Clears all analytics data for this instance from the device and resets the app instance ID.
+/// FIRAnalyticsConfiguration values will be reset to the default values.
++ (void)resetAnalyticsData;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 13 - 0
Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h

@@ -0,0 +1,13 @@
+#ifndef FIR_SWIFT_NAME
+
+#import <Foundation/Foundation.h>
+
+// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK.
+// Wrap it in our own macro if it's a non-compatible SDK.
+#ifdef __IPHONE_9_3
+#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X)
+#else
+#define FIR_SWIFT_NAME(X)  // Intentionally blank.
+#endif  // #ifdef __IPHONE_9_3
+
+#endif  // FIR_SWIFT_NAME

+ 72 - 35
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h → Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h

@@ -7,12 +7,15 @@
 /// Event type. Some common events are suggested below, but you may also choose to specify custom
 /// Event types that are associated with your specific app. Each event type is identified by a
 /// unique name. Event names can be up to 40 characters long, may only contain alphanumeric
-/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_"
-/// prefix is reserved and should not be used.
+/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_",
+/// "google_", and "ga_" prefixes are reserved and should not be used.
+
+#import <Foundation/Foundation.h>
 
 /// Add Payment Info event. This event signifies that a user has submitted their payment information
 /// to your app.
-static NSString *const kFIREventAddPaymentInfo = @"add_payment_info";
+static NSString *const kFIREventAddPaymentInfo NS_SWIFT_NAME(AnalyticsEventAddPaymentInfo) =
+    @"add_payment_info";
 
 /// E-Commerce Add To Cart event. This event signifies that an item was added to a cart for
 /// purchase. Add this event to a funnel with kFIREventEcommercePurchase to gauge the effectiveness
@@ -34,7 +37,7 @@ static NSString *const kFIREventAddPaymentInfo = @"add_payment_info";
 ///     <li>@c kFIRParameterStartDate (NSString) (optional)</li>
 ///     <li>@c kFIRParameterEndDate (NSString) (optional)</li>
 /// </ul>
-static NSString *const kFIREventAddToCart = @"add_to_cart";
+static NSString *const kFIREventAddToCart NS_SWIFT_NAME(AnalyticsEventAddToCart) = @"add_to_cart";
 
 /// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist.
 /// Use this event to identify popular gift items in your app. Note: If you supply the
@@ -51,13 +54,14 @@ static NSString *const kFIREventAddToCart = @"add_to_cart";
 ///     <li>@c kFIRParameterCurrency (NSString) (optional)</li>
 ///     <li>@c kFIRParameterValue (double as NSNumber) (optional)</li>
 /// </ul>
-static NSString *const kFIREventAddToWishlist = @"add_to_wishlist";
+static NSString *const kFIREventAddToWishlist NS_SWIFT_NAME(AnalyticsEventAddToWishlist) =
+    @"add_to_wishlist";
 
-/// App Open event. By logging this event when an App is moved to the foreground, developers can
-/// understand how often users leave and return during the course of a Session. Although Sessions
-/// are automatically reported, this event can provide further clarification around the continuous
-/// engagement of app-users.
-static NSString *const kFIREventAppOpen = @"app_open";
+/// App Open event. By logging this event when an App becomes active, developers can understand how
+/// often users leave and return during the course of a Session. Although Sessions are automatically
+/// reported, this event can provide further clarification around the continuous engagement of
+/// app-users.
+static NSString *const kFIREventAppOpen NS_SWIFT_NAME(AnalyticsEventAppOpen) = @"app_open";
 
 /// E-Commerce Begin Checkout event. This event signifies that a user has begun the process of
 /// checking out. Add this event to a funnel with your kFIREventEcommercePurchase event to gauge the
@@ -81,7 +85,8 @@ static NSString *const kFIREventAppOpen = @"app_open";
 ///     <li>@c kFIRParameterDestination (NSString) (optional)</li>
 ///     <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li>
 /// </ul>
-static NSString *const kFIREventBeginCheckout = @"begin_checkout";
+static NSString *const kFIREventBeginCheckout NS_SWIFT_NAME(AnalyticsEventBeginCheckout) =
+    @"begin_checkout";
 
 /// Campaign Detail event. Log this event to supply the referral details of a re-engagement
 /// campaign. Note: you must supply at least one of the required parameters kFIRParameterSource,
@@ -96,7 +101,8 @@ static NSString *const kFIREventBeginCheckout = @"begin_checkout";
 ///     <li>@c kFIRParameterAdNetworkClickID (NSString) (optional)</li>
 ///     <li>@c kFIRParameterCP1 (NSString) (optional)</li>
 /// </ul>
-static NSString *const kFIREventCampaignDetails = @"campaign_details";
+static NSString *const kFIREventCampaignDetails NS_SWIFT_NAME(AnalyticsEventCampaignDetails) =
+    @"campaign_details";
 
 /// Checkout progress. Params:
 ///
@@ -104,7 +110,8 @@ static NSString *const kFIREventCampaignDetails = @"campaign_details";
 ///    <li>@c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)</li>
 ///    <li>@c kFIRParameterCheckoutOption (NSString) (optional)</li>
 /// </ul>
-static NSString *const kFIREventCheckoutProgress = @"checkout_progress";
+static NSString *const kFIREventCheckoutProgress NS_SWIFT_NAME(AnalyticsEventCheckoutProgress) =
+    @"checkout_progress";
 
 /// Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Log
 /// this along with @c kFIREventSpendVirtualCurrency to better understand your virtual economy.
@@ -114,7 +121,8 @@ static NSString *const kFIREventCheckoutProgress = @"checkout_progress";
 ///     <li>@c kFIRParameterVirtualCurrencyName (NSString)</li>
 ///     <li>@c kFIRParameterValue (signed 64-bit integer or double as NSNumber)</li>
 /// </ul>
-static NSString *const kFIREventEarnVirtualCurrency = @"earn_virtual_currency";
+static NSString *const kFIREventEarnVirtualCurrency
+    NS_SWIFT_NAME(AnalyticsEventEarnVirtualCurrency) = @"earn_virtual_currency";
 
 /// E-Commerce Purchase event. This event signifies that an item was purchased by a user. Note:
 /// This is different from the in-app purchase event, which is reported automatically for App
@@ -142,7 +150,8 @@ static NSString *const kFIREventEarnVirtualCurrency = @"earn_virtual_currency";
 ///     <li>@c kFIRParameterDestination (NSString) (optional)</li>
 ///     <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li>
 /// </ul>
-static NSString *const kFIREventEcommercePurchase = @"ecommerce_purchase";
+static NSString *const kFIREventEcommercePurchase NS_SWIFT_NAME(AnalyticsEventEcommercePurchase) =
+    @"ecommerce_purchase";
 
 /// Generate Lead event. Log this event when a lead has been generated in the app to understand the
 /// efficacy of your install and re-engagement campaigns. Note: If you supply the
@@ -153,7 +162,8 @@ static NSString *const kFIREventEcommercePurchase = @"ecommerce_purchase";
 ///     <li>@c kFIRParameterCurrency (NSString) (optional)</li>
 ///     <li>@c kFIRParameterValue (double as NSNumber) (optional)</li>
 /// </ul>
-static NSString *const kFIREventGenerateLead = @"generate_lead";
+static NSString *const kFIREventGenerateLead NS_SWIFT_NAME(AnalyticsEventGenerateLead) =
+    @"generate_lead";
 
 /// Join Group event. Log this event when a user joins a group such as a guild, team or family. Use
 /// this event to analyze how popular certain groups or social features are in your app. Params:
@@ -161,7 +171,7 @@ static NSString *const kFIREventGenerateLead = @"generate_lead";
 /// <ul>
 ///     <li>@c kFIRParameterGroupID (NSString)</li>
 /// </ul>
-static NSString *const kFIREventJoinGroup = @"join_group";
+static NSString *const kFIREventJoinGroup NS_SWIFT_NAME(AnalyticsEventJoinGroup) = @"join_group";
 
 /// Level Up event. This event signifies that a player has leveled up in your gaming app. It can
 /// help you gauge the level distribution of your userbase and help you identify certain levels that
@@ -171,11 +181,11 @@ static NSString *const kFIREventJoinGroup = @"join_group";
 ///     <li>@c kFIRParameterLevel (signed 64-bit integer as NSNumber)</li>
 ///     <li>@c kFIRParameterCharacter (NSString) (optional)</li>
 /// </ul>
-static NSString *const kFIREventLevelUp = @"level_up";
+static NSString *const kFIREventLevelUp NS_SWIFT_NAME(AnalyticsEventLevelUp) = @"level_up";
 
 /// Login event. Apps with a login feature can report this event to signify that a user has logged
 /// in.
-static NSString *const kFIREventLogin = @"login";
+static NSString *const kFIREventLogin NS_SWIFT_NAME(AnalyticsEventLogin) = @"login";
 
 /// Post Score event. Log this event when the user posts a score in your gaming app. This event can
 /// help you understand how users are actually performing in your game and it can help you correlate
@@ -186,7 +196,7 @@ static NSString *const kFIREventLogin = @"login";
 ///     <li>@c kFIRParameterLevel (signed 64-bit integer as NSNumber) (optional)</li>
 ///     <li>@c kFIRParameterCharacter (NSString) (optional)</li>
 /// </ul>
-static NSString *const kFIREventPostScore = @"post_score";
+static NSString *const kFIREventPostScore NS_SWIFT_NAME(AnalyticsEventPostScore) = @"post_score";
 
 /// Present Offer event. This event signifies that the app has presented a purchase offer to a user.
 /// Add this event to a funnel with the kFIREventAddToCart and kFIREventEcommercePurchase to gauge
@@ -204,7 +214,8 @@ static NSString *const kFIREventPostScore = @"post_score";
 ///     <li>@c kFIRParameterCurrency (NSString) (optional)</li>
 ///     <li>@c kFIRParameterValue (double as NSNumber) (optional)</li>
 /// </ul>
-static NSString *const kFIREventPresentOffer = @"present_offer";
+static NSString *const kFIREventPresentOffer NS_SWIFT_NAME(AnalyticsEventPresentOffer) =
+    @"present_offer";
 
 /// E-Commerce Purchase Refund event. This event signifies that an item purchase was refunded.
 /// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the
@@ -216,7 +227,8 @@ static NSString *const kFIREventPresentOffer = @"present_offer";
 ///     <li>@c kFIRParameterValue (double as NSNumber) (optional)</li>
 ///     <li>@c kFIRParameterTransactionID (NSString) (optional)</li>
 /// </ul>
-static NSString *const kFIREventPurchaseRefund = @"purchase_refund";
+static NSString *const kFIREventPurchaseRefund NS_SWIFT_NAME(AnalyticsEventPurchaseRefund) =
+    @"purchase_refund";
 
 /// Remove from cart event. Params:
 ///
@@ -234,7 +246,8 @@ static NSString *const kFIREventPurchaseRefund = @"purchase_refund";
 ///     <li>@c kFIRParameterStartDate (NSString) (optional)</li>
 ///     <li>@c kFIRParameterEndDate (NSString) (optional)</li>
 /// </ul>
-static NSString *const kFIREventRemoveFromCart = @"remove_from_cart";
+static NSString *const kFIREventRemoveFromCart NS_SWIFT_NAME(AnalyticsEventRemoveFromCart) =
+    @"remove_from_cart";
 
 /// Search event. Apps that support search features can use this event to contextualize search
 /// operations by supplying the appropriate, corresponding parameters. This event can help you
@@ -254,7 +267,7 @@ static NSString *const kFIREventRemoveFromCart = @"remove_from_cart";
 ///     <li>@c kFIRParameterDestination (NSString) (optional)</li>
 ///     <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li>
 /// </ul>
-static NSString *const kFIREventSearch = @"search";
+static NSString *const kFIREventSearch NS_SWIFT_NAME(AnalyticsEventSearch) = @"search";
 
 /// Select Content event. This general purpose event signifies that a user has selected some content
 /// of a certain type in an app. The content can be any object in your app. This event can help you
@@ -264,7 +277,8 @@ static NSString *const kFIREventSearch = @"search";
 ///     <li>@c kFIRParameterContentType (NSString)</li>
 ///     <li>@c kFIRParameterItemID (NSString)</li>
 /// </ul>
-static NSString *const kFIREventSelectContent = @"select_content";
+static NSString *const kFIREventSelectContent NS_SWIFT_NAME(AnalyticsEventSelectContent) =
+    @"select_content";
 
 /// Set checkout option. Params:
 ///
@@ -272,7 +286,8 @@ static NSString *const kFIREventSelectContent = @"select_content";
 ///    <li>@c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)</li>
 ///    <li>@c kFIRParameterCheckoutOption (NSString)</li>
 /// </ul>
-static NSString *const kFIREventSetCheckoutOption = @"set_checkout_option";
+static NSString *const kFIREventSetCheckoutOption NS_SWIFT_NAME(AnalyticsEventSetCheckoutOption) =
+    @"set_checkout_option";
 
 /// Share event. Apps with social features can log the Share event to identify the most viral
 /// content. Params:
@@ -281,7 +296,7 @@ static NSString *const kFIREventSetCheckoutOption = @"set_checkout_option";
 ///     <li>@c kFIRParameterContentType (NSString)</li>
 ///     <li>@c kFIRParameterItemID (NSString)</li>
 /// </ul>
-static NSString *const kFIREventShare = @"share";
+static NSString *const kFIREventShare NS_SWIFT_NAME(AnalyticsEventShare) = @"share";
 
 /// Sign Up event. This event indicates that a user has signed up for an account in your app. The
 /// parameter signifies the method by which the user signed up. Use this event to understand the
@@ -290,7 +305,7 @@ static NSString *const kFIREventShare = @"share";
 /// <ul>
 ///     <li>@c kFIRParameterSignUpMethod (NSString)</li>
 /// </ul>
-static NSString *const kFIREventSignUp = @"sign_up";
+static NSString *const kFIREventSignUp NS_SWIFT_NAME(AnalyticsEventSignUp) = @"sign_up";
 
 /// Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and can
 /// help you identify which virtual goods are the most popular objects of purchase. Params:
@@ -300,17 +315,20 @@ static NSString *const kFIREventSignUp = @"sign_up";
 ///     <li>@c kFIRParameterVirtualCurrencyName (NSString)</li>
 ///     <li>@c kFIRParameterValue (signed 64-bit integer or double as NSNumber)</li>
 /// </ul>
-static NSString *const kFIREventSpendVirtualCurrency = @"spend_virtual_currency";
+static NSString *const kFIREventSpendVirtualCurrency
+    NS_SWIFT_NAME(AnalyticsEventSpendVirtualCurrency) = @"spend_virtual_currency";
 
 /// Tutorial Begin event. This event signifies the start of the on-boarding process in your app. Use
 /// this in a funnel with kFIREventTutorialComplete to understand how many users complete this
 /// process and move on to the full app experience.
-static NSString *const kFIREventTutorialBegin = @"tutorial_begin";
+static NSString *const kFIREventTutorialBegin NS_SWIFT_NAME(AnalyticsEventTutorialBegin) =
+    @"tutorial_begin";
 
 /// Tutorial End event. Use this event to signify the user's completion of your app's on-boarding
 /// process. Add this to a funnel with kFIREventTutorialBegin to gauge the completion rate of your
 /// on-boarding process.
-static NSString *const kFIREventTutorialComplete = @"tutorial_complete";
+static NSString *const kFIREventTutorialComplete NS_SWIFT_NAME(AnalyticsEventTutorialComplete) =
+    @"tutorial_complete";
 
 /// Unlock Achievement event. Log this event when the user has unlocked an achievement in your
 /// game. Since achievements generally represent the breadth of a gaming experience, this event can
@@ -319,7 +337,8 @@ static NSString *const kFIREventTutorialComplete = @"tutorial_complete";
 /// <ul>
 ///     <li>@c kFIRParameterAchievementID (NSString)</li>
 /// </ul>
-static NSString *const kFIREventUnlockAchievement = @"unlock_achievement";
+static NSString *const kFIREventUnlockAchievement NS_SWIFT_NAME(AnalyticsEventUnlockAchievement) =
+    @"unlock_achievement";
 
 /// View Item event. This event signifies that some content was shown to the user. This content may
 /// be a product, a webpage or just a simple image or text. Use the appropriate parameters to
@@ -351,7 +370,7 @@ static NSString *const kFIREventUnlockAchievement = @"unlock_achievement";
 ///     <li>@c kFIRParameterSearchTerm (NSString) (optional) for travel bookings</li>
 ///     <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li>
 /// </ul>
-static NSString *const kFIREventViewItem = @"view_item";
+static NSString *const kFIREventViewItem NS_SWIFT_NAME(AnalyticsEventViewItem) = @"view_item";
 
 /// View Item List event. Log this event when the user has been presented with a list of items of a
 /// certain category. Params:
@@ -359,7 +378,8 @@ static NSString *const kFIREventViewItem = @"view_item";
 /// <ul>
 ///     <li>@c kFIRParameterItemCategory (NSString)</li>
 /// </ul>
-static NSString *const kFIREventViewItemList = @"view_item_list";
+static NSString *const kFIREventViewItemList NS_SWIFT_NAME(AnalyticsEventViewItemList) =
+    @"view_item_list";
 
 /// View Search Results event. Log this event when the user has been presented with the results of a
 /// search. Params:
@@ -367,4 +387,21 @@ static NSString *const kFIREventViewItemList = @"view_item_list";
 /// <ul>
 ///     <li>@c kFIRParameterSearchTerm (NSString)</li>
 /// </ul>
-static NSString *const kFIREventViewSearchResults = @"view_search_results";
+static NSString *const kFIREventViewSearchResults NS_SWIFT_NAME(AnalyticsEventViewSearchResults) =
+    @"view_search_results";
+
+/// Level Start event. Log this event when the user starts a new level. Params:
+///
+/// <ul>
+///     <li>@c kFIRParameterLevelName (NSString)</li>
+/// </ul>
+static NSString *const kFIREventLevelStart NS_SWIFT_NAME(AnalyticsEventLevelStart) =
+    @"level_start";
+
+/// Level End event. Log this event when the user finishes a level. Params:
+///
+/// <ul>
+///     <li>@c kFIRParameterLevelName (NSString)</li>
+///     <li>@c kFIRParameterSuccess (NSString)</li>
+/// </ul>
+static NSString *const kFIREventLevelEnd NS_SWIFT_NAME(AnalyticsEventLevelEnd) = @"level_end";

+ 114 - 48
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h → Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h

@@ -7,7 +7,10 @@
 /// not limited to these. You may supply extra Params for suggested Events or custom Params for
 /// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric
 /// characters and underscores ("_"), and must start with an alphabetic character. Param values can
-/// be up to 100 characters long. The "firebase_" prefix is reserved and should not be used.
+/// be up to 100 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and
+/// should not be used.
+
+#import <Foundation/Foundation.h>
 
 /// Game achievement ID (NSString).
 /// <pre>
@@ -16,7 +19,8 @@
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterAchievementID = @"achievement_id";
+static NSString *const kFIRParameterAchievementID NS_SWIFT_NAME(AnalyticsParameterAchievementID) =
+    @"achievement_id";
 
 /// Ad Network Click ID (NSString). Used for network-specific click IDs which vary in format.
 /// <pre>
@@ -25,7 +29,8 @@ static NSString *const kFIRParameterAchievementID = @"achievement_id";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterAdNetworkClickID = @"aclid";
+static NSString *const kFIRParameterAdNetworkClickID
+    NS_SWIFT_NAME(AnalyticsParameterAdNetworkClickID) = @"aclid";
 
 /// The store or affiliation from which this transaction occurred (NSString).
 /// <pre>
@@ -34,7 +39,8 @@ static NSString *const kFIRParameterAdNetworkClickID = @"aclid";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterAffiliation = @"affiliation";
+static NSString *const kFIRParameterAffiliation NS_SWIFT_NAME(AnalyticsParameterAffiliation) =
+    @"affiliation";
 
 /// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to
 /// capture campaign information, otherwise can be populated by developer. Highly Recommended
@@ -45,7 +51,8 @@ static NSString *const kFIRParameterAffiliation = @"affiliation";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCampaign = @"campaign";
+static NSString *const kFIRParameterCampaign NS_SWIFT_NAME(AnalyticsParameterCampaign) =
+    @"campaign";
 
 /// Character used in game (NSString).
 /// <pre>
@@ -54,7 +61,8 @@ static NSString *const kFIRParameterCampaign = @"campaign";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCharacter = @"character";
+static NSString *const kFIRParameterCharacter NS_SWIFT_NAME(AnalyticsParameterCharacter) =
+    @"character";
 
 /// The checkout step (1..N) (unsigned 64-bit integer as NSNumber).
 /// <pre>
@@ -63,7 +71,8 @@ static NSString *const kFIRParameterCharacter = @"character";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCheckoutStep = @"checkout_step";
+static NSString *const kFIRParameterCheckoutStep NS_SWIFT_NAME(AnalyticsParameterCheckoutStep) =
+    @"checkout_step";
 
 /// Some option on a step in an ecommerce flow (NSString).
 /// <pre>
@@ -72,10 +81,11 @@ static NSString *const kFIRParameterCheckoutStep = @"checkout_step";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCheckoutOption = @"checkout_option";
+static NSString *const kFIRParameterCheckoutOption
+    NS_SWIFT_NAME(AnalyticsParameterCheckoutOption) = @"checkout_option";
 
 /// Campaign content (NSString).
-static NSString *const kFIRParameterContent = @"content";
+static NSString *const kFIRParameterContent NS_SWIFT_NAME(AnalyticsParameterContent) = @"content";
 
 /// Type of content selected (NSString).
 /// <pre>
@@ -84,7 +94,8 @@ static NSString *const kFIRParameterContent = @"content";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterContentType = @"content_type";
+static NSString *const kFIRParameterContentType NS_SWIFT_NAME(AnalyticsParameterContentType) =
+    @"content_type";
 
 /// Coupon code for a purchasable item (NSString).
 /// <pre>
@@ -93,7 +104,7 @@ static NSString *const kFIRParameterContentType = @"content_type";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCoupon = @"coupon";
+static NSString *const kFIRParameterCoupon NS_SWIFT_NAME(AnalyticsParameterCoupon) = @"coupon";
 
 /// Campaign custom parameter (NSString). Used as a method of capturing custom data in a campaign.
 /// Use varies by network.
@@ -103,7 +114,7 @@ static NSString *const kFIRParameterCoupon = @"coupon";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCP1 = @"cp1";
+static NSString *const kFIRParameterCP1 NS_SWIFT_NAME(AnalyticsParameterCP1) = @"cp1";
 
 /// The name of a creative used in a promotional spot (NSString).
 /// <pre>
@@ -112,7 +123,8 @@ static NSString *const kFIRParameterCP1 = @"cp1";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCreativeName = @"creative_name";
+static NSString *const kFIRParameterCreativeName NS_SWIFT_NAME(AnalyticsParameterCreativeName) =
+    @"creative_name";
 
 /// The name of a creative slot (NSString).
 /// <pre>
@@ -121,7 +133,8 @@ static NSString *const kFIRParameterCreativeName = @"creative_name";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCreativeSlot = @"creative_slot";
+static NSString *const kFIRParameterCreativeSlot NS_SWIFT_NAME(AnalyticsParameterCreativeSlot) =
+    @"creative_slot";
 
 /// Purchase currency in 3-letter <a href="http://en.wikipedia.org/wiki/ISO_4217#Active_codes">
 /// ISO_4217</a> format (NSString).
@@ -131,7 +144,8 @@ static NSString *const kFIRParameterCreativeSlot = @"creative_slot";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterCurrency = @"currency";
+static NSString *const kFIRParameterCurrency NS_SWIFT_NAME(AnalyticsParameterCurrency) =
+    @"currency";
 
 /// Flight or Travel destination (NSString).
 /// <pre>
@@ -140,7 +154,8 @@ static NSString *const kFIRParameterCurrency = @"currency";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterDestination = @"destination";
+static NSString *const kFIRParameterDestination NS_SWIFT_NAME(AnalyticsParameterDestination) =
+    @"destination";
 
 /// The arrival date, check-out date or rental end date for the item. This should be in
 /// YYYY-MM-DD format (NSString).
@@ -150,7 +165,7 @@ static NSString *const kFIRParameterDestination = @"destination";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterEndDate = @"end_date";
+static NSString *const kFIRParameterEndDate NS_SWIFT_NAME(AnalyticsParameterEndDate) = @"end_date";
 
 /// Flight number for travel events (NSString).
 /// <pre>
@@ -159,7 +174,8 @@ static NSString *const kFIRParameterEndDate = @"end_date";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterFlightNumber = @"flight_number";
+static NSString *const kFIRParameterFlightNumber NS_SWIFT_NAME(AnalyticsParameterFlightNumber) =
+    @"flight_number";
 
 /// Group/clan/guild ID (NSString).
 /// <pre>
@@ -168,7 +184,16 @@ static NSString *const kFIRParameterFlightNumber = @"flight_number";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterGroupID = @"group_id";
+static NSString *const kFIRParameterGroupID NS_SWIFT_NAME(AnalyticsParameterGroupID) = @"group_id";
+
+/// Index of an item in a list (signed 64-bit integer as NSNumber).
+/// <pre>
+///     NSDictionary *params = @{
+///       kFIRParameterIndex : @(1),
+///       // ...
+///     };
+/// </pre>
+static NSString *const kFIRParameterIndex NS_SWIFT_NAME(AnalyticsParameterIndex) = @"index";
 
 /// Item brand (NSString).
 /// <pre>
@@ -177,7 +202,8 @@ static NSString *const kFIRParameterGroupID = @"group_id";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterItemBrand = @"item_brand";
+static NSString *const kFIRParameterItemBrand NS_SWIFT_NAME(AnalyticsParameterItemBrand) =
+    @"item_brand";
 
 /// Item category (NSString).
 /// <pre>
@@ -186,7 +212,8 @@ static NSString *const kFIRParameterItemBrand = @"item_brand";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterItemCategory = @"item_category";
+static NSString *const kFIRParameterItemCategory NS_SWIFT_NAME(AnalyticsParameterItemCategory) =
+    @"item_category";
 
 /// Item ID (NSString).
 /// <pre>
@@ -195,7 +222,7 @@ static NSString *const kFIRParameterItemCategory = @"item_category";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterItemID = @"item_id";
+static NSString *const kFIRParameterItemID NS_SWIFT_NAME(AnalyticsParameterItemID) = @"item_id";
 
 /// The Google <a href="https://developers.google.com/places/place-id">Place ID</a> (NSString) that
 /// corresponds to the associated item. Alternatively, you can supply your own custom Location ID.
@@ -205,7 +232,8 @@ static NSString *const kFIRParameterItemID = @"item_id";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterItemLocationID = @"item_location_id";
+static NSString *const kFIRParameterItemLocationID
+    NS_SWIFT_NAME(AnalyticsParameterItemLocationID) = @"item_location_id";
 
 /// Item name (NSString).
 /// <pre>
@@ -214,7 +242,8 @@ static NSString *const kFIRParameterItemLocationID = @"item_location_id";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterItemName = @"item_name";
+static NSString *const kFIRParameterItemName NS_SWIFT_NAME(AnalyticsParameterItemName) =
+    @"item_name";
 
 /// The list in which the item was presented to the user (NSString).
 /// <pre>
@@ -223,7 +252,8 @@ static NSString *const kFIRParameterItemName = @"item_name";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterItemList = @"item_list";
+static NSString *const kFIRParameterItemList NS_SWIFT_NAME(AnalyticsParameterItemList) =
+    @"item_list";
 
 /// Item variant (NSString).
 /// <pre>
@@ -232,7 +262,8 @@ static NSString *const kFIRParameterItemList = @"item_list";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterItemVariant = @"item_variant";
+static NSString *const kFIRParameterItemVariant NS_SWIFT_NAME(AnalyticsParameterItemVariant) =
+    @"item_variant";
 
 /// Level in game (signed 64-bit integer as NSNumber).
 /// <pre>
@@ -241,7 +272,7 @@ static NSString *const kFIRParameterItemVariant = @"item_variant";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterLevel = @"level";
+static NSString *const kFIRParameterLevel NS_SWIFT_NAME(AnalyticsParameterLevel) = @"level";
 
 /// Location (NSString). The Google <a href="https://developers.google.com/places/place-id">Place ID
 /// </a> that corresponds to the associated event. Alternatively, you can supply your own custom
@@ -252,7 +283,8 @@ static NSString *const kFIRParameterLevel = @"level";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterLocation = @"location";
+static NSString *const kFIRParameterLocation NS_SWIFT_NAME(AnalyticsParameterLocation) =
+    @"location";
 
 /// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended
 /// (NSString).
@@ -262,7 +294,7 @@ static NSString *const kFIRParameterLocation = @"location";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterMedium = @"medium";
+static NSString *const kFIRParameterMedium NS_SWIFT_NAME(AnalyticsParameterMedium) = @"medium";
 
 /// Number of nights staying at hotel (signed 64-bit integer as NSNumber).
 /// <pre>
@@ -271,7 +303,8 @@ static NSString *const kFIRParameterMedium = @"medium";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterNumberOfNights = @"number_of_nights";
+static NSString *const kFIRParameterNumberOfNights
+    NS_SWIFT_NAME(AnalyticsParameterNumberOfNights) = @"number_of_nights";
 
 /// Number of passengers traveling (signed 64-bit integer as NSNumber).
 /// <pre>
@@ -280,7 +313,8 @@ static NSString *const kFIRParameterNumberOfNights = @"number_of_nights";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterNumberOfPassengers = @"number_of_passengers";
+static NSString *const kFIRParameterNumberOfPassengers
+    NS_SWIFT_NAME(AnalyticsParameterNumberOfPassengers) = @"number_of_passengers";
 
 /// Number of rooms for travel events (signed 64-bit integer as NSNumber).
 /// <pre>
@@ -289,7 +323,8 @@ static NSString *const kFIRParameterNumberOfPassengers = @"number_of_passengers"
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterNumberOfRooms = @"number_of_rooms";
+static NSString *const kFIRParameterNumberOfRooms NS_SWIFT_NAME(AnalyticsParameterNumberOfRooms) =
+    @"number_of_rooms";
 
 /// Flight or Travel origin (NSString).
 /// <pre>
@@ -298,7 +333,7 @@ static NSString *const kFIRParameterNumberOfRooms = @"number_of_rooms";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterOrigin = @"origin";
+static NSString *const kFIRParameterOrigin NS_SWIFT_NAME(AnalyticsParameterOrigin) = @"origin";
 
 /// Purchase price (double as NSNumber).
 /// <pre>
@@ -308,7 +343,7 @@ static NSString *const kFIRParameterOrigin = @"origin";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterPrice = @"price";
+static NSString *const kFIRParameterPrice NS_SWIFT_NAME(AnalyticsParameterPrice) = @"price";
 
 /// Purchase quantity (signed 64-bit integer as NSNumber).
 /// <pre>
@@ -317,7 +352,8 @@ static NSString *const kFIRParameterPrice = @"price";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterQuantity = @"quantity";
+static NSString *const kFIRParameterQuantity NS_SWIFT_NAME(AnalyticsParameterQuantity) =
+    @"quantity";
 
 /// Score in game (signed 64-bit integer as NSNumber).
 /// <pre>
@@ -326,7 +362,7 @@ static NSString *const kFIRParameterQuantity = @"quantity";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterScore = @"score";
+static NSString *const kFIRParameterScore NS_SWIFT_NAME(AnalyticsParameterScore) = @"score";
 
 /// The search string/keywords used (NSString).
 /// <pre>
@@ -335,7 +371,8 @@ static NSString *const kFIRParameterScore = @"score";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterSearchTerm = @"search_term";
+static NSString *const kFIRParameterSearchTerm NS_SWIFT_NAME(AnalyticsParameterSearchTerm) =
+    @"search_term";
 
 /// Shipping cost (double as NSNumber).
 /// <pre>
@@ -345,7 +382,8 @@ static NSString *const kFIRParameterSearchTerm = @"search_term";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterShipping = @"shipping";
+static NSString *const kFIRParameterShipping NS_SWIFT_NAME(AnalyticsParameterShipping) =
+    @"shipping";
 
 /// Sign up method (NSString).
 /// <pre>
@@ -354,7 +392,8 @@ static NSString *const kFIRParameterShipping = @"shipping";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterSignUpMethod = @"sign_up_method";
+static NSString *const kFIRParameterSignUpMethod NS_SWIFT_NAME(AnalyticsParameterSignUpMethod) =
+    @"sign_up_method";
 
 /// The origin of your traffic, such as an Ad network (for example, google) or partner (urban
 /// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your
@@ -365,7 +404,7 @@ static NSString *const kFIRParameterSignUpMethod = @"sign_up_method";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterSource = @"source";
+static NSString *const kFIRParameterSource NS_SWIFT_NAME(AnalyticsParameterSource) = @"source";
 
 /// The departure date, check-in date or rental start date for the item. This should be in
 /// YYYY-MM-DD format (NSString).
@@ -375,7 +414,8 @@ static NSString *const kFIRParameterSource = @"source";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterStartDate = @"start_date";
+static NSString *const kFIRParameterStartDate NS_SWIFT_NAME(AnalyticsParameterStartDate) =
+    @"start_date";
 
 /// Tax amount (double as NSNumber).
 /// <pre>
@@ -385,7 +425,7 @@ static NSString *const kFIRParameterStartDate = @"start_date";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterTax = @"tax";
+static NSString *const kFIRParameterTax NS_SWIFT_NAME(AnalyticsParameterTax) = @"tax";
 
 /// If you're manually tagging keyword campaigns, you should use utm_term to specify the keyword
 /// (NSString).
@@ -395,7 +435,7 @@ static NSString *const kFIRParameterTax = @"tax";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterTerm = @"term";
+static NSString *const kFIRParameterTerm NS_SWIFT_NAME(AnalyticsParameterTerm) = @"term";
 
 /// A single ID for a ecommerce group transaction (NSString).
 /// <pre>
@@ -404,7 +444,8 @@ static NSString *const kFIRParameterTerm = @"term";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterTransactionID = @"transaction_id";
+static NSString *const kFIRParameterTransactionID NS_SWIFT_NAME(AnalyticsParameterTransactionID) =
+    @"transaction_id";
 
 /// Travel class (NSString).
 /// <pre>
@@ -413,7 +454,8 @@ static NSString *const kFIRParameterTransactionID = @"transaction_id";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterTravelClass = @"travel_class";
+static NSString *const kFIRParameterTravelClass NS_SWIFT_NAME(AnalyticsParameterTravelClass) =
+    @"travel_class";
 
 /// A context-specific numeric value which is accumulated automatically for each event type. This is
 /// a general purpose parameter that is useful for accumulating a key metric that pertains to an
@@ -421,7 +463,10 @@ static NSString *const kFIRParameterTravelClass = @"travel_class";
 /// 64-bit integer or double as NSNumber. Notes: Values for pre-defined currency-related events
 /// (such as @c kFIREventAddToCart) should be supplied using double as NSNumber and must be
 /// accompanied by a @c kFIRParameterCurrency parameter. The valid range of accumulated values is
-/// [-9,223,372,036,854.77, 9,223,372,036,854.77].
+/// [-9,223,372,036,854.77, 9,223,372,036,854.77]. Supplying a non-numeric value, omitting the
+/// corresponding @c kFIRParameterCurrency parameter, or supplying an invalid
+/// <a href="https://goo.gl/qqX3J2">currency code</a> for conversion events will cause that
+/// conversion to be omitted from reporting.
 /// <pre>
 ///     NSDictionary *params = @{
 ///       kFIRParameterValue : @(3.99),
@@ -429,7 +474,7 @@ static NSString *const kFIRParameterTravelClass = @"travel_class";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterValue = @"value";
+static NSString *const kFIRParameterValue NS_SWIFT_NAME(AnalyticsParameterValue) = @"value";
 
 /// Name of virtual currency type (NSString).
 /// <pre>
@@ -438,4 +483,25 @@ static NSString *const kFIRParameterValue = @"value";
 ///       // ...
 ///     };
 /// </pre>
-static NSString *const kFIRParameterVirtualCurrencyName = @"virtual_currency_name";
+static NSString *const kFIRParameterVirtualCurrencyName
+    NS_SWIFT_NAME(AnalyticsParameterVirtualCurrencyName) = @"virtual_currency_name";
+
+/// The name of a level in a game (NSString).
+/// <pre>
+///     NSDictionary *params = @{
+///       kFIRParameterLevelName : @"room_1",
+///       // ...
+///     };
+/// </pre>
+static NSString *const kFIRParameterLevelName NS_SWIFT_NAME(AnalyticsParameterLevelName) =
+    @"level_name";
+
+/// The result of an operation. Specify 1 to indicate success and 0 to indicate failure (unsigned
+/// integer as NSNumber).
+/// <pre>
+///     NSDictionary *params = @{
+///       kFIRParameterSuccess : @(1),
+///       // ...
+///     };
+/// </pre>
+static NSString *const kFIRParameterSuccess NS_SWIFT_NAME(AnalyticsParameterSuccess) = @"success";

+ 6 - 2
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h → Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h

@@ -7,7 +7,11 @@
 /// unique UserProperties per app, and you can use the name and value of your choosing for each one.
 /// UserProperty names can be up to 24 characters long, may only contain alphanumeric characters and
 /// underscores ("_"), and must start with an alphabetic character. UserProperty values can be up to
-/// 36 characters long. The "firebase_" prefix is reserved and should not be used.
+/// 36 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and should not
+/// be used.
+
+#import <Foundation/Foundation.h>
 
 /// The method used to sign in. For example, "google", "facebook" or "twitter".
-static NSString *const kFIRUserPropertySignUpMethod = @"sign_up_method";
+static NSString *const kFIRUserPropertySignUpMethod
+    NS_SWIFT_NAME(AnalyticsUserPropertySignUpMethod) = @"sign_up_method";

+ 1 - 4
Libraries external/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h → Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h

@@ -1,9 +1,6 @@
-#import "FIRAnalyticsConfiguration.h"
-#import "FIRApp.h"
-#import "FIRConfiguration.h"
-#import "FIROptions.h"
 #import "FIRAnalytics+AppDelegate.h"
 #import "FIRAnalytics.h"
+#import "FIRAnalyticsSwiftNameSupport.h"
 #import "FIREventNames.h"
 #import "FIRParameterNames.h"
 #import "FIRUserPropertyNames.h"

+ 4 - 3
Libraries external/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap → Libraries external/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap

@@ -2,8 +2,9 @@ framework module FirebaseAnalytics {
   umbrella header "FirebaseAnalytics.h"
   export *
   module * { export *}
-  link "c++"
   link "sqlite3"
   link "z"
-  link framework "UIKit"
-}
+  link framework "Security"
+  link framework "StoreKit"
+  link framework "SystemConfiguration"
+  link framework "UIKit"}

二进制
Libraries external/Firebase/Analytics/FirebaseCore.framework/FirebaseCore


+ 22 - 8
Libraries external/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h → Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h

@@ -1,14 +1,33 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #import <Foundation/Foundation.h>
 
+NS_ASSUME_NONNULL_BEGIN
+
 /**
  * This class provides configuration fields for Firebase Analytics.
  */
+NS_SWIFT_NAME(AnalyticsConfiguration)
 @interface FIRAnalyticsConfiguration : NSObject
 
 /**
  * Returns the shared instance of FIRAnalyticsConfiguration.
  */
-+ (FIRAnalyticsConfiguration *)sharedInstance;
++ (FIRAnalyticsConfiguration *)sharedInstance NS_SWIFT_NAME(shared());
 
 /**
  * Sets the minimum engagement time in seconds required to start a new session. The default value
@@ -28,11 +47,6 @@
  */
 - (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled;
 
-/**
- * Deprecated. Sets whether measurement and reporting are enabled for this app on this device. By
- * default they are enabled.
- */
-- (void)setIsEnabled:(BOOL)isEnabled
-    DEPRECATED_MSG_ATTRIBUTE("Use setAnalyticsCollectionEnabled: instead.");
-
 @end
+
+NS_ASSUME_NONNULL_END

+ 30 - 10
Libraries external/Analytics/FirebaseCore.framework/Headers/FIRApp.h → Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIRApp.h

@@ -1,12 +1,27 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
 
 @class FIROptions;
 
 NS_ASSUME_NONNULL_BEGIN
 
 /** A block that takes a BOOL and has no return value. */
-typedef void (^FIRAppVoidBoolCallback)(BOOL success);
+typedef void (^FIRAppVoidBoolCallback)(BOOL success) NS_SWIFT_NAME(FirebaseAppVoidBoolCallback);
 
 /**
  * The entry point of Firebase SDKs.
@@ -26,12 +41,14 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success);
  * It is also possible to change the default logging level in code by calling setLoggerLevel: on
  * the FIRConfiguration interface.
  */
+NS_SWIFT_NAME(FirebaseApp)
 @interface FIRApp : NSObject
 
 /**
  * Configures a default Firebase app. Raises an exception if any configuration step fails. The
  * default app is named "__FIRAPP_DEFAULT". This method should be called after the app is launched
- * and before using Firebase services. This method is thread safe.
+ * and before using Firebase services. This method is thread safe and contains synchronous file I/O
+ * (reading GoogleService-Info.plist from disk).
  */
 + (void)configure;
 
@@ -42,7 +59,7 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success);
  *
  * @param options The Firebase application options used to configure the service.
  */
-+ (void)configureWithOptions:(FIROptions *)options;
++ (void)configureWithOptions:(FIROptions *)options NS_SWIFT_NAME(configure(options:));
 
 /**
  * Configures a Firebase app with the given name and options. Raises an exception if any
@@ -52,24 +69,27 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success);
                Letters, Numbers and Underscore.
  * @param options The Firebase application options used to configure the services.
  */
-+ (void)configureWithName:(NSString *)name options:(FIROptions *)options;
+// clang-format off
++ (void)configureWithName:(NSString *)name
+                  options:(FIROptions *)options NS_SWIFT_NAME(configure(name:options:));
+// clang-format on
 
 /**
  * Returns the default app, or nil if the default app does not exist.
  */
-+ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(defaultApp());
++ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(app());
 
 /**
  * Returns a previously created FIRApp instance with the given name, or nil if no such app exists.
  * This method is thread safe.
  */
-+ (nullable FIRApp *)appNamed:(NSString *)name;
++ (nullable FIRApp *)appNamed:(NSString *)name NS_SWIFT_NAME(app(name:));
 
 /**
  * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This
  * method is thread safe.
  */
-+ (nullable NSDictionary *)allApps;
+@property(class, readonly, nullable) NSDictionary<NSString *, FIRApp *> *allApps;
 
 /**
  * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for
@@ -89,9 +109,9 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success);
 @property(nonatomic, copy, readonly) NSString *name;
 
 /**
- * Gets the options for this app.
+ * Gets a copy of the options for this app. These are non-modifiable.
  */
-@property(nonatomic, readonly) FIROptions *options;
+@property(nonatomic, copy, readonly) FIROptions *options;
 
 @end
 

+ 21 - 23
Libraries external/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h → Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h

@@ -1,43 +1,39 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #import <Foundation/Foundation.h>
 
 #import "FIRAnalyticsConfiguration.h"
 #import "FIRLoggerLevel.h"
 
-/**
- * The log levels used by FIRConfiguration.
- */
-typedef NS_ENUM(NSInteger, FIRLogLevel) {
-  /** Error */
-  kFIRLogLevelError __deprecated = 0,
-  /** Warning */
-  kFIRLogLevelWarning __deprecated,
-  /** Info */
-  kFIRLogLevelInfo __deprecated,
-  /** Debug */
-  kFIRLogLevelDebug __deprecated,
-  /** Assert */
-  kFIRLogLevelAssert __deprecated,
-  /** Max */
-  kFIRLogLevelMax __deprecated = kFIRLogLevelAssert
-} DEPRECATED_MSG_ATTRIBUTE(
-    "Use -FIRDebugEnabled and -FIRDebugDisabled or setLoggerLevel. See FIRApp.h for more details.");
+NS_ASSUME_NONNULL_BEGIN
 
 /**
  * This interface provides global level properties that the developer can tweak, and the singleton
  * of the Firebase Analytics configuration class.
  */
+NS_SWIFT_NAME(FirebaseConfiguration)
 @interface FIRConfiguration : NSObject
 
 /** Returns the shared configuration object. */
-+ (FIRConfiguration *)sharedInstance;
+@property(class, nonatomic, readonly) FIRConfiguration *sharedInstance NS_SWIFT_NAME(shared);
 
 /** The configuration class for Firebase Analytics. */
 @property(nonatomic, readwrite) FIRAnalyticsConfiguration *analyticsConfiguration;
 
-/** Global log level. Defaults to kFIRLogLevelError. */
-@property(nonatomic, readwrite, assign) FIRLogLevel logLevel DEPRECATED_MSG_ATTRIBUTE(
-    "Use -FIRDebugEnabled and -FIRDebugDisabled or setLoggerLevel. See FIRApp.h for more details.");
-
 /**
  * Sets the logging level for internal Firebase logging. Firebase will only log messages
  * that are logged at or below loggerLevel. The messages are logged both to the Xcode
@@ -50,3 +46,5 @@ typedef NS_ENUM(NSInteger, FIRLogLevel) {
 - (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel;
 
 @end
+
+NS_ASSUME_NONNULL_END

+ 35 - 0
Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h

@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * The log levels used by internal logging.
+ */
+typedef NS_ENUM(NSInteger, FIRLoggerLevel) {
+  /** Error level, matches ASL_LEVEL_ERR. */
+  FIRLoggerLevelError = 3,
+  /** Warning level, matches ASL_LEVEL_WARNING. */
+  FIRLoggerLevelWarning = 4,
+  /** Notice level, matches ASL_LEVEL_NOTICE. */
+  FIRLoggerLevelNotice = 5,
+  /** Info level, matches ASL_LEVEL_NOTICE. */
+  FIRLoggerLevelInfo = 6,
+  /** Debug level, matches ASL_LEVEL_DEBUG. */
+  FIRLoggerLevelDebug = 7,
+  /** Minimum log level. */
+  FIRLoggerLevelMin = FIRLoggerLevelError,
+  /** Maximum log level. */
+  FIRLoggerLevelMax = FIRLoggerLevelDebug
+} NS_SWIFT_NAME(FirebaseLoggerLevel);

+ 116 - 0
Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h

@@ -0,0 +1,116 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ * This class provides constant fields of Google APIs.
+ */
+NS_SWIFT_NAME(FirebaseOptions)
+@interface FIROptions : NSObject <NSCopying>
+
+/**
+ * Returns the default options. The first time this is called it synchronously reads
+ * GoogleService-Info.plist from disk.
+ */
++ (nullable FIROptions *)defaultOptions NS_SWIFT_NAME(defaultOptions());
+
+/**
+ * An iOS API key used for authenticating requests from your app, e.g.
+ * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers.
+ */
+@property(nonatomic, copy, nullable) NSString *APIKey NS_SWIFT_NAME(apiKey);
+
+/**
+ * The bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]` when not set
+ * manually or in a plist.
+ */
+@property(nonatomic, copy) NSString *bundleID;
+
+/**
+ * The OAuth2 client ID for iOS application used to authenticate Google users, for example
+ * @"12345.apps.googleusercontent.com", used for signing in with Google.
+ */
+@property(nonatomic, copy, nullable) NSString *clientID;
+
+/**
+ * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics.
+ */
+@property(nonatomic, copy, nullable) NSString *trackingID;
+
+/**
+ * The Project Number from the Google Developer's console, for example @"012345678901", used to
+ * configure Google Cloud Messaging.
+ */
+@property(nonatomic, copy) NSString *GCMSenderID NS_SWIFT_NAME(gcmSenderID);
+
+/**
+ * The Project ID from the Firebase console, for example @"abc-xyz-123".
+ */
+@property(nonatomic, copy, nullable) NSString *projectID;
+
+/**
+ * The Android client ID used in Google AppInvite when an iOS app has its Android version, for
+ * example @"12345.apps.googleusercontent.com".
+ */
+@property(nonatomic, copy, nullable) NSString *androidClientID;
+
+/**
+ * The Google App ID that is used to uniquely identify an instance of an app.
+ */
+@property(nonatomic, copy) NSString *googleAppID;
+
+/**
+ * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com".
+ */
+@property(nonatomic, copy, nullable) NSString *databaseURL;
+
+/**
+ * The URL scheme used to set up Durable Deep Link service.
+ */
+@property(nonatomic, copy, nullable) NSString *deepLinkURLScheme;
+
+/**
+ * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com".
+ */
+@property(nonatomic, copy, nullable) NSString *storageBucket;
+
+/**
+ * Initializes a customized instance of FIROptions from the file at the given plist file path. This
+ * will read the file synchronously from disk.
+ * For example,
+ * NSString *filePath =
+ *     [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];
+ * FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
+ * Returns nil if the plist file does not exist or is invalid.
+ */
+- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath;
+
+/**
+ * Initializes a customized instance of FIROptions with required fields. Use the mutable properties
+ * to modify fields for configuring specific services.
+ */
+// clang-format off
+- (instancetype)initWithGoogleAppID:(NSString *)googleAppID
+                        GCMSenderID:(NSString *)GCMSenderID
+    NS_SWIFT_NAME(init(googleAppID:gcmSenderID:));
+// clang-format on
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 21 - 0
Libraries external/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h

@@ -0,0 +1,21 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#import "FIRAnalyticsConfiguration.h"
+#import "FIRApp.h"
+#import "FIRConfiguration.h"
+#import "FIRLoggerLevel.h"
+#import "FIROptions.h"

+ 3 - 3
Libraries external/Analytics/FirebaseCore.framework/Modules/module.modulemap → Libraries external/Firebase/Analytics/FirebaseCore.framework/Modules/module.modulemap

@@ -2,6 +2,6 @@ framework module FirebaseCore {
   umbrella header "FirebaseCore.h"
   export *
   module * { export *}
-  link "c++"
-  link "z"
-}
+  link framework "Foundation"
+  link framework "SystemConfiguration"
+}

二进制
Libraries external/Firebase/Analytics/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics


+ 6 - 0
Libraries external/Firebase/Analytics/FirebaseCoreDiagnostics.framework/Modules/module.modulemap

@@ -0,0 +1,6 @@
+framework module FirebaseCoreDiagnostics {
+  export *
+  module * { export *}
+  link "z"
+  link framework "Security"
+  link framework "SystemConfiguration"}

二进制
Libraries external/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID


+ 108 - 49
Libraries external/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h → Libraries external/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h

@@ -1,12 +1,28 @@
 #import <Foundation/Foundation.h>
 
+NS_ASSUME_NONNULL_BEGIN
+
+@class FIRInstanceIDResult;
 /**
  *  @memberof FIRInstanceID
  *
  *  The scope to be used when fetching/deleting a token for Firebase Messaging.
  */
-FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessaging;
+FOUNDATION_EXPORT NSString *const kFIRInstanceIDScopeFirebaseMessaging
+    NS_SWIFT_NAME(InstanceIDScopeFirebaseMessaging);
 
+#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
+/**
+ *  Called when the system determines that tokens need to be refreshed.
+ *  This method is also called if Instance ID has been reset in which
+ *  case, tokens and FCM topic subscriptions also need to be refreshed.
+ *
+ *  Instance ID service will throttle the refresh event across all devices
+ *  to control the rate of token updates on application servers.
+ */
+FOUNDATION_EXPORT const NSNotificationName kFIRInstanceIDTokenRefreshNotification
+    NS_SWIFT_NAME(InstanceIDTokenRefresh);
+#else
 /**
  *  Called when the system determines that tokens need to be refreshed.
  *  This method is also called if Instance ID has been reset in which
@@ -15,7 +31,9 @@ FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessagin
  *  Instance ID service will throttle the refresh event across all devices
  *  to control the rate of token updates on application servers.
  */
-FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotification;
+FOUNDATION_EXPORT NSString *const kFIRInstanceIDTokenRefreshNotification
+    NS_SWIFT_NAME(InstanceIDTokenRefreshNotification);
+#endif  // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
 
 /**
  *  @related FIRInstanceID
@@ -29,8 +47,8 @@ FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotificat
  *               failed. See the error codes below for a more detailed
  *               description.
  */
-typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * __nullable error);
-
+typedef void (^FIRInstanceIDTokenHandler)(NSString *__nullable token, NSError *__nullable error)
+    NS_SWIFT_NAME(InstanceIDTokenHandler);
 
 /**
  *  @related FIRInstanceID
@@ -41,7 +59,8 @@ typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError *
  *  @param error The error describing why deleting the token failed.
  *               See the error codes below for a more detailed description.
  */
-typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error);
+typedef void (^FIRInstanceIDDeleteTokenHandler)(NSError *error)
+    NS_SWIFT_NAME(InstanceIDDeleteTokenHandler);
 
 /**
  *  @related FIRInstanceID
@@ -53,7 +72,8 @@ typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error);
  *                  while creating an identity.
  *  @param error    The error if fetching the identity fails else nil.
  */
-typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __nullable error);
+typedef void (^FIRInstanceIDHandler)(NSString *__nullable identity, NSError *__nullable error)
+    NS_SWIFT_NAME(InstanceIDHandler);
 
 /**
  *  @related FIRInstanceID
@@ -64,10 +84,25 @@ typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __
  *  @param error The error if deleting the identity and all the tokens associated with
  *               it fails else nil.
  */
-typedef void(^FIRInstanceIDDeleteHandler)(NSError * __nullable error);
+typedef void (^FIRInstanceIDDeleteHandler)(NSError *__nullable error)
+    NS_SWIFT_NAME(InstanceIDDeleteHandler);
+
+/**
+ *  @related FIRInstanceID
+ *
+ *  The completion handler invoked when the app identity and token are fetched. If the
+ *  identity wasn't created for some reason we return the appropriate error code.
+ *
+ *  @param result   The result containing an identity for the app instance and a valid token,
+ *                  nil if there was an error while creating the result.
+ *  @param error    The error if fetching the identity or token fails else nil.
+ */
+typedef void (^FIRInstanceIDResultHandler)(FIRInstanceIDResult *__nullable result,
+                                           NSError *__nullable error)
+    NS_SWIFT_NAME(InstanceIDResultHandler);
 
 /**
- * @enum FIRInstanceIDError
+ * Public errors produced by InstanceID.
  */
 typedef NS_ENUM(NSUInteger, FIRInstanceIDError) {
   // Http related errors.
@@ -93,26 +128,34 @@ typedef NS_ENUM(NSUInteger, FIRInstanceIDError) {
 
   /// InvalidRequest -- Some parameters of the request were invalid.
   FIRInstanceIDErrorInvalidRequest = 7,
-};
+} NS_SWIFT_NAME(InstanceIDError);
 
 /**
- *  The APNS token type for the app. If the token type is set to `UNKNOWN`
- *  InstanceID will implicitly try to figure out what the actual token type
- *  is from the provisioning profile.
+ * A class contains the results of InstanceID and token query.
  */
-typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) {
-  /// Unknown token type.
-  FIRInstanceIDAPNSTokenTypeUnknown,
-  /// Sandbox token type.
-  FIRInstanceIDAPNSTokenTypeSandbox,
-  /// Production token type.
-  FIRInstanceIDAPNSTokenTypeProd,
-};
+NS_SWIFT_NAME(InstanceIDResult)
+@interface FIRInstanceIDResult : NSObject <NSCopying>
+
+/**
+ * An instanceID uniquely identifies the app instance.
+ */
+@property(nonatomic, readonly, copy) NSString *instanceID;
+
+/*
+ * Returns a Firebase Messaging scoped token for the firebase app.
+ */
+@property(nonatomic, readonly, copy) NSString *token;
+
+@end
 
 /**
  *  Instance ID provides a unique identifier for each app instance and a mechanism
  *  to authenticate and authorize actions (for example, sending an FCM message).
  *
+ *  Once an InstanceID is generated, the library periodically sends information about the
+ *  application and the device where it's running to the Firebase backend. To stop this. see
+ *  `[FIRInstanceID deleteIDWithHandler:]`.
+ *
  *  Instance ID is long lived but, may be reset if the device is not used for
  *  a long time or the Instance ID service detects a problem.
  *  If Instance ID is reset, the app will be notified via
@@ -124,6 +167,7 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) {
  *  services associated with the app, call
  *  `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`.
  */
+NS_SWIFT_NAME(InstanceID)
 @interface FIRInstanceID : NSObject
 
 /**
@@ -131,35 +175,30 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) {
  *
  *  @return A shared instance of FIRInstanceID.
  */
-+ (nonnull instancetype)instanceID NS_SWIFT_NAME(instanceID());
++ (instancetype)instanceID NS_SWIFT_NAME(instanceID());
 
 /**
  *  Unavailable. Use +instanceID instead.
  */
-- (nonnull instancetype)init __attribute__((unavailable("Use +instanceID instead.")));
+- (instancetype)init __attribute__((unavailable("Use +instanceID instead.")));
+
+#pragma mark - Tokens
 
 /**
- *  Set APNS token for the application. This APNS token will be used to register
- *  with Firebase Messaging using `token` or
- *  `tokenWithAuthorizedEntity:scope:options:handler`. If the token type is set to
- *  `FIRInstanceIDAPNSTokenTypeUnknown` InstanceID will read the provisioning profile
- *  to find out the token type.
- *
- *  @param token The APNS token for the application.
- *  @param type  The APNS token type for the above token.
+ * Returns a result of app instance identifier InstanceID and a Firebase Messaging scoped token.
+ * param handler    The callback handler invoked when an app instanceID and a default token
+ *                  are generated and returned. If instanceID and token fetching fail for some
+ *                  reason the callback is invoked with nil `result` and the appropriate error.
  */
-- (void)setAPNSToken:(nonnull NSData *)token
-                type:(FIRInstanceIDAPNSTokenType)type;
-
-#pragma mark - Tokens
+- (void)instanceIDWithHandler:(FIRInstanceIDResultHandler)handler;
 
 /**
  *  Returns a Firebase Messaging scoped token for the firebase app.
  *
- *  @return Null Returns null if the device has not yet been registerd with
- *          Firebase Message else returns a valid token.
+ *  @return Returns the stored token if the device has registered with Firebase Messaging, otherwise
+ *          returns nil.
  */
-- (nullable NSString *)token;
+- (nullable NSString *)token __deprecated_msg("Use instanceIDWithHandler: instead.");
 
 /**
  *  Returns a token that authorizes an Entity (example: cloud service) to perform
@@ -172,6 +211,9 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) {
  *  we invoke the completion callback with nil `token` and the appropriate
  *  error.
  *
+ *  This generates an Instance ID if it does not exist yet, which starts periodically sending
+ *  information to the Firebase backend (see `[FIRInstanceID getIDWithHandler:]`).
+ *
  *  Note, you can only have one `token` or `deleteToken` call for a given
  *  authorizedEntity and scope at any point of time. Making another such call with the
  *  same authorizedEntity and scope before the last one finishes will result in an
@@ -183,21 +225,24 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) {
  *  @param scope            Action authorized for authorizedEntity.
  *  @param options          The extra options to be sent with your token request. The
  *                          value for the `apns_token` should be the NSData object
- *                          passed to UIApplication's
+ *                          passed to the UIApplicationDelegate's
  *                          `didRegisterForRemoteNotificationsWithDeviceToken` method.
- *                          All other keys and values in the options dict need to be
- *                          instances of NSString or else they will be discarded. Bundle
- *                          keys starting with 'GCM.' and 'GOOGLE.' are reserved.
+ *                          The value for `apns_sandbox` should be a boolean (or an
+ *                          NSNumber representing a BOOL in Objective C) set to true if
+ *                          your app is a debug build, which means that the APNs
+ *                          device token is for the sandbox environment. It should be
+ *                          set to false otherwise. If the `apns_sandbox` key is not
+ *                          provided, an automatically-detected value shall be used.
  *  @param handler          The callback handler which is invoked when the token is
  *                          successfully fetched. In case of success a valid `token` and
  *                          `nil` error are returned. In case of any error the `token`
  *                          is nil and a valid `error` is returned. The valid error
  *                          codes have been documented above.
  */
-- (void)tokenWithAuthorizedEntity:(nonnull NSString *)authorizedEntity
-                            scope:(nonnull NSString *)scope
+- (void)tokenWithAuthorizedEntity:(NSString *)authorizedEntity
+                            scope:(NSString *)scope
                           options:(nullable NSDictionary *)options
-                          handler:(nonnull FIRInstanceIDTokenHandler)handler;
+                          handler:(FIRInstanceIDTokenHandler)handler;
 
 /**
  *  Revokes access to a scope (action) for an entity previously
@@ -218,9 +263,9 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) {
  *                          In case of error an appropriate error object is returned
  *                          else error is nil.
  */
-- (void)deleteTokenWithAuthorizedEntity:(nonnull NSString *)authorizedEntity
-                                  scope:(nonnull NSString *)scope
-                                handler:(nonnull FIRInstanceIDDeleteTokenHandler)handler;
+- (void)deleteTokenWithAuthorizedEntity:(NSString *)authorizedEntity
+                                  scope:(NSString *)scope
+                                handler:(FIRInstanceIDDeleteTokenHandler)handler;
 
 #pragma mark - Identity
 
@@ -229,17 +274,31 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) {
  *  instance. If the identifier has been revoked or has expired, this method will
  *  return a new identifier.
  *
+ *  Once an InstanceID is generated, the library periodically sends information about the
+ *  application and the device where it's running to the Firebase backend. To stop this. see
+ *  `[FIRInstanceID deleteIDWithHandler:]`.
  *
  *  @param handler The handler to invoke once the identifier has been fetched.
  *                 In case of error an appropriate error object is returned else
  *                 a valid identifier is returned and a valid identifier for the
  *                 application instance.
  */
-- (void)getIDWithHandler:(nonnull FIRInstanceIDHandler)handler;
+- (void)getIDWithHandler:(FIRInstanceIDHandler)handler NS_SWIFT_NAME(getID(handler:));
 
 /**
  *  Resets Instance ID and revokes all tokens.
+ *
+ *  This method also triggers a request to fetch a new Instance ID and Firebase Messaging scope
+ *  token. Please listen to kFIRInstanceIDTokenRefreshNotification when the new ID and token are
+ *  ready.
+ *
+ *  This stops the periodic sending of data to the Firebase backend that began when the Instance ID
+ *  was generated. No more data is sent until another library calls Instance ID internally again
+ *  (like FCM, RemoteConfig or Analytics) or user explicitly calls Instance ID APIs to get an
+ *  Instance ID and token again.
  */
-- (void)deleteIDWithHandler:(nonnull FIRInstanceIDDeleteHandler)handler;
+- (void)deleteIDWithHandler:(FIRInstanceIDDeleteHandler)handler NS_SWIFT_NAME(deleteID(handler:));
 
 @end
+
+NS_ASSUME_NONNULL_END

+ 0 - 0
Libraries external/Analytics/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h → Libraries external/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h


+ 2 - 2
Libraries external/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap → Libraries external/Firebase/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap

@@ -2,6 +2,6 @@ framework module FirebaseInstanceID {
   umbrella header "FirebaseInstanceID.h"
   export *
   module * { export *}
-  link "c++"
   link "z"
-}
+  link framework "Security"
+  link framework "SystemConfiguration"}

二进制
Libraries external/Firebase/Analytics/FirebaseNanoPB.framework/FirebaseNanoPB


二进制
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac


+ 100 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMDebugSelectorValidation.h

@@ -0,0 +1,100 @@
+//
+//  GTMDebugSelectorValidation.h
+//
+//  This file should only be included within an implimation file.  In any
+//  function that takes an object and selector to invoke, you should call:
+//
+//    GTMAssertSelectorNilOrImplementedWithArguments(obj, sel, @encode(arg1type), ..., NULL)
+//  or
+//    GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments(obj, sel, @encode(returnType), @encode(arg1type), ..., NULL)
+//
+//  This will then validate that the selector is defined and using the right
+//  type(s), this can help catch errors much earlier then waiting for the
+//  selector to actually fire (and in the case of error selectors, might never
+//  really be tested until in the field).
+//
+//  Copyright 2007-2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#if DEBUG
+
+#import <stdarg.h>
+#import "GTMDefines.h"
+
+static void GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments(id obj, SEL sel, const char *retType, ...) {
+
+  // verify that the object's selector is implemented with the proper
+  // number and type of arguments
+  va_list argList;
+  va_start(argList, retType);
+
+  if (obj && sel) {
+    // check that the selector is implemented
+    _GTMDevAssert([obj respondsToSelector:sel],
+                  @"\"%@\" selector \"%@\" is unimplemented or misnamed",
+                  NSStringFromClass([obj class]),
+                  NSStringFromSelector(sel));
+
+    const char *expectedArgType;
+    NSUInteger argCount = 2; // skip self and _cmd
+    NSMethodSignature *sig = [obj methodSignatureForSelector:sel];
+
+    // check that each expected argument is present and of the correct type
+    while ((expectedArgType = va_arg(argList, const char*)) != 0) {
+
+      if ([sig numberOfArguments] > argCount) {
+        const char *foundArgType = [sig getArgumentTypeAtIndex:argCount];
+
+        _GTMDevAssert(0 == strncmp(foundArgType, expectedArgType, strlen(expectedArgType)),
+                      @"\"%@\" selector \"%@\" argument %u should be type %s",
+                      NSStringFromClass([obj class]),
+                      NSStringFromSelector(sel),
+                      (uint32_t)(argCount - 2),
+                      expectedArgType);
+      }
+      argCount++;
+    }
+
+    // check that the proper number of arguments are present in the selector
+    _GTMDevAssert(argCount == [sig numberOfArguments],
+                  @"\"%@\" selector \"%@\" should have %u arguments",
+                  NSStringFromClass([obj class]),
+                  NSStringFromSelector(sel),
+                  (uint32_t)(argCount - 2));
+
+    // if asked, validate the return type
+    if (retType && (strcmp("gtm_skip_return_test", retType) != 0)) {
+      const char *foundRetType = [sig methodReturnType];
+      _GTMDevAssert(0 == strncmp(foundRetType, retType, strlen(retType)),
+                    @"\"%@\" selector \"%@\" return type should be type %s",
+                    NSStringFromClass([obj class]),
+                    NSStringFromSelector(sel),
+                    retType);
+    }
+  }
+
+  va_end(argList);
+}
+
+#define GTMAssertSelectorNilOrImplementedWithArguments(obj, sel, ...) \
+  GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments((obj), (sel), "gtm_skip_return_test", __VA_ARGS__)
+
+#else // DEBUG
+
+// make it go away if not debug
+#define GTMAssertSelectorNilOrImplementedWithReturnTypeAndArguments(obj, sel, retType, ...) do { } while (0)
+#define GTMAssertSelectorNilOrImplementedWithArguments(obj, sel, ...) do { } while (0)
+
+#endif // DEBUG

+ 44 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMDebugThreadValidation.h

@@ -0,0 +1,44 @@
+//
+//  GTMDebugThreadValidation.h
+//
+//  Copyright 2016 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import "GTMDefines.h"
+#import <Foundation/Foundation.h>
+
+// GTMCheckCurrentQueue, GTMIsCurrentQueue
+//
+// GTMCheckCurrentQueue takes a target queue and uses _GTMDevAssert to
+// report if that is not the currently executing queue.
+//
+// GTMIsCurrentQueue takes a target queue and returns true if the target queue
+// is the currently executing dispatch queue. This can be passed to another
+// assertion call in debug builds; it should never be used in release code.
+//
+// The dispatch queue must have a label.
+#define GTMCheckCurrentQueue(targetQueue)                    \
+  _GTMDevAssert(GTMIsCurrentQueue(targetQueue),              \
+                @"Current queue is %s (expected %s)",        \
+                _GTMQueueName(DISPATCH_CURRENT_QUEUE_LABEL), \
+                _GTMQueueName(targetQueue))
+
+#define GTMIsCurrentQueue(targetQueue)                 \
+  (strcmp(_GTMQueueName(DISPATCH_CURRENT_QUEUE_LABEL), \
+          _GTMQueueName(targetQueue)) == 0)
+
+#define _GTMQueueName(queue)                     \
+  (strlen(dispatch_queue_get_label(queue)) > 0 ? \
+    dispatch_queue_get_label(queue) : "unnamed")

+ 398 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMDefines.h

@@ -0,0 +1,398 @@
+//
+// GTMDefines.h
+//
+//  Copyright 2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+// ============================================================================
+
+#include <AvailabilityMacros.h>
+#include <TargetConditionals.h>
+
+#ifdef __OBJC__
+#include <Foundation/NSObjCRuntime.h>
+#endif  // __OBJC__
+
+#if TARGET_OS_IPHONE
+#include <Availability.h>
+#endif  // TARGET_OS_IPHONE
+
+// ----------------------------------------------------------------------------
+// CPP symbols that can be overridden in a prefix to control how the toolbox
+// is compiled.
+// ----------------------------------------------------------------------------
+
+
+// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and
+// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens
+// when a validation fails. If you implement your own validators, you may want
+// to control their internals using the same macros for consistency.
+#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT
+  #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0
+#endif
+
+// Ensure __has_feature and __has_extension are safe to use.
+// See http://clang-analyzer.llvm.org/annotations.html
+#ifndef __has_feature      // Optional.
+  #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#endif
+
+#ifndef __has_extension
+  #define __has_extension __has_feature // Compatibility with pre-3.0 compilers.
+#endif
+
+// Give ourselves a consistent way to do inlines.  Apple's macros even use
+// a few different actual definitions, so we're based off of the foundation
+// one.
+#if !defined(GTM_INLINE)
+  #if (defined (__GNUC__) && (__GNUC__ == 4)) || defined (__clang__)
+    #define GTM_INLINE static __inline__ __attribute__((always_inline))
+  #else
+    #define GTM_INLINE static __inline__
+  #endif
+#endif
+
+// Give ourselves a consistent way of doing externs that links up nicely
+// when mixing objc and objc++
+#if !defined (GTM_EXTERN)
+  #if defined __cplusplus
+    #define GTM_EXTERN extern "C"
+    #define GTM_EXTERN_C_BEGIN extern "C" {
+    #define GTM_EXTERN_C_END }
+  #else
+    #define GTM_EXTERN extern
+    #define GTM_EXTERN_C_BEGIN
+    #define GTM_EXTERN_C_END
+  #endif
+#endif
+
+// Give ourselves a consistent way of exporting things if we have visibility
+// set to hidden.
+#if !defined (GTM_EXPORT)
+  #define GTM_EXPORT __attribute__((visibility("default")))
+#endif
+
+// Give ourselves a consistent way of declaring something as unused. This
+// doesn't use __unused because that is only supported in gcc 4.2 and greater.
+#if !defined (GTM_UNUSED)
+#define GTM_UNUSED(x) ((void)(x))
+#endif
+
+// _GTMDevLog & _GTMDevAssert
+//
+// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for
+// developer level errors.  This implementation simply macros to NSLog/NSAssert.
+// It is not intended to be a general logging/reporting system.
+//
+// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert
+// for a little more background on the usage of these macros.
+//
+//    _GTMDevLog           log some error/problem in debug builds
+//    _GTMDevAssert        assert if condition isn't met w/in a method/function
+//                           in all builds.
+//
+// To replace this system, just provide different macro definitions in your
+// prefix header.  Remember, any implementation you provide *must* be thread
+// safe since this could be called by anything in what ever situtation it has
+// been placed in.
+//
+
+// Ignore the "Macro name is a reserved identifier" warning in this section
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreserved-id-macro"
+
+// We only define the simple macros if nothing else has defined this.
+#ifndef _GTMDevLog
+
+#ifdef DEBUG
+  #define _GTMDevLog(...) NSLog(__VA_ARGS__)
+#else
+  #define _GTMDevLog(...) do { } while (0)
+#endif
+
+#endif // _GTMDevLog
+
+#ifndef _GTMDevAssert
+// we directly invoke the NSAssert handler so we can pass on the varargs
+// (NSAssert doesn't have a macro we can use that takes varargs)
+#if !defined(NS_BLOCK_ASSERTIONS)
+  #define _GTMDevAssert(condition, ...)                                       \
+    do {                                                                      \
+      if (!(condition)) {                                                     \
+        [[NSAssertionHandler currentHandler]                                  \
+            handleFailureInFunction:(NSString *)                              \
+                                        [NSString stringWithUTF8String:__PRETTY_FUNCTION__] \
+                               file:(NSString *)[NSString stringWithUTF8String:__FILE__]  \
+                         lineNumber:__LINE__                                  \
+                        description:__VA_ARGS__];                             \
+      }                                                                       \
+    } while(0)
+#else // !defined(NS_BLOCK_ASSERTIONS)
+  #define _GTMDevAssert(condition, ...) do { } while (0)
+#endif // !defined(NS_BLOCK_ASSERTIONS)
+
+#endif // _GTMDevAssert
+
+// _GTMCompileAssert
+//
+// Note:  Software for current compilers should just use _Static_assert directly
+// instead of this macro.
+//
+// _GTMCompileAssert is an assert that is meant to fire at compile time if you
+// want to check things at compile instead of runtime. For example if you
+// want to check that a wchar is 4 bytes instead of 2 you would use
+// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X)
+// Note that the second "arg" is not in quotes, and must be a valid processor
+// symbol in it's own right (no spaces, punctuation etc).
+
+// Wrapping this in an #ifndef allows external groups to define their own
+// compile time assert scheme.
+#ifndef _GTMCompileAssert
+  #if __has_feature(c_static_assert) || __has_extension(c_static_assert)
+    #define _GTMCompileAssert(test, msg) _Static_assert((test), #msg)
+  #else
+    // Pre-Xcode 7 support.
+    //
+    // We got this technique from here:
+    // http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html
+    #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg
+    #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg)
+    #define _GTMCompileAssert(test, msg) \
+      typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ]
+  #endif  // __has_feature(c_static_assert) || __has_extension(c_static_assert)
+#endif // _GTMCompileAssert
+
+#pragma clang diagnostic pop
+
+// ----------------------------------------------------------------------------
+// CPP symbols defined based on the project settings so the GTM code has
+// simple things to test against w/o scattering the knowledge of project
+// setting through all the code.
+// ----------------------------------------------------------------------------
+
+// Provide a single constant CPP symbol that all of GTM uses for ifdefing
+// iPhone code.
+#if TARGET_OS_IPHONE // iPhone SDK
+  // For iPhone specific stuff
+  #define GTM_IPHONE_SDK 1
+  #if TARGET_IPHONE_SIMULATOR
+    #define GTM_IPHONE_DEVICE 0
+    #define GTM_IPHONE_SIMULATOR 1
+  #else
+    #define GTM_IPHONE_DEVICE 1
+    #define GTM_IPHONE_SIMULATOR 0
+  #endif  // TARGET_IPHONE_SIMULATOR
+  // By default, GTM has provided it's own unittesting support, define this
+  // to use the support provided by Xcode, especially for the Xcode4 support
+  // for unittesting.
+  #ifndef GTM_USING_XCTEST
+    #define GTM_USING_XCTEST 0
+  #endif
+  #define GTM_MACOS_SDK 0
+#else
+  // For MacOS specific stuff
+  #define GTM_MACOS_SDK 1
+  #define GTM_IPHONE_SDK 0
+  #define GTM_IPHONE_SIMULATOR 0
+  #define GTM_IPHONE_DEVICE 0
+  #ifndef GTM_USING_XCTEST
+    #define GTM_USING_XCTEST 0
+  #endif
+#endif
+
+// Some of our own availability macros
+#if GTM_MACOS_SDK
+#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE
+#define GTM_AVAILABLE_ONLY_ON_MACOS
+#else
+#define GTM_AVAILABLE_ONLY_ON_IPHONE
+#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE
+#endif
+
+// GC was dropped by Apple, define the old constant incase anyone still keys
+// off of it.
+#ifndef GTM_SUPPORT_GC
+  #define GTM_SUPPORT_GC 0
+#endif
+
+// Some support for advanced clang static analysis functionality
+#ifndef NS_RETURNS_RETAINED
+  #if __has_feature(attribute_ns_returns_retained)
+    #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
+  #else
+    #define NS_RETURNS_RETAINED
+  #endif
+#endif
+
+#ifndef NS_RETURNS_NOT_RETAINED
+  #if __has_feature(attribute_ns_returns_not_retained)
+    #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
+  #else
+    #define NS_RETURNS_NOT_RETAINED
+  #endif
+#endif
+
+#ifndef CF_RETURNS_RETAINED
+  #if __has_feature(attribute_cf_returns_retained)
+    #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
+  #else
+    #define CF_RETURNS_RETAINED
+  #endif
+#endif
+
+#ifndef CF_RETURNS_NOT_RETAINED
+  #if __has_feature(attribute_cf_returns_not_retained)
+    #define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
+  #else
+    #define CF_RETURNS_NOT_RETAINED
+  #endif
+#endif
+
+#ifndef NS_CONSUMED
+  #if __has_feature(attribute_ns_consumed)
+    #define NS_CONSUMED __attribute__((ns_consumed))
+  #else
+    #define NS_CONSUMED
+  #endif
+#endif
+
+#ifndef CF_CONSUMED
+  #if __has_feature(attribute_cf_consumed)
+    #define CF_CONSUMED __attribute__((cf_consumed))
+  #else
+    #define CF_CONSUMED
+  #endif
+#endif
+
+#ifndef NS_CONSUMES_SELF
+  #if __has_feature(attribute_ns_consumes_self)
+    #define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
+  #else
+    #define NS_CONSUMES_SELF
+  #endif
+#endif
+
+#ifndef GTM_NONNULL
+  #if defined(__has_attribute)
+    #if __has_attribute(nonnull)
+      #define GTM_NONNULL(x) __attribute__((nonnull x))
+    #else
+      #define GTM_NONNULL(x)
+    #endif
+  #else
+    #define GTM_NONNULL(x)
+  #endif
+#endif
+
+// Invalidates the initializer from which it's called.
+#ifndef GTMInvalidateInitializer
+  #if __has_feature(objc_arc)
+    #define GTMInvalidateInitializer() \
+      do { \
+        [self class]; /* Avoid warning of dead store to |self|. */ \
+        _GTMDevAssert(NO, @"Invalid initializer."); \
+        return nil; \
+      } while (0)
+  #else
+    #define GTMInvalidateInitializer() \
+      do { \
+        [self release]; \
+        _GTMDevAssert(NO, @"Invalid initializer."); \
+        return nil; \
+      } while (0)
+  #endif
+#endif
+
+#ifndef GTMCFAutorelease
+  // GTMCFAutorelease returns an id.  In contrast, Apple's CFAutorelease returns
+  // a CFTypeRef.
+  #if __has_feature(objc_arc)
+    #define GTMCFAutorelease(x) CFBridgingRelease(x)
+  #else
+    #define GTMCFAutorelease(x) ([(id)x autorelease])
+  #endif
+#endif
+
+#ifdef __OBJC__
+
+
+// Macro to allow you to create NSStrings out of other macros.
+// #define FOO foo
+// NSString *fooString = GTM_NSSTRINGIFY(FOO);
+#if !defined (GTM_NSSTRINGIFY)
+  #define GTM_NSSTRINGIFY_INNER(x) @#x
+  #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x)
+#endif
+
+// Macro to allow fast enumeration when building for 10.5 or later, and
+// reliance on NSEnumerator for 10.4.  Remember, NSDictionary w/ FastEnumeration
+// does keys, so pick the right thing, nothing is done on the FastEnumeration
+// side to be sure you're getting what you wanted.
+#ifndef GTM_FOREACH_OBJECT
+  #if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
+    #define GTM_FOREACH_ENUMEREE(element, enumeration) \
+      for (element in enumeration)
+    #define GTM_FOREACH_OBJECT(element, collection) \
+      for (element in collection)
+    #define GTM_FOREACH_KEY(element, collection) \
+      for (element in collection)
+  #else
+    #define GTM_FOREACH_ENUMEREE(element, enumeration) \
+      for (NSEnumerator *_ ## element ## _enum = enumeration; \
+           (element = [_ ## element ## _enum nextObject]) != nil; )
+    #define GTM_FOREACH_OBJECT(element, collection) \
+      GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator])
+    #define GTM_FOREACH_KEY(element, collection) \
+      GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator])
+  #endif
+#endif
+
+// ============================================================================
+
+// GTM_SEL_STRING is for specifying selector (usually property) names to KVC
+// or KVO methods.
+// In debug it will generate warnings for undeclared selectors if
+// -Wunknown-selector is turned on.
+// In release it will have no runtime overhead.
+#ifndef GTM_SEL_STRING
+  #ifdef DEBUG
+    #define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName))
+  #else
+    #define GTM_SEL_STRING(selName) @#selName
+  #endif  // DEBUG
+#endif  // GTM_SEL_STRING
+
+#ifndef GTM_WEAK
+#if __has_feature(objc_arc_weak)
+    // With ARC enabled, __weak means a reference that isn't implicitly
+    // retained.  __weak objects are accessed through runtime functions, so
+    // they are zeroed out, but this requires OS X 10.7+.
+    // At clang r251041+, ARC-style zeroing weak references even work in
+    // non-ARC mode.
+    #define GTM_WEAK __weak
+  #elif __has_feature(objc_arc)
+    // ARC, but targeting 10.6 or older, where zeroing weak references don't
+    // exist.
+    #define GTM_WEAK __unsafe_unretained
+  #else
+    // With manual reference counting, __weak used to be silently ignored.
+    // clang r251041 gives it the ARC semantics instead.  This means they
+    // now require a deployment target of 10.7, while some clients of GTM
+    // still target 10.6.  In these cases, expand to __unsafe_unretained instead
+    #define GTM_WEAK
+  #endif
+#endif
+
+#endif  // __OBJC__

+ 79 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMLocalizedString.h

@@ -0,0 +1,79 @@
+//
+//  GTMLocalizedString.h
+//
+//  Copyright (c) 2010 Google Inc. All rights reserved.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import <Foundation/Foundation.h>
+#import "GTMDefines.h"
+
+// The NSLocalizedString macros do not have NS_FORMAT_ARGUMENT modifiers put
+// on them which means you get warnings on Snow Leopard with when
+// GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES and you do things like:
+// NSString *foo
+//   = [NSString stringWithFormat:NSLocalizedString(@"blah %@", nil), @"bar"];
+// The GTMLocalizedString functions fix that for you so you can do:
+// NSString *foo
+//   = [NSString stringWithFormat:GTMLocalizedString(@"blah %@", nil), @"bar"];
+// and you will compile cleanly.
+// If you use genstrings you can call it with
+// genstrings -s GTMLocalizedString ...
+// and it should work as expected.
+// You can override how GTM gets its localized strings (if you are using
+// something other than NSLocalizedString) by redefining
+// GTMLocalizedStringWithDefaultValueInternal.
+
+#ifndef GTMLocalizedStringWithDefaultValueInternal
+  #define GTMLocalizedStringWithDefaultValueInternal \
+      NSLocalizedStringWithDefaultValue
+#endif
+
+GTM_INLINE NS_FORMAT_ARGUMENT(1) NSString *GTMLocalizedString(
+    NSString *key,  NSString *comment) {
+  return GTMLocalizedStringWithDefaultValueInternal(key,
+                                                    nil,
+                                                    [NSBundle mainBundle],
+                                                    @"",
+                                                    comment);
+}
+
+GTM_INLINE NS_FORMAT_ARGUMENT(1) NSString *GTMLocalizedStringFromTable(
+    NSString *key, NSString *tableName, NSString *comment) {
+  return GTMLocalizedStringWithDefaultValueInternal(key,
+                                                    tableName,
+                                                    [NSBundle mainBundle],
+                                                    @"",
+                                                    comment);
+}
+
+GTM_INLINE NS_FORMAT_ARGUMENT(1) NSString *GTMLocalizedStringFromTableInBundle(
+    NSString *key,  NSString *tableName, NSBundle *bundle, NSString *comment) {
+  return GTMLocalizedStringWithDefaultValueInternal(key,
+                                                    tableName,
+                                                    bundle,
+                                                    @"",
+                                                    comment);
+}
+
+GTM_INLINE NS_FORMAT_ARGUMENT(1) NSString *GTMLocalizedStringWithDefaultValue(
+    NSString *key, NSString *tableName, NSBundle *bundle, NSString *value,
+    NSString *comment) {
+  return GTMLocalizedStringWithDefaultValueInternal(key,
+                                                    tableName,
+                                                    bundle,
+                                                    value,
+                                                    comment);
+}
+

+ 508 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMLogger.h

@@ -0,0 +1,508 @@
+//
+//  GTMLogger.h
+//
+//  Copyright 2007-2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+// Key Abstractions
+// ----------------
+//
+// This file declares multiple classes and protocols that are used by the
+// GTMLogger logging system. The 4 main abstractions used in this file are the
+// following:
+//
+//   * logger (GTMLogger) - The main logging class that users interact with. It
+//   has methods for logging at different levels and uses a log writer, a log
+//   formatter, and a log filter to get the job done.
+//
+//   * log writer (GTMLogWriter) - Writes a given string to some log file, where
+//   a "log file" can be a physical file on disk, a POST over HTTP to some URL,
+//   or even some in-memory structure (e.g., a ring buffer).
+//
+//   * log formatter (GTMLogFormatter) - Given a format string and arguments as
+//   a va_list, returns a single formatted NSString. A "formatted string" could
+//   be a string with the date prepended, a string with values in a CSV format,
+//   or even a string of XML.
+//
+//   * log filter (GTMLogFilter) - Given a formatted log message as an NSString
+//   and the level at which the message is to be logged, this class will decide
+//   whether the given message should be logged or not. This is a flexible way
+//   to filter out messages logged at a certain level, messages that contain
+//   certain text, or filter nothing out at all. This gives the caller the
+//   flexibility to dynamically enable debug logging in Release builds.
+//
+// This file also declares some classes to handle the common log writer, log
+// formatter, and log filter cases. Callers can also create their own writers,
+// formatters, and filters and they can even build them on top of the ones
+// declared here. Keep in mind that your custom writer/formatter/filter may be
+// called from multiple threads, so it must be thread-safe.
+
+#import <Foundation/Foundation.h>
+#import "GTMDefines.h"
+
+// Predeclaration of used protocols that are declared later in this file.
+@protocol GTMLogWriter, GTMLogFormatter, GTMLogFilter;
+
+// GTMLogger
+//
+// GTMLogger is the primary user-facing class for an object-oriented logging
+// system. It is built on the concept of log formatters (GTMLogFormatter), log
+// writers (GTMLogWriter), and log filters (GTMLogFilter). When a message is
+// sent to a GTMLogger to log a message, the message is formatted using the log
+// formatter, then the log filter is consulted to see if the message should be
+// logged, and if so, the message is sent to the log writer to be written out.
+//
+// GTMLogger is intended to be a flexible and thread-safe logging solution. Its
+// flexibility comes from the fact that GTMLogger instances can be customized
+// with user defined formatters, filters, and writers. And these writers,
+// filters, and formatters can be combined, stacked, and customized in arbitrary
+// ways to suit the needs at hand. For example, multiple writers can be used at
+// the same time, and a GTMLogger instance can even be used as another
+// GTMLogger's writer. This allows for arbitrarily deep logging trees.
+//
+// A standard GTMLogger uses a writer that sends messages to standard out, a
+// formatter that smacks a timestamp and a few other bits of interesting
+// information on the message, and a filter that filters out debug messages from
+// release builds. Using the standard log settings, a log message will look like
+// the following:
+//
+//   2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] foo=<Foo: 0x123>
+//
+// The output contains the date and time of the log message, the name of the
+// process followed by its process ID/thread ID, the log level at which the
+// message was logged (in the previous example the level was 1:
+// kGTMLoggerLevelDebug), and finally, the user-specified log message itself (in
+// this case, the log message was @"foo=%@", foo).
+//
+// Multiple instances of GTMLogger can be created, each configured their own
+// way.  Though GTMLogger is not a singleton (in the GoF sense), it does provide
+// access to a shared (i.e., globally accessible) GTMLogger instance. This makes
+// it convenient for all code in a process to use the same GTMLogger instance.
+// The shared GTMLogger instance can also be configured in an arbitrary, and
+// these configuration changes will affect all code that logs through the shared
+// instance.
+
+//
+// Log Levels
+// ----------
+// GTMLogger has 3 different log levels: Debug, Info, and Error. GTMLogger
+// doesn't take any special action based on the log level; it simply forwards
+// this information on to formatters, filters, and writers, each of which may
+// optionally take action based on the level. Since log level filtering is
+// performed at runtime, log messages are typically not filtered out at compile
+// time.  The exception to this rule is that calls to the GTMLoggerDebug() macro
+// *ARE* filtered out of non-DEBUG builds. This is to be backwards compatible
+// with behavior that many developers are currently used to. Note that this
+// means that GTMLoggerDebug(@"hi") will be compiled out of Release builds, but
+// [[GTMLogger sharedLogger] logDebug:@"hi"] will NOT be compiled out.
+//
+// Standard loggers are created with the GTMLogLevelFilter log filter, which
+// filters out certain log messages based on log level, and some other settings.
+//
+// In addition to the -logDebug:, -logInfo:, and -logError: methods defined on
+// GTMLogger itself, there are also C macros that make usage of the shared
+// GTMLogger instance very convenient. These macros are:
+//
+//   GTMLoggerDebug(...)
+//   GTMLoggerInfo(...)
+//   GTMLoggerError(...)
+//
+// Again, a notable feature of these macros is that GTMLogDebug() calls *will be
+// compiled out of non-DEBUG builds*.
+//
+// Standard Loggers
+// ----------------
+// GTMLogger has the concept of "standard loggers". A standard logger is simply
+// a logger that is pre-configured with some standard/common writer, formatter,
+// and filter combination. Standard loggers are created using the creation
+// methods beginning with "standard". The alternative to a standard logger is a
+// regular logger, which will send messages to stdout, with no special
+// formatting, and no filtering.
+//
+// How do I use GTMLogger?
+// ----------------------
+// The typical way you will want to use GTMLogger is to simply use the
+// GTMLogger*() macros for logging from code. That way we can easily make
+// changes to the GTMLogger class and simply update the macros accordingly. Only
+// your application startup code (perhaps, somewhere in main()) should use the
+// GTMLogger class directly in order to configure the shared logger, which all
+// of the code using the macros will be using. Again, this is just the typical
+// situation.
+//
+// To be complete, there are cases where you may want to use GTMLogger directly,
+// or even create separate GTMLogger instances for some reason. That's fine,
+// too.
+//
+// Examples
+// --------
+// The following show some common GTMLogger use cases.
+//
+// 1. You want to log something as simply as possible. Also, this call will only
+//    appear in debug builds. In non-DEBUG builds it will be completely removed.
+//
+//      GTMLoggerDebug(@"foo = %@", foo);
+//
+// 2. The previous example is similar to the following. The major difference is
+//    that the previous call (example 1) will be compiled out of Release builds
+//    but this statement will not be compiled out.
+//
+//      [[GTMLogger sharedLogger] logDebug:@"foo = %@", foo];
+//
+// 3. Send all logging output from the shared logger to a file. We do this by
+//    creating an NSFileHandle for writing associated with a file, and setting
+//    that file handle as the logger's writer.
+//
+//      NSFileHandle *f = [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log"
+//                                                          create:YES];
+//      [[GTMLogger sharedLogger] setWriter:f];
+//      GTMLoggerError(@"hi");  // This will be sent to /tmp/f.log
+//
+// 4. Create a new GTMLogger that will log to a file. This example differs from
+//    the previous one because here we create a new GTMLogger that is different
+//    from the shared logger.
+//
+//      GTMLogger *logger = [GTMLogger standardLoggerWithPath:@"/tmp/temp.log"];
+//      [logger logInfo:@"hi temp log file"];
+//
+// 5. Create a logger that writes to stdout and does NOT do any formatting to
+//    the log message. This might be useful, for example, when writing a help
+//    screen for a command-line tool to standard output.
+//
+//      GTMLogger *logger = [GTMLogger logger];
+//      [logger logInfo:@"%@ version 0.1 usage", progName];
+//
+// 6. Send log output to stdout AND to a log file. The trick here is that
+//    NSArrays function as composite log writers, which means when an array is
+//    set as the log writer, it forwards all logging messages to all of its
+//    contained GTMLogWriters.
+//
+//      // Create array of GTMLogWriters
+//      NSArray *writers = [NSArray arrayWithObjects:
+//          [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log" create:YES],
+//          [NSFileHandle fileHandleWithStandardOutput], nil];
+//
+//      GTMLogger *logger = [GTMLogger standardLogger];
+//      [logger setWriter:writers];
+//      [logger logInfo:@"hi"];  // Output goes to stdout and /tmp/f.log
+//
+// For futher details on log writers, formatters, and filters, see the
+// documentation below.
+//
+// NOTE: GTMLogger is application level logging.  By default it does nothing
+// with _GTMDevLog/_GTMDevAssert (see GTMDefines.h).  An application can choose
+// to bridge _GTMDevLog/_GTMDevAssert to GTMLogger by providing macro
+// definitions in its prefix header (see GTMDefines.h for how one would do
+// that).
+//
+@interface GTMLogger : NSObject {
+ @private
+  id<GTMLogWriter> writer_;
+  id<GTMLogFormatter> formatter_;
+  id<GTMLogFilter> filter_;
+}
+
+//
+// Accessors for the shared logger instance
+//
+
+// Returns a shared/global standard GTMLogger instance. Callers should typically
+// use this method to get a GTMLogger instance, unless they explicitly want
+// their own instance to configure for their own needs. This is the only method
+// that returns a shared instance; all the rest return new GTMLogger instances.
++ (id)sharedLogger;
+
+// Sets the shared logger instance to |logger|. Future calls to +sharedLogger
+// will return |logger| instead.
++ (void)setSharedLogger:(GTMLogger *)logger;
+
+//
+// Creation methods
+//
+
+// Returns a new autoreleased GTMLogger instance that will log to stdout, using
+// the GTMLogStandardFormatter, and the GTMLogLevelFilter filter.
++ (id)standardLogger;
+
+// Same as +standardLogger, but logs to stderr.
++ (id)standardLoggerWithStderr;
+
+// Same as +standardLogger but levels >= kGTMLoggerLevelError are routed to
+// stderr, everything else goes to stdout.
++ (id)standardLoggerWithStdoutAndStderr;
+
+// Returns a new standard GTMLogger instance with a log writer that will
+// write to the file at |path|, and will use the GTMLogStandardFormatter and
+// GTMLogLevelFilter classes. If |path| does not exist, it will be created.
++ (id)standardLoggerWithPath:(NSString *)path;
+
+// Returns an autoreleased GTMLogger instance that will use the specified
+// |writer|, |formatter|, and |filter|.
++ (id)loggerWithWriter:(id<GTMLogWriter>)writer
+             formatter:(id<GTMLogFormatter>)formatter
+                filter:(id<GTMLogFilter>)filter;
+
+// Returns an autoreleased GTMLogger instance that logs to stdout, with the
+// basic formatter, and no filter. The returned logger differs from the logger
+// returned by +standardLogger because this one does not do any filtering and
+// does not do any special log formatting; this is the difference between a
+// "regular" logger and a "standard" logger.
++ (id)logger;
+
+// Designated initializer. This method returns a GTMLogger initialized with the
+// specified |writer|, |formatter|, and |filter|. See the setter methods below
+// for what values will be used if nil is passed for a parameter.
+- (id)initWithWriter:(id<GTMLogWriter>)writer
+           formatter:(id<GTMLogFormatter>)formatter
+              filter:(id<GTMLogFilter>)filter;
+
+//
+// Logging  methods
+//
+
+// Logs a message at the debug level (kGTMLoggerLevelDebug).
+- (void)logDebug:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2);
+// Logs a message at the info level (kGTMLoggerLevelInfo).
+- (void)logInfo:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2);
+// Logs a message at the error level (kGTMLoggerLevelError).
+- (void)logError:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2);
+// Logs a message at the assert level (kGTMLoggerLevelAssert).
+- (void)logAssert:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2);
+
+
+//
+// Accessors
+//
+
+// Accessor methods for the log writer. If the log writer is set to nil,
+// [NSFileHandle fileHandleWithStandardOutput] is used.
+- (id<GTMLogWriter>)writer;
+- (void)setWriter:(id<GTMLogWriter>)writer;
+
+// Accessor methods for the log formatter. If the log formatter is set to nil,
+// GTMLogBasicFormatter is used. This formatter will format log messages in a
+// plain printf style.
+- (id<GTMLogFormatter>)formatter;
+- (void)setFormatter:(id<GTMLogFormatter>)formatter;
+
+// Accessor methods for the log filter. If the log filter is set to nil,
+// GTMLogNoFilter is used, which allows all log messages through.
+- (id<GTMLogFilter>)filter;
+- (void)setFilter:(id<GTMLogFilter>)filter;
+
+@end  // GTMLogger
+
+
+// Helper functions that are used by the convenience GTMLogger*() macros that
+// enable the logging of function names.
+@interface GTMLogger (GTMLoggerMacroHelpers)
+- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ...
+  NS_FORMAT_FUNCTION(2, 3);
+- (void)logFuncInfo:(const char *)func msg:(NSString *)fmt, ...
+  NS_FORMAT_FUNCTION(2, 3);
+- (void)logFuncError:(const char *)func msg:(NSString *)fmt, ...
+  NS_FORMAT_FUNCTION(2, 3);
+- (void)logFuncAssert:(const char *)func msg:(NSString *)fmt, ...
+  NS_FORMAT_FUNCTION(2, 3);
+@end  // GTMLoggerMacroHelpers
+
+
+// The convenience macros are only defined if they haven't already been defined.
+#ifndef GTMLoggerInfo
+
+// Convenience macros that log to the shared GTMLogger instance. These macros
+// are how users should typically log to GTMLogger. Notice that GTMLoggerDebug()
+// calls will be compiled out of non-Debug builds.
+#define GTMLoggerDebug(...)  \
+  [[GTMLogger sharedLogger] logFuncDebug:__func__ msg:__VA_ARGS__]
+#define GTMLoggerInfo(...)   \
+  [[GTMLogger sharedLogger] logFuncInfo:__func__ msg:__VA_ARGS__]
+#define GTMLoggerError(...)  \
+  [[GTMLogger sharedLogger] logFuncError:__func__ msg:__VA_ARGS__]
+#define GTMLoggerAssert(...) \
+  [[GTMLogger sharedLogger] logFuncAssert:__func__ msg:__VA_ARGS__]
+
+// If we're not in a debug build, remove the GTMLoggerDebug statements. This
+// makes calls to GTMLoggerDebug "compile out" of Release builds
+#ifndef DEBUG
+#undef GTMLoggerDebug
+#define GTMLoggerDebug(...) do {} while(0)
+#endif
+
+#endif  // !defined(GTMLoggerInfo)
+
+// Log levels.
+typedef enum {
+  kGTMLoggerLevelUnknown,
+  kGTMLoggerLevelDebug,
+  kGTMLoggerLevelInfo,
+  kGTMLoggerLevelError,
+  kGTMLoggerLevelAssert,
+} GTMLoggerLevel;
+
+
+//
+//   Log Writers
+//
+
+// Protocol to be implemented by a GTMLogWriter instance.
+@protocol GTMLogWriter <NSObject>
+// Writes the given log message to where the log writer is configured to write.
+- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level;
+@end  // GTMLogWriter
+
+
+// Simple category on NSFileHandle that makes NSFileHandles valid log writers.
+// This is convenient because something like, say, +fileHandleWithStandardError
+// now becomes a valid log writer. Log messages are written to the file handle
+// with a newline appended.
+@interface NSFileHandle (GTMFileHandleLogWriter) <GTMLogWriter>
+// Opens the file at |path| in append mode, and creates the file with |mode|
+// if it didn't previously exist.
++ (id)fileHandleForLoggingAtPath:(NSString *)path mode:(mode_t)mode;
+@end  // NSFileHandle
+
+
+// This category makes NSArray a GTMLogWriter that can be composed of other
+// GTMLogWriters. This is the classic Composite GoF design pattern. When the
+// GTMLogWriter -logMessage:level: message is sent to the array, the array
+// forwards the message to all of its elements that implement the GTMLogWriter
+// protocol.
+//
+// This is useful in situations where you would like to send log output to
+// multiple log writers at the same time. Simply create an NSArray of the log
+// writers you wish to use, then set the array as the "writer" for your
+// GTMLogger instance.
+@interface NSArray (GTMArrayCompositeLogWriter) <GTMLogWriter>
+@end  // GTMArrayCompositeLogWriter
+
+
+// This category adapts the GTMLogger interface so that it can be used as a log
+// writer; it's an "adapter" in the GoF Adapter pattern sense.
+//
+// This is useful when you want to configure a logger to log to a specific
+// writer with a specific formatter and/or filter. But you want to also compose
+// that with a different log writer that may have its own formatter and/or
+// filter.
+@interface GTMLogger (GTMLoggerLogWriter) <GTMLogWriter>
+@end  // GTMLoggerLogWriter
+
+
+//
+//   Log Formatters
+//
+
+// Protocol to be implemented by a GTMLogFormatter instance.
+@protocol GTMLogFormatter <NSObject>
+// Returns a formatted string using the format specified in |fmt| and the va
+// args specified in |args|.
+- (NSString *)stringForFunc:(NSString *)func
+                 withFormat:(NSString *)fmt
+                     valist:(va_list)args
+                      level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0);
+@end  // GTMLogFormatter
+
+
+// A basic log formatter that formats a string the same way that NSLog (or
+// printf) would. It does not do anything fancy, nor does it add any data of its
+// own.
+@interface GTMLogBasicFormatter : NSObject <GTMLogFormatter>
+
+// Helper method for prettying C99 __func__ and GCC __PRETTY_FUNCTION__
+- (NSString *)prettyNameForFunc:(NSString *)func;
+
+@end  // GTMLogBasicFormatter
+
+
+// A log formatter that formats the log string like the basic formatter, but
+// also prepends a timestamp and some basic process info to the message, as
+// shown in the following sample output.
+//   2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] log mesage here
+@interface GTMLogStandardFormatter : GTMLogBasicFormatter {
+ @private
+  NSDateFormatter *dateFormatter_;  // yyyy-MM-dd HH:mm:ss.SSS
+  NSString *pname_;
+  pid_t pid_;
+}
+@end  // GTMLogStandardFormatter
+
+
+//
+//   Log Filters
+//
+
+// Protocol to be implemented by a GTMLogFilter instance.
+@protocol GTMLogFilter <NSObject>
+// Returns YES if |msg| at |level| should be logged; NO otherwise.
+- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level;
+@end  // GTMLogFilter
+
+
+// A log filter that filters messages at the kGTMLoggerLevelDebug level out of
+// non-debug builds. Messages at the kGTMLoggerLevelInfo level are also filtered
+// out of non-debug builds unless GTMVerboseLogging is set in the environment or
+// the processes's defaults. Messages at the kGTMLoggerLevelError level are
+// never filtered.
+@interface GTMLogLevelFilter : NSObject <GTMLogFilter> {
+ @private
+  BOOL verboseLoggingEnabled_;
+  NSUserDefaults *userDefaults_;
+}
+@end  // GTMLogLevelFilter
+
+// A simple log filter that does NOT filter anything out;
+// -filterAllowsMessage:level will always return YES. This can be a convenient
+// way to enable debug-level logging in release builds (if you so desire).
+@interface GTMLogNoFilter : NSObject <GTMLogFilter>
+@end  // GTMLogNoFilter
+
+
+// Base class for custom level filters. Not for direct use, use the minimum
+// or maximum level subclasses below.
+@interface GTMLogAllowedLevelFilter : NSObject <GTMLogFilter> {
+ @private
+  NSIndexSet *allowedLevels_;
+}
+@end
+
+// A log filter that allows you to set a minimum log level. Messages below this
+// level will be filtered.
+@interface GTMLogMininumLevelFilter : GTMLogAllowedLevelFilter
+
+// Designated initializer, logs at levels < |level| will be filtered.
+- (id)initWithMinimumLevel:(GTMLoggerLevel)level;
+
+@end
+
+// A log filter that allows you to set a maximum log level. Messages whose level
+// exceeds this level will be filtered. This is really only useful if you have
+// a composite GTMLogger that is sending the other messages elsewhere.
+@interface GTMLogMaximumLevelFilter : GTMLogAllowedLevelFilter
+
+// Designated initializer, logs at levels > |level| will be filtered.
+- (id)initWithMaximumLevel:(GTMLoggerLevel)level;
+
+@end
+
+
+// For subclasses only
+@interface GTMLogger (PrivateMethods)
+
+- (void)logInternalFunc:(const char *)func
+                 format:(NSString *)fmt
+                 valist:(va_list)args
+                  level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0);
+
+@end
+

+ 69 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMMethodCheck.h

@@ -0,0 +1,69 @@
+//
+//  GTMMethodCheck.h
+//
+//  Copyright 2006-2016 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import <Foundation/Foundation.h>
+#import <stdio.h>
+#import <sysexits.h>
+
+/// A macro for enforcing debug time checks to make sure all required methods are linked in
+//
+// When using categories, it can be very easy to forget to include the
+// implementation of a category.
+// Let's say you had a class foo that depended on method bar of class baz, and
+// method bar was implemented as a member of a category.
+// You could add the following code:
+//
+// GTM_METHOD_CHECK(baz, bar)
+//
+// and the code would check to make sure baz was implemented just before main
+// was called. This works for both dynamic libraries, and executables.
+//
+//
+// This is not compiled into release builds.
+
+#ifdef DEBUG
+
+// This is the "magic".
+// A) we need a multi layer define here so that the preprocessor expands
+//    __LINE__ the way we want it. We need __LINE__ so that each of our
+//    GTM_METHOD_CHECKs generates a unique function name.
+#define GTM_METHOD_CHECK(class, method) GTM_METHOD_CHECK_INNER(class, method, __LINE__)
+#define GTM_METHOD_CHECK_INNER(class, method, line) \
+    GTM_METHOD_CHECK_INNER_INNER(class, method, line)
+
+// B) define a function that is called at startup to check that |class| has an
+//    implementation for |method| (either a class method or an instance method).
+#define GTM_METHOD_CHECK_INNER_INNER(class, method, line) \
+__attribute__ ((constructor, visibility("hidden"))) \
+    static void xxGTMMethodCheckMethod ## class ## line () { \
+  @autoreleasepool { \
+    if (![class instancesRespondToSelector:@selector(method)] \
+        && ![class respondsToSelector:@selector(method)]) { \
+      fprintf(stderr, "%s:%d: error: We need method '%s' to be linked in for class '%s'\n", \
+              __FILE__, line, #method, #class); \
+      exit(EX_SOFTWARE); \
+    } \
+  } \
+}
+
+#else  // DEBUG
+
+// Do nothing in release.
+#define GTM_METHOD_CHECK(class, method)
+
+#endif  // DEBUG

+ 199 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMNSData+zlib.h

@@ -0,0 +1,199 @@
+//
+//  GTMNSData+zlib.h
+//
+//  Copyright 2007-2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import <Foundation/Foundation.h>
+#import "GTMDefines.h"
+
+/// Helpers for dealing w/ zlib inflate/deflate calls.
+@interface NSData (GTMZLibAdditions)
+
+// NOTE: For 64bit, none of these apis handle input sizes >32bits, they will
+// return nil when given such data.  To handle data of that size you really
+// should be streaming it rather then doing it all in memory.
+
+#pragma mark Gzip Compression
+
+/// Return an autoreleased NSData w/ the result of gzipping the bytes.
+//
+//  Uses the default compression level.
++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes
+                             length:(NSUInteger)length;
++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes
+                             length:(NSUInteger)length
+                              error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of gzipping the payload of |data|.
+//
+//  Uses the default compression level.
++ (NSData *)gtm_dataByGzippingData:(NSData *)data __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByGzippingData:(NSData *)data
+                             error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of gzipping the bytes using |level| compression level.
+//
+// |level| can be 1-9, any other values will be clipped to that range.
++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes
+                             length:(NSUInteger)length
+                   compressionLevel:(int)level __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes
+                             length:(NSUInteger)length
+                   compressionLevel:(int)level
+                              error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of gzipping the payload of |data| using |level| compression level.
++ (NSData *)gtm_dataByGzippingData:(NSData *)data
+                  compressionLevel:(int)level __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByGzippingData:(NSData *)data
+                  compressionLevel:(int)level
+                             error:(NSError **)error;
+
+#pragma mark Zlib "Stream" Compression
+
+// NOTE: deflate is *NOT* gzip.  deflate is a "zlib" stream.  pick which one
+// you really want to create.  (the inflate api will handle either)
+
+/// Return an autoreleased NSData w/ the result of deflating the bytes.
+//
+//  Uses the default compression level.
++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes
+                              length:(NSUInteger)length __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes
+                              length:(NSUInteger)length
+                               error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of deflating the payload of |data|.
+//
+//  Uses the default compression level.
++ (NSData *)gtm_dataByDeflatingData:(NSData *)data __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByDeflatingData:(NSData *)data
+                              error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of deflating the bytes using |level| compression level.
+//
+// |level| can be 1-9, any other values will be clipped to that range.
++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes
+                              length:(NSUInteger)length
+                    compressionLevel:(int)level __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes
+                              length:(NSUInteger)length
+                    compressionLevel:(int)level
+                               error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of deflating the payload of |data| using |level| compression level.
++ (NSData *)gtm_dataByDeflatingData:(NSData *)data
+                   compressionLevel:(int)level __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByDeflatingData:(NSData *)data
+                   compressionLevel:(int)level
+                              error:(NSError **)error;
+
+#pragma mark Uncompress of Gzip or Zlib
+
+/// Return an autoreleased NSData w/ the result of decompressing the bytes.
+//
+// The bytes to decompress can be zlib or gzip payloads.
++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes
+                              length:(NSUInteger)length __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes
+                              length:(NSUInteger)length
+                               error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of decompressing the payload of |data|.
+//
+// The data to decompress can be zlib or gzip payloads.
++ (NSData *)gtm_dataByInflatingData:(NSData *)data __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByInflatingData:(NSData *)data
+                              error:(NSError **)error;
+
+#pragma mark "Raw" Compression Support
+
+// NOTE: raw deflate is *NOT* gzip or deflate.  it does not include a header
+// of any form and should only be used within streams here an external crc/etc.
+// is done to validate the data.  The RawInflate apis can be used on data
+// processed like this.
+
+/// Return an autoreleased NSData w/ the result of *raw* deflating the bytes.
+//
+//  Uses the default compression level.
+//  *No* header is added to the resulting data.
++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes
+                                 length:(NSUInteger)length __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes
+                                 length:(NSUInteger)length
+                                  error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of *raw* deflating the payload of |data|.
+//
+//  Uses the default compression level.
+//  *No* header is added to the resulting data.
++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data
+                                 error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of *raw* deflating the bytes using |level| compression level.
+//
+// |level| can be 1-9, any other values will be clipped to that range.
+//  *No* header is added to the resulting data.
++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes
+                                 length:(NSUInteger)length
+                       compressionLevel:(int)level __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes
+                                 length:(NSUInteger)length
+                       compressionLevel:(int)level
+                                  error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of *raw* deflating the payload of |data| using |level| compression level.
+//  *No* header is added to the resulting data.
++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data
+                      compressionLevel:(int)level __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data
+                      compressionLevel:(int)level
+                                 error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of *raw* decompressing the bytes.
+//
+// The data to decompress, it should *not* have any header (zlib nor gzip).
++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes
+                                 length:(NSUInteger)length __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes
+                                 length:(NSUInteger)length
+                                  error:(NSError **)error;
+
+/// Return an autoreleased NSData w/ the result of *raw* decompressing the payload of |data|.
+//
+// The data to decompress, it should *not* have any header (zlib nor gzip).
++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data __attribute__((deprecated("Use error variant")));
++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data
+                                 error:(NSError **)error;
+
+@end
+
+FOUNDATION_EXPORT NSString *const GTMNSDataZlibErrorDomain;
+FOUNDATION_EXPORT NSString *const GTMNSDataZlibErrorKey;  // NSNumber
+FOUNDATION_EXPORT NSString *const GTMNSDataZlibRemainingBytesKey;  // NSNumber
+
+typedef NS_ENUM(NSInteger, GTMNSDataZlibError) {
+  GTMNSDataZlibErrorGreaterThan32BitsToCompress = 1024,
+  // An internal zlib error.
+  // GTMNSDataZlibErrorKey will contain the error value.
+  // NSLocalizedDescriptionKey may contain an error string from zlib.
+  // Look in zlib.h for list of errors.
+  GTMNSDataZlibErrorInternal,
+  // There was left over data in the buffer that was not used.
+  // GTMNSDataZlibRemainingBytesKey will contain number of remaining bytes.
+  GTMNSDataZlibErrorDataRemaining
+};

+ 40 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMNSDictionary+URLArguments.h

@@ -0,0 +1,40 @@
+//
+//  GTMNSDictionary+URLArguments.h
+//
+//  Copyright 2006-2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import <Foundation/Foundation.h>
+
+/// Utility for building a URL or POST argument string.
+@interface NSDictionary (GTMNSDictionaryURLArgumentsAdditions)
+
+/// Returns a dictionary of the decoded key-value pairs in a http arguments
+/// string of the form key1=value1&key2=value2&...&keyN=valueN.
+/// Keys and values will be unescaped automatically.
+/// Only the first value for a repeated key is returned.
+///
+/// NOTE: Apps targeting iOS 8 or OS X 10.10 and later should use
+///       NSURLComponents and NSURLQueryItem to create URLs with
+///       query arguments instead of using these category methods.
++ (NSDictionary *)gtm_dictionaryWithHttpArgumentsString:(NSString *)argString;
+
+/// Gets a string representation of the dictionary in the form
+/// key1=value1&key2=value2&...&keyN=valueN, suitable for use as either
+/// URL arguments (after a '?') or POST body. Keys and values will be escaped
+/// automatically, so should be unescaped in the dictionary.
+- (NSString *)gtm_httpArgumentsString;
+
+@end

+ 45 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMNSString+URLArguments.h

@@ -0,0 +1,45 @@
+//
+//  GTMNSString+URLArguments.h
+//
+//  Copyright 2006-2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import <Foundation/Foundation.h>
+
+/// Utilities for encoding and decoding URL arguments.
+@interface NSString (GTMNSStringURLArgumentsAdditions)
+
+/// Returns a string that is escaped properly to be a URL argument.
+///
+/// This differs from stringByAddingPercentEscapesUsingEncoding: in that it
+/// will escape all the reserved characters (per RFC 3986
+/// <http://www.ietf.org/rfc/rfc3986.txt>) which
+/// stringByAddingPercentEscapesUsingEncoding would leave.
+///
+/// This will also escape '%', so this should not be used on a string that has
+/// already been escaped unless double-escaping is the desired result.
+///
+/// NOTE: Apps targeting iOS 8 or OS X 10.10 and later should use
+///       NSURLComponents and NSURLQueryItem to create properly-escaped
+///       URLs instead of using these category methods.
+- (NSString*)gtm_stringByEscapingForURLArgument;
+
+/// Returns the unescaped version of a URL argument
+///
+/// This has the same behavior as stringByReplacingPercentEscapesUsingEncoding:,
+/// except that it will also convert '+' to space.
+- (NSString*)gtm_stringByUnescapingFromURLArgument;
+
+@end

+ 112 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMStringEncoding.h

@@ -0,0 +1,112 @@
+//
+//  GTMStringEncoding.h
+//
+//  Copyright 2010 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import <Foundation/Foundation.h>
+#import "GTMDefines.h"
+
+// A generic class for arbitrary base-2 to 128 string encoding and decoding.
+@interface GTMStringEncoding : NSObject {
+ @private
+  NSData *charMapData_;
+  char *charMap_;
+  int reverseCharMap_[128];
+  int shift_;
+  int mask_;
+  BOOL doPad_;
+  char paddingChar_;
+  int padLen_;
+}
+
+// Create a new, autoreleased GTMStringEncoding object with a standard encoding.
++ (id)binaryStringEncoding;
++ (id)hexStringEncoding;
++ (id)rfc4648Base32StringEncoding;
++ (id)rfc4648Base32HexStringEncoding;
++ (id)crockfordBase32StringEncoding;
++ (id)rfc4648Base64StringEncoding;
++ (id)rfc4648Base64WebsafeStringEncoding;
+
+// Create a new, autoreleased GTMStringEncoding object with the given string,
+// as described below.
++ (id)stringEncodingWithString:(NSString *)string;
+
+// Initialize a new GTMStringEncoding object with the string.
+//
+// The length of the string must be a power of 2, at least 2 and at most 128.
+// Only 7-bit ASCII characters are permitted in the string.
+//
+// These characters are the canonical set emitted during encoding.
+// If the characters have alternatives (e.g. case, easily transposed) then use
+// addDecodeSynonyms: to configure them.
+- (id)initWithString:(NSString *)string;
+
+// Add decoding synonyms as specified in the synonyms argument.
+//
+// It should be a sequence of one previously reverse mapped character,
+// followed by one or more non-reverse mapped character synonyms.
+// Only 7-bit ASCII characters are permitted in the string.
+//
+// e.g. If a GTMStringEncoder object has already been initialised with a set
+// of characters excluding I, L and O (to avoid confusion with digits) and you
+// want to accept them as digits you can call addDecodeSynonyms:@"0oO1iIlL".
+- (void)addDecodeSynonyms:(NSString *)synonyms;
+
+// A sequence of characters to ignore if they occur during encoding.
+// Only 7-bit ASCII characters are permitted in the string.
+- (void)ignoreCharacters:(NSString *)chars;
+
+// Indicates whether padding is performed during encoding.
+- (BOOL)doPad;
+- (void)setDoPad:(BOOL)doPad;
+
+// Sets the padding character to use during encoding.
+- (void)setPaddingChar:(char)c;
+
+// Encode a raw binary buffer to a 7-bit ASCII string.
+- (NSString *)encode:(NSData *)data __attribute__((deprecated("Use encode:error:")));
+- (NSString *)encodeString:(NSString *)string __attribute__((deprecated("Use encodeString:error:")));
+
+- (NSString *)encode:(NSData *)data error:(NSError **)error;
+- (NSString *)encodeString:(NSString *)string error:(NSError **)error;
+
+// Decode a 7-bit ASCII string to a raw binary buffer.
+- (NSData *)decode:(NSString *)string __attribute__((deprecated("Use decode:error:")));
+- (NSString *)stringByDecoding:(NSString *)string __attribute__((deprecated("Use stringByDecoding:error:")));
+
+- (NSData *)decode:(NSString *)string error:(NSError **)error;
+- (NSString *)stringByDecoding:(NSString *)string error:(NSError **)error;
+
+@end
+
+FOUNDATION_EXPORT NSString *const GTMStringEncodingErrorDomain;
+FOUNDATION_EXPORT NSString *const GTMStringEncodingBadCharacterIndexKey;  // NSNumber
+
+typedef NS_ENUM(NSInteger, GTMStringEncodingError) {
+  // Unable to convert a buffer to NSASCIIStringEncoding.
+  GTMStringEncodingErrorUnableToConverToAscii = 1024,
+  // Unable to convert a buffer to NSUTF8StringEncoding.
+  GTMStringEncodingErrorUnableToConverToUTF8,
+  // Encountered a bad character.
+  // GTMStringEncodingBadCharacterIndexKey will have the index of the character.
+  GTMStringEncodingErrorUnknownCharacter,
+  // The data had a padding character in the middle of the data. Padding characters
+  // can only be at the end.
+  GTMStringEncodingErrorExpectedPadding,
+  // There is unexpected data at the end of the data that could not be decoded.
+  GTMStringEncodingErrorIncompleteTrailingData,
+};

+ 71 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMTypeCasting.h

@@ -0,0 +1,71 @@
+//
+//  GTMTypeCasting.h
+//
+//  Copyright 2010 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import <Foundation/Foundation.h>
+#import "GTMDefines.h"
+
+// These are some basic macros for making down-casting safer in Objective C.
+// They are loosely based on the same cast types with similar names in C++.
+// A typical usage would look like this:
+//
+// Bar* b = [[Bar alloc] init];
+// Foo* a = GTM_STATIC_CAST(Foo, b);
+//
+// Note that it's GTM_STATIC_CAST(Foo, b) and not GTM_STATIC_CAST(Foo*, b).
+//
+// GTM_STATIC_CAST runs only in debug mode, and will assert if and only if:
+//   - object is non nil
+//   - [object isKindOfClass:[cls class]] returns nil
+//
+// otherwise it returns object.
+//
+// GTM_DYNAMIC_CAST runs in both debug and release and will return nil if
+//   - object is nil
+//   - [object isKindOfClass:[cls class]] returns nil
+//
+// otherwise it returns object.
+//
+
+// Support functions for dealing with casting.
+GTM_INLINE id GTMDynamicCastSupport(Class cls, id object) {
+  _GTMDevAssert(cls, @"Nil Class");
+  return [object isKindOfClass:cls] ? object : nil;
+}
+
+GTM_INLINE id GTMStaticCastSupport(Class cls, id object) {
+  id value = nil;
+  if (object) {
+    value = GTMDynamicCastSupport(cls, object);
+    _GTMDevAssert(value, @"Could not cast %@ to class %@", object, cls);
+  }
+  return value;
+}
+
+#ifndef GTM_STATIC_CAST
+  #ifdef DEBUG
+    #define GTM_STATIC_CAST(type, object) \
+      ((type *) GTMStaticCastSupport([type class], object))
+  #else
+    #define GTM_STATIC_CAST(type, object) ((type *) (object))
+  #endif
+#endif
+
+#ifndef GTM_DYNAMIC_CAST
+  #define GTM_DYNAMIC_CAST(type, object) \
+    ((type *) GTMDynamicCastSupport([type class], object))
+#endif

+ 73 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Headers/GTMURLBuilder.h

@@ -0,0 +1,73 @@
+//
+//  GTMURLBuilder.h
+//
+//  Copyright 2012 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations
+//  under the License.
+//
+
+//
+// Class for creating URLs. It handles URL encoding of parameters.
+//
+// Usage example:
+//
+// GTMURLBuilder *URLBuilder =
+//     [GTMURLBuilder builderWithString:@"http://www.google.com"];
+// [URLBuilder setValue:@"abc" forParameter:@"q"];
+// NSURL *URL = [URLBuilder URL];
+//
+// NOTE: Apps targeting iOS 8 or OS X 10.10 and later should use
+//       NSURLComponents and NSURLQueryItem to create URLs with
+//       query arguments instead of using this class.
+
+
+#import <Foundation/Foundation.h>
+#import "GTMDefines.h"
+
+#if (!TARGET_OS_IPHONE && defined(MAC_OS_X_VERSION_10_10) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10) \
+|| (TARGET_OS_IPHONE && defined(__IPHONE_8_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
+__deprecated_msg("GTMURLBuilder is obsolete; update your app to use NSURLComponents queryItems property instead.")
+#endif
+@interface GTMURLBuilder : NSObject {
+ @private
+  NSMutableDictionary *params_;
+}
+
+@property(nonatomic, readonly) NSString *baseURLString;
+
+// |URLString| is expected to be a valid URL with already escaped parameter
+// values.
++ (GTMURLBuilder *)builderWithString:(NSString *)URLString;
++ (GTMURLBuilder *)builderWithURL:(NSURL *)URL;
+
+// |URLString| The base URL to which parameters will be appended.
+// If the URL already contains parameters, they should already be encoded.
+- (id)initWithString:(NSString *)URLString;
+- (void)setValue:(NSString *)value forParameter:(NSString *)parameter;
+- (void)setIntegerValue:(NSInteger)value forParameter:(NSString *)parameter;
+- (NSString *)valueForParameter:(NSString *)parameter;
+// Returns 0 if there is no value for |parameter| or if the value cannot
+// be parsed into an NSInteger. Use valueForParameter if you want to make
+// sure that the value is set before attempting the parsing.
+- (NSInteger)integerValueForParameter:(NSString *)parameter;
+- (void)removeParameter:(NSString *)parameter;
+- (void)setParameters:(NSDictionary *)parameters;
+- (NSDictionary *)parameters;
+- (NSURL *)URL;
+- (NSString *)URLString;
+
+// Case-sensitive comparison of the URL. Also protocol and host are compared
+// as case-sensitive strings. The order of URL parameters is ignored.
+- (BOOL)isEqual:(GTMURLBuilder *)URLBuilder;
+
+@end

+ 6 - 0
Libraries external/Firebase/Analytics/GoogleToolboxForMac.framework/Modules/module.modulemap

@@ -0,0 +1,6 @@
+framework module GoogleToolboxForMac {
+  umbrella header "GoogleToolboxForMac.h"
+  export *
+  module * { export *}
+  link "z"
+}

+ 583 - 0
Libraries external/Firebase/Analytics/nanopb.framework/Headers/pb.h

@@ -0,0 +1,583 @@
+/* Common parts of the nanopb library. Most of these are quite low-level
+ * stuff. For the high-level interface, see pb_encode.h and pb_decode.h.
+ */
+
+#ifndef PB_H_INCLUDED
+#define PB_H_INCLUDED
+
+/*****************************************************************
+ * Nanopb compilation time options. You can change these here by *
+ * uncommenting the lines, or on the compiler command line.      *
+ *****************************************************************/
+
+/* Enable support for dynamically allocated fields */
+/* #define PB_ENABLE_MALLOC 1 */
+
+/* Define this if your CPU / compiler combination does not support
+ * unaligned memory access to packed structures. */
+/* #define PB_NO_PACKED_STRUCTS 1 */
+
+/* Increase the number of required fields that are tracked.
+ * A compiler warning will tell if you need this. */
+/* #define PB_MAX_REQUIRED_FIELDS 256 */
+
+/* Add support for tag numbers > 255 and fields larger than 255 bytes. */
+/* #define PB_FIELD_16BIT 1 */
+
+/* Add support for tag numbers > 65536 and fields larger than 65536 bytes. */
+/* #define PB_FIELD_32BIT 1 */
+
+/* Disable support for error messages in order to save some code space. */
+/* #define PB_NO_ERRMSG 1 */
+
+/* Disable support for custom streams (support only memory buffers). */
+/* #define PB_BUFFER_ONLY 1 */
+
+/* Switch back to the old-style callback function signature.
+ * This was the default until nanopb-0.2.1. */
+/* #define PB_OLD_CALLBACK_STYLE */
+
+
+/******************************************************************
+ * You usually don't need to change anything below this line.     *
+ * Feel free to look around and use the defined macros, though.   *
+ ******************************************************************/
+
+
+/* Version of the nanopb library. Just in case you want to check it in
+ * your own program. */
+#define NANOPB_VERSION nanopb-0.3.8
+
+/* Include all the system headers needed by nanopb. You will need the
+ * definitions of the following:
+ * - strlen, memcpy, memset functions
+ * - [u]int_least8_t, uint_fast8_t, [u]int_least16_t, [u]int32_t, [u]int64_t
+ * - size_t
+ * - bool
+ *
+ * If you don't have the standard header files, you can instead provide
+ * a custom header that defines or includes all this. In that case,
+ * define PB_SYSTEM_HEADER to the path of this file.
+ */
+#ifdef PB_SYSTEM_HEADER
+#include PB_SYSTEM_HEADER
+#else
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include <string.h>
+
+#ifdef PB_ENABLE_MALLOC
+#include <stdlib.h>
+#endif
+#endif
+
+/* Macro for defining packed structures (compiler dependent).
+ * This just reduces memory requirements, but is not required.
+ */
+#if defined(PB_NO_PACKED_STRUCTS)
+    /* Disable struct packing */
+#   define PB_PACKED_STRUCT_START
+#   define PB_PACKED_STRUCT_END
+#   define pb_packed
+#elif defined(__GNUC__) || defined(__clang__)
+    /* For GCC and clang */
+#   define PB_PACKED_STRUCT_START
+#   define PB_PACKED_STRUCT_END
+#   define pb_packed __attribute__((packed))
+#elif defined(__ICCARM__) || defined(__CC_ARM)
+    /* For IAR ARM and Keil MDK-ARM compilers */
+#   define PB_PACKED_STRUCT_START _Pragma("pack(push, 1)")
+#   define PB_PACKED_STRUCT_END _Pragma("pack(pop)")
+#   define pb_packed
+#elif defined(_MSC_VER) && (_MSC_VER >= 1500)
+    /* For Microsoft Visual C++ */
+#   define PB_PACKED_STRUCT_START __pragma(pack(push, 1))
+#   define PB_PACKED_STRUCT_END __pragma(pack(pop))
+#   define pb_packed
+#else
+    /* Unknown compiler */
+#   define PB_PACKED_STRUCT_START
+#   define PB_PACKED_STRUCT_END
+#   define pb_packed
+#endif
+
+/* Handly macro for suppressing unreferenced-parameter compiler warnings. */
+#ifndef PB_UNUSED
+#define PB_UNUSED(x) (void)(x)
+#endif
+
+/* Compile-time assertion, used for checking compatible compilation options.
+ * If this does not work properly on your compiler, use
+ * #define PB_NO_STATIC_ASSERT to disable it.
+ *
+ * But before doing that, check carefully the error message / place where it
+ * comes from to see if the error has a real cause. Unfortunately the error
+ * message is not always very clear to read, but you can see the reason better
+ * in the place where the PB_STATIC_ASSERT macro was called.
+ */
+#ifndef PB_NO_STATIC_ASSERT
+#ifndef PB_STATIC_ASSERT
+#define PB_STATIC_ASSERT(COND,MSG) typedef char PB_STATIC_ASSERT_MSG(MSG, __LINE__, __COUNTER__)[(COND)?1:-1];
+#define PB_STATIC_ASSERT_MSG(MSG, LINE, COUNTER) PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER)
+#define PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) pb_static_assertion_##MSG##LINE##COUNTER
+#endif
+#else
+#define PB_STATIC_ASSERT(COND,MSG)
+#endif
+
+/* Number of required fields to keep track of. */
+#ifndef PB_MAX_REQUIRED_FIELDS
+#define PB_MAX_REQUIRED_FIELDS 64
+#endif
+
+#if PB_MAX_REQUIRED_FIELDS < 64
+#error You should not lower PB_MAX_REQUIRED_FIELDS from the default value (64).
+#endif
+
+/* List of possible field types. These are used in the autogenerated code.
+ * Least-significant 4 bits tell the scalar type
+ * Most-significant 4 bits specify repeated/required/packed etc.
+ */
+
+typedef uint_least8_t pb_type_t;
+
+/**** Field data types ****/
+
+/* Numeric types */
+#define PB_LTYPE_VARINT  0x00 /* int32, int64, enum, bool */
+#define PB_LTYPE_UVARINT 0x01 /* uint32, uint64 */
+#define PB_LTYPE_SVARINT 0x02 /* sint32, sint64 */
+#define PB_LTYPE_FIXED32 0x03 /* fixed32, sfixed32, float */
+#define PB_LTYPE_FIXED64 0x04 /* fixed64, sfixed64, double */
+
+/* Marker for last packable field type. */
+#define PB_LTYPE_LAST_PACKABLE 0x04
+
+/* Byte array with pre-allocated buffer.
+ * data_size is the length of the allocated PB_BYTES_ARRAY structure. */
+#define PB_LTYPE_BYTES 0x05
+
+/* String with pre-allocated buffer.
+ * data_size is the maximum length. */
+#define PB_LTYPE_STRING 0x06
+
+/* Submessage
+ * submsg_fields is pointer to field descriptions */
+#define PB_LTYPE_SUBMESSAGE 0x07
+
+/* Extension pseudo-field
+ * The field contains a pointer to pb_extension_t */
+#define PB_LTYPE_EXTENSION 0x08
+
+/* Byte array with inline, pre-allocated byffer.
+ * data_size is the length of the inline, allocated buffer.
+ * This differs from PB_LTYPE_BYTES by defining the element as
+ * pb_byte_t[data_size] rather than pb_bytes_array_t. */
+#define PB_LTYPE_FIXED_LENGTH_BYTES 0x09
+
+/* Number of declared LTYPES */
+#define PB_LTYPES_COUNT 0x0A
+#define PB_LTYPE_MASK 0x0F
+
+/**** Field repetition rules ****/
+
+#define PB_HTYPE_REQUIRED 0x00
+#define PB_HTYPE_OPTIONAL 0x10
+#define PB_HTYPE_REPEATED 0x20
+#define PB_HTYPE_ONEOF    0x30
+#define PB_HTYPE_MASK     0x30
+
+/**** Field allocation types ****/
+ 
+#define PB_ATYPE_STATIC   0x00
+#define PB_ATYPE_POINTER  0x80
+#define PB_ATYPE_CALLBACK 0x40
+#define PB_ATYPE_MASK     0xC0
+
+#define PB_ATYPE(x) ((x) & PB_ATYPE_MASK)
+#define PB_HTYPE(x) ((x) & PB_HTYPE_MASK)
+#define PB_LTYPE(x) ((x) & PB_LTYPE_MASK)
+
+/* Data type used for storing sizes of struct fields
+ * and array counts.
+ */
+#if defined(PB_FIELD_32BIT)
+    typedef uint32_t pb_size_t;
+    typedef int32_t pb_ssize_t;
+#elif defined(PB_FIELD_16BIT)
+    typedef uint_least16_t pb_size_t;
+    typedef int_least16_t pb_ssize_t;
+#else
+    typedef uint_least8_t pb_size_t;
+    typedef int_least8_t pb_ssize_t;
+#endif
+#define PB_SIZE_MAX ((pb_size_t)-1)
+
+/* Data type for storing encoded data and other byte streams.
+ * This typedef exists to support platforms where uint8_t does not exist.
+ * You can regard it as equivalent on uint8_t on other platforms.
+ */
+typedef uint_least8_t pb_byte_t;
+
+/* This structure is used in auto-generated constants
+ * to specify struct fields.
+ * You can change field sizes if you need structures
+ * larger than 256 bytes or field tags larger than 256.
+ * The compiler should complain if your .proto has such
+ * structures. Fix that by defining PB_FIELD_16BIT or
+ * PB_FIELD_32BIT.
+ */
+PB_PACKED_STRUCT_START
+typedef struct pb_field_s pb_field_t;
+struct pb_field_s {
+    pb_size_t tag;
+    pb_type_t type;
+    pb_size_t data_offset; /* Offset of field data, relative to previous field. */
+    pb_ssize_t size_offset; /* Offset of array size or has-boolean, relative to data */
+    pb_size_t data_size; /* Data size in bytes for a single item */
+    pb_size_t array_size; /* Maximum number of entries in array */
+    
+    /* Field definitions for submessage
+     * OR default value for all other non-array, non-callback types
+     * If null, then field will zeroed. */
+    const void *ptr;
+} pb_packed;
+PB_PACKED_STRUCT_END
+
+/* Make sure that the standard integer types are of the expected sizes.
+ * Otherwise fixed32/fixed64 fields can break.
+ *
+ * If you get errors here, it probably means that your stdint.h is not
+ * correct for your platform.
+ */
+PB_STATIC_ASSERT(sizeof(int64_t) == 2 * sizeof(int32_t), INT64_T_WRONG_SIZE)
+PB_STATIC_ASSERT(sizeof(uint64_t) == 2 * sizeof(uint32_t), UINT64_T_WRONG_SIZE)
+
+/* This structure is used for 'bytes' arrays.
+ * It has the number of bytes in the beginning, and after that an array.
+ * Note that actual structs used will have a different length of bytes array.
+ */
+#define PB_BYTES_ARRAY_T(n) struct { pb_size_t size; pb_byte_t bytes[n]; }
+#define PB_BYTES_ARRAY_T_ALLOCSIZE(n) ((size_t)n + offsetof(pb_bytes_array_t, bytes))
+
+struct pb_bytes_array_s {
+    pb_size_t size;
+    pb_byte_t bytes[1];
+};
+typedef struct pb_bytes_array_s pb_bytes_array_t;
+
+/* This structure is used for giving the callback function.
+ * It is stored in the message structure and filled in by the method that
+ * calls pb_decode.
+ *
+ * The decoding callback will be given a limited-length stream
+ * If the wire type was string, the length is the length of the string.
+ * If the wire type was a varint/fixed32/fixed64, the length is the length
+ * of the actual value.
+ * The function may be called multiple times (especially for repeated types,
+ * but also otherwise if the message happens to contain the field multiple
+ * times.)
+ *
+ * The encoding callback will receive the actual output stream.
+ * It should write all the data in one call, including the field tag and
+ * wire type. It can write multiple fields.
+ *
+ * The callback can be null if you want to skip a field.
+ */
+typedef struct pb_istream_s pb_istream_t;
+typedef struct pb_ostream_s pb_ostream_t;
+typedef struct pb_callback_s pb_callback_t;
+struct pb_callback_s {
+#ifdef PB_OLD_CALLBACK_STYLE
+    /* Deprecated since nanopb-0.2.1 */
+    union {
+        bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void *arg);
+        bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, const void *arg);
+    } funcs;
+#else
+    /* New function signature, which allows modifying arg contents in callback. */
+    union {
+        bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void **arg);
+        bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, void * const *arg);
+    } funcs;
+#endif    
+    
+    /* Free arg for use by callback */
+    void *arg;
+};
+
+/* Wire types. Library user needs these only in encoder callbacks. */
+typedef enum {
+    PB_WT_VARINT = 0,
+    PB_WT_64BIT  = 1,
+    PB_WT_STRING = 2,
+    PB_WT_32BIT  = 5
+} pb_wire_type_t;
+
+/* Structure for defining the handling of unknown/extension fields.
+ * Usually the pb_extension_type_t structure is automatically generated,
+ * while the pb_extension_t structure is created by the user. However,
+ * if you want to catch all unknown fields, you can also create a custom
+ * pb_extension_type_t with your own callback.
+ */
+typedef struct pb_extension_type_s pb_extension_type_t;
+typedef struct pb_extension_s pb_extension_t;
+struct pb_extension_type_s {
+    /* Called for each unknown field in the message.
+     * If you handle the field, read off all of its data and return true.
+     * If you do not handle the field, do not read anything and return true.
+     * If you run into an error, return false.
+     * Set to NULL for default handler.
+     */
+    bool (*decode)(pb_istream_t *stream, pb_extension_t *extension,
+                   uint32_t tag, pb_wire_type_t wire_type);
+    
+    /* Called once after all regular fields have been encoded.
+     * If you have something to write, do so and return true.
+     * If you do not have anything to write, just return true.
+     * If you run into an error, return false.
+     * Set to NULL for default handler.
+     */
+    bool (*encode)(pb_ostream_t *stream, const pb_extension_t *extension);
+    
+    /* Free field for use by the callback. */
+    const void *arg;
+};
+
+struct pb_extension_s {
+    /* Type describing the extension field. Usually you'll initialize
+     * this to a pointer to the automatically generated structure. */
+    const pb_extension_type_t *type;
+    
+    /* Destination for the decoded data. This must match the datatype
+     * of the extension field. */
+    void *dest;
+    
+    /* Pointer to the next extension handler, or NULL.
+     * If this extension does not match a field, the next handler is
+     * automatically called. */
+    pb_extension_t *next;
+
+    /* The decoder sets this to true if the extension was found.
+     * Ignored for encoding. */
+    bool found;
+};
+
+/* Memory allocation functions to use. You can define pb_realloc and
+ * pb_free to custom functions if you want. */
+#ifdef PB_ENABLE_MALLOC
+#   ifndef pb_realloc
+#       define pb_realloc(ptr, size) realloc(ptr, size)
+#   endif
+#   ifndef pb_free
+#       define pb_free(ptr) free(ptr)
+#   endif
+#endif
+
+/* This is used to inform about need to regenerate .pb.h/.pb.c files. */
+#define PB_PROTO_HEADER_VERSION 30
+
+/* These macros are used to declare pb_field_t's in the constant array. */
+/* Size of a structure member, in bytes. */
+#define pb_membersize(st, m) (sizeof ((st*)0)->m)
+/* Number of entries in an array. */
+#define pb_arraysize(st, m) (pb_membersize(st, m) / pb_membersize(st, m[0]))
+/* Delta from start of one member to the start of another member. */
+#define pb_delta(st, m1, m2) ((int)offsetof(st, m1) - (int)offsetof(st, m2))
+/* Marks the end of the field list */
+#define PB_LAST_FIELD {0,(pb_type_t) 0,0,0,0,0,0}
+
+/* Macros for filling in the data_offset field */
+/* data_offset for first field in a message */
+#define PB_DATAOFFSET_FIRST(st, m1, m2) (offsetof(st, m1))
+/* data_offset for subsequent fields */
+#define PB_DATAOFFSET_OTHER(st, m1, m2) (offsetof(st, m1) - offsetof(st, m2) - pb_membersize(st, m2))
+/* data offset for subsequent fields inside an union (oneof) */
+#define PB_DATAOFFSET_UNION(st, m1, m2) (PB_SIZE_MAX)
+/* Choose first/other based on m1 == m2 (deprecated, remains for backwards compatibility) */
+#define PB_DATAOFFSET_CHOOSE(st, m1, m2) (int)(offsetof(st, m1) == offsetof(st, m2) \
+                                  ? PB_DATAOFFSET_FIRST(st, m1, m2) \
+                                  : PB_DATAOFFSET_OTHER(st, m1, m2))
+
+/* Required fields are the simplest. They just have delta (padding) from
+ * previous field end, and the size of the field. Pointer is used for
+ * submessages and default values.
+ */
+#define PB_REQUIRED_STATIC(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_STATIC | PB_HTYPE_REQUIRED | ltype, \
+    fd, 0, pb_membersize(st, m), 0, ptr}
+
+/* Optional fields add the delta to the has_ variable. */
+#define PB_OPTIONAL_STATIC(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_STATIC | PB_HTYPE_OPTIONAL | ltype, \
+    fd, \
+    pb_delta(st, has_ ## m, m), \
+    pb_membersize(st, m), 0, ptr}
+
+#define PB_SINGULAR_STATIC(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_STATIC | PB_HTYPE_OPTIONAL | ltype, \
+    fd, 0, pb_membersize(st, m), 0, ptr}
+
+/* Repeated fields have a _count field and also the maximum number of entries. */
+#define PB_REPEATED_STATIC(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_STATIC | PB_HTYPE_REPEATED | ltype, \
+    fd, \
+    pb_delta(st, m ## _count, m), \
+    pb_membersize(st, m[0]), \
+    pb_arraysize(st, m), ptr}
+
+/* Allocated fields carry the size of the actual data, not the pointer */
+#define PB_REQUIRED_POINTER(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_POINTER | PB_HTYPE_REQUIRED | ltype, \
+    fd, 0, pb_membersize(st, m[0]), 0, ptr}
+
+/* Optional fields don't need a has_ variable, as information would be redundant */
+#define PB_OPTIONAL_POINTER(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_POINTER | PB_HTYPE_OPTIONAL | ltype, \
+    fd, 0, pb_membersize(st, m[0]), 0, ptr}
+
+/* Same as optional fields*/
+#define PB_SINGULAR_POINTER(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_POINTER | PB_HTYPE_OPTIONAL | ltype, \
+    fd, 0, pb_membersize(st, m[0]), 0, ptr}
+
+/* Repeated fields have a _count field and a pointer to array of pointers */
+#define PB_REPEATED_POINTER(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_POINTER | PB_HTYPE_REPEATED | ltype, \
+    fd, pb_delta(st, m ## _count, m), \
+    pb_membersize(st, m[0]), 0, ptr}
+
+/* Callbacks are much like required fields except with special datatype. */
+#define PB_REQUIRED_CALLBACK(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_CALLBACK | PB_HTYPE_REQUIRED | ltype, \
+    fd, 0, pb_membersize(st, m), 0, ptr}
+
+#define PB_OPTIONAL_CALLBACK(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_CALLBACK | PB_HTYPE_OPTIONAL | ltype, \
+    fd, 0, pb_membersize(st, m), 0, ptr}
+
+#define PB_SINGULAR_CALLBACK(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_CALLBACK | PB_HTYPE_OPTIONAL | ltype, \
+    fd, 0, pb_membersize(st, m), 0, ptr}
+    
+#define PB_REPEATED_CALLBACK(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_CALLBACK | PB_HTYPE_REPEATED | ltype, \
+    fd, 0, pb_membersize(st, m), 0, ptr}
+
+/* Optional extensions don't have the has_ field, as that would be redundant.
+ * Furthermore, the combination of OPTIONAL without has_ field is used
+ * for indicating proto3 style fields. Extensions exist in proto2 mode only,
+ * so they should be encoded according to proto2 rules. To avoid the conflict,
+ * extensions are marked as REQUIRED instead.
+ */
+#define PB_OPTEXT_STATIC(tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_STATIC | PB_HTYPE_REQUIRED | ltype, \
+    0, \
+    0, \
+    pb_membersize(st, m), 0, ptr}
+
+#define PB_OPTEXT_POINTER(tag, st, m, fd, ltype, ptr) \
+    PB_OPTIONAL_POINTER(tag, st, m, fd, ltype, ptr)
+
+#define PB_OPTEXT_CALLBACK(tag, st, m, fd, ltype, ptr) \
+    PB_OPTIONAL_CALLBACK(tag, st, m, fd, ltype, ptr)
+
+/* The mapping from protobuf types to LTYPEs is done using these macros. */
+#define PB_LTYPE_MAP_BOOL               PB_LTYPE_VARINT
+#define PB_LTYPE_MAP_BYTES              PB_LTYPE_BYTES
+#define PB_LTYPE_MAP_DOUBLE             PB_LTYPE_FIXED64
+#define PB_LTYPE_MAP_ENUM               PB_LTYPE_VARINT
+#define PB_LTYPE_MAP_UENUM              PB_LTYPE_UVARINT
+#define PB_LTYPE_MAP_FIXED32            PB_LTYPE_FIXED32
+#define PB_LTYPE_MAP_FIXED64            PB_LTYPE_FIXED64
+#define PB_LTYPE_MAP_FLOAT              PB_LTYPE_FIXED32
+#define PB_LTYPE_MAP_INT32              PB_LTYPE_VARINT
+#define PB_LTYPE_MAP_INT64              PB_LTYPE_VARINT
+#define PB_LTYPE_MAP_MESSAGE            PB_LTYPE_SUBMESSAGE
+#define PB_LTYPE_MAP_SFIXED32           PB_LTYPE_FIXED32
+#define PB_LTYPE_MAP_SFIXED64           PB_LTYPE_FIXED64
+#define PB_LTYPE_MAP_SINT32             PB_LTYPE_SVARINT
+#define PB_LTYPE_MAP_SINT64             PB_LTYPE_SVARINT
+#define PB_LTYPE_MAP_STRING             PB_LTYPE_STRING
+#define PB_LTYPE_MAP_UINT32             PB_LTYPE_UVARINT
+#define PB_LTYPE_MAP_UINT64             PB_LTYPE_UVARINT
+#define PB_LTYPE_MAP_EXTENSION          PB_LTYPE_EXTENSION
+#define PB_LTYPE_MAP_FIXED_LENGTH_BYTES PB_LTYPE_FIXED_LENGTH_BYTES
+
+/* This is the actual macro used in field descriptions.
+ * It takes these arguments:
+ * - Field tag number
+ * - Field type:   BOOL, BYTES, DOUBLE, ENUM, UENUM, FIXED32, FIXED64,
+ *                 FLOAT, INT32, INT64, MESSAGE, SFIXED32, SFIXED64
+ *                 SINT32, SINT64, STRING, UINT32, UINT64 or EXTENSION
+ * - Field rules:  REQUIRED, OPTIONAL or REPEATED
+ * - Allocation:   STATIC, CALLBACK or POINTER
+ * - Placement: FIRST or OTHER, depending on if this is the first field in structure.
+ * - Message name
+ * - Field name
+ * - Previous field name (or field name again for first field)
+ * - Pointer to default value or submsg fields.
+ */
+
+#define PB_FIELD(tag, type, rules, allocation, placement, message, field, prevfield, ptr) \
+        PB_ ## rules ## _ ## allocation(tag, message, field, \
+        PB_DATAOFFSET_ ## placement(message, field, prevfield), \
+        PB_LTYPE_MAP_ ## type, ptr)
+
+/* Field description for oneof fields. This requires taking into account the
+ * union name also, that's why a separate set of macros is needed.
+ */
+#define PB_ONEOF_STATIC(u, tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_STATIC | PB_HTYPE_ONEOF | ltype, \
+    fd, pb_delta(st, which_ ## u, u.m), \
+    pb_membersize(st, u.m), 0, ptr}
+
+#define PB_ONEOF_POINTER(u, tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_POINTER | PB_HTYPE_ONEOF | ltype, \
+    fd, pb_delta(st, which_ ## u, u.m), \
+    pb_membersize(st, u.m[0]), 0, ptr}
+
+#define PB_ONEOF_FIELD(union_name, tag, type, rules, allocation, placement, message, field, prevfield, ptr) \
+        PB_ONEOF_ ## allocation(union_name, tag, message, field, \
+        PB_DATAOFFSET_ ## placement(message, union_name.field, prevfield), \
+        PB_LTYPE_MAP_ ## type, ptr)
+
+#define PB_ANONYMOUS_ONEOF_STATIC(u, tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_STATIC | PB_HTYPE_ONEOF | ltype, \
+    fd, pb_delta(st, which_ ## u, m), \
+    pb_membersize(st, m), 0, ptr}
+
+#define PB_ANONYMOUS_ONEOF_POINTER(u, tag, st, m, fd, ltype, ptr) \
+    {tag, PB_ATYPE_POINTER | PB_HTYPE_ONEOF | ltype, \
+    fd, pb_delta(st, which_ ## u, m), \
+    pb_membersize(st, m[0]), 0, ptr}
+
+#define PB_ANONYMOUS_ONEOF_FIELD(union_name, tag, type, rules, allocation, placement, message, field, prevfield, ptr) \
+        PB_ANONYMOUS_ONEOF_ ## allocation(union_name, tag, message, field, \
+        PB_DATAOFFSET_ ## placement(message, field, prevfield), \
+        PB_LTYPE_MAP_ ## type, ptr)
+
+/* These macros are used for giving out error messages.
+ * They are mostly a debugging aid; the main error information
+ * is the true/false return value from functions.
+ * Some code space can be saved by disabling the error
+ * messages if not used.
+ *
+ * PB_SET_ERROR() sets the error message if none has been set yet.
+ *                msg must be a constant string literal.
+ * PB_GET_ERROR() always returns a pointer to a string.
+ * PB_RETURN_ERROR() sets the error and returns false from current
+ *                   function.
+ */
+#ifdef PB_NO_ERRMSG
+#define PB_SET_ERROR(stream, msg) PB_UNUSED(stream)
+#define PB_GET_ERROR(stream) "(errmsg disabled)"
+#else
+#define PB_SET_ERROR(stream, msg) (stream->errmsg = (stream)->errmsg ? (stream)->errmsg : (msg))
+#define PB_GET_ERROR(stream) ((stream)->errmsg ? (stream)->errmsg : "(none)")
+#endif
+
+#define PB_RETURN_ERROR(stream, msg) return PB_SET_ERROR(stream, msg), false
+
+#endif

+ 42 - 0
Libraries external/Firebase/Analytics/nanopb.framework/Headers/pb_common.h

@@ -0,0 +1,42 @@
+/* pb_common.h: Common support functions for pb_encode.c and pb_decode.c.
+ * These functions are rarely needed by applications directly.
+ */
+
+#ifndef PB_COMMON_H_INCLUDED
+#define PB_COMMON_H_INCLUDED
+
+#include "pb.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Iterator for pb_field_t list */
+struct pb_field_iter_s {
+    const pb_field_t *start;       /* Start of the pb_field_t array */
+    const pb_field_t *pos;         /* Current position of the iterator */
+    unsigned required_field_index; /* Zero-based index that counts only the required fields */
+    void *dest_struct;             /* Pointer to start of the structure */
+    void *pData;                   /* Pointer to current field value */
+    void *pSize;                   /* Pointer to count/has field */
+};
+typedef struct pb_field_iter_s pb_field_iter_t;
+
+/* Initialize the field iterator structure to beginning.
+ * Returns false if the message type is empty. */
+bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_field_t *fields, void *dest_struct);
+
+/* Advance the iterator to the next field.
+ * Returns false when the iterator wraps back to the first field. */
+bool pb_field_iter_next(pb_field_iter_t *iter);
+
+/* Advance the iterator until it points at a field with the given tag.
+ * Returns false if no such field exists. */
+bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
+

+ 153 - 0
Libraries external/Firebase/Analytics/nanopb.framework/Headers/pb_decode.h

@@ -0,0 +1,153 @@
+/* pb_decode.h: Functions to decode protocol buffers. Depends on pb_decode.c.
+ * The main function is pb_decode. You also need an input stream, and the
+ * field descriptions created by nanopb_generator.py.
+ */
+
+#ifndef PB_DECODE_H_INCLUDED
+#define PB_DECODE_H_INCLUDED
+
+#include "pb.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Structure for defining custom input streams. You will need to provide
+ * a callback function to read the bytes from your storage, which can be
+ * for example a file or a network socket.
+ * 
+ * The callback must conform to these rules:
+ *
+ * 1) Return false on IO errors. This will cause decoding to abort.
+ * 2) You can use state to store your own data (e.g. buffer pointer),
+ *    and rely on pb_read to verify that no-body reads past bytes_left.
+ * 3) Your callback may be used with substreams, in which case bytes_left
+ *    is different than from the main stream. Don't use bytes_left to compute
+ *    any pointers.
+ */
+struct pb_istream_s
+{
+#ifdef PB_BUFFER_ONLY
+    /* Callback pointer is not used in buffer-only configuration.
+     * Having an int pointer here allows binary compatibility but
+     * gives an error if someone tries to assign callback function.
+     */
+    int *callback;
+#else
+    bool (*callback)(pb_istream_t *stream, pb_byte_t *buf, size_t count);
+#endif
+
+    void *state; /* Free field for use by callback implementation */
+    size_t bytes_left;
+    
+#ifndef PB_NO_ERRMSG
+    const char *errmsg;
+#endif
+};
+
+/***************************
+ * Main decoding functions *
+ ***************************/
+ 
+/* Decode a single protocol buffers message from input stream into a C structure.
+ * Returns true on success, false on any failure.
+ * The actual struct pointed to by dest must match the description in fields.
+ * Callback fields of the destination structure must be initialized by caller.
+ * All other fields will be initialized by this function.
+ *
+ * Example usage:
+ *    MyMessage msg = {};
+ *    uint8_t buffer[64];
+ *    pb_istream_t stream;
+ *    
+ *    // ... read some data into buffer ...
+ *
+ *    stream = pb_istream_from_buffer(buffer, count);
+ *    pb_decode(&stream, MyMessage_fields, &msg);
+ */
+bool pb_decode(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct);
+
+/* Same as pb_decode, except does not initialize the destination structure
+ * to default values. This is slightly faster if you need no default values
+ * and just do memset(struct, 0, sizeof(struct)) yourself.
+ *
+ * This can also be used for 'merging' two messages, i.e. update only the
+ * fields that exist in the new message.
+ *
+ * Note: If this function returns with an error, it will not release any
+ * dynamically allocated fields. You will need to call pb_release() yourself.
+ */
+bool pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct);
+
+/* Same as pb_decode, except expects the stream to start with the message size
+ * encoded as varint. Corresponds to parseDelimitedFrom() in Google's
+ * protobuf API.
+ */
+bool pb_decode_delimited(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct);
+
+#ifdef PB_ENABLE_MALLOC
+/* Release any allocated pointer fields. If you use dynamic allocation, you should
+ * call this for any successfully decoded message when you are done with it. If
+ * pb_decode() returns with an error, the message is already released.
+ */
+void pb_release(const pb_field_t fields[], void *dest_struct);
+#endif
+
+
+/**************************************
+ * Functions for manipulating streams *
+ **************************************/
+
+/* Create an input stream for reading from a memory buffer.
+ *
+ * Alternatively, you can use a custom stream that reads directly from e.g.
+ * a file or a network socket.
+ */
+pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t bufsize);
+
+/* Function to read from a pb_istream_t. You can use this if you need to
+ * read some custom header data, or to read data in field callbacks.
+ */
+bool pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count);
+
+
+/************************************************
+ * Helper functions for writing field callbacks *
+ ************************************************/
+
+/* Decode the tag for the next field in the stream. Gives the wire type and
+ * field tag. At end of the message, returns false and sets eof to true. */
+bool pb_decode_tag(pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof);
+
+/* Skip the field payload data, given the wire type. */
+bool pb_skip_field(pb_istream_t *stream, pb_wire_type_t wire_type);
+
+/* Decode an integer in the varint format. This works for bool, enum, int32,
+ * int64, uint32 and uint64 field types. */
+bool pb_decode_varint(pb_istream_t *stream, uint64_t *dest);
+
+/* Decode an integer in the varint format. This works for bool, enum, int32,
+ * and uint32 field types. */
+bool pb_decode_varint32(pb_istream_t *stream, uint32_t *dest);
+
+/* Decode an integer in the zig-zagged svarint format. This works for sint32
+ * and sint64. */
+bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest);
+
+/* Decode a fixed32, sfixed32 or float value. You need to pass a pointer to
+ * a 4-byte wide C variable. */
+bool pb_decode_fixed32(pb_istream_t *stream, void *dest);
+
+/* Decode a fixed64, sfixed64 or double value. You need to pass a pointer to
+ * a 8-byte wide C variable. */
+bool pb_decode_fixed64(pb_istream_t *stream, void *dest);
+
+/* Make a limited-length substream for reading a PB_WT_STRING field. */
+bool pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream);
+bool pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif

+ 154 - 0
Libraries external/Firebase/Analytics/nanopb.framework/Headers/pb_encode.h

@@ -0,0 +1,154 @@
+/* pb_encode.h: Functions to encode protocol buffers. Depends on pb_encode.c.
+ * The main function is pb_encode. You also need an output stream, and the
+ * field descriptions created by nanopb_generator.py.
+ */
+
+#ifndef PB_ENCODE_H_INCLUDED
+#define PB_ENCODE_H_INCLUDED
+
+#include "pb.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Structure for defining custom output streams. You will need to provide
+ * a callback function to write the bytes to your storage, which can be
+ * for example a file or a network socket.
+ *
+ * The callback must conform to these rules:
+ *
+ * 1) Return false on IO errors. This will cause encoding to abort.
+ * 2) You can use state to store your own data (e.g. buffer pointer).
+ * 3) pb_write will update bytes_written after your callback runs.
+ * 4) Substreams will modify max_size and bytes_written. Don't use them
+ *    to calculate any pointers.
+ */
+struct pb_ostream_s
+{
+#ifdef PB_BUFFER_ONLY
+    /* Callback pointer is not used in buffer-only configuration.
+     * Having an int pointer here allows binary compatibility but
+     * gives an error if someone tries to assign callback function.
+     * Also, NULL pointer marks a 'sizing stream' that does not
+     * write anything.
+     */
+    int *callback;
+#else
+    bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
+#endif
+    void *state;          /* Free field for use by callback implementation. */
+    size_t max_size;      /* Limit number of output bytes written (or use SIZE_MAX). */
+    size_t bytes_written; /* Number of bytes written so far. */
+    
+#ifndef PB_NO_ERRMSG
+    const char *errmsg;
+#endif
+};
+
+/***************************
+ * Main encoding functions *
+ ***************************/
+
+/* Encode a single protocol buffers message from C structure into a stream.
+ * Returns true on success, false on any failure.
+ * The actual struct pointed to by src_struct must match the description in fields.
+ * All required fields in the struct are assumed to have been filled in.
+ *
+ * Example usage:
+ *    MyMessage msg = {};
+ *    uint8_t buffer[64];
+ *    pb_ostream_t stream;
+ *
+ *    msg.field1 = 42;
+ *    stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
+ *    pb_encode(&stream, MyMessage_fields, &msg);
+ */
+bool pb_encode(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct);
+
+/* Same as pb_encode, but prepends the length of the message as a varint.
+ * Corresponds to writeDelimitedTo() in Google's protobuf API.
+ */
+bool pb_encode_delimited(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct);
+
+/* Encode the message to get the size of the encoded data, but do not store
+ * the data. */
+bool pb_get_encoded_size(size_t *size, const pb_field_t fields[], const void *src_struct);
+
+/**************************************
+ * Functions for manipulating streams *
+ **************************************/
+
+/* Create an output stream for writing into a memory buffer.
+ * The number of bytes written can be found in stream.bytes_written after
+ * encoding the message.
+ *
+ * Alternatively, you can use a custom stream that writes directly to e.g.
+ * a file or a network socket.
+ */
+pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize);
+
+/* Pseudo-stream for measuring the size of a message without actually storing
+ * the encoded data.
+ * 
+ * Example usage:
+ *    MyMessage msg = {};
+ *    pb_ostream_t stream = PB_OSTREAM_SIZING;
+ *    pb_encode(&stream, MyMessage_fields, &msg);
+ *    printf("Message size is %d\n", stream.bytes_written);
+ */
+#ifndef PB_NO_ERRMSG
+#define PB_OSTREAM_SIZING {0,0,0,0,0}
+#else
+#define PB_OSTREAM_SIZING {0,0,0,0}
+#endif
+
+/* Function to write into a pb_ostream_t stream. You can use this if you need
+ * to append or prepend some custom headers to the message.
+ */
+bool pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count);
+
+
+/************************************************
+ * Helper functions for writing field callbacks *
+ ************************************************/
+
+/* Encode field header based on type and field number defined in the field
+ * structure. Call this from the callback before writing out field contents. */
+bool pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_t *field);
+
+/* Encode field header by manually specifing wire type. You need to use this
+ * if you want to write out packed arrays from a callback field. */
+bool pb_encode_tag(pb_ostream_t *stream, pb_wire_type_t wiretype, uint32_t field_number);
+
+/* Encode an integer in the varint format.
+ * This works for bool, enum, int32, int64, uint32 and uint64 field types. */
+bool pb_encode_varint(pb_ostream_t *stream, uint64_t value);
+
+/* Encode an integer in the zig-zagged svarint format.
+ * This works for sint32 and sint64. */
+bool pb_encode_svarint(pb_ostream_t *stream, int64_t value);
+
+/* Encode a string or bytes type field. For strings, pass strlen(s) as size. */
+bool pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size);
+
+/* Encode a fixed32, sfixed32 or float value.
+ * You need to pass a pointer to a 4-byte wide C variable. */
+bool pb_encode_fixed32(pb_ostream_t *stream, const void *value);
+
+/* Encode a fixed64, sfixed64 or double value.
+ * You need to pass a pointer to a 8-byte wide C variable. */
+bool pb_encode_fixed64(pb_ostream_t *stream, const void *value);
+
+/* Encode a submessage field.
+ * You need to pass the pb_field_t array and pointer to struct, just like
+ * with pb_encode(). This internally encodes the submessage twice, first to
+ * calculate message size and then to actually write it out.
+ */
+bool pb_encode_submessage(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif

+ 5 - 0
Libraries external/Firebase/Analytics/nanopb.framework/Modules/module.modulemap

@@ -0,0 +1,5 @@
+framework module nanopb {
+  umbrella header "nanopb.h"
+  export *
+  module * { export *}
+}

二进制
Libraries external/Firebase/Analytics/nanopb.framework/nanopb


+ 101 - 0
Libraries external/Firebase/Firebase.h

@@ -0,0 +1,101 @@
+#import <FirebaseCore/FirebaseCore.h>
+
+#if !defined(__has_include)
+  #error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \
+          import the headers individually."
+#else
+  #if __has_include(<FirebaseAnalytics/FirebaseAnalytics.h>)
+    #import <FirebaseAnalytics/FirebaseAnalytics.h>
+  #else
+    #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
+      #warning "FirebaseAnalytics.framework is not included in your target. Please add \
+`Firebase/Core` to your Podfile or add FirebaseAnalytics.framework to your project to ensure \
+Firebase services work as intended."
+    #endif // #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING
+  #endif
+
+  #if __has_include(<FirebaseAuth/FirebaseAuth.h>)
+    #import <FirebaseAuth/FirebaseAuth.h>
+  #endif
+
+  #if __has_include(<FirebaseCrash/FirebaseCrash.h>)
+    #import <FirebaseCrash/FirebaseCrash.h>
+  #endif
+
+  #if __has_include(<FirebaseDatabase/FirebaseDatabase.h>)
+    #import <FirebaseDatabase/FirebaseDatabase.h>
+  #endif
+
+  #if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>)
+    #import <FirebaseDynamicLinks/FirebaseDynamicLinks.h>
+  #endif
+
+  #if __has_include(<FirebaseFirestore/FirebaseFirestore.h>)
+    #import <FirebaseFirestore/FirebaseFirestore.h>
+  #endif
+
+  #if __has_include(<FirebaseFunctions/FirebaseFunctions.h>)
+    #import <FirebaseFunctions/FirebaseFunctions.h>
+  #endif
+
+  #if __has_include(<FirebaseInstanceID/FirebaseInstanceID.h>)
+    #import <FirebaseInstanceID/FirebaseInstanceID.h>
+  #endif
+
+  #if __has_include(<FirebaseInvites/FirebaseInvites.h>)
+    #import <FirebaseInvites/FirebaseInvites.h>
+  #endif
+
+  #if __has_include(<FirebaseMessaging/FirebaseMessaging.h>)
+    #import <FirebaseMessaging/FirebaseMessaging.h>
+  #endif
+
+  #if __has_include(<FirebaseMLModelInterpreter/FirebaseMLModelInterpreter.h>)
+    #import <FirebaseMLModelInterpreter/FirebaseMLModelInterpreter.h>
+  #endif
+
+  #if __has_include(<FirebaseMLVision/FirebaseMLVision.h>)
+    #import <FirebaseMLVision/FirebaseMLVision.h>
+  #endif
+
+  #if __has_include(<FirebaseMLVisionBarcodeModel/FirebaseMLVisionBarcodeModel.h>)
+    #import <FirebaseMLVisionBarcodeModel/FirebaseMLVisionBarcodeModel.h>
+  #endif
+
+  #if __has_include(<FirebaseMLVisionFaceModel/FirebaseMLVisionFaceModel.h>)
+    #import <FirebaseMLVisionFaceModel/FirebaseMLVisionFaceModel.h>
+  #endif
+
+  #if __has_include(<FirebaseMLVisionLabelModel/FirebaseMLVisionLabelModel.h>)
+    #import <FirebaseMLVisionLabelModel/FirebaseMLVisionLabelModel.h>
+  #endif
+
+  #if __has_include(<FirebaseMLVisionTextModel/FirebaseMLVisionTextModel.h>)
+    #import <FirebaseMLVisionTextModel/FirebaseMLVisionTextModel.h>
+  #endif
+
+  #if __has_include(<FirebasePerformance/FirebasePerformance.h>)
+    #import <FirebasePerformance/FirebasePerformance.h>
+  #endif
+
+  #if __has_include(<FirebaseRemoteConfig/FirebaseRemoteConfig.h>)
+    #import <FirebaseRemoteConfig/FirebaseRemoteConfig.h>
+  #endif
+
+  #if __has_include(<FirebaseStorage/FirebaseStorage.h>)
+    #import <FirebaseStorage/FirebaseStorage.h>
+  #endif
+
+  #if __has_include(<GoogleMobileAds/GoogleMobileAds.h>)
+    #import <GoogleMobileAds/GoogleMobileAds.h>
+  #endif
+
+  #if __has_include(<Fabric/Fabric.h>)
+    #import <Fabric/Fabric.h>
+  #endif
+
+  #if __has_include(<Crashlytics/Crashlytics.h>)
+    #import <Crashlytics/Crashlytics.h>
+  #endif
+
+#endif  // defined(__has_include)

二进制
Libraries external/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging


+ 527 - 0
Libraries external/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h

@@ -0,0 +1,527 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ *  @related FIRMessaging
+ *
+ *  The completion handler invoked when the registration token returns.
+ *  If the call fails we return the appropriate `error code`, described by
+ *  `FIRMessagingError`.
+ *
+ *  @param FCMToken  The valid registration token returned by FCM.
+ *  @param error     The error describing why a token request failed. The error code
+ *                   will match a value from the FIRMessagingError enumeration.
+ */
+typedef void(^FIRMessagingFCMTokenFetchCompletion)(NSString * _Nullable FCMToken,
+    NSError * _Nullable error)
+    NS_SWIFT_NAME(MessagingFCMTokenFetchCompletion);
+
+
+/**
+ *  @related FIRMessaging
+ *
+ *  The completion handler invoked when the registration token deletion request is
+ *  completed. If the call fails we return the appropriate `error code`, described
+ *  by `FIRMessagingError`.
+ *
+ *  @param error The error describing why a token deletion failed. The error code
+ *               will match a value from the FIRMessagingError enumeration.
+ */
+typedef void(^FIRMessagingDeleteFCMTokenCompletion)(NSError * _Nullable error)
+    NS_SWIFT_NAME(MessagingDeleteFCMTokenCompletion);
+
+/**
+ *  Callback to invoke once the HTTP call to FIRMessaging backend for updating
+ *  subscription finishes.
+ *
+ *  @param error  The error which occurred while updating the subscription topic
+ *                on the FIRMessaging server. This will be nil in case the operation
+ *                was successful, or if the operation was cancelled.
+ */
+typedef void (^FIRMessagingTopicOperationCompletion)(NSError *_Nullable error);
+
+/**
+ *  The completion handler invoked once the data connection with FIRMessaging is
+ *  established.  The data connection is used to send a continous stream of
+ *  data and all the FIRMessaging data notifications arrive through this connection.
+ *  Once the connection is established we invoke the callback with `nil` error.
+ *  Correspondingly if we get an error while trying to establish a connection
+ *  we invoke the handler with an appropriate error object and do an
+ *  exponential backoff to try and connect again unless successful.
+ *
+ *  @param error The error object if any describing why the data connection
+ *               to FIRMessaging failed.
+ */
+typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error)
+    NS_SWIFT_NAME(MessagingConnectCompletion)
+    __deprecated_msg("Please listen for the FIRMessagingConnectionStateChangedNotification "
+                     "NSNotification instead.");
+
+#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
+/**
+ *  Notification sent when the upstream message has been delivered
+ *  successfully to the server. The notification object will be the messageID
+ *  of the successfully delivered message.
+ */
+FOUNDATION_EXPORT const NSNotificationName FIRMessagingSendSuccessNotification
+    NS_SWIFT_NAME(MessagingSendSuccess);
+
+/**
+ *  Notification sent when the upstream message was failed to be sent to the
+ *  server.  The notification object will be the messageID of the failed
+ *  message. The userInfo dictionary will contain the relevant error
+ *  information for the failure.
+ */
+FOUNDATION_EXPORT const NSNotificationName FIRMessagingSendErrorNotification
+    NS_SWIFT_NAME(MessagingSendError);
+
+/**
+ *  Notification sent when the Firebase messaging server deletes pending
+ *  messages due to exceeded storage limits. This may occur, for example, when
+ *  the device cannot be reached for an extended period of time.
+ *
+ *  It is recommended to retrieve any missing messages directly from the
+ *  server.
+ */
+FOUNDATION_EXPORT const NSNotificationName FIRMessagingMessagesDeletedNotification
+    NS_SWIFT_NAME(MessagingMessagesDeleted);
+
+/**
+ *  Notification sent when Firebase Messaging establishes or disconnects from
+ *  an FCM socket connection. You can query the connection state in this
+ *  notification by checking the `isDirectChannelEstablished` property of FIRMessaging.
+ */
+FOUNDATION_EXPORT const NSNotificationName FIRMessagingConnectionStateChangedNotification
+    NS_SWIFT_NAME(MessagingConnectionStateChanged);
+
+/**
+ *  Notification sent when the FCM registration token has been refreshed. Please use the
+ *  FIRMessaging delegate method `messaging:didReceiveRegistrationToken:` to receive current and
+ *  updated tokens.
+ */
+FOUNDATION_EXPORT const NSNotificationName
+    FIRMessagingRegistrationTokenRefreshedNotification
+    NS_SWIFT_NAME(MessagingRegistrationTokenRefreshed);
+#else
+/**
+ *  Notification sent when the upstream message has been delivered
+ *  successfully to the server. The notification object will be the messageID
+ *  of the successfully delivered message.
+ */
+FOUNDATION_EXPORT NSString *const FIRMessagingSendSuccessNotification
+    NS_SWIFT_NAME(MessagingSendSuccessNotification);
+
+/**
+ *  Notification sent when the upstream message was failed to be sent to the
+ *  server.  The notification object will be the messageID of the failed
+ *  message. The userInfo dictionary will contain the relevant error
+ *  information for the failure.
+ */
+FOUNDATION_EXPORT NSString *const FIRMessagingSendErrorNotification
+    NS_SWIFT_NAME(MessagingSendErrorNotification);
+
+/**
+ *  Notification sent when the Firebase messaging server deletes pending
+ *  messages due to exceeded storage limits. This may occur, for example, when
+ *  the device cannot be reached for an extended period of time.
+ *
+ *  It is recommended to retrieve any missing messages directly from the
+ *  server.
+ */
+FOUNDATION_EXPORT NSString *const FIRMessagingMessagesDeletedNotification
+    NS_SWIFT_NAME(MessagingMessagesDeletedNotification);
+
+/**
+ *  Notification sent when Firebase Messaging establishes or disconnects from
+ *  an FCM socket connection. You can query the connection state in this
+ *  notification by checking the `isDirectChannelEstablished` property of FIRMessaging.
+ */
+FOUNDATION_EXPORT NSString *const FIRMessagingConnectionStateChangedNotification
+    NS_SWIFT_NAME(MessagingConnectionStateChangedNotification);
+
+/**
+ *  Notification sent when the FCM registration token has been refreshed. Please use the
+ *  FIRMessaging delegate method `messaging:didReceiveRegistrationToken:` to receive current and
+ *  updated tokens.
+ */
+FOUNDATION_EXPORT NSString *const FIRMessagingRegistrationTokenRefreshedNotification
+    NS_SWIFT_NAME(MessagingRegistrationTokenRefreshedNotification);
+#endif  // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
+
+/**
+ *  @enum FIRMessagingError
+ */
+typedef NS_ENUM(NSUInteger, FIRMessagingError) {
+  /// Unknown error.
+  FIRMessagingErrorUnknown = 0,
+
+  /// FIRMessaging couldn't validate request from this client.
+  FIRMessagingErrorAuthentication = 1,
+
+  /// InstanceID service cannot be accessed.
+  FIRMessagingErrorNoAccess = 2,
+
+  /// Request to InstanceID backend timed out.
+  FIRMessagingErrorTimeout = 3,
+
+  /// No network available to reach the servers.
+  FIRMessagingErrorNetwork = 4,
+
+  /// Another similar operation in progress, bailing this one.
+  FIRMessagingErrorOperationInProgress = 5,
+
+  /// Some parameters of the request were invalid.
+  FIRMessagingErrorInvalidRequest = 7,
+} NS_SWIFT_NAME(MessagingError);
+
+/// Status for the downstream message received by the app.
+typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) {
+  /// Unknown status.
+  FIRMessagingMessageStatusUnknown,
+  /// New downstream message received by the app.
+  FIRMessagingMessageStatusNew,
+} NS_SWIFT_NAME(MessagingMessageStatus);
+
+/**
+ *  The APNS token type for the app. If the token type is set to `UNKNOWN`
+ *  Firebase Messaging will implicitly try to figure out what the actual token type
+ *  is from the provisioning profile.
+ *  Unless you really need to specify the type, you should use the `APNSToken`
+ *  property instead.
+ */
+typedef NS_ENUM(NSInteger, FIRMessagingAPNSTokenType) {
+  /// Unknown token type.
+  FIRMessagingAPNSTokenTypeUnknown,
+  /// Sandbox token type.
+  FIRMessagingAPNSTokenTypeSandbox,
+  /// Production token type.
+  FIRMessagingAPNSTokenTypeProd,
+} NS_SWIFT_NAME(MessagingAPNSTokenType);
+
+/// Information about a downstream message received by the app.
+NS_SWIFT_NAME(MessagingMessageInfo)
+@interface FIRMessagingMessageInfo : NSObject
+
+/// The status of the downstream message
+@property(nonatomic, readonly, assign) FIRMessagingMessageStatus status;
+
+@end
+
+/**
+ * A remote data message received by the app via FCM (not just the APNs interface).
+ *
+ * This is only for devices running iOS 10 or above. To support devices running iOS 9 or below, use
+ * the local and remote notifications handlers defined in UIApplicationDelegate protocol.
+ */
+NS_SWIFT_NAME(MessagingRemoteMessage)
+@interface FIRMessagingRemoteMessage : NSObject
+
+/// The downstream message received by the application.
+@property(nonatomic, readonly, strong) NSDictionary *appData;
+@end
+
+@class FIRMessaging;
+/**
+ * A protocol to handle token update or data message delivery from FCM.
+ *
+ */
+NS_SWIFT_NAME(MessagingDelegate)
+@protocol FIRMessagingDelegate <NSObject>
+
+@optional
+/// This method will be called once a token is available, or has been refreshed. Typically it
+/// will be called once per app start, but may be called more often, if token is invalidated or
+/// updated. In this method, you should perform operations such as:
+///
+/// * Uploading the FCM token to your application server, so targeted notifications can be sent.
+///
+/// * Subscribing to any topics.
+- (void)messaging:(FIRMessaging *)messaging
+    didReceiveRegistrationToken:(NSString *)fcmToken
+    NS_SWIFT_NAME(messaging(_:didReceiveRegistrationToken:));
+
+/// This method is called on iOS 10 devices to handle data messages received via FCM through its
+/// direct channel (not via APNS). For iOS 9 and below, the FCM data message is delivered via the
+/// UIApplicationDelegate's -application:didReceiveRemoteNotification: method.
+- (void)messaging:(FIRMessaging *)messaging
+    didReceiveMessage:(FIRMessagingRemoteMessage *)remoteMessage
+    NS_SWIFT_NAME(messaging(_:didReceive:))
+    __IOS_AVAILABLE(10.0);
+
+@end
+
+/**
+ *  Firebase Messaging lets you reliably deliver messages at no cost.
+ *
+ *  To send or receive messages, the app must get a
+ *  registration token from FIRInstanceID. This token authorizes an
+ *  app server to send messages to an app instance.
+ *
+ *  In order to receive FIRMessaging messages, declare `application:didReceiveRemoteNotification:`.
+ */
+NS_SWIFT_NAME(Messaging)
+@interface FIRMessaging : NSObject
+
+/**
+ * Delegate to handle FCM token refreshes, and remote data messages received via FCM for devices
+ * running iOS 10 or above.
+ */
+@property(nonatomic, weak, nullable) id<FIRMessagingDelegate> delegate;
+
+/**
+ *  When set to `YES`, Firebase Messaging will automatically establish a socket-based, direct
+ *  channel to the FCM server. Enable this only if you are sending upstream messages or
+ *  receiving non-APNS, data-only messages in foregrounded apps.
+ *  Default is `NO`.
+ */
+@property(nonatomic) BOOL shouldEstablishDirectChannel;
+
+/**
+ *  Returns `YES` if the direct channel to the FCM server is active, and `NO` otherwise.
+ */
+@property(nonatomic, readonly) BOOL isDirectChannelEstablished;
+
+/**
+ *  FIRMessaging
+ *
+ *  @return An instance of FIRMessaging.
+ */
++ (instancetype)messaging NS_SWIFT_NAME(messaging());
+
+/**
+ *  Unavailable. Use +messaging instead.
+ */
+- (instancetype)init __attribute__((unavailable("Use +messaging instead.")));
+
+#pragma mark - APNS
+
+/**
+ *  This property is used to set the APNS Token received by the application delegate.
+ *
+ *  FIRMessaging uses method swizzling to ensure that the APNS token is set
+ *  automatically. However, if you have disabled swizzling by setting
+ *  `FirebaseAppDelegateProxyEnabled` to `NO` in your app's
+ *  Info.plist, you should manually set the APNS token in your application
+ *  delegate's `-application:didRegisterForRemoteNotificationsWithDeviceToken:`
+ *  method.
+ *
+ *  If you would like to set the type of the APNS token, rather than relying on
+ *  automatic detection, see: `-setAPNSToken:type:`.
+ */
+@property(nonatomic, copy, nullable) NSData *APNSToken NS_SWIFT_NAME(apnsToken);
+
+/**
+ *  Set APNS token for the application. This APNS token will be used to register
+ *  with Firebase Messaging using `FCMToken` or
+ *  `tokenWithAuthorizedEntity:scope:options:handler`.
+ *
+ *  @param apnsToken The APNS token for the application.
+ *  @param type  The type of APNS token. Debug builds should use
+ *  FIRMessagingAPNSTokenTypeSandbox. Alternatively, you can supply
+ *  FIRMessagingAPNSTokenTypeUnknown to have the type automatically
+ *  detected based on your provisioning profile.
+ */
+- (void)setAPNSToken:(NSData *)apnsToken type:(FIRMessagingAPNSTokenType)type;
+
+#pragma mark - FCM Tokens
+
+/**
+ * Is Firebase Messaging token auto generation enabled?  If this flag is disabled,
+ * Firebase Messaging will not generate token automatically for message delivery.
+ *
+ * If this flag is disabled, Firebase Messaging does not generate new tokens automatically for
+ * message delivery. If this flag is enabled, FCM generates a registration token on application
+ * start when there is no existing valid token. FCM also generates a new token when an existing
+ * token is deleted.
+ *
+ * This setting is persisted, and is applied on future
+ * invocations of your application.  Once explicitly set, it overrides any
+ * settings in your Info.plist.
+ *
+ * By default, FCM automatic initialization is enabled.  If you need to change the
+ * default (for example, because you want to prompt the user before getting token)
+ * set FirebaseMessagingAutoInitEnabled to false in your application's Info.plist.
+ */
+@property(nonatomic, assign, getter=isAutoInitEnabled) BOOL autoInitEnabled;
+
+/**
+ *  The FCM token is used to identify this device so that FCM can send notifications to it.
+ *  It is associated with your APNS token when the APNS token is supplied, so that sending
+ *  messages to the FCM token will be delivered over APNS.
+ *
+ *  The FCM token is sometimes refreshed automatically. In your FIRMessaging delegate, the
+ *  delegate method `messaging:didReceiveRegistrationToken:` will be called once a token is
+ *  available, or has been refreshed. Typically it should be called once per app start, but
+ *  may be called more often, if token is invalidated or updated.
+ *
+ *  Once you have an FCM token, you should send it to your application server, so it can use
+ *  the FCM token to send notifications to your device.
+ */
+@property(nonatomic, readonly, nullable) NSString *FCMToken NS_SWIFT_NAME(fcmToken);
+
+
+/**
+ *  Retrieves an FCM registration token for a particular Sender ID. This can be used to allow
+ *  multiple senders to send notifications to the same device. By providing a different Sender
+ *  ID than your default when fetching a token, you can create a new FCM token which you can
+ *  give to a different sender. Both tokens will deliver notifications to your device, and you
+ *  can revoke a token when you need to.
+ *
+ *  This registration token is not cached by FIRMessaging. FIRMessaging should have an APNS
+ *  token set before calling this to ensure that notifications can be delivered via APNS using
+ *  this FCM token. You may re-retrieve the FCM token once you have the APNS token set, to
+ *  associate it with the FCM token. The default FCM token is automatically associated with
+ *  the APNS token, if the APNS token data is available.
+ *
+ *  @param senderID The Sender ID for a particular Firebase project.
+ *  @param completion The completion handler to handle the token request.
+ */
+- (void)retrieveFCMTokenForSenderID:(NSString *)senderID
+                         completion:(FIRMessagingFCMTokenFetchCompletion)completion
+    NS_SWIFT_NAME(retrieveFCMToken(forSenderID:completion:));
+
+
+/**
+ *  Invalidates an FCM token for a particular Sender ID. That Sender ID cannot no longer send
+ *  notifications to that FCM token.
+ *
+ *  @param senderID The senderID for a particular Firebase project.
+ *  @param completion The completion handler to handle the token deletion.
+ */
+- (void)deleteFCMTokenForSenderID:(NSString *)senderID
+                       completion:(FIRMessagingDeleteFCMTokenCompletion)completion
+    NS_SWIFT_NAME(deleteFCMToken(forSenderID:completion:));
+
+
+#pragma mark - Connect
+
+/**
+ *  Create a FIRMessaging data connection which will be used to send the data notifications
+ *  sent by your server. It will also be used to send ACKS and other messages based
+ *  on the FIRMessaging ACKS and other messages based  on the FIRMessaging protocol.
+ *
+ *
+ *  @param handler  The handler to be invoked once the connection is established.
+ *                  If the connection fails we invoke the handler with an
+ *                  appropriate error code letting you know why it failed. At
+ *                  the same time, FIRMessaging performs exponential backoff to retry
+ *                  establishing a connection and invoke the handler when successful.
+ */
+- (void)connectWithCompletion:(FIRMessagingConnectCompletion)handler
+    NS_SWIFT_NAME(connect(handler:))
+    __deprecated_msg("Please use the shouldEstablishDirectChannel property instead.");
+
+/**
+ *  Disconnect the current FIRMessaging data connection. This stops any attempts to
+ *  connect to FIRMessaging. Calling this on an already disconnected client is a no-op.
+ *
+ *  Call this before `teardown` when your app is going to the background.
+ *  Since the FIRMessaging connection won't be allowed to live when in the background, it is
+ *  prudent to close the connection.
+ */
+- (void)disconnect
+      __deprecated_msg("Please use the shouldEstablishDirectChannel property instead.");
+
+#pragma mark - Topics
+
+/**
+ *  Asynchronously subscribes to a topic.
+ *
+ *  @param topic The name of the topic, for example, @"sports".
+ */
+- (void)subscribeToTopic:(NSString *)topic NS_SWIFT_NAME(subscribe(toTopic:));
+
+/**
+ *  Asynchronously subscribe to the provided topic, retrying on failure.
+ *
+ *  @param topic       The topic name to subscribe to, for example, @"sports".
+ *  @param completion  The completion that is invoked once the subscribe call ends.
+ *                     In case of success, nil error is returned. Otherwise, an
+ *                     appropriate error object is returned.
+ */
+- (void)subscribeToTopic:(nonnull NSString *)topic
+              completion:(nullable FIRMessagingTopicOperationCompletion)completion;
+
+/**
+ *  Asynchronously unsubscribe from a topic.
+ *
+ *  @param topic The name of the topic, for example @"sports".
+ */
+- (void)unsubscribeFromTopic:(NSString *)topic NS_SWIFT_NAME(unsubscribe(fromTopic:));
+
+/**
+ *  Asynchronously unsubscribe from the provided topic, retrying on failure.
+ *
+ *  @param topic       The topic name to unsubscribe from, for example @"sports".
+ *  @param completion  The completion that is invoked once the unsubscribe call ends.
+ *                     In case of success, nil error is returned. Otherwise, an
+ *                     appropriate error object is returned.
+ */
+- (void)unsubscribeFromTopic:(nonnull NSString *)topic
+                  completion:(nullable FIRMessagingTopicOperationCompletion)completion;
+
+#pragma mark - Upstream
+
+/**
+ *  Sends an upstream ("device to cloud") message.
+ *
+ *  The message is queued if we don't have an active connection.
+ *  You can only use the upstream feature if your FCM implementation
+ *  uses the XMPP server protocol.
+ *
+ *  @param message      Key/Value pairs to be sent. Values must be String, any
+ *                      other type will be ignored.
+ *  @param receiver     A string identifying the receiver of the message. For FCM
+ *                      project IDs the value is `SENDER_ID@gcm.googleapis.com`.
+ *  @param messageID    The ID of the message. This is generated by the application. It
+ *                      must be unique for each message generated by this application.
+ *                      It allows error callbacks and debugging, to uniquely identify
+ *                      each message.
+ *  @param ttl          The time to live for the message. In case we aren't able to
+ *                      send the message before the TTL expires we will send you a
+ *                      callback. If 0, we'll attempt to send immediately and return
+ *                      an error if we're not connected.  Otherwise, the message will
+ *                      be queued.  As for server-side messages, we don't return an error
+ *                      if the message has been dropped because of TTL; this can happen
+ *                      on the server side, and it would require extra communication.
+ */
+- (void)sendMessage:(NSDictionary *)message
+                 to:(NSString *)receiver
+      withMessageID:(NSString *)messageID
+         timeToLive:(int64_t)ttl;
+
+#pragma mark - Analytics
+
+/**
+ *  Use this to track message delivery and analytics for messages, typically
+ *  when you receive a notification in `application:didReceiveRemoteNotification:`.
+ *  However, you only need to call this if you set the `FirebaseAppDelegateProxyEnabled`
+ *  flag to `NO` in your Info.plist. If `FirebaseAppDelegateProxyEnabled` is either missing
+ *  or set to `YES` in your Info.plist, the library will call this automatically.
+ *
+ *  @param message The downstream message received by the application.
+ *
+ *  @return Information about the downstream message.
+ */
+- (FIRMessagingMessageInfo *)appDidReceiveMessage:(NSDictionary *)message;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 17 - 0
Libraries external/Firebase/Messaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h

@@ -0,0 +1,17 @@
+/*
+ * Copyright 2017 Google
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#import "FIRMessaging.h"

+ 2 - 5
Libraries external/Analytics/FirebaseMessaging.framework/Modules/module.modulemap → Libraries external/Firebase/Messaging/FirebaseMessaging.framework/Modules/module.modulemap

@@ -2,9 +2,6 @@ framework module FirebaseMessaging {
   umbrella header "FirebaseMessaging.h"
   export *
   module * { export *}
-  link "c++"
-  link "sqlite3"
-  link "z"
   link framework "SystemConfiguration"
-  link framework "UIKit"
-}
+  link "sqlite3"
+}

+ 182 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/Any.pbobjc.h

@@ -0,0 +1,182 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/protobuf/any.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBDescriptor.h>
+ #import <Protobuf/GPBMessage.h>
+ #import <Protobuf/GPBRootObject.h>
+#else
+ #import "GPBDescriptor.h"
+ #import "GPBMessage.h"
+ #import "GPBRootObject.h"
+#endif
+
+#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
+#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
+#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+CF_EXTERN_C_BEGIN
+
+NS_ASSUME_NONNULL_BEGIN
+
+#pragma mark - GPBAnyRoot
+
+/**
+ * Exposes the extension registry for this file.
+ *
+ * The base class provides:
+ * @code
+ *   + (GPBExtensionRegistry *)extensionRegistry;
+ * @endcode
+ * which is a @c GPBExtensionRegistry that includes all the extensions defined by
+ * this file and all files that it depends on.
+ **/
+@interface GPBAnyRoot : GPBRootObject
+@end
+
+#pragma mark - GPBAny
+
+typedef GPB_ENUM(GPBAny_FieldNumber) {
+  GPBAny_FieldNumber_TypeURL = 1,
+  GPBAny_FieldNumber_Value = 2,
+};
+
+/**
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
+ * URL that describes the type of the serialized message.
+ *
+ * Protobuf library provides support to pack/unpack Any values in the form
+ * of utility functions or additional generated methods of the Any type.
+ *
+ * Example 1: Pack and unpack a message in C++.
+ *
+ *     Foo foo = ...;
+ *     Any any;
+ *     any.PackFrom(foo);
+ *     ...
+ *     if (any.UnpackTo(&foo)) {
+ *       ...
+ *     }
+ *
+ * Example 2: Pack and unpack a message in Java.
+ *
+ *     Foo foo = ...;
+ *     Any any = Any.pack(foo);
+ *     ...
+ *     if (any.is(Foo.class)) {
+ *       foo = any.unpack(Foo.class);
+ *     }
+ *
+ *  Example 3: Pack and unpack a message in Python.
+ *
+ *     foo = Foo(...)
+ *     any = Any()
+ *     any.Pack(foo)
+ *     ...
+ *     if any.Is(Foo.DESCRIPTOR):
+ *       any.Unpack(foo)
+ *       ...
+ *
+ *  Example 4: Pack and unpack a message in Go
+ *
+ *      foo := &pb.Foo{...}
+ *      any, err := ptypes.MarshalAny(foo)
+ *      ...
+ *      foo := &pb.Foo{}
+ *      if err := ptypes.UnmarshalAny(any, foo); err != nil {
+ *        ...
+ *      }
+ *
+ * The pack methods provided by protobuf library will by default use
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
+ * methods only use the fully qualified type name after the last '/'
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
+ * name "y.z".
+ *
+ *
+ * JSON
+ * ====
+ * The JSON representation of an `Any` value uses the regular
+ * representation of the deserialized, embedded message, with an
+ * additional field `\@type` which contains the type URL. Example:
+ *
+ *     package google.profile;
+ *     message Person {
+ *       string first_name = 1;
+ *       string last_name = 2;
+ *     }
+ *
+ *     {
+ *       "\@type": "type.googleapis.com/google.profile.Person",
+ *       "firstName": <string>,
+ *       "lastName": <string>
+ *     }
+ *
+ * If the embedded message type is well-known and has a custom JSON
+ * representation, that representation will be embedded adding a field
+ * `value` which holds the custom JSON in addition to the `\@type`
+ * field. Example (for message [google.protobuf.Duration][]):
+ *
+ *     {
+ *       "\@type": "type.googleapis.com/google.protobuf.Duration",
+ *       "value": "1.212s"
+ *     }
+ **/
+@interface GPBAny : GPBMessage
+
+/**
+ * A URL/resource name that uniquely identifies the type of the serialized
+ * protocol buffer message. The last segment of the URL's path must represent
+ * the fully qualified name of the type (as in
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
+ * (e.g., leading "." is not accepted).
+ *
+ * In practice, teams usually precompile into the binary all types that they
+ * expect it to use in the context of Any. However, for URLs which use the
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
+ * server that maps type URLs to message definitions as follows:
+ *
+ * * If no scheme is provided, `https` is assumed.
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
+ *   value in binary format, or produce an error.
+ * * Applications are allowed to cache lookup results based on the
+ *   URL, or have them precompiled into a binary to avoid any
+ *   lookup. Therefore, binary compatibility needs to be preserved
+ *   on changes to types. (Use versioned type names to manage
+ *   breaking changes.)
+ *
+ * Note: this functionality is not currently available in the official
+ * protobuf release, and it is not used for type URLs beginning with
+ * type.googleapis.com.
+ *
+ * Schemes other than `http`, `https` (or the empty scheme) might be
+ * used with implementation specific semantics.
+ **/
+@property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL;
+
+/** Must be a valid serialized protocol buffer of the above specified type. */
+@property(nonatomic, readwrite, copy, null_resettable) NSData *value;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+CF_EXTERN_C_END
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)

+ 311 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/Api.pbobjc.h

@@ -0,0 +1,311 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/protobuf/api.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBDescriptor.h>
+ #import <Protobuf/GPBMessage.h>
+ #import <Protobuf/GPBRootObject.h>
+#else
+ #import "GPBDescriptor.h"
+ #import "GPBMessage.h"
+ #import "GPBRootObject.h"
+#endif
+
+#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
+#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
+#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+CF_EXTERN_C_BEGIN
+
+@class GPBMethod;
+@class GPBMixin;
+@class GPBOption;
+@class GPBSourceContext;
+GPB_ENUM_FWD_DECLARE(GPBSyntax);
+
+NS_ASSUME_NONNULL_BEGIN
+
+#pragma mark - GPBApiRoot
+
+/**
+ * Exposes the extension registry for this file.
+ *
+ * The base class provides:
+ * @code
+ *   + (GPBExtensionRegistry *)extensionRegistry;
+ * @endcode
+ * which is a @c GPBExtensionRegistry that includes all the extensions defined by
+ * this file and all files that it depends on.
+ **/
+@interface GPBApiRoot : GPBRootObject
+@end
+
+#pragma mark - GPBApi
+
+typedef GPB_ENUM(GPBApi_FieldNumber) {
+  GPBApi_FieldNumber_Name = 1,
+  GPBApi_FieldNumber_MethodsArray = 2,
+  GPBApi_FieldNumber_OptionsArray = 3,
+  GPBApi_FieldNumber_Version = 4,
+  GPBApi_FieldNumber_SourceContext = 5,
+  GPBApi_FieldNumber_MixinsArray = 6,
+  GPBApi_FieldNumber_Syntax = 7,
+};
+
+/**
+ * Api is a light-weight descriptor for an API Interface.
+ *
+ * Interfaces are also described as "protocol buffer services" in some contexts,
+ * such as by the "service" keyword in a .proto file, but they are different
+ * from API Services, which represent a concrete implementation of an interface
+ * as opposed to simply a description of methods and bindings. They are also
+ * sometimes simply referred to as "APIs" in other contexts, such as the name of
+ * this message itself. See https://cloud.google.com/apis/design/glossary for
+ * detailed terminology.
+ **/
+@interface GPBApi : GPBMessage
+
+/**
+ * The fully qualified name of this interface, including package name
+ * followed by the interface's simple name.
+ **/
+@property(nonatomic, readwrite, copy, null_resettable) NSString *name;
+
+/** The methods of this interface, in unspecified order. */
+@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBMethod*> *methodsArray;
+/** The number of items in @c methodsArray without causing the array to be created. */
+@property(nonatomic, readonly) NSUInteger methodsArray_Count;
+
+/** Any metadata attached to the interface. */
+@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray;
+/** The number of items in @c optionsArray without causing the array to be created. */
+@property(nonatomic, readonly) NSUInteger optionsArray_Count;
+
+/**
+ * A version string for this interface. If specified, must have the form
+ * `major-version.minor-version`, as in `1.10`. If the minor version is
+ * omitted, it defaults to zero. If the entire version field is empty, the
+ * major version is derived from the package name, as outlined below. If the
+ * field is not empty, the version in the package name will be verified to be
+ * consistent with what is provided here.
+ *
+ * The versioning schema uses [semantic
+ * versioning](http://semver.org) where the major version number
+ * indicates a breaking change and the minor version an additive,
+ * non-breaking change. Both version numbers are signals to users
+ * what to expect from different versions, and should be carefully
+ * chosen based on the product plan.
+ *
+ * The major version is also reflected in the package name of the
+ * interface, which must end in `v<major-version>`, as in
+ * `google.feature.v1`. For major versions 0 and 1, the suffix can
+ * be omitted. Zero major versions must only be used for
+ * experimental, non-GA interfaces.
+ **/
+@property(nonatomic, readwrite, copy, null_resettable) NSString *version;
+
+/**
+ * Source context for the protocol buffer service represented by this
+ * message.
+ **/
+@property(nonatomic, readwrite, strong, null_resettable) GPBSourceContext *sourceContext;
+/** Test to see if @c sourceContext has been set. */
+@property(nonatomic, readwrite) BOOL hasSourceContext;
+
+/** Included interfaces. See [Mixin][]. */
+@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBMixin*> *mixinsArray;
+/** The number of items in @c mixinsArray without causing the array to be created. */
+@property(nonatomic, readonly) NSUInteger mixinsArray_Count;
+
+/** The source syntax of the service. */
+@property(nonatomic, readwrite) enum GPBSyntax syntax;
+
+@end
+
+/**
+ * Fetches the raw value of a @c GPBApi's @c syntax property, even
+ * if the value was not defined by the enum at the time the code was generated.
+ **/
+int32_t GPBApi_Syntax_RawValue(GPBApi *message);
+/**
+ * Sets the raw value of an @c GPBApi's @c syntax property, allowing
+ * it to be set to a value that was not defined by the enum at the time the code
+ * was generated.
+ **/
+void SetGPBApi_Syntax_RawValue(GPBApi *message, int32_t value);
+
+#pragma mark - GPBMethod
+
+typedef GPB_ENUM(GPBMethod_FieldNumber) {
+  GPBMethod_FieldNumber_Name = 1,
+  GPBMethod_FieldNumber_RequestTypeURL = 2,
+  GPBMethod_FieldNumber_RequestStreaming = 3,
+  GPBMethod_FieldNumber_ResponseTypeURL = 4,
+  GPBMethod_FieldNumber_ResponseStreaming = 5,
+  GPBMethod_FieldNumber_OptionsArray = 6,
+  GPBMethod_FieldNumber_Syntax = 7,
+};
+
+/**
+ * Method represents a method of an API interface.
+ **/
+@interface GPBMethod : GPBMessage
+
+/** The simple name of this method. */
+@property(nonatomic, readwrite, copy, null_resettable) NSString *name;
+
+/** A URL of the input message type. */
+@property(nonatomic, readwrite, copy, null_resettable) NSString *requestTypeURL;
+
+/** If true, the request is streamed. */
+@property(nonatomic, readwrite) BOOL requestStreaming;
+
+/** The URL of the output message type. */
+@property(nonatomic, readwrite, copy, null_resettable) NSString *responseTypeURL;
+
+/** If true, the response is streamed. */
+@property(nonatomic, readwrite) BOOL responseStreaming;
+
+/** Any metadata attached to the method. */
+@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray;
+/** The number of items in @c optionsArray without causing the array to be created. */
+@property(nonatomic, readonly) NSUInteger optionsArray_Count;
+
+/** The source syntax of this method. */
+@property(nonatomic, readwrite) enum GPBSyntax syntax;
+
+@end
+
+/**
+ * Fetches the raw value of a @c GPBMethod's @c syntax property, even
+ * if the value was not defined by the enum at the time the code was generated.
+ **/
+int32_t GPBMethod_Syntax_RawValue(GPBMethod *message);
+/**
+ * Sets the raw value of an @c GPBMethod's @c syntax property, allowing
+ * it to be set to a value that was not defined by the enum at the time the code
+ * was generated.
+ **/
+void SetGPBMethod_Syntax_RawValue(GPBMethod *message, int32_t value);
+
+#pragma mark - GPBMixin
+
+typedef GPB_ENUM(GPBMixin_FieldNumber) {
+  GPBMixin_FieldNumber_Name = 1,
+  GPBMixin_FieldNumber_Root = 2,
+};
+
+/**
+ * Declares an API Interface to be included in this interface. The including
+ * interface must redeclare all the methods from the included interface, but
+ * documentation and options are inherited as follows:
+ *
+ * - If after comment and whitespace stripping, the documentation
+ *   string of the redeclared method is empty, it will be inherited
+ *   from the original method.
+ *
+ * - Each annotation belonging to the service config (http,
+ *   visibility) which is not set in the redeclared method will be
+ *   inherited.
+ *
+ * - If an http annotation is inherited, the path pattern will be
+ *   modified as follows. Any version prefix will be replaced by the
+ *   version of the including interface plus the [root][] path if
+ *   specified.
+ *
+ * Example of a simple mixin:
+ *
+ *     package google.acl.v1;
+ *     service AccessControl {
+ *       // Get the underlying ACL object.
+ *       rpc GetAcl(GetAclRequest) returns (Acl) {
+ *         option (google.api.http).get = "/v1/{resource=**}:getAcl";
+ *       }
+ *     }
+ *
+ *     package google.storage.v2;
+ *     service Storage {
+ *       rpc GetAcl(GetAclRequest) returns (Acl);
+ *
+ *       // Get a data record.
+ *       rpc GetData(GetDataRequest) returns (Data) {
+ *         option (google.api.http).get = "/v2/{resource=**}";
+ *       }
+ *     }
+ *
+ * Example of a mixin configuration:
+ *
+ *     apis:
+ *     - name: google.storage.v2.Storage
+ *       mixins:
+ *       - name: google.acl.v1.AccessControl
+ *
+ * The mixin construct implies that all methods in `AccessControl` are
+ * also declared with same name and request/response types in
+ * `Storage`. A documentation generator or annotation processor will
+ * see the effective `Storage.GetAcl` method after inherting
+ * documentation and annotations as follows:
+ *
+ *     service Storage {
+ *       // Get the underlying ACL object.
+ *       rpc GetAcl(GetAclRequest) returns (Acl) {
+ *         option (google.api.http).get = "/v2/{resource=**}:getAcl";
+ *       }
+ *       ...
+ *     }
+ *
+ * Note how the version in the path pattern changed from `v1` to `v2`.
+ *
+ * If the `root` field in the mixin is specified, it should be a
+ * relative path under which inherited HTTP paths are placed. Example:
+ *
+ *     apis:
+ *     - name: google.storage.v2.Storage
+ *       mixins:
+ *       - name: google.acl.v1.AccessControl
+ *         root: acls
+ *
+ * This implies the following inherited HTTP annotation:
+ *
+ *     service Storage {
+ *       // Get the underlying ACL object.
+ *       rpc GetAcl(GetAclRequest) returns (Acl) {
+ *         option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
+ *       }
+ *       ...
+ *     }
+ **/
+@interface GPBMixin : GPBMessage
+
+/** The fully qualified name of the interface which is included. */
+@property(nonatomic, readwrite, copy, null_resettable) NSString *name;
+
+/**
+ * If non-empty specifies a path under which inherited HTTP paths
+ * are rooted.
+ **/
+@property(nonatomic, readwrite, copy, null_resettable) NSString *root;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+CF_EXTERN_C_END
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)

+ 145 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/Duration.pbobjc.h

@@ -0,0 +1,145 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/protobuf/duration.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBDescriptor.h>
+ #import <Protobuf/GPBMessage.h>
+ #import <Protobuf/GPBRootObject.h>
+#else
+ #import "GPBDescriptor.h"
+ #import "GPBMessage.h"
+ #import "GPBRootObject.h"
+#endif
+
+#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
+#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
+#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+CF_EXTERN_C_BEGIN
+
+NS_ASSUME_NONNULL_BEGIN
+
+#pragma mark - GPBDurationRoot
+
+/**
+ * Exposes the extension registry for this file.
+ *
+ * The base class provides:
+ * @code
+ *   + (GPBExtensionRegistry *)extensionRegistry;
+ * @endcode
+ * which is a @c GPBExtensionRegistry that includes all the extensions defined by
+ * this file and all files that it depends on.
+ **/
+@interface GPBDurationRoot : GPBRootObject
+@end
+
+#pragma mark - GPBDuration
+
+typedef GPB_ENUM(GPBDuration_FieldNumber) {
+  GPBDuration_FieldNumber_Seconds = 1,
+  GPBDuration_FieldNumber_Nanos = 2,
+};
+
+/**
+ * A Duration represents a signed, fixed-length span of time represented
+ * as a count of seconds and fractions of seconds at nanosecond
+ * resolution. It is independent of any calendar and concepts like "day"
+ * or "month". It is related to Timestamp in that the difference between
+ * two Timestamp values is a Duration and it can be added or subtracted
+ * from a Timestamp. Range is approximately +-10,000 years.
+ *
+ * # Examples
+ *
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
+ *
+ *     Timestamp start = ...;
+ *     Timestamp end = ...;
+ *     Duration duration = ...;
+ *
+ *     duration.seconds = end.seconds - start.seconds;
+ *     duration.nanos = end.nanos - start.nanos;
+ *
+ *     if (duration.seconds < 0 && duration.nanos > 0) {
+ *       duration.seconds += 1;
+ *       duration.nanos -= 1000000000;
+ *     } else if (durations.seconds > 0 && duration.nanos < 0) {
+ *       duration.seconds -= 1;
+ *       duration.nanos += 1000000000;
+ *     }
+ *
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
+ *
+ *     Timestamp start = ...;
+ *     Duration duration = ...;
+ *     Timestamp end = ...;
+ *
+ *     end.seconds = start.seconds + duration.seconds;
+ *     end.nanos = start.nanos + duration.nanos;
+ *
+ *     if (end.nanos < 0) {
+ *       end.seconds -= 1;
+ *       end.nanos += 1000000000;
+ *     } else if (end.nanos >= 1000000000) {
+ *       end.seconds += 1;
+ *       end.nanos -= 1000000000;
+ *     }
+ *
+ * Example 3: Compute Duration from datetime.timedelta in Python.
+ *
+ *     td = datetime.timedelta(days=3, minutes=10)
+ *     duration = Duration()
+ *     duration.FromTimedelta(td)
+ *
+ * # JSON Mapping
+ *
+ * In JSON format, the Duration type is encoded as a string rather than an
+ * object, where the string ends in the suffix "s" (indicating seconds) and
+ * is preceded by the number of seconds, with nanoseconds expressed as
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
+ * microsecond should be expressed in JSON format as "3.000001s".
+ **/
+@interface GPBDuration : GPBMessage
+
+/**
+ * Signed seconds of the span of time. Must be from -315,576,000,000
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
+ **/
+@property(nonatomic, readwrite) int64_t seconds;
+
+/**
+ * Signed fractions of a second at nanosecond resolution of the span
+ * of time. Durations less than one second are represented with a 0
+ * `seconds` field and a positive or negative `nanos` field. For durations
+ * of one second or more, a non-zero value for the `nanos` field must be
+ * of the same sign as the `seconds` field. Must be from -999,999,999
+ * to +999,999,999 inclusive.
+ **/
+@property(nonatomic, readwrite) int32_t nanos;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+CF_EXTERN_C_END
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)

+ 74 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/Empty.pbobjc.h

@@ -0,0 +1,74 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/protobuf/empty.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBDescriptor.h>
+ #import <Protobuf/GPBMessage.h>
+ #import <Protobuf/GPBRootObject.h>
+#else
+ #import "GPBDescriptor.h"
+ #import "GPBMessage.h"
+ #import "GPBRootObject.h"
+#endif
+
+#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
+#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
+#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+CF_EXTERN_C_BEGIN
+
+NS_ASSUME_NONNULL_BEGIN
+
+#pragma mark - GPBEmptyRoot
+
+/**
+ * Exposes the extension registry for this file.
+ *
+ * The base class provides:
+ * @code
+ *   + (GPBExtensionRegistry *)extensionRegistry;
+ * @endcode
+ * which is a @c GPBExtensionRegistry that includes all the extensions defined by
+ * this file and all files that it depends on.
+ **/
+@interface GPBEmptyRoot : GPBRootObject
+@end
+
+#pragma mark - GPBEmpty
+
+/**
+ * A generic empty message that you can re-use to avoid defining duplicated
+ * empty messages in your APIs. A typical example is to use it as the request
+ * or the response type of an API method. For instance:
+ *
+ *     service Foo {
+ *       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
+ *     }
+ *
+ * The JSON representation for `Empty` is empty JSON object `{}`.
+ **/
+@interface GPBEmpty : GPBMessage
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+CF_EXTERN_C_END
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)

+ 281 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/FieldMask.pbobjc.h

@@ -0,0 +1,281 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/protobuf/field_mask.proto
+
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/GPBDescriptor.h>
+ #import <Protobuf/GPBMessage.h>
+ #import <Protobuf/GPBRootObject.h>
+#else
+ #import "GPBDescriptor.h"
+ #import "GPBMessage.h"
+ #import "GPBRootObject.h"
+#endif
+
+#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002
+#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION
+#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources.
+#endif
+
+// @@protoc_insertion_point(imports)
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+CF_EXTERN_C_BEGIN
+
+NS_ASSUME_NONNULL_BEGIN
+
+#pragma mark - GPBFieldMaskRoot
+
+/**
+ * Exposes the extension registry for this file.
+ *
+ * The base class provides:
+ * @code
+ *   + (GPBExtensionRegistry *)extensionRegistry;
+ * @endcode
+ * which is a @c GPBExtensionRegistry that includes all the extensions defined by
+ * this file and all files that it depends on.
+ **/
+@interface GPBFieldMaskRoot : GPBRootObject
+@end
+
+#pragma mark - GPBFieldMask
+
+typedef GPB_ENUM(GPBFieldMask_FieldNumber) {
+  GPBFieldMask_FieldNumber_PathsArray = 1,
+};
+
+/**
+ * `FieldMask` represents a set of symbolic field paths, for example:
+ *
+ *     paths: "f.a"
+ *     paths: "f.b.d"
+ *
+ * Here `f` represents a field in some root message, `a` and `b`
+ * fields in the message found in `f`, and `d` a field found in the
+ * message in `f.b`.
+ *
+ * Field masks are used to specify a subset of fields that should be
+ * returned by a get operation or modified by an update operation.
+ * Field masks also have a custom JSON encoding (see below).
+ *
+ * # Field Masks in Projections
+ *
+ * When used in the context of a projection, a response message or
+ * sub-message is filtered by the API to only contain those fields as
+ * specified in the mask. For example, if the mask in the previous
+ * example is applied to a response message as follows:
+ *
+ *     f {
+ *       a : 22
+ *       b {
+ *         d : 1
+ *         x : 2
+ *       }
+ *       y : 13
+ *     }
+ *     z: 8
+ *
+ * The result will not contain specific values for fields x,y and z
+ * (their value will be set to the default, and omitted in proto text
+ * output):
+ *
+ *
+ *     f {
+ *       a : 22
+ *       b {
+ *         d : 1
+ *       }
+ *     }
+ *
+ * A repeated field is not allowed except at the last position of a
+ * paths string.
+ *
+ * If a FieldMask object is not present in a get operation, the
+ * operation applies to all fields (as if a FieldMask of all fields
+ * had been specified).
+ *
+ * Note that a field mask does not necessarily apply to the
+ * top-level response message. In case of a REST get operation, the
+ * field mask applies directly to the response, but in case of a REST
+ * list operation, the mask instead applies to each individual message
+ * in the returned resource list. In case of a REST custom method,
+ * other definitions may be used. Where the mask applies will be
+ * clearly documented together with its declaration in the API.  In
+ * any case, the effect on the returned resource/resources is required
+ * behavior for APIs.
+ *
+ * # Field Masks in Update Operations
+ *
+ * A field mask in update operations specifies which fields of the
+ * targeted resource are going to be updated. The API is required
+ * to only change the values of the fields as specified in the mask
+ * and leave the others untouched. If a resource is passed in to
+ * describe the updated values, the API ignores the values of all
+ * fields not covered by the mask.
+ *
+ * If a repeated field is specified for an update operation, the existing
+ * repeated values in the target resource will be overwritten by the new values.
+ * Note that a repeated field is only allowed in the last position of a `paths`
+ * string.
+ *
+ * If a sub-message is specified in the last position of the field mask for an
+ * update operation, then the existing sub-message in the target resource is
+ * overwritten. Given the target message:
+ *
+ *     f {
+ *       b {
+ *         d : 1
+ *         x : 2
+ *       }
+ *       c : 1
+ *     }
+ *
+ * And an update message:
+ *
+ *     f {
+ *       b {
+ *         d : 10
+ *       }
+ *     }
+ *
+ * then if the field mask is:
+ *
+ *  paths: "f.b"
+ *
+ * then the result will be:
+ *
+ *     f {
+ *       b {
+ *         d : 10
+ *       }
+ *       c : 1
+ *     }
+ *
+ * However, if the update mask was:
+ *
+ *  paths: "f.b.d"
+ *
+ * then the result would be:
+ *
+ *     f {
+ *       b {
+ *         d : 10
+ *         x : 2
+ *       }
+ *       c : 1
+ *     }
+ *
+ * In order to reset a field's value to the default, the field must
+ * be in the mask and set to the default value in the provided resource.
+ * Hence, in order to reset all fields of a resource, provide a default
+ * instance of the resource and set all fields in the mask, or do
+ * not provide a mask as described below.
+ *
+ * If a field mask is not present on update, the operation applies to
+ * all fields (as if a field mask of all fields has been specified).
+ * Note that in the presence of schema evolution, this may mean that
+ * fields the client does not know and has therefore not filled into
+ * the request will be reset to their default. If this is unwanted
+ * behavior, a specific service may require a client to always specify
+ * a field mask, producing an error if not.
+ *
+ * As with get operations, the location of the resource which
+ * describes the updated values in the request message depends on the
+ * operation kind. In any case, the effect of the field mask is
+ * required to be honored by the API.
+ *
+ * ## Considerations for HTTP REST
+ *
+ * The HTTP kind of an update operation which uses a field mask must
+ * be set to PATCH instead of PUT in order to satisfy HTTP semantics
+ * (PUT must only be used for full updates).
+ *
+ * # JSON Encoding of Field Masks
+ *
+ * In JSON, a field mask is encoded as a single string where paths are
+ * separated by a comma. Fields name in each path are converted
+ * to/from lower-camel naming conventions.
+ *
+ * As an example, consider the following message declarations:
+ *
+ *     message Profile {
+ *       User user = 1;
+ *       Photo photo = 2;
+ *     }
+ *     message User {
+ *       string display_name = 1;
+ *       string address = 2;
+ *     }
+ *
+ * In proto a field mask for `Profile` may look as such:
+ *
+ *     mask {
+ *       paths: "user.display_name"
+ *       paths: "photo"
+ *     }
+ *
+ * In JSON, the same mask is represented as below:
+ *
+ *     {
+ *       mask: "user.displayName,photo"
+ *     }
+ *
+ * # Field Masks and Oneof Fields
+ *
+ * Field masks treat fields in oneofs just as regular fields. Consider the
+ * following message:
+ *
+ *     message SampleMessage {
+ *       oneof test_oneof {
+ *         string name = 4;
+ *         SubMessage sub_message = 9;
+ *       }
+ *     }
+ *
+ * The field mask can be:
+ *
+ *     mask {
+ *       paths: "name"
+ *     }
+ *
+ * Or:
+ *
+ *     mask {
+ *       paths: "sub_message"
+ *     }
+ *
+ * Note that oneof type names ("test_oneof" in this case) cannot be used in
+ * paths.
+ *
+ * ## Field Mask Verification
+ *
+ * The implementation of any API method which has a FieldMask type field in the
+ * request should verify the included field paths, and return an
+ * `INVALID_ARGUMENT` error if any path is duplicated or unmappable.
+ **/
+@interface GPBFieldMask : GPBMessage
+
+/** The set of field mask paths. */
+@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *pathsArray;
+/** The number of items in @c pathsArray without causing the array to be created. */
+@property(nonatomic, readonly) NSUInteger pathsArray_Count;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+CF_EXTERN_C_END
+
+#pragma clang diagnostic pop
+
+// @@protoc_insertion_point(global_scope)

+ 1967 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBArray.h

@@ -0,0 +1,1967 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2015 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+#import "GPBRuntimeTypes.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+//%PDDM-EXPAND DECLARE_ARRAYS()
+// This block of code is generated, do not edit it directly.
+
+#pragma mark - Int32
+
+/**
+ * Class used for repeated fields of int32_t values. This performs better than
+ * boxing into NSNumbers in NSArrays.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32Array : NSObject <NSCopying>
+
+/** The number of elements contained in the array. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * @return A newly instanced and empty GPBInt32Array.
+ **/
++ (instancetype)array;
+
+/**
+ * Creates and initializes a GPBInt32Array with the single element given.
+ *
+ * @param value The value to be placed in the array.
+ *
+ * @return A newly instanced GPBInt32Array with value in it.
+ **/
++ (instancetype)arrayWithValue:(int32_t)value;
+
+/**
+ * Creates and initializes a GPBInt32Array with the contents of the given
+ * array.
+ *
+ * @param array Array with the contents to be put into the new array.
+ *
+ * @return A newly instanced GPBInt32Array with the contents of array.
+ **/
++ (instancetype)arrayWithValueArray:(GPBInt32Array *)array;
+
+/**
+ * Creates and initializes a GPBInt32Array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly instanced GPBInt32Array with a capacity of count.
+ **/
++ (instancetype)arrayWithCapacity:(NSUInteger)count;
+
+/**
+ * @return A newly initialized and empty GPBInt32Array.
+ **/
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param values An array with the values to put inside this array.
+ * @param count  The number of elements to copy into the array.
+ *
+ * @return A newly initialized GPBInt32Array with a copy of the values.
+ **/
+- (instancetype)initWithValues:(const int32_t [__nullable])values
+                         count:(NSUInteger)count;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param array An array with the values to put inside this array.
+ *
+ * @return A newly initialized GPBInt32Array with a copy of the values.
+ **/
+- (instancetype)initWithValueArray:(GPBInt32Array *)array;
+
+/**
+ * Initializes the array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly initialized GPBInt32Array with a capacity of count.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)count;
+
+/**
+ * Gets the value at the given index.
+ *
+ * @param index The index of the value to get.
+ *
+ * @return The value at the given index.
+ **/
+- (int32_t)valueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+                        usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Adds a value to this array.
+ *
+ * @param value The value to add to this array.
+ **/
+- (void)addValue:(int32_t)value;
+
+/**
+ * Adds values to this array.
+ *
+ * @param values The values to add to this array.
+ * @param count  The number of elements to add.
+ **/
+- (void)addValues:(const int32_t [__nullable])values count:(NSUInteger)count;
+
+/**
+ * Adds the values from the given array to this array.
+ *
+ * @param array The array containing the elements to add to this array.
+ **/
+- (void)addValuesFromArray:(GPBInt32Array *)array;
+
+/**
+ * Inserts a value into the given position.
+ *
+ * @param value The value to add to this array.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertValue:(int32_t)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the value at the given index with the given value.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int32_t)value;
+
+/**
+ * Removes the value at the given index.
+ *
+ * @param index The index of the value to remove.
+ **/
+- (void)removeValueAtIndex:(NSUInteger)index;
+
+/**
+ * Removes all the values from this array.
+ **/
+- (void)removeAll;
+
+/**
+ * Exchanges the values between the given indexes.
+ *
+ * @param idx1 The index of the first element to exchange.
+ * @param idx2 The index of the second element to exchange.
+ **/
+- (void)exchangeValueAtIndex:(NSUInteger)idx1
+            withValueAtIndex:(NSUInteger)idx2;
+
+@end
+
+#pragma mark - UInt32
+
+/**
+ * Class used for repeated fields of uint32_t values. This performs better than
+ * boxing into NSNumbers in NSArrays.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32Array : NSObject <NSCopying>
+
+/** The number of elements contained in the array. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * @return A newly instanced and empty GPBUInt32Array.
+ **/
++ (instancetype)array;
+
+/**
+ * Creates and initializes a GPBUInt32Array with the single element given.
+ *
+ * @param value The value to be placed in the array.
+ *
+ * @return A newly instanced GPBUInt32Array with value in it.
+ **/
++ (instancetype)arrayWithValue:(uint32_t)value;
+
+/**
+ * Creates and initializes a GPBUInt32Array with the contents of the given
+ * array.
+ *
+ * @param array Array with the contents to be put into the new array.
+ *
+ * @return A newly instanced GPBUInt32Array with the contents of array.
+ **/
++ (instancetype)arrayWithValueArray:(GPBUInt32Array *)array;
+
+/**
+ * Creates and initializes a GPBUInt32Array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly instanced GPBUInt32Array with a capacity of count.
+ **/
++ (instancetype)arrayWithCapacity:(NSUInteger)count;
+
+/**
+ * @return A newly initialized and empty GPBUInt32Array.
+ **/
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param values An array with the values to put inside this array.
+ * @param count  The number of elements to copy into the array.
+ *
+ * @return A newly initialized GPBUInt32Array with a copy of the values.
+ **/
+- (instancetype)initWithValues:(const uint32_t [__nullable])values
+                         count:(NSUInteger)count;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param array An array with the values to put inside this array.
+ *
+ * @return A newly initialized GPBUInt32Array with a copy of the values.
+ **/
+- (instancetype)initWithValueArray:(GPBUInt32Array *)array;
+
+/**
+ * Initializes the array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly initialized GPBUInt32Array with a capacity of count.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)count;
+
+/**
+ * Gets the value at the given index.
+ *
+ * @param index The index of the value to get.
+ *
+ * @return The value at the given index.
+ **/
+- (uint32_t)valueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithBlock:(void (^)(uint32_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+                        usingBlock:(void (^)(uint32_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Adds a value to this array.
+ *
+ * @param value The value to add to this array.
+ **/
+- (void)addValue:(uint32_t)value;
+
+/**
+ * Adds values to this array.
+ *
+ * @param values The values to add to this array.
+ * @param count  The number of elements to add.
+ **/
+- (void)addValues:(const uint32_t [__nullable])values count:(NSUInteger)count;
+
+/**
+ * Adds the values from the given array to this array.
+ *
+ * @param array The array containing the elements to add to this array.
+ **/
+- (void)addValuesFromArray:(GPBUInt32Array *)array;
+
+/**
+ * Inserts a value into the given position.
+ *
+ * @param value The value to add to this array.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertValue:(uint32_t)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the value at the given index with the given value.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withValue:(uint32_t)value;
+
+/**
+ * Removes the value at the given index.
+ *
+ * @param index The index of the value to remove.
+ **/
+- (void)removeValueAtIndex:(NSUInteger)index;
+
+/**
+ * Removes all the values from this array.
+ **/
+- (void)removeAll;
+
+/**
+ * Exchanges the values between the given indexes.
+ *
+ * @param idx1 The index of the first element to exchange.
+ * @param idx2 The index of the second element to exchange.
+ **/
+- (void)exchangeValueAtIndex:(NSUInteger)idx1
+            withValueAtIndex:(NSUInteger)idx2;
+
+@end
+
+#pragma mark - Int64
+
+/**
+ * Class used for repeated fields of int64_t values. This performs better than
+ * boxing into NSNumbers in NSArrays.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64Array : NSObject <NSCopying>
+
+/** The number of elements contained in the array. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * @return A newly instanced and empty GPBInt64Array.
+ **/
++ (instancetype)array;
+
+/**
+ * Creates and initializes a GPBInt64Array with the single element given.
+ *
+ * @param value The value to be placed in the array.
+ *
+ * @return A newly instanced GPBInt64Array with value in it.
+ **/
++ (instancetype)arrayWithValue:(int64_t)value;
+
+/**
+ * Creates and initializes a GPBInt64Array with the contents of the given
+ * array.
+ *
+ * @param array Array with the contents to be put into the new array.
+ *
+ * @return A newly instanced GPBInt64Array with the contents of array.
+ **/
++ (instancetype)arrayWithValueArray:(GPBInt64Array *)array;
+
+/**
+ * Creates and initializes a GPBInt64Array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly instanced GPBInt64Array with a capacity of count.
+ **/
++ (instancetype)arrayWithCapacity:(NSUInteger)count;
+
+/**
+ * @return A newly initialized and empty GPBInt64Array.
+ **/
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param values An array with the values to put inside this array.
+ * @param count  The number of elements to copy into the array.
+ *
+ * @return A newly initialized GPBInt64Array with a copy of the values.
+ **/
+- (instancetype)initWithValues:(const int64_t [__nullable])values
+                         count:(NSUInteger)count;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param array An array with the values to put inside this array.
+ *
+ * @return A newly initialized GPBInt64Array with a copy of the values.
+ **/
+- (instancetype)initWithValueArray:(GPBInt64Array *)array;
+
+/**
+ * Initializes the array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly initialized GPBInt64Array with a capacity of count.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)count;
+
+/**
+ * Gets the value at the given index.
+ *
+ * @param index The index of the value to get.
+ *
+ * @return The value at the given index.
+ **/
+- (int64_t)valueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithBlock:(void (^)(int64_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+                        usingBlock:(void (^)(int64_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Adds a value to this array.
+ *
+ * @param value The value to add to this array.
+ **/
+- (void)addValue:(int64_t)value;
+
+/**
+ * Adds values to this array.
+ *
+ * @param values The values to add to this array.
+ * @param count  The number of elements to add.
+ **/
+- (void)addValues:(const int64_t [__nullable])values count:(NSUInteger)count;
+
+/**
+ * Adds the values from the given array to this array.
+ *
+ * @param array The array containing the elements to add to this array.
+ **/
+- (void)addValuesFromArray:(GPBInt64Array *)array;
+
+/**
+ * Inserts a value into the given position.
+ *
+ * @param value The value to add to this array.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertValue:(int64_t)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the value at the given index with the given value.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int64_t)value;
+
+/**
+ * Removes the value at the given index.
+ *
+ * @param index The index of the value to remove.
+ **/
+- (void)removeValueAtIndex:(NSUInteger)index;
+
+/**
+ * Removes all the values from this array.
+ **/
+- (void)removeAll;
+
+/**
+ * Exchanges the values between the given indexes.
+ *
+ * @param idx1 The index of the first element to exchange.
+ * @param idx2 The index of the second element to exchange.
+ **/
+- (void)exchangeValueAtIndex:(NSUInteger)idx1
+            withValueAtIndex:(NSUInteger)idx2;
+
+@end
+
+#pragma mark - UInt64
+
+/**
+ * Class used for repeated fields of uint64_t values. This performs better than
+ * boxing into NSNumbers in NSArrays.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64Array : NSObject <NSCopying>
+
+/** The number of elements contained in the array. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * @return A newly instanced and empty GPBUInt64Array.
+ **/
++ (instancetype)array;
+
+/**
+ * Creates and initializes a GPBUInt64Array with the single element given.
+ *
+ * @param value The value to be placed in the array.
+ *
+ * @return A newly instanced GPBUInt64Array with value in it.
+ **/
++ (instancetype)arrayWithValue:(uint64_t)value;
+
+/**
+ * Creates and initializes a GPBUInt64Array with the contents of the given
+ * array.
+ *
+ * @param array Array with the contents to be put into the new array.
+ *
+ * @return A newly instanced GPBUInt64Array with the contents of array.
+ **/
++ (instancetype)arrayWithValueArray:(GPBUInt64Array *)array;
+
+/**
+ * Creates and initializes a GPBUInt64Array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly instanced GPBUInt64Array with a capacity of count.
+ **/
++ (instancetype)arrayWithCapacity:(NSUInteger)count;
+
+/**
+ * @return A newly initialized and empty GPBUInt64Array.
+ **/
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param values An array with the values to put inside this array.
+ * @param count  The number of elements to copy into the array.
+ *
+ * @return A newly initialized GPBUInt64Array with a copy of the values.
+ **/
+- (instancetype)initWithValues:(const uint64_t [__nullable])values
+                         count:(NSUInteger)count;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param array An array with the values to put inside this array.
+ *
+ * @return A newly initialized GPBUInt64Array with a copy of the values.
+ **/
+- (instancetype)initWithValueArray:(GPBUInt64Array *)array;
+
+/**
+ * Initializes the array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly initialized GPBUInt64Array with a capacity of count.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)count;
+
+/**
+ * Gets the value at the given index.
+ *
+ * @param index The index of the value to get.
+ *
+ * @return The value at the given index.
+ **/
+- (uint64_t)valueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithBlock:(void (^)(uint64_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+                        usingBlock:(void (^)(uint64_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Adds a value to this array.
+ *
+ * @param value The value to add to this array.
+ **/
+- (void)addValue:(uint64_t)value;
+
+/**
+ * Adds values to this array.
+ *
+ * @param values The values to add to this array.
+ * @param count  The number of elements to add.
+ **/
+- (void)addValues:(const uint64_t [__nullable])values count:(NSUInteger)count;
+
+/**
+ * Adds the values from the given array to this array.
+ *
+ * @param array The array containing the elements to add to this array.
+ **/
+- (void)addValuesFromArray:(GPBUInt64Array *)array;
+
+/**
+ * Inserts a value into the given position.
+ *
+ * @param value The value to add to this array.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertValue:(uint64_t)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the value at the given index with the given value.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withValue:(uint64_t)value;
+
+/**
+ * Removes the value at the given index.
+ *
+ * @param index The index of the value to remove.
+ **/
+- (void)removeValueAtIndex:(NSUInteger)index;
+
+/**
+ * Removes all the values from this array.
+ **/
+- (void)removeAll;
+
+/**
+ * Exchanges the values between the given indexes.
+ *
+ * @param idx1 The index of the first element to exchange.
+ * @param idx2 The index of the second element to exchange.
+ **/
+- (void)exchangeValueAtIndex:(NSUInteger)idx1
+            withValueAtIndex:(NSUInteger)idx2;
+
+@end
+
+#pragma mark - Float
+
+/**
+ * Class used for repeated fields of float values. This performs better than
+ * boxing into NSNumbers in NSArrays.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBFloatArray : NSObject <NSCopying>
+
+/** The number of elements contained in the array. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * @return A newly instanced and empty GPBFloatArray.
+ **/
++ (instancetype)array;
+
+/**
+ * Creates and initializes a GPBFloatArray with the single element given.
+ *
+ * @param value The value to be placed in the array.
+ *
+ * @return A newly instanced GPBFloatArray with value in it.
+ **/
++ (instancetype)arrayWithValue:(float)value;
+
+/**
+ * Creates and initializes a GPBFloatArray with the contents of the given
+ * array.
+ *
+ * @param array Array with the contents to be put into the new array.
+ *
+ * @return A newly instanced GPBFloatArray with the contents of array.
+ **/
++ (instancetype)arrayWithValueArray:(GPBFloatArray *)array;
+
+/**
+ * Creates and initializes a GPBFloatArray with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly instanced GPBFloatArray with a capacity of count.
+ **/
++ (instancetype)arrayWithCapacity:(NSUInteger)count;
+
+/**
+ * @return A newly initialized and empty GPBFloatArray.
+ **/
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param values An array with the values to put inside this array.
+ * @param count  The number of elements to copy into the array.
+ *
+ * @return A newly initialized GPBFloatArray with a copy of the values.
+ **/
+- (instancetype)initWithValues:(const float [__nullable])values
+                         count:(NSUInteger)count;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param array An array with the values to put inside this array.
+ *
+ * @return A newly initialized GPBFloatArray with a copy of the values.
+ **/
+- (instancetype)initWithValueArray:(GPBFloatArray *)array;
+
+/**
+ * Initializes the array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly initialized GPBFloatArray with a capacity of count.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)count;
+
+/**
+ * Gets the value at the given index.
+ *
+ * @param index The index of the value to get.
+ *
+ * @return The value at the given index.
+ **/
+- (float)valueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithBlock:(void (^)(float value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+                        usingBlock:(void (^)(float value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Adds a value to this array.
+ *
+ * @param value The value to add to this array.
+ **/
+- (void)addValue:(float)value;
+
+/**
+ * Adds values to this array.
+ *
+ * @param values The values to add to this array.
+ * @param count  The number of elements to add.
+ **/
+- (void)addValues:(const float [__nullable])values count:(NSUInteger)count;
+
+/**
+ * Adds the values from the given array to this array.
+ *
+ * @param array The array containing the elements to add to this array.
+ **/
+- (void)addValuesFromArray:(GPBFloatArray *)array;
+
+/**
+ * Inserts a value into the given position.
+ *
+ * @param value The value to add to this array.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertValue:(float)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the value at the given index with the given value.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withValue:(float)value;
+
+/**
+ * Removes the value at the given index.
+ *
+ * @param index The index of the value to remove.
+ **/
+- (void)removeValueAtIndex:(NSUInteger)index;
+
+/**
+ * Removes all the values from this array.
+ **/
+- (void)removeAll;
+
+/**
+ * Exchanges the values between the given indexes.
+ *
+ * @param idx1 The index of the first element to exchange.
+ * @param idx2 The index of the second element to exchange.
+ **/
+- (void)exchangeValueAtIndex:(NSUInteger)idx1
+            withValueAtIndex:(NSUInteger)idx2;
+
+@end
+
+#pragma mark - Double
+
+/**
+ * Class used for repeated fields of double values. This performs better than
+ * boxing into NSNumbers in NSArrays.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBDoubleArray : NSObject <NSCopying>
+
+/** The number of elements contained in the array. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * @return A newly instanced and empty GPBDoubleArray.
+ **/
++ (instancetype)array;
+
+/**
+ * Creates and initializes a GPBDoubleArray with the single element given.
+ *
+ * @param value The value to be placed in the array.
+ *
+ * @return A newly instanced GPBDoubleArray with value in it.
+ **/
++ (instancetype)arrayWithValue:(double)value;
+
+/**
+ * Creates and initializes a GPBDoubleArray with the contents of the given
+ * array.
+ *
+ * @param array Array with the contents to be put into the new array.
+ *
+ * @return A newly instanced GPBDoubleArray with the contents of array.
+ **/
++ (instancetype)arrayWithValueArray:(GPBDoubleArray *)array;
+
+/**
+ * Creates and initializes a GPBDoubleArray with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly instanced GPBDoubleArray with a capacity of count.
+ **/
++ (instancetype)arrayWithCapacity:(NSUInteger)count;
+
+/**
+ * @return A newly initialized and empty GPBDoubleArray.
+ **/
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param values An array with the values to put inside this array.
+ * @param count  The number of elements to copy into the array.
+ *
+ * @return A newly initialized GPBDoubleArray with a copy of the values.
+ **/
+- (instancetype)initWithValues:(const double [__nullable])values
+                         count:(NSUInteger)count;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param array An array with the values to put inside this array.
+ *
+ * @return A newly initialized GPBDoubleArray with a copy of the values.
+ **/
+- (instancetype)initWithValueArray:(GPBDoubleArray *)array;
+
+/**
+ * Initializes the array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly initialized GPBDoubleArray with a capacity of count.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)count;
+
+/**
+ * Gets the value at the given index.
+ *
+ * @param index The index of the value to get.
+ *
+ * @return The value at the given index.
+ **/
+- (double)valueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithBlock:(void (^)(double value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+                        usingBlock:(void (^)(double value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Adds a value to this array.
+ *
+ * @param value The value to add to this array.
+ **/
+- (void)addValue:(double)value;
+
+/**
+ * Adds values to this array.
+ *
+ * @param values The values to add to this array.
+ * @param count  The number of elements to add.
+ **/
+- (void)addValues:(const double [__nullable])values count:(NSUInteger)count;
+
+/**
+ * Adds the values from the given array to this array.
+ *
+ * @param array The array containing the elements to add to this array.
+ **/
+- (void)addValuesFromArray:(GPBDoubleArray *)array;
+
+/**
+ * Inserts a value into the given position.
+ *
+ * @param value The value to add to this array.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertValue:(double)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the value at the given index with the given value.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withValue:(double)value;
+
+/**
+ * Removes the value at the given index.
+ *
+ * @param index The index of the value to remove.
+ **/
+- (void)removeValueAtIndex:(NSUInteger)index;
+
+/**
+ * Removes all the values from this array.
+ **/
+- (void)removeAll;
+
+/**
+ * Exchanges the values between the given indexes.
+ *
+ * @param idx1 The index of the first element to exchange.
+ * @param idx2 The index of the second element to exchange.
+ **/
+- (void)exchangeValueAtIndex:(NSUInteger)idx1
+            withValueAtIndex:(NSUInteger)idx2;
+
+@end
+
+#pragma mark - Bool
+
+/**
+ * Class used for repeated fields of BOOL values. This performs better than
+ * boxing into NSNumbers in NSArrays.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolArray : NSObject <NSCopying>
+
+/** The number of elements contained in the array. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * @return A newly instanced and empty GPBBoolArray.
+ **/
++ (instancetype)array;
+
+/**
+ * Creates and initializes a GPBBoolArray with the single element given.
+ *
+ * @param value The value to be placed in the array.
+ *
+ * @return A newly instanced GPBBoolArray with value in it.
+ **/
++ (instancetype)arrayWithValue:(BOOL)value;
+
+/**
+ * Creates and initializes a GPBBoolArray with the contents of the given
+ * array.
+ *
+ * @param array Array with the contents to be put into the new array.
+ *
+ * @return A newly instanced GPBBoolArray with the contents of array.
+ **/
++ (instancetype)arrayWithValueArray:(GPBBoolArray *)array;
+
+/**
+ * Creates and initializes a GPBBoolArray with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly instanced GPBBoolArray with a capacity of count.
+ **/
++ (instancetype)arrayWithCapacity:(NSUInteger)count;
+
+/**
+ * @return A newly initialized and empty GPBBoolArray.
+ **/
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param values An array with the values to put inside this array.
+ * @param count  The number of elements to copy into the array.
+ *
+ * @return A newly initialized GPBBoolArray with a copy of the values.
+ **/
+- (instancetype)initWithValues:(const BOOL [__nullable])values
+                         count:(NSUInteger)count;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param array An array with the values to put inside this array.
+ *
+ * @return A newly initialized GPBBoolArray with a copy of the values.
+ **/
+- (instancetype)initWithValueArray:(GPBBoolArray *)array;
+
+/**
+ * Initializes the array with the given capacity.
+ *
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly initialized GPBBoolArray with a capacity of count.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)count;
+
+/**
+ * Gets the value at the given index.
+ *
+ * @param index The index of the value to get.
+ *
+ * @return The value at the given index.
+ **/
+- (BOOL)valueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithBlock:(void (^)(BOOL value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+                        usingBlock:(void (^)(BOOL value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Adds a value to this array.
+ *
+ * @param value The value to add to this array.
+ **/
+- (void)addValue:(BOOL)value;
+
+/**
+ * Adds values to this array.
+ *
+ * @param values The values to add to this array.
+ * @param count  The number of elements to add.
+ **/
+- (void)addValues:(const BOOL [__nullable])values count:(NSUInteger)count;
+
+/**
+ * Adds the values from the given array to this array.
+ *
+ * @param array The array containing the elements to add to this array.
+ **/
+- (void)addValuesFromArray:(GPBBoolArray *)array;
+
+/**
+ * Inserts a value into the given position.
+ *
+ * @param value The value to add to this array.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertValue:(BOOL)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the value at the given index with the given value.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withValue:(BOOL)value;
+
+/**
+ * Removes the value at the given index.
+ *
+ * @param index The index of the value to remove.
+ **/
+- (void)removeValueAtIndex:(NSUInteger)index;
+
+/**
+ * Removes all the values from this array.
+ **/
+- (void)removeAll;
+
+/**
+ * Exchanges the values between the given indexes.
+ *
+ * @param idx1 The index of the first element to exchange.
+ * @param idx2 The index of the second element to exchange.
+ **/
+- (void)exchangeValueAtIndex:(NSUInteger)idx1
+            withValueAtIndex:(NSUInteger)idx2;
+
+@end
+
+#pragma mark - Enum
+
+/**
+ * This class is used for repeated fields of int32_t values. This performs
+ * better than boxing into NSNumbers in NSArrays.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBEnumArray : NSObject <NSCopying>
+
+/** The number of elements contained in the array. */
+@property(nonatomic, readonly) NSUInteger count;
+/** The validation function to check if the enums are valid. */
+@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+
+/**
+ * @return A newly instanced and empty GPBEnumArray.
+ **/
++ (instancetype)array;
+
+/**
+ * Creates and initializes a GPBEnumArray with the enum validation function
+ * given.
+ *
+ * @param func The enum validation function for the array.
+ *
+ * @return A newly instanced GPBEnumArray.
+ **/
++ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+
+/**
+ * Creates and initializes a GPBEnumArray with the enum validation function
+ * given and the single raw value given.
+ *
+ * @param func  The enum validation function for the array.
+ * @param value The raw value to add to this array.
+ *
+ * @return A newly instanced GPBEnumArray.
+ **/
++ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                   rawValue:(int32_t)value;
+
+/**
+ * Creates and initializes a GPBEnumArray that adds the elements from the
+ * given array.
+ *
+ * @param array Array containing the values to add to the new array.
+ *
+ * @return A newly instanced GPBEnumArray.
+ **/
++ (instancetype)arrayWithValueArray:(GPBEnumArray *)array;
+
+/**
+ * Creates and initializes a GPBEnumArray with the given enum validation
+ * function and with the givencapacity.
+ *
+ * @param func  The enum validation function for the array.
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly instanced GPBEnumArray with a capacity of count.
+ **/
++ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                   capacity:(NSUInteger)count;
+
+/**
+ * Initializes the array with the given enum validation function.
+ *
+ * @param func The enum validation function for the array.
+ *
+ * @return A newly initialized GPBEnumArray with a copy of the values.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+    NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param func   The enum validation function for the array.
+ * @param values An array with the values to put inside this array.
+ * @param count  The number of elements to copy into the array.
+ *
+ * @return A newly initialized GPBEnumArray with a copy of the values.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                 rawValues:(const int32_t [__nullable])values
+                                     count:(NSUInteger)count;
+
+/**
+ * Initializes the array, copying the given values.
+ *
+ * @param array An array with the values to put inside this array.
+ *
+ * @return A newly initialized GPBEnumArray with a copy of the values.
+ **/
+- (instancetype)initWithValueArray:(GPBEnumArray *)array;
+
+/**
+ * Initializes the array with the given capacity.
+ *
+ * @param func  The enum validation function for the array.
+ * @param count The capacity needed for the array.
+ *
+ * @return A newly initialized GPBEnumArray with a capacity of count.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                  capacity:(NSUInteger)count;
+
+// These will return kGPBUnrecognizedEnumeratorValue if the value at index is not a
+// valid enumerator as defined by validationFunc. If the actual value is
+// desired, use "raw" version of the method.
+
+/**
+ * Gets the value at the given index.
+ *
+ * @param index The index of the value to get.
+ *
+ * @return The value at the given index.
+ **/
+- (int32_t)valueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+                        usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block;
+
+// These methods bypass the validationFunc to provide access to values that were not
+// known at the time the binary was compiled.
+
+/**
+ * Gets the raw enum value at the given index.
+ *
+ * @param index The index of the raw enum value to get.
+ *
+ * @return The raw enum value at the given index.
+ **/
+- (int32_t)rawValueAtIndex:(NSUInteger)index;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateRawValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block;
+
+/**
+ * Enumerates the values on this array with the given block.
+ *
+ * @param opts  Options to control the enumeration.
+ * @param block The block to enumerate with.
+ *   **value**: The current value being enumerated.
+ *   **idx**:   The index of the current value.
+ *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateRawValuesWithOptions:(NSEnumerationOptions)opts
+                           usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block;
+
+// If value is not a valid enumerator as defined by validationFunc, these
+// methods will assert in debug, and will log in release and assign the value
+// to the default value. Use the rawValue methods below to assign non enumerator
+// values.
+
+/**
+ * Adds a value to this array.
+ *
+ * @param value The value to add to this array.
+ **/
+- (void)addValue:(int32_t)value;
+
+/**
+ * Adds values to this array.
+ *
+ * @param values The values to add to this array.
+ * @param count  The number of elements to add.
+ **/
+- (void)addValues:(const int32_t [__nullable])values count:(NSUInteger)count;
+
+
+/**
+ * Inserts a value into the given position.
+ *
+ * @param value The value to add to this array.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertValue:(int32_t)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the value at the given index with the given value.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int32_t)value;
+
+// These methods bypass the validationFunc to provide setting of values that were not
+// known at the time the binary was compiled.
+
+/**
+ * Adds a raw enum value to this array.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param value The raw enum value to add to the array.
+ **/
+- (void)addRawValue:(int32_t)value;
+
+/**
+ * Adds raw enum values to this array.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param array Array containing the raw enum values to add to this array.
+ **/
+- (void)addRawValuesFromArray:(GPBEnumArray *)array;
+
+/**
+ * Adds raw enum values to this array.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param values Array containing the raw enum values to add to this array.
+ * @param count  The number of raw values to add.
+ **/
+- (void)addRawValues:(const int32_t [__nullable])values count:(NSUInteger)count;
+
+/**
+ * Inserts a raw enum value at the given index.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param value Raw enum value to add.
+ * @param index The index into which to insert the value.
+ **/
+- (void)insertRawValue:(int32_t)value atIndex:(NSUInteger)index;
+
+/**
+ * Replaces the raw enum value at the given index with the given value.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param index The index for which to replace the value.
+ * @param value The raw enum value to replace with.
+ **/
+- (void)replaceValueAtIndex:(NSUInteger)index withRawValue:(int32_t)value;
+
+// No validation applies to these methods.
+
+/**
+ * Removes the value at the given index.
+ *
+ * @param index The index of the value to remove.
+ **/
+- (void)removeValueAtIndex:(NSUInteger)index;
+
+/**
+ * Removes all the values from this array.
+ **/
+- (void)removeAll;
+
+/**
+ * Exchanges the values between the given indexes.
+ *
+ * @param idx1 The index of the first element to exchange.
+ * @param idx2 The index of the second element to exchange.
+ **/
+- (void)exchangeValueAtIndex:(NSUInteger)idx1
+            withValueAtIndex:(NSUInteger)idx2;
+
+@end
+
+//%PDDM-EXPAND-END DECLARE_ARRAYS()
+
+NS_ASSUME_NONNULL_END
+
+//%PDDM-DEFINE DECLARE_ARRAYS()
+//%ARRAY_INTERFACE_SIMPLE(Int32, int32_t)
+//%ARRAY_INTERFACE_SIMPLE(UInt32, uint32_t)
+//%ARRAY_INTERFACE_SIMPLE(Int64, int64_t)
+//%ARRAY_INTERFACE_SIMPLE(UInt64, uint64_t)
+//%ARRAY_INTERFACE_SIMPLE(Float, float)
+//%ARRAY_INTERFACE_SIMPLE(Double, double)
+//%ARRAY_INTERFACE_SIMPLE(Bool, BOOL)
+//%ARRAY_INTERFACE_ENUM(Enum, int32_t)
+
+//
+// The common case (everything but Enum)
+//
+
+//%PDDM-DEFINE ARRAY_INTERFACE_SIMPLE(NAME, TYPE)
+//%#pragma mark - NAME
+//%
+//%/**
+//% * Class used for repeated fields of ##TYPE## values. This performs better than
+//% * boxing into NSNumbers in NSArrays.
+//% *
+//% * @note This class is not meant to be subclassed.
+//% **/
+//%@interface GPB##NAME##Array : NSObject <NSCopying>
+//%
+//%/** The number of elements contained in the array. */
+//%@property(nonatomic, readonly) NSUInteger count;
+//%
+//%/**
+//% * @return A newly instanced and empty GPB##NAME##Array.
+//% **/
+//%+ (instancetype)array;
+//%
+//%/**
+//% * Creates and initializes a GPB##NAME##Array with the single element given.
+//% *
+//% * @param value The value to be placed in the array.
+//% *
+//% * @return A newly instanced GPB##NAME##Array with value in it.
+//% **/
+//%+ (instancetype)arrayWithValue:(TYPE)value;
+//%
+//%/**
+//% * Creates and initializes a GPB##NAME##Array with the contents of the given
+//% * array.
+//% *
+//% * @param array Array with the contents to be put into the new array.
+//% *
+//% * @return A newly instanced GPB##NAME##Array with the contents of array.
+//% **/
+//%+ (instancetype)arrayWithValueArray:(GPB##NAME##Array *)array;
+//%
+//%/**
+//% * Creates and initializes a GPB##NAME##Array with the given capacity.
+//% *
+//% * @param count The capacity needed for the array.
+//% *
+//% * @return A newly instanced GPB##NAME##Array with a capacity of count.
+//% **/
+//%+ (instancetype)arrayWithCapacity:(NSUInteger)count;
+//%
+//%/**
+//% * @return A newly initialized and empty GPB##NAME##Array.
+//% **/
+//%- (instancetype)init NS_DESIGNATED_INITIALIZER;
+//%
+//%/**
+//% * Initializes the array, copying the given values.
+//% *
+//% * @param values An array with the values to put inside this array.
+//% * @param count  The number of elements to copy into the array.
+//% *
+//% * @return A newly initialized GPB##NAME##Array with a copy of the values.
+//% **/
+//%- (instancetype)initWithValues:(const TYPE [__nullable])values
+//%                         count:(NSUInteger)count;
+//%
+//%/**
+//% * Initializes the array, copying the given values.
+//% *
+//% * @param array An array with the values to put inside this array.
+//% *
+//% * @return A newly initialized GPB##NAME##Array with a copy of the values.
+//% **/
+//%- (instancetype)initWithValueArray:(GPB##NAME##Array *)array;
+//%
+//%/**
+//% * Initializes the array with the given capacity.
+//% *
+//% * @param count The capacity needed for the array.
+//% *
+//% * @return A newly initialized GPB##NAME##Array with a capacity of count.
+//% **/
+//%- (instancetype)initWithCapacity:(NSUInteger)count;
+//%
+//%ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, Basic)
+//%
+//%ARRAY_MUTABLE_INTERFACE(NAME, TYPE, Basic)
+//%
+//%@end
+//%
+
+//
+// Macros specific to Enums (to tweak their interface).
+//
+
+//%PDDM-DEFINE ARRAY_INTERFACE_ENUM(NAME, TYPE)
+//%#pragma mark - NAME
+//%
+//%/**
+//% * This class is used for repeated fields of ##TYPE## values. This performs
+//% * better than boxing into NSNumbers in NSArrays.
+//% *
+//% * @note This class is not meant to be subclassed.
+//% **/
+//%@interface GPB##NAME##Array : NSObject <NSCopying>
+//%
+//%/** The number of elements contained in the array. */
+//%@property(nonatomic, readonly) NSUInteger count;
+//%/** The validation function to check if the enums are valid. */
+//%@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+//%
+//%/**
+//% * @return A newly instanced and empty GPB##NAME##Array.
+//% **/
+//%+ (instancetype)array;
+//%
+//%/**
+//% * Creates and initializes a GPB##NAME##Array with the enum validation function
+//% * given.
+//% *
+//% * @param func The enum validation function for the array.
+//% *
+//% * @return A newly instanced GPB##NAME##Array.
+//% **/
+//%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+//%
+//%/**
+//% * Creates and initializes a GPB##NAME##Array with the enum validation function
+//% * given and the single raw value given.
+//% *
+//% * @param func  The enum validation function for the array.
+//% * @param value The raw value to add to this array.
+//% *
+//% * @return A newly instanced GPB##NAME##Array.
+//% **/
+//%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func
+//%                                   rawValue:(TYPE)value;
+//%
+//%/**
+//% * Creates and initializes a GPB##NAME##Array that adds the elements from the
+//% * given array.
+//% *
+//% * @param array Array containing the values to add to the new array.
+//% *
+//% * @return A newly instanced GPB##NAME##Array.
+//% **/
+//%+ (instancetype)arrayWithValueArray:(GPB##NAME##Array *)array;
+//%
+//%/**
+//% * Creates and initializes a GPB##NAME##Array with the given enum validation
+//% * function and with the givencapacity.
+//% *
+//% * @param func  The enum validation function for the array.
+//% * @param count The capacity needed for the array.
+//% *
+//% * @return A newly instanced GPB##NAME##Array with a capacity of count.
+//% **/
+//%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func
+//%                                   capacity:(NSUInteger)count;
+//%
+//%/**
+//% * Initializes the array with the given enum validation function.
+//% *
+//% * @param func The enum validation function for the array.
+//% *
+//% * @return A newly initialized GPB##NAME##Array with a copy of the values.
+//% **/
+//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+//%    NS_DESIGNATED_INITIALIZER;
+//%
+//%/**
+//% * Initializes the array, copying the given values.
+//% *
+//% * @param func   The enum validation function for the array.
+//% * @param values An array with the values to put inside this array.
+//% * @param count  The number of elements to copy into the array.
+//% *
+//% * @return A newly initialized GPB##NAME##Array with a copy of the values.
+//% **/
+//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+//%                                 rawValues:(const TYPE [__nullable])values
+//%                                     count:(NSUInteger)count;
+//%
+//%/**
+//% * Initializes the array, copying the given values.
+//% *
+//% * @param array An array with the values to put inside this array.
+//% *
+//% * @return A newly initialized GPB##NAME##Array with a copy of the values.
+//% **/
+//%- (instancetype)initWithValueArray:(GPB##NAME##Array *)array;
+//%
+//%/**
+//% * Initializes the array with the given capacity.
+//% *
+//% * @param func  The enum validation function for the array.
+//% * @param count The capacity needed for the array.
+//% *
+//% * @return A newly initialized GPB##NAME##Array with a capacity of count.
+//% **/
+//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+//%                                  capacity:(NSUInteger)count;
+//%
+//%// These will return kGPBUnrecognizedEnumeratorValue if the value at index is not a
+//%// valid enumerator as defined by validationFunc. If the actual value is
+//%// desired, use "raw" version of the method.
+//%
+//%ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, NAME)
+//%
+//%// These methods bypass the validationFunc to provide access to values that were not
+//%// known at the time the binary was compiled.
+//%
+//%/**
+//% * Gets the raw enum value at the given index.
+//% *
+//% * @param index The index of the raw enum value to get.
+//% *
+//% * @return The raw enum value at the given index.
+//% **/
+//%- (TYPE)rawValueAtIndex:(NSUInteger)index;
+//%
+//%/**
+//% * Enumerates the values on this array with the given block.
+//% *
+//% * @param block The block to enumerate with.
+//% *   **value**: The current value being enumerated.
+//% *   **idx**:   The index of the current value.
+//% *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+//% **/
+//%- (void)enumerateRawValuesWithBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block;
+//%
+//%/**
+//% * Enumerates the values on this array with the given block.
+//% *
+//% * @param opts  Options to control the enumeration.
+//% * @param block The block to enumerate with.
+//% *   **value**: The current value being enumerated.
+//% *   **idx**:   The index of the current value.
+//% *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+//% **/
+//%- (void)enumerateRawValuesWithOptions:(NSEnumerationOptions)opts
+//%                           usingBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block;
+//%
+//%// If value is not a valid enumerator as defined by validationFunc, these
+//%// methods will assert in debug, and will log in release and assign the value
+//%// to the default value. Use the rawValue methods below to assign non enumerator
+//%// values.
+//%
+//%ARRAY_MUTABLE_INTERFACE(NAME, TYPE, NAME)
+//%
+//%@end
+//%
+
+//%PDDM-DEFINE ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, HELPER_NAME)
+//%/**
+//% * Gets the value at the given index.
+//% *
+//% * @param index The index of the value to get.
+//% *
+//% * @return The value at the given index.
+//% **/
+//%- (TYPE)valueAtIndex:(NSUInteger)index;
+//%
+//%/**
+//% * Enumerates the values on this array with the given block.
+//% *
+//% * @param block The block to enumerate with.
+//% *   **value**: The current value being enumerated.
+//% *   **idx**:   The index of the current value.
+//% *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+//% **/
+//%- (void)enumerateValuesWithBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block;
+//%
+//%/**
+//% * Enumerates the values on this array with the given block.
+//% *
+//% * @param opts  Options to control the enumeration.
+//% * @param block The block to enumerate with.
+//% *   **value**: The current value being enumerated.
+//% *   **idx**:   The index of the current value.
+//% *   **stop**:  A pointer to a boolean that when set stops the enumeration.
+//% **/
+//%- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts
+//%                        usingBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block;
+
+//%PDDM-DEFINE ARRAY_MUTABLE_INTERFACE(NAME, TYPE, HELPER_NAME)
+//%/**
+//% * Adds a value to this array.
+//% *
+//% * @param value The value to add to this array.
+//% **/
+//%- (void)addValue:(TYPE)value;
+//%
+//%/**
+//% * Adds values to this array.
+//% *
+//% * @param values The values to add to this array.
+//% * @param count  The number of elements to add.
+//% **/
+//%- (void)addValues:(const TYPE [__nullable])values count:(NSUInteger)count;
+//%
+//%ARRAY_EXTRA_MUTABLE_METHODS1_##HELPER_NAME(NAME, TYPE)
+//%/**
+//% * Inserts a value into the given position.
+//% *
+//% * @param value The value to add to this array.
+//% * @param index The index into which to insert the value.
+//% **/
+//%- (void)insertValue:(TYPE)value atIndex:(NSUInteger)index;
+//%
+//%/**
+//% * Replaces the value at the given index with the given value.
+//% *
+//% * @param index The index for which to replace the value.
+//% * @param value The value to replace with.
+//% **/
+//%- (void)replaceValueAtIndex:(NSUInteger)index withValue:(TYPE)value;
+//%ARRAY_EXTRA_MUTABLE_METHODS2_##HELPER_NAME(NAME, TYPE)
+//%/**
+//% * Removes the value at the given index.
+//% *
+//% * @param index The index of the value to remove.
+//% **/
+//%- (void)removeValueAtIndex:(NSUInteger)index;
+//%
+//%/**
+//% * Removes all the values from this array.
+//% **/
+//%- (void)removeAll;
+//%
+//%/**
+//% * Exchanges the values between the given indexes.
+//% *
+//% * @param idx1 The index of the first element to exchange.
+//% * @param idx2 The index of the second element to exchange.
+//% **/
+//%- (void)exchangeValueAtIndex:(NSUInteger)idx1
+//%            withValueAtIndex:(NSUInteger)idx2;
+
+//
+// These are hooks invoked by the above to do insert as needed.
+//
+
+//%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS1_Basic(NAME, TYPE)
+//%/**
+//% * Adds the values from the given array to this array.
+//% *
+//% * @param array The array containing the elements to add to this array.
+//% **/
+//%- (void)addValuesFromArray:(GPB##NAME##Array *)array;
+//%
+//%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS2_Basic(NAME, TYPE)
+// Empty
+//%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS1_Enum(NAME, TYPE)
+// Empty
+//%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS2_Enum(NAME, TYPE)
+//%
+//%// These methods bypass the validationFunc to provide setting of values that were not
+//%// known at the time the binary was compiled.
+//%
+//%/**
+//% * Adds a raw enum value to this array.
+//% *
+//% * @note This method bypass the validationFunc to enable the setting of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param value The raw enum value to add to the array.
+//% **/
+//%- (void)addRawValue:(TYPE)value;
+//%
+//%/**
+//% * Adds raw enum values to this array.
+//% *
+//% * @note This method bypass the validationFunc to enable the setting of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param array Array containing the raw enum values to add to this array.
+//% **/
+//%- (void)addRawValuesFromArray:(GPB##NAME##Array *)array;
+//%
+//%/**
+//% * Adds raw enum values to this array.
+//% *
+//% * @note This method bypass the validationFunc to enable the setting of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param values Array containing the raw enum values to add to this array.
+//% * @param count  The number of raw values to add.
+//% **/
+//%- (void)addRawValues:(const TYPE [__nullable])values count:(NSUInteger)count;
+//%
+//%/**
+//% * Inserts a raw enum value at the given index.
+//% *
+//% * @note This method bypass the validationFunc to enable the setting of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param value Raw enum value to add.
+//% * @param index The index into which to insert the value.
+//% **/
+//%- (void)insertRawValue:(TYPE)value atIndex:(NSUInteger)index;
+//%
+//%/**
+//% * Replaces the raw enum value at the given index with the given value.
+//% *
+//% * @note This method bypass the validationFunc to enable the setting of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param index The index for which to replace the value.
+//% * @param value The raw enum value to replace with.
+//% **/
+//%- (void)replaceValueAtIndex:(NSUInteger)index withRawValue:(TYPE)value;
+//%
+//%// No validation applies to these methods.
+//%

+ 130 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBArray_PackagePrivate.h

@@ -0,0 +1,130 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2015 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import "GPBArray.h"
+
+@class GPBMessage;
+
+//%PDDM-DEFINE DECLARE_ARRAY_EXTRAS()
+//%ARRAY_INTERFACE_EXTRAS(Int32, int32_t)
+//%ARRAY_INTERFACE_EXTRAS(UInt32, uint32_t)
+//%ARRAY_INTERFACE_EXTRAS(Int64, int64_t)
+//%ARRAY_INTERFACE_EXTRAS(UInt64, uint64_t)
+//%ARRAY_INTERFACE_EXTRAS(Float, float)
+//%ARRAY_INTERFACE_EXTRAS(Double, double)
+//%ARRAY_INTERFACE_EXTRAS(Bool, BOOL)
+//%ARRAY_INTERFACE_EXTRAS(Enum, int32_t)
+
+//%PDDM-DEFINE ARRAY_INTERFACE_EXTRAS(NAME, TYPE)
+//%#pragma mark - NAME
+//%
+//%@interface GPB##NAME##Array () {
+//% @package
+//%  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+//%}
+//%@end
+//%
+
+//%PDDM-EXPAND DECLARE_ARRAY_EXTRAS()
+// This block of code is generated, do not edit it directly.
+
+#pragma mark - Int32
+
+@interface GPBInt32Array () {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+#pragma mark - UInt32
+
+@interface GPBUInt32Array () {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+#pragma mark - Int64
+
+@interface GPBInt64Array () {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+#pragma mark - UInt64
+
+@interface GPBUInt64Array () {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+#pragma mark - Float
+
+@interface GPBFloatArray () {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+#pragma mark - Double
+
+@interface GPBDoubleArray () {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+#pragma mark - Bool
+
+@interface GPBBoolArray () {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+#pragma mark - Enum
+
+@interface GPBEnumArray () {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+//%PDDM-EXPAND-END DECLARE_ARRAY_EXTRAS()
+
+#pragma mark - NSArray Subclass
+
+@interface GPBAutocreatedArray : NSMutableArray {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end

+ 123 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBBootstrap.h

@@ -0,0 +1,123 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+/**
+ * The Objective C runtime has complete enough info that most protos don’t end
+ * up using this, so leaving it on is no cost or very little cost.  If you
+ * happen to see it causing bloat, this is the way to disable it. If you do
+ * need to disable it, try only disabling it for Release builds as having
+ * full TextFormat can be useful for debugging.
+ **/
+#ifndef GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
+#define GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS 0
+#endif
+
+// Used in the generated code to give sizes to enums. int32_t was chosen based
+// on the fact that Protocol Buffers enums are limited to this range.
+#if !__has_feature(objc_fixed_enum)
+ #error All supported Xcode versions should support objc_fixed_enum.
+#endif
+
+// If the headers are imported into Objective-C++, we can run into an issue
+// where the defintion of NS_ENUM (really CF_ENUM) changes based on the C++
+// standard that is in effect.  If it isn't C++11 or higher, the definition
+// doesn't allow us to forward declare. We work around this one case by
+// providing a local definition. The default case has to use NS_ENUM for the
+// magic that is Swift bridging of enums.
+#if (defined(__cplusplus) && __cplusplus && __cplusplus < 201103L)
+ #define GPB_ENUM(X) enum X : int32_t X; enum X : int32_t
+#else
+ #define GPB_ENUM(X) NS_ENUM(int32_t, X)
+#endif
+
+/**
+ * GPB_ENUM_FWD_DECLARE is used for forward declaring enums, for example:
+ *
+ * ```
+ * GPB_ENUM_FWD_DECLARE(Foo_Enum)
+ *
+ * @interface BarClass : NSObject
+ * @property (nonatomic) enum Foo_Enum value;
+ * - (void)bazMethod:(enum Foo_Enum):value;
+ * @end
+ * ```
+ **/
+#define GPB_ENUM_FWD_DECLARE(X) enum X : int32_t
+
+/**
+ * Based upon CF_INLINE. Forces inlining in non DEBUG builds.
+ **/
+#if !defined(DEBUG)
+#define GPB_INLINE static __inline__ __attribute__((always_inline))
+#else
+#define GPB_INLINE static __inline__
+#endif
+
+/**
+ * For use in public headers that might need to deal with ARC.
+ **/
+#ifndef GPB_UNSAFE_UNRETAINED
+#if __has_feature(objc_arc)
+#define GPB_UNSAFE_UNRETAINED __unsafe_unretained
+#else
+#define GPB_UNSAFE_UNRETAINED
+#endif
+#endif
+
+// If property name starts with init we need to annotate it to get past ARC.
+// http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227
+//
+// Meant to be used internally by generated code.
+#define GPB_METHOD_FAMILY_NONE __attribute__((objc_method_family(none)))
+
+// ----------------------------------------------------------------------------
+// These version numbers are all internal to the ObjC Protobuf runtime; they
+// are used to ensure compatibility between the generated sources and the
+// headers being compiled against and/or the version of sources being run
+// against.
+//
+// They are all #defines so the values are captured into every .o file they
+// are used in and to allow comparisons in the preprocessor.
+
+// Current library runtime version.
+// - Gets bumped when the runtime makes changes to the interfaces between the
+//   generated code and runtime (things added/removed, etc).
+#define GOOGLE_PROTOBUF_OBJC_VERSION 30002
+
+// Minimum runtime version supported for compiling/running against.
+// - Gets changed when support for the older generated code is dropped.
+#define GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION 30001
+
+
+// This is a legacy constant now frozen in time for old generated code. If
+// GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION ever gets moved above 30001 then
+// this should also change to break code compiled with an old runtime that
+// can't be supported any more.
+#define GOOGLE_PROTOBUF_OBJC_GEN_VERSION 30001

+ 253 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBCodedInputStream.h

@@ -0,0 +1,253 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+@class GPBMessage;
+@class GPBExtensionRegistry;
+
+NS_ASSUME_NONNULL_BEGIN
+
+CF_EXTERN_C_BEGIN
+
+/**
+ * @c GPBCodedInputStream exception name. Exceptions raised from
+ * @c GPBCodedInputStream contain an underlying error in the userInfo dictionary
+ * under the GPBCodedInputStreamUnderlyingErrorKey key.
+ **/
+extern NSString *const GPBCodedInputStreamException;
+
+/** The key under which the underlying NSError from the exception is stored. */
+extern NSString *const GPBCodedInputStreamUnderlyingErrorKey;
+
+/** NSError domain used for @c GPBCodedInputStream errors. */
+extern NSString *const GPBCodedInputStreamErrorDomain;
+
+/**
+ * Error code for NSError with @c GPBCodedInputStreamErrorDomain.
+ **/
+typedef NS_ENUM(NSInteger, GPBCodedInputStreamErrorCode) {
+  /** The size does not fit in the remaining bytes to be read. */
+  GPBCodedInputStreamErrorInvalidSize = -100,
+  /** Attempted to read beyond the subsection limit. */
+  GPBCodedInputStreamErrorSubsectionLimitReached = -101,
+  /** The requested subsection limit is invalid. */
+  GPBCodedInputStreamErrorInvalidSubsectionLimit = -102,
+  /** Invalid tag read. */
+  GPBCodedInputStreamErrorInvalidTag = -103,
+  /** Invalid UTF-8 character in a string. */
+  GPBCodedInputStreamErrorInvalidUTF8 = -104,
+  /** Invalid VarInt read. */
+  GPBCodedInputStreamErrorInvalidVarInt = -105,
+  /** The maximum recursion depth of messages was exceeded. */
+  GPBCodedInputStreamErrorRecursionDepthExceeded = -106,
+};
+
+CF_EXTERN_C_END
+
+/**
+ * Reads and decodes protocol message fields.
+ *
+ * The common uses of protocol buffers shouldn't need to use this class.
+ * @c GPBMessage's provide a @c +parseFromData:error: and
+ * @c +parseFromData:extensionRegistry:error: method that will decode a
+ * message for you.
+ *
+ * @note Subclassing of @c GPBCodedInputStream is NOT supported.
+ **/
+@interface GPBCodedInputStream : NSObject
+
+/**
+ * Creates a new stream wrapping some data.
+ *
+ * @param data The data to wrap inside the stream.
+ *
+ * @return A newly instanced GPBCodedInputStream.
+ **/
++ (instancetype)streamWithData:(NSData *)data;
+
+/**
+ * Initializes a stream wrapping some data.
+ *
+ * @param data The data to wrap inside the stream.
+ *
+ * @return A newly initialized GPBCodedInputStream.
+ **/
+- (instancetype)initWithData:(NSData *)data;
+
+/**
+ * Attempts to read a field tag, returning zero if we have reached EOF.
+ * Protocol message parsers use this to read tags, since a protocol message
+ * may legally end wherever a tag occurs, and zero is not a valid tag number.
+ *
+ * @return The field tag, or zero if EOF was reached.
+ **/
+- (int32_t)readTag;
+
+/**
+ * @return A double read from the stream.
+ **/
+- (double)readDouble;
+/**
+ * @return A float read from the stream.
+ **/
+- (float)readFloat;
+/**
+ * @return A uint64 read from the stream.
+ **/
+- (uint64_t)readUInt64;
+/**
+ * @return A uint32 read from the stream.
+ **/
+- (uint32_t)readUInt32;
+/**
+ * @return An int64 read from the stream.
+ **/
+- (int64_t)readInt64;
+/**
+ * @return An int32 read from the stream.
+ **/
+- (int32_t)readInt32;
+/**
+ * @return A fixed64 read from the stream.
+ **/
+- (uint64_t)readFixed64;
+/**
+ * @return A fixed32 read from the stream.
+ **/
+- (uint32_t)readFixed32;
+/**
+ * @return An enum read from the stream.
+ **/
+- (int32_t)readEnum;
+/**
+ * @return A sfixed32 read from the stream.
+ **/
+- (int32_t)readSFixed32;
+/**
+ * @return A fixed64 read from the stream.
+ **/
+- (int64_t)readSFixed64;
+/**
+ * @return A sint32 read from the stream.
+ **/
+- (int32_t)readSInt32;
+/**
+ * @return A sint64 read from the stream.
+ **/
+- (int64_t)readSInt64;
+/**
+ * @return A boolean read from the stream.
+ **/
+- (BOOL)readBool;
+/**
+ * @return A string read from the stream.
+ **/
+- (NSString *)readString;
+/**
+ * @return Data read from the stream.
+ **/
+- (NSData *)readBytes;
+
+/**
+ * Read an embedded message field value from the stream.
+ *
+ * @param message           The message to set fields on as they are read.
+ * @param extensionRegistry An optional extension registry to use to lookup
+ *                          extensions for message.
+ **/
+- (void)readMessage:(GPBMessage *)message
+  extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry;
+
+/**
+ * Reads and discards a single field, given its tag value.
+ *
+ * @param tag The tag number of the field to skip.
+ *
+ * @return NO if the tag is an endgroup tag (in which case nothing is skipped),
+ *         YES in all other cases.
+ **/
+- (BOOL)skipField:(int32_t)tag;
+
+/**
+ * Reads and discards an entire message. This will read either until EOF or
+ * until an endgroup tag, whichever comes first.
+ **/
+- (void)skipMessage;
+
+/**
+ * Check to see if the logical end of the stream has been reached.
+ *
+ * @note This can return NO when there is no more data, but the current parsing
+ *       expected more data.
+ *
+ * @return YES if the logical end of the stream has been reached, NO otherwise.
+ **/
+- (BOOL)isAtEnd;
+
+/**
+ * @return The offset into the stream.
+ **/
+- (size_t)position;
+
+/**
+ * Moves the limit to the given byte offset starting at the current location.
+ *
+ * @exception GPBCodedInputStreamException If the requested bytes exceeed the
+ *            current limit.
+ *
+ * @param byteLimit The number of bytes to move the limit, offset to the current
+ *                  location.
+ *
+ * @return The limit offset before moving the new limit.
+ */
+- (size_t)pushLimit:(size_t)byteLimit;
+
+/**
+ * Moves the limit back to the offset as it was before calling pushLimit:.
+ *
+ * @param oldLimit The number of bytes to move the current limit. Usually this
+ *                 is the value returned by the pushLimit: method.
+ */
+- (void)popLimit:(size_t)oldLimit;
+
+/**
+ * Verifies that the last call to -readTag returned the given tag value. This
+ * is used to verify that a nested group ended with the correct end tag.
+ *
+ * @exception NSParseErrorException If the value does not match the last tag.
+ *
+ * @param expected The tag that was expected.
+ **/
+- (void)checkLastTagWas:(int32_t)expected;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 112 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBCodedInputStream_PackagePrivate.h

@@ -0,0 +1,112 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This header is private to the ProtobolBuffers library and must NOT be
+// included by any sources outside this library. The contents of this file are
+// subject to change at any time without notice.
+
+#import "GPBCodedInputStream.h"
+
+@class GPBUnknownFieldSet;
+@class GPBFieldDescriptor;
+
+typedef struct GPBCodedInputStreamState {
+  const uint8_t *bytes;
+  size_t bufferSize;
+  size_t bufferPos;
+
+  // For parsing subsections of an input stream you can put a hard limit on
+  // how much should be read. Normally the limit is the end of the stream,
+  // but you can adjust it to anywhere, and if you hit it you will be at the
+  // end of the stream, until you adjust the limit.
+  size_t currentLimit;
+  int32_t lastTag;
+  NSUInteger recursionDepth;
+} GPBCodedInputStreamState;
+
+@interface GPBCodedInputStream () {
+ @package
+  struct GPBCodedInputStreamState state_;
+  NSData *buffer_;
+}
+
+// Group support is deprecated, so we hide this interface from users, but
+// support for older data.
+- (void)readGroup:(int32_t)fieldNumber
+              message:(GPBMessage *)message
+    extensionRegistry:(GPBExtensionRegistry *)extensionRegistry;
+
+// Reads a group field value from the stream and merges it into the given
+// UnknownFieldSet.
+- (void)readUnknownGroup:(int32_t)fieldNumber
+                 message:(GPBUnknownFieldSet *)message;
+
+// Reads a map entry.
+- (void)readMapEntry:(id)mapDictionary
+    extensionRegistry:(GPBExtensionRegistry *)extensionRegistry
+                field:(GPBFieldDescriptor *)field
+        parentMessage:(GPBMessage *)parentMessage;
+@end
+
+CF_EXTERN_C_BEGIN
+
+int32_t GPBCodedInputStreamReadTag(GPBCodedInputStreamState *state);
+
+double GPBCodedInputStreamReadDouble(GPBCodedInputStreamState *state);
+float GPBCodedInputStreamReadFloat(GPBCodedInputStreamState *state);
+uint64_t GPBCodedInputStreamReadUInt64(GPBCodedInputStreamState *state);
+uint32_t GPBCodedInputStreamReadUInt32(GPBCodedInputStreamState *state);
+int64_t GPBCodedInputStreamReadInt64(GPBCodedInputStreamState *state);
+int32_t GPBCodedInputStreamReadInt32(GPBCodedInputStreamState *state);
+uint64_t GPBCodedInputStreamReadFixed64(GPBCodedInputStreamState *state);
+uint32_t GPBCodedInputStreamReadFixed32(GPBCodedInputStreamState *state);
+int32_t GPBCodedInputStreamReadEnum(GPBCodedInputStreamState *state);
+int32_t GPBCodedInputStreamReadSFixed32(GPBCodedInputStreamState *state);
+int64_t GPBCodedInputStreamReadSFixed64(GPBCodedInputStreamState *state);
+int32_t GPBCodedInputStreamReadSInt32(GPBCodedInputStreamState *state);
+int64_t GPBCodedInputStreamReadSInt64(GPBCodedInputStreamState *state);
+BOOL GPBCodedInputStreamReadBool(GPBCodedInputStreamState *state);
+NSString *GPBCodedInputStreamReadRetainedString(GPBCodedInputStreamState *state)
+    __attribute((ns_returns_retained));
+NSData *GPBCodedInputStreamReadRetainedBytes(GPBCodedInputStreamState *state)
+    __attribute((ns_returns_retained));
+NSData *GPBCodedInputStreamReadRetainedBytesNoCopy(
+    GPBCodedInputStreamState *state) __attribute((ns_returns_retained));
+
+size_t GPBCodedInputStreamPushLimit(GPBCodedInputStreamState *state,
+                                    size_t byteLimit);
+void GPBCodedInputStreamPopLimit(GPBCodedInputStreamState *state,
+                                 size_t oldLimit);
+size_t GPBCodedInputStreamBytesUntilLimit(GPBCodedInputStreamState *state);
+BOOL GPBCodedInputStreamIsAtEnd(GPBCodedInputStreamState *state);
+void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state,
+                                        int32_t value);
+
+CF_EXTERN_C_END

+ 748 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBCodedOutputStream.h

@@ -0,0 +1,748 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+#import "GPBRuntimeTypes.h"
+#import "GPBWireFormat.h"
+
+@class GPBBoolArray;
+@class GPBDoubleArray;
+@class GPBEnumArray;
+@class GPBFloatArray;
+@class GPBMessage;
+@class GPBInt32Array;
+@class GPBInt64Array;
+@class GPBUInt32Array;
+@class GPBUInt64Array;
+@class GPBUnknownFieldSet;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ * @c GPBCodedOutputStream exception names.
+ **/
+extern NSString *const GPBCodedOutputStreamException_OutOfSpace;
+extern NSString *const GPBCodedOutputStreamException_WriteFailed;
+
+/**
+ * Writes out protocol message fields.
+ *
+ * The common uses of protocol buffers shouldn't need to use this class.
+ * GPBMessage's provide a -data method that will serialize the message for you.
+ *
+ * @note Any -write* api can raise the GPBCodedOutputStreamException_*
+ *       exceptions.
+ *
+ * @note Subclassing of GPBCodedOutputStream is NOT supported.
+ **/
+@interface GPBCodedOutputStream : NSObject
+
+/**
+ * Creates a stream to fill in the given data. Data must be sized to fit or
+ * an error will be raised when out of space.
+ *
+ * @param data The data where the stream will be written to.
+ *
+ * @return A newly instanced GPBCodedOutputStream.
+ **/
++ (instancetype)streamWithData:(NSMutableData *)data;
+
+/**
+ * Creates a stream to write into the given NSOutputStream.
+ *
+ * @param output The output stream where the stream will be written to.
+ *
+ * @return A newly instanced GPBCodedOutputStream.
+ **/
++ (instancetype)streamWithOutputStream:(NSOutputStream *)output;
+
+/**
+ * Initializes a stream to fill in the given data. Data must be sized to fit
+ * or an error will be raised when out of space.
+ *
+ * @param data The data where the stream will be written to.
+ *
+ * @return A newly initialized GPBCodedOutputStream.
+ **/
+- (instancetype)initWithData:(NSMutableData *)data;
+
+/**
+ * Initializes a stream to write into the given @c NSOutputStream.
+ *
+ * @param output The output stream where the stream will be written to.
+ *
+ * @return A newly initialized GPBCodedOutputStream.
+ **/
+- (instancetype)initWithOutputStream:(NSOutputStream *)output;
+
+/**
+ * Flush any buffered data out.
+ **/
+- (void)flush;
+
+/**
+ * Write the raw byte out.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeRawByte:(uint8_t)value;
+
+/**
+ * Write the tag for the given field number and wire format.
+ *
+ * @param fieldNumber The field number.
+ * @param format      The wire format the data for the field will be in.
+ **/
+- (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format;
+
+/**
+ * Write a 32bit value out in little endian format.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeRawLittleEndian32:(int32_t)value;
+/**
+ * Write a 64bit value out in little endian format.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeRawLittleEndian64:(int64_t)value;
+
+/**
+ * Write a 32bit value out in varint format.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeRawVarint32:(int32_t)value;
+/**
+ * Write a 64bit value out in varint format.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeRawVarint64:(int64_t)value;
+
+/**
+ * Write a size_t out as a 32bit varint value.
+ *
+ * @note This will truncate 64 bit values to 32.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeRawVarintSizeTAs32:(size_t)value;
+
+/**
+ * Writes the contents of an NSData out.
+ *
+ * @param data The data to write out.
+ **/
+- (void)writeRawData:(NSData *)data;
+/**
+ * Writes out the given data.
+ *
+ * @param data   The data blob to write out.
+ * @param offset The offset into the blob to start writing out.
+ * @param length The number of bytes from the blob to write out.
+ **/
+- (void)writeRawPtr:(const void *)data
+             offset:(size_t)offset
+             length:(size_t)length;
+
+//%PDDM-EXPAND _WRITE_DECLS()
+// This block of code is generated, do not edit it directly.
+
+/**
+ * Write a double for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeDouble:(int32_t)fieldNumber value:(double)value;
+/**
+ * Write a packed array of double for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeDoubleArray:(int32_t)fieldNumber
+                  values:(GPBDoubleArray *)values
+                     tag:(uint32_t)tag;
+/**
+ * Write a double without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeDoubleNoTag:(double)value;
+
+/**
+ * Write a float for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeFloat:(int32_t)fieldNumber value:(float)value;
+/**
+ * Write a packed array of float for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeFloatArray:(int32_t)fieldNumber
+                 values:(GPBFloatArray *)values
+                    tag:(uint32_t)tag;
+/**
+ * Write a float without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeFloatNoTag:(float)value;
+
+/**
+ * Write a uint64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value;
+/**
+ * Write a packed array of uint64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeUInt64Array:(int32_t)fieldNumber
+                  values:(GPBUInt64Array *)values
+                     tag:(uint32_t)tag;
+/**
+ * Write a uint64_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeUInt64NoTag:(uint64_t)value;
+
+/**
+ * Write a int64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value;
+/**
+ * Write a packed array of int64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeInt64Array:(int32_t)fieldNumber
+                 values:(GPBInt64Array *)values
+                    tag:(uint32_t)tag;
+/**
+ * Write a int64_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeInt64NoTag:(int64_t)value;
+
+/**
+ * Write a int32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value;
+/**
+ * Write a packed array of int32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeInt32Array:(int32_t)fieldNumber
+                 values:(GPBInt32Array *)values
+                    tag:(uint32_t)tag;
+/**
+ * Write a int32_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeInt32NoTag:(int32_t)value;
+
+/**
+ * Write a uint32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value;
+/**
+ * Write a packed array of uint32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeUInt32Array:(int32_t)fieldNumber
+                  values:(GPBUInt32Array *)values
+                     tag:(uint32_t)tag;
+/**
+ * Write a uint32_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeUInt32NoTag:(uint32_t)value;
+
+/**
+ * Write a uint64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value;
+/**
+ * Write a packed array of uint64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeFixed64Array:(int32_t)fieldNumber
+                   values:(GPBUInt64Array *)values
+                      tag:(uint32_t)tag;
+/**
+ * Write a uint64_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeFixed64NoTag:(uint64_t)value;
+
+/**
+ * Write a uint32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value;
+/**
+ * Write a packed array of uint32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeFixed32Array:(int32_t)fieldNumber
+                   values:(GPBUInt32Array *)values
+                      tag:(uint32_t)tag;
+/**
+ * Write a uint32_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeFixed32NoTag:(uint32_t)value;
+
+/**
+ * Write a int32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value;
+/**
+ * Write a packed array of int32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeSInt32Array:(int32_t)fieldNumber
+                  values:(GPBInt32Array *)values
+                     tag:(uint32_t)tag;
+/**
+ * Write a int32_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeSInt32NoTag:(int32_t)value;
+
+/**
+ * Write a int64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value;
+/**
+ * Write a packed array of int64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeSInt64Array:(int32_t)fieldNumber
+                  values:(GPBInt64Array *)values
+                     tag:(uint32_t)tag;
+/**
+ * Write a int64_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeSInt64NoTag:(int64_t)value;
+
+/**
+ * Write a int64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value;
+/**
+ * Write a packed array of int64_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeSFixed64Array:(int32_t)fieldNumber
+                    values:(GPBInt64Array *)values
+                       tag:(uint32_t)tag;
+/**
+ * Write a int64_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeSFixed64NoTag:(int64_t)value;
+
+/**
+ * Write a int32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value;
+/**
+ * Write a packed array of int32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeSFixed32Array:(int32_t)fieldNumber
+                    values:(GPBInt32Array *)values
+                       tag:(uint32_t)tag;
+/**
+ * Write a int32_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeSFixed32NoTag:(int32_t)value;
+
+/**
+ * Write a BOOL for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeBool:(int32_t)fieldNumber value:(BOOL)value;
+/**
+ * Write a packed array of BOOL for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeBoolArray:(int32_t)fieldNumber
+                values:(GPBBoolArray *)values
+                   tag:(uint32_t)tag;
+/**
+ * Write a BOOL without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeBoolNoTag:(BOOL)value;
+
+/**
+ * Write a int32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value;
+/**
+ * Write a packed array of int32_t for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ * @param tag         The tag assigned to the values.
+ **/
+- (void)writeEnumArray:(int32_t)fieldNumber
+                values:(GPBEnumArray *)values
+                   tag:(uint32_t)tag;
+/**
+ * Write a int32_t without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeEnumNoTag:(int32_t)value;
+
+/**
+ * Write a NSString for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeString:(int32_t)fieldNumber value:(NSString *)value;
+/**
+ * Write an array of NSString for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ **/
+- (void)writeStringArray:(int32_t)fieldNumber values:(NSArray<NSString*> *)values;
+/**
+ * Write a NSString without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeStringNoTag:(NSString *)value;
+
+/**
+ * Write a GPBMessage for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value;
+/**
+ * Write an array of GPBMessage for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ **/
+- (void)writeMessageArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)values;
+/**
+ * Write a GPBMessage without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeMessageNoTag:(GPBMessage *)value;
+
+/**
+ * Write a NSData for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value;
+/**
+ * Write an array of NSData for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ **/
+- (void)writeBytesArray:(int32_t)fieldNumber values:(NSArray<NSData*> *)values;
+/**
+ * Write a NSData without any tag.
+ *
+ * @param value The value to write out.
+ **/
+- (void)writeBytesNoTag:(NSData *)value;
+
+/**
+ * Write a GPBMessage for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeGroup:(int32_t)fieldNumber
+             value:(GPBMessage *)value;
+/**
+ * Write an array of GPBMessage for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ **/
+- (void)writeGroupArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)values;
+/**
+ * Write a GPBMessage without any tag (but does write the endGroup tag).
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeGroupNoTag:(int32_t)fieldNumber
+                  value:(GPBMessage *)value;
+
+/**
+ * Write a GPBUnknownFieldSet for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeUnknownGroup:(int32_t)fieldNumber
+                    value:(GPBUnknownFieldSet *)value;
+/**
+ * Write an array of GPBUnknownFieldSet for the given field number.
+ *
+ * @param fieldNumber The field number assigned to the values.
+ * @param values      The values to write out.
+ **/
+- (void)writeUnknownGroupArray:(int32_t)fieldNumber values:(NSArray<GPBUnknownFieldSet*> *)values;
+/**
+ * Write a GPBUnknownFieldSet without any tag (but does write the endGroup tag).
+ *
+ * @param fieldNumber The field number assigned to the value.
+ * @param value       The value to write out.
+ **/
+- (void)writeUnknownGroupNoTag:(int32_t)fieldNumber
+                         value:(GPBUnknownFieldSet *)value;
+
+//%PDDM-EXPAND-END _WRITE_DECLS()
+
+/**
+Write a MessageSet extension field to the stream. For historical reasons,
+the wire format differs from normal fields.
+
+@param fieldNumber The extension field number to write out.
+@param value       The message from where to get the extension.
+*/
+- (void)writeMessageSetExtension:(int32_t)fieldNumber value:(GPBMessage *)value;
+
+/**
+Write an unparsed MessageSet extension field to the stream. For historical
+reasons, the wire format differs from normal fields.
+
+@param fieldNumber The extension field number to write out.
+@param value       The raw message from where to get the extension.
+*/
+- (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+// Write methods for types that can be in packed arrays.
+//%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE)
+//%/**
+//% * Write a TYPE for the given field number.
+//% *
+//% * @param fieldNumber The field number assigned to the value.
+//% * @param value       The value to write out.
+//% **/
+//%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value;
+//%/**
+//% * Write a packed array of TYPE for the given field number.
+//% *
+//% * @param fieldNumber The field number assigned to the values.
+//% * @param values      The values to write out.
+//% * @param tag         The tag assigned to the values.
+//% **/
+//%- (void)write##NAME##Array:(int32_t)fieldNumber
+//%       NAME$S     values:(GPB##ARRAY_TYPE##Array *)values
+//%       NAME$S        tag:(uint32_t)tag;
+//%/**
+//% * Write a TYPE without any tag.
+//% *
+//% * @param value The value to write out.
+//% **/
+//%- (void)write##NAME##NoTag:(TYPE)value;
+//%
+// Write methods for types that aren't in packed arrays.
+//%PDDM-DEFINE _WRITE_UNPACKABLE_DECLS(NAME, TYPE)
+//%/**
+//% * Write a TYPE for the given field number.
+//% *
+//% * @param fieldNumber The field number assigned to the value.
+//% * @param value       The value to write out.
+//% **/
+//%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE *)value;
+//%/**
+//% * Write an array of TYPE for the given field number.
+//% *
+//% * @param fieldNumber The field number assigned to the values.
+//% * @param values      The values to write out.
+//% **/
+//%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)values;
+//%/**
+//% * Write a TYPE without any tag.
+//% *
+//% * @param value The value to write out.
+//% **/
+//%- (void)write##NAME##NoTag:(TYPE *)value;
+//%
+// Special write methods for Groups.
+//%PDDM-DEFINE _WRITE_GROUP_DECLS(NAME, TYPE)
+//%/**
+//% * Write a TYPE for the given field number.
+//% *
+//% * @param fieldNumber The field number assigned to the value.
+//% * @param value       The value to write out.
+//% **/
+//%- (void)write##NAME:(int32_t)fieldNumber
+//%       NAME$S value:(TYPE *)value;
+//%/**
+//% * Write an array of TYPE for the given field number.
+//% *
+//% * @param fieldNumber The field number assigned to the values.
+//% * @param values      The values to write out.
+//% **/
+//%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)values;
+//%/**
+//% * Write a TYPE without any tag (but does write the endGroup tag).
+//% *
+//% * @param fieldNumber The field number assigned to the value.
+//% * @param value       The value to write out.
+//% **/
+//%- (void)write##NAME##NoTag:(int32_t)fieldNumber
+//%            NAME$S value:(TYPE *)value;
+//%
+
+// One macro to hide it all up above.
+//%PDDM-DEFINE _WRITE_DECLS()
+//%_WRITE_PACKABLE_DECLS(Double, Double, double)
+//%_WRITE_PACKABLE_DECLS(Float, Float, float)
+//%_WRITE_PACKABLE_DECLS(UInt64, UInt64, uint64_t)
+//%_WRITE_PACKABLE_DECLS(Int64, Int64, int64_t)
+//%_WRITE_PACKABLE_DECLS(Int32, Int32, int32_t)
+//%_WRITE_PACKABLE_DECLS(UInt32, UInt32, uint32_t)
+//%_WRITE_PACKABLE_DECLS(Fixed64, UInt64, uint64_t)
+//%_WRITE_PACKABLE_DECLS(Fixed32, UInt32, uint32_t)
+//%_WRITE_PACKABLE_DECLS(SInt32, Int32, int32_t)
+//%_WRITE_PACKABLE_DECLS(SInt64, Int64, int64_t)
+//%_WRITE_PACKABLE_DECLS(SFixed64, Int64, int64_t)
+//%_WRITE_PACKABLE_DECLS(SFixed32, Int32, int32_t)
+//%_WRITE_PACKABLE_DECLS(Bool, Bool, BOOL)
+//%_WRITE_PACKABLE_DECLS(Enum, Enum, int32_t)
+//%_WRITE_UNPACKABLE_DECLS(String, NSString)
+//%_WRITE_UNPACKABLE_DECLS(Message, GPBMessage)
+//%_WRITE_UNPACKABLE_DECLS(Bytes, NSData)
+//%_WRITE_GROUP_DECLS(Group, GPBMessage)
+//%_WRITE_GROUP_DECLS(UnknownGroup, GPBUnknownFieldSet)

+ 126 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBCodedOutputStream_PackagePrivate.h

@@ -0,0 +1,126 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2016 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import "GPBCodedOutputStream.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+CF_EXTERN_C_BEGIN
+
+size_t GPBComputeDoubleSize(int32_t fieldNumber, double value)
+    __attribute__((const));
+size_t GPBComputeFloatSize(int32_t fieldNumber, float value)
+    __attribute__((const));
+size_t GPBComputeUInt64Size(int32_t fieldNumber, uint64_t value)
+    __attribute__((const));
+size_t GPBComputeInt64Size(int32_t fieldNumber, int64_t value)
+    __attribute__((const));
+size_t GPBComputeInt32Size(int32_t fieldNumber, int32_t value)
+    __attribute__((const));
+size_t GPBComputeFixed64Size(int32_t fieldNumber, uint64_t value)
+    __attribute__((const));
+size_t GPBComputeFixed32Size(int32_t fieldNumber, uint32_t value)
+    __attribute__((const));
+size_t GPBComputeBoolSize(int32_t fieldNumber, BOOL value)
+    __attribute__((const));
+size_t GPBComputeStringSize(int32_t fieldNumber, NSString *value)
+    __attribute__((const));
+size_t GPBComputeGroupSize(int32_t fieldNumber, GPBMessage *value)
+    __attribute__((const));
+size_t GPBComputeUnknownGroupSize(int32_t fieldNumber,
+                                  GPBUnknownFieldSet *value)
+    __attribute__((const));
+size_t GPBComputeMessageSize(int32_t fieldNumber, GPBMessage *value)
+    __attribute__((const));
+size_t GPBComputeBytesSize(int32_t fieldNumber, NSData *value)
+    __attribute__((const));
+size_t GPBComputeUInt32Size(int32_t fieldNumber, uint32_t value)
+    __attribute__((const));
+size_t GPBComputeSFixed32Size(int32_t fieldNumber, int32_t value)
+    __attribute__((const));
+size_t GPBComputeSFixed64Size(int32_t fieldNumber, int64_t value)
+    __attribute__((const));
+size_t GPBComputeSInt32Size(int32_t fieldNumber, int32_t value)
+    __attribute__((const));
+size_t GPBComputeSInt64Size(int32_t fieldNumber, int64_t value)
+    __attribute__((const));
+size_t GPBComputeTagSize(int32_t fieldNumber) __attribute__((const));
+size_t GPBComputeWireFormatTagSize(int field_number, GPBDataType dataType)
+    __attribute__((const));
+
+size_t GPBComputeDoubleSizeNoTag(double value) __attribute__((const));
+size_t GPBComputeFloatSizeNoTag(float value) __attribute__((const));
+size_t GPBComputeUInt64SizeNoTag(uint64_t value) __attribute__((const));
+size_t GPBComputeInt64SizeNoTag(int64_t value) __attribute__((const));
+size_t GPBComputeInt32SizeNoTag(int32_t value) __attribute__((const));
+size_t GPBComputeFixed64SizeNoTag(uint64_t value) __attribute__((const));
+size_t GPBComputeFixed32SizeNoTag(uint32_t value) __attribute__((const));
+size_t GPBComputeBoolSizeNoTag(BOOL value) __attribute__((const));
+size_t GPBComputeStringSizeNoTag(NSString *value) __attribute__((const));
+size_t GPBComputeGroupSizeNoTag(GPBMessage *value) __attribute__((const));
+size_t GPBComputeUnknownGroupSizeNoTag(GPBUnknownFieldSet *value)
+    __attribute__((const));
+size_t GPBComputeMessageSizeNoTag(GPBMessage *value) __attribute__((const));
+size_t GPBComputeBytesSizeNoTag(NSData *value) __attribute__((const));
+size_t GPBComputeUInt32SizeNoTag(int32_t value) __attribute__((const));
+size_t GPBComputeEnumSizeNoTag(int32_t value) __attribute__((const));
+size_t GPBComputeSFixed32SizeNoTag(int32_t value) __attribute__((const));
+size_t GPBComputeSFixed64SizeNoTag(int64_t value) __attribute__((const));
+size_t GPBComputeSInt32SizeNoTag(int32_t value) __attribute__((const));
+size_t GPBComputeSInt64SizeNoTag(int64_t value) __attribute__((const));
+
+// Note that this will calculate the size of 64 bit values truncated to 32.
+size_t GPBComputeSizeTSizeAsInt32NoTag(size_t value) __attribute__((const));
+
+size_t GPBComputeRawVarint32Size(int32_t value) __attribute__((const));
+size_t GPBComputeRawVarint64Size(int64_t value) __attribute__((const));
+
+// Note that this will calculate the size of 64 bit values truncated to 32.
+size_t GPBComputeRawVarint32SizeForInteger(NSInteger value)
+    __attribute__((const));
+
+// Compute the number of bytes that would be needed to encode a
+// MessageSet extension to the stream.  For historical reasons,
+// the wire format differs from normal fields.
+size_t GPBComputeMessageSetExtensionSize(int32_t fieldNumber, GPBMessage *value)
+    __attribute__((const));
+
+// Compute the number of bytes that would be needed to encode an
+// unparsed MessageSet extension field to the stream.  For
+// historical reasons, the wire format differs from normal fields.
+size_t GPBComputeRawMessageSetExtensionSize(int32_t fieldNumber, NSData *value)
+    __attribute__((const));
+
+size_t GPBComputeEnumSize(int32_t fieldNumber, int32_t value)
+    __attribute__((const));
+
+CF_EXTERN_C_END
+
+NS_ASSUME_NONNULL_END

+ 288 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBDescriptor.h

@@ -0,0 +1,288 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+#import "GPBRuntimeTypes.h"
+
+@class GPBEnumDescriptor;
+@class GPBFieldDescriptor;
+@class GPBFileDescriptor;
+@class GPBOneofDescriptor;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/** Syntax used in the proto file. */
+typedef NS_ENUM(uint8_t, GPBFileSyntax) {
+  /** Unknown syntax. */
+  GPBFileSyntaxUnknown = 0,
+  /** Proto2 syntax. */
+  GPBFileSyntaxProto2 = 2,
+  /** Proto3 syntax. */
+  GPBFileSyntaxProto3 = 3,
+};
+
+/** Type of proto field. */
+typedef NS_ENUM(uint8_t, GPBFieldType) {
+  /** Optional/required field. Only valid for proto2 fields. */
+  GPBFieldTypeSingle,
+  /** Repeated field. */
+  GPBFieldTypeRepeated,
+  /** Map field. */
+  GPBFieldTypeMap,
+};
+
+/**
+ * Describes a proto message.
+ **/
+@interface GPBDescriptor : NSObject<NSCopying>
+
+/** Name of the message. */
+@property(nonatomic, readonly, copy) NSString *name;
+/** Fields declared in the message. */
+@property(nonatomic, readonly, strong, nullable) NSArray<GPBFieldDescriptor*> *fields;
+/** Oneofs declared in the message. */
+@property(nonatomic, readonly, strong, nullable) NSArray<GPBOneofDescriptor*> *oneofs;
+/** Extension range declared for the message. */
+@property(nonatomic, readonly, nullable) const GPBExtensionRange *extensionRanges;
+/** Number of extension ranges declared for the message. */
+@property(nonatomic, readonly) uint32_t extensionRangesCount;
+/** Descriptor for the file where the message was defined. */
+@property(nonatomic, readonly, assign) GPBFileDescriptor *file;
+
+/** Whether the message is in wire format or not. */
+@property(nonatomic, readonly, getter=isWireFormat) BOOL wireFormat;
+/** The class of this message. */
+@property(nonatomic, readonly) Class messageClass;
+/** Containing message descriptor if this message is nested, or nil otherwise. */
+@property(readonly, nullable) GPBDescriptor *containingType;
+/**
+ * Fully qualified name for this message (package.message). Can be nil if the
+ * value is unable to be computed.
+ */
+@property(readonly, nullable) NSString *fullName;
+
+/**
+ * Gets the field for the given number.
+ *
+ * @param fieldNumber The number for the field to get.
+ *
+ * @return The field descriptor for the given number, or nil if not found.
+ **/
+- (nullable GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber;
+
+/**
+ * Gets the field for the given name.
+ *
+ * @param name The name for the field to get.
+ *
+ * @return The field descriptor for the given name, or nil if not found.
+ **/
+- (nullable GPBFieldDescriptor *)fieldWithName:(NSString *)name;
+
+/**
+ * Gets the oneof for the given name.
+ *
+ * @param name The name for the oneof to get.
+ *
+ * @return The oneof descriptor for the given name, or nil if not found.
+ **/
+- (nullable GPBOneofDescriptor *)oneofWithName:(NSString *)name;
+
+@end
+
+/**
+ * Describes a proto file.
+ **/
+@interface GPBFileDescriptor : NSObject
+
+/** The package declared in the proto file. */
+@property(nonatomic, readonly, copy) NSString *package;
+/** The objc prefix declared in the proto file. */
+@property(nonatomic, readonly, copy, nullable) NSString *objcPrefix;
+/** The syntax of the proto file. */
+@property(nonatomic, readonly) GPBFileSyntax syntax;
+
+@end
+
+/**
+ * Describes a oneof field.
+ **/
+@interface GPBOneofDescriptor : NSObject
+/** Name of the oneof field. */
+@property(nonatomic, readonly) NSString *name;
+/** Fields declared in the oneof. */
+@property(nonatomic, readonly) NSArray<GPBFieldDescriptor*> *fields;
+
+/**
+ * Gets the field for the given number.
+ *
+ * @param fieldNumber The number for the field to get.
+ *
+ * @return The field descriptor for the given number, or nil if not found.
+ **/
+- (nullable GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber;
+
+/**
+ * Gets the field for the given name.
+ *
+ * @param name The name for the field to get.
+ *
+ * @return The field descriptor for the given name, or nil if not found.
+ **/
+- (nullable GPBFieldDescriptor *)fieldWithName:(NSString *)name;
+
+@end
+
+/**
+ * Describes a proto field.
+ **/
+@interface GPBFieldDescriptor : NSObject
+
+/** Name of the field. */
+@property(nonatomic, readonly, copy) NSString *name;
+/** Number associated with the field. */
+@property(nonatomic, readonly) uint32_t number;
+/** Data type contained in the field. */
+@property(nonatomic, readonly) GPBDataType dataType;
+/** Whether it has a default value or not. */
+@property(nonatomic, readonly) BOOL hasDefaultValue;
+/** Default value for the field. */
+@property(nonatomic, readonly) GPBGenericValue defaultValue;
+/** Whether this field is required. Only valid for proto2 fields. */
+@property(nonatomic, readonly, getter=isRequired) BOOL required;
+/** Whether this field is optional. */
+@property(nonatomic, readonly, getter=isOptional) BOOL optional;
+/** Type of field (single, repeated, map). */
+@property(nonatomic, readonly) GPBFieldType fieldType;
+/** Type of the key if the field is a map. The value's type is -fieldType. */
+@property(nonatomic, readonly) GPBDataType mapKeyDataType;
+/** Whether the field is packable. */
+@property(nonatomic, readonly, getter=isPackable) BOOL packable;
+
+/** The containing oneof if this field is part of one, nil otherwise. */
+@property(nonatomic, readonly, assign, nullable) GPBOneofDescriptor *containingOneof;
+
+/** Class of the message if the field is of message type. */
+@property(nonatomic, readonly, assign, nullable) Class msgClass;
+
+/** Descriptor for the enum if this field is an enum. */
+@property(nonatomic, readonly, strong, nullable) GPBEnumDescriptor *enumDescriptor;
+
+/**
+ * Checks whether the given enum raw value is a valid enum value.
+ *
+ * @param value The raw enum value to check.
+ *
+ * @return YES if value is a valid enum raw value.
+ **/
+- (BOOL)isValidEnumValue:(int32_t)value;
+
+/** @return Name for the text format, or nil if not known. */
+- (nullable NSString *)textFormatName;
+
+@end
+
+/**
+ * Describes a proto enum.
+ **/
+@interface GPBEnumDescriptor : NSObject
+
+/** Name of the enum. */
+@property(nonatomic, readonly, copy) NSString *name;
+/** Function that validates that raw values are valid enum values. */
+@property(nonatomic, readonly) GPBEnumValidationFunc enumVerifier;
+
+/**
+ * Returns the enum value name for the given raw enum.
+ *
+ * @param number The raw enum value.
+ *
+ * @return The name of the enum value passed, or nil if not valid.
+ **/
+- (nullable NSString *)enumNameForValue:(int32_t)number;
+
+/**
+ * Gets the enum raw value for the given enum name.
+ *
+ * @param outValue A pointer where the value will be set.
+ * @param name     The enum name for which to get the raw value.
+ *
+ * @return YES if a value was copied into the pointer, NO otherwise.
+ **/
+- (BOOL)getValue:(nullable int32_t *)outValue forEnumName:(NSString *)name;
+
+/**
+ * Returns the text format for the given raw enum value.
+ *
+ * @param number The raw enum value.
+ *
+ * @return The text format name for the raw enum value, or nil if not valid.
+ **/
+- (nullable NSString *)textFormatNameForValue:(int32_t)number;
+
+/**
+ * Gets the enum raw value for the given text format name.
+ *
+ * @param outValue       A pointer where the value will be set.
+ * @param textFormatName The text format name for which to get the raw value.
+ *
+ * @return YES if a value was copied into the pointer, NO otherwise.
+ **/
+- (BOOL)getValue:(nullable int32_t *)outValue forEnumTextFormatName:(NSString *)textFormatName;
+
+@end
+
+/**
+ * Describes a proto extension.
+ **/
+@interface GPBExtensionDescriptor : NSObject<NSCopying>
+/** Field number under which the extension is stored. */
+@property(nonatomic, readonly) uint32_t fieldNumber;
+/** The containing message class, i.e. the class extended by this extension. */
+@property(nonatomic, readonly) Class containingMessageClass;
+/** Data type contained in the extension. */
+@property(nonatomic, readonly) GPBDataType dataType;
+/** Whether the extension is repeated. */
+@property(nonatomic, readonly, getter=isRepeated) BOOL repeated;
+/** Whether the extension is packable. */
+@property(nonatomic, readonly, getter=isPackable) BOOL packable;
+/** The class of the message if the extension is of message type. */
+@property(nonatomic, readonly, assign) Class msgClass;
+/** The singleton name for the extension. */
+@property(nonatomic, readonly) NSString *singletonName;
+/** The enum descriptor if the extension is of enum type. */
+@property(nonatomic, readonly, strong, nullable) GPBEnumDescriptor *enumDescriptor;
+/** The default value for the extension. */
+@property(nonatomic, readonly, nullable) id defaultValue;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 325 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBDescriptor_PackagePrivate.h

@@ -0,0 +1,325 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// This header is private to the ProtobolBuffers library and must NOT be
+// included by any sources outside this library. The contents of this file are
+// subject to change at any time without notice.
+
+#import "GPBDescriptor.h"
+#import "GPBWireFormat.h"
+
+// Describes attributes of the field.
+typedef NS_OPTIONS(uint16_t, GPBFieldFlags) {
+  GPBFieldNone            = 0,
+  // These map to standard protobuf concepts.
+  GPBFieldRequired        = 1 << 0,
+  GPBFieldRepeated        = 1 << 1,
+  GPBFieldPacked          = 1 << 2,
+  GPBFieldOptional        = 1 << 3,
+  GPBFieldHasDefaultValue = 1 << 4,
+
+  // Indicates the field needs custom handling for the TextFormat name, if not
+  // set, the name can be derived from the ObjC name.
+  GPBFieldTextFormatNameCustom = 1 << 6,
+  // Indicates the field has an enum descriptor.
+  GPBFieldHasEnumDescriptor = 1 << 7,
+
+  // These are not standard protobuf concepts, they are specific to the
+  // Objective C runtime.
+
+  // These bits are used to mark the field as a map and what the key
+  // type is.
+  GPBFieldMapKeyMask     = 0xF << 8,
+  GPBFieldMapKeyInt32    =  1 << 8,
+  GPBFieldMapKeyInt64    =  2 << 8,
+  GPBFieldMapKeyUInt32   =  3 << 8,
+  GPBFieldMapKeyUInt64   =  4 << 8,
+  GPBFieldMapKeySInt32   =  5 << 8,
+  GPBFieldMapKeySInt64   =  6 << 8,
+  GPBFieldMapKeyFixed32  =  7 << 8,
+  GPBFieldMapKeyFixed64  =  8 << 8,
+  GPBFieldMapKeySFixed32 =  9 << 8,
+  GPBFieldMapKeySFixed64 = 10 << 8,
+  GPBFieldMapKeyBool     = 11 << 8,
+  GPBFieldMapKeyString   = 12 << 8,
+};
+
+// NOTE: The structures defined here have their members ordered to minimize
+// their size. This directly impacts the size of apps since these exist per
+// field/extension.
+
+// Describes a single field in a protobuf as it is represented as an ivar.
+typedef struct GPBMessageFieldDescription {
+  // Name of ivar.
+  const char *name;
+  union {
+    const char *className;  // Name for message class.
+    // For enums only: If EnumDescriptors are compiled in, it will be that,
+    // otherwise it will be the verifier.
+    GPBEnumDescriptorFunc enumDescFunc;
+    GPBEnumValidationFunc enumVerifier;
+  } dataTypeSpecific;
+  // The field number for the ivar.
+  uint32_t number;
+  // The index (in bits) into _has_storage_.
+  //   >= 0: the bit to use for a value being set.
+  //   = GPBNoHasBit(INT32_MAX): no storage used.
+  //   < 0: in a oneOf, use a full int32 to record the field active.
+  int32_t hasIndex;
+  // Offset of the variable into it's structure struct.
+  uint32_t offset;
+  // Field flags. Use accessor functions below.
+  GPBFieldFlags flags;
+  // Data type of the ivar.
+  GPBDataType dataType;
+} GPBMessageFieldDescription;
+
+// Fields in messages defined in a 'proto2' syntax file can provide a default
+// value. This struct provides the default along with the field info.
+typedef struct GPBMessageFieldDescriptionWithDefault {
+  // Default value for the ivar.
+  GPBGenericValue defaultValue;
+
+  GPBMessageFieldDescription core;
+} GPBMessageFieldDescriptionWithDefault;
+
+// Describes attributes of the extension.
+typedef NS_OPTIONS(uint8_t, GPBExtensionOptions) {
+  GPBExtensionNone          = 0,
+  // These map to standard protobuf concepts.
+  GPBExtensionRepeated      = 1 << 0,
+  GPBExtensionPacked        = 1 << 1,
+  GPBExtensionSetWireFormat = 1 << 2,
+};
+
+// An extension
+typedef struct GPBExtensionDescription {
+  GPBGenericValue defaultValue;
+  const char *singletonName;
+  const char *extendedClass;
+  const char *messageOrGroupClassName;
+  GPBEnumDescriptorFunc enumDescriptorFunc;
+  int32_t fieldNumber;
+  GPBDataType dataType;
+  GPBExtensionOptions options;
+} GPBExtensionDescription;
+
+typedef NS_OPTIONS(uint32_t, GPBDescriptorInitializationFlags) {
+  GPBDescriptorInitializationFlag_None              = 0,
+  GPBDescriptorInitializationFlag_FieldsWithDefault = 1 << 0,
+  GPBDescriptorInitializationFlag_WireFormat        = 1 << 1,
+};
+
+@interface GPBDescriptor () {
+ @package
+  NSArray *fields_;
+  NSArray *oneofs_;
+  uint32_t storageSize_;
+}
+
+// fieldDescriptions have to be long lived, they are held as raw pointers.
++ (instancetype)
+    allocDescriptorForClass:(Class)messageClass
+                  rootClass:(Class)rootClass
+                       file:(GPBFileDescriptor *)file
+                     fields:(void *)fieldDescriptions
+                 fieldCount:(uint32_t)fieldCount
+                storageSize:(uint32_t)storageSize
+                      flags:(GPBDescriptorInitializationFlags)flags;
+
+- (instancetype)initWithClass:(Class)messageClass
+                         file:(GPBFileDescriptor *)file
+                       fields:(NSArray *)fields
+                  storageSize:(uint32_t)storage
+                   wireFormat:(BOOL)wireFormat;
+
+// Called right after init to provide extra information to avoid init having
+// an explosion of args. These pointers are recorded, so they are expected
+// to live for the lifetime of the app.
+- (void)setupOneofs:(const char **)oneofNames
+              count:(uint32_t)count
+      firstHasIndex:(int32_t)firstHasIndex;
+- (void)setupExtraTextInfo:(const char *)extraTextFormatInfo;
+- (void)setupExtensionRanges:(const GPBExtensionRange *)ranges count:(int32_t)count;
+- (void)setupContainingMessageClassName:(const char *)msgClassName;
+- (void)setupMessageClassNameSuffix:(NSString *)suffix;
+
+@end
+
+@interface GPBFileDescriptor ()
+- (instancetype)initWithPackage:(NSString *)package
+                     objcPrefix:(NSString *)objcPrefix
+                         syntax:(GPBFileSyntax)syntax;
+- (instancetype)initWithPackage:(NSString *)package
+                         syntax:(GPBFileSyntax)syntax;
+@end
+
+@interface GPBOneofDescriptor () {
+ @package
+  const char *name_;
+  NSArray *fields_;
+  SEL caseSel_;
+}
+// name must be long lived.
+- (instancetype)initWithName:(const char *)name fields:(NSArray *)fields;
+@end
+
+@interface GPBFieldDescriptor () {
+ @package
+  GPBMessageFieldDescription *description_;
+  GPB_UNSAFE_UNRETAINED GPBOneofDescriptor *containingOneof_;
+
+  SEL getSel_;
+  SEL setSel_;
+  SEL hasOrCountSel_;  // *Count for map<>/repeated fields, has* otherwise.
+  SEL setHasSel_;
+}
+
+// Single initializer
+// description has to be long lived, it is held as a raw pointer.
+- (instancetype)initWithFieldDescription:(void *)description
+                         includesDefault:(BOOL)includesDefault
+                                  syntax:(GPBFileSyntax)syntax;
+@end
+
+@interface GPBEnumDescriptor ()
+// valueNames, values and extraTextFormatInfo have to be long lived, they are
+// held as raw pointers.
++ (instancetype)
+    allocDescriptorForName:(NSString *)name
+                valueNames:(const char *)valueNames
+                    values:(const int32_t *)values
+                     count:(uint32_t)valueCount
+              enumVerifier:(GPBEnumValidationFunc)enumVerifier;
++ (instancetype)
+    allocDescriptorForName:(NSString *)name
+                valueNames:(const char *)valueNames
+                    values:(const int32_t *)values
+                     count:(uint32_t)valueCount
+              enumVerifier:(GPBEnumValidationFunc)enumVerifier
+       extraTextFormatInfo:(const char *)extraTextFormatInfo;
+
+- (instancetype)initWithName:(NSString *)name
+                  valueNames:(const char *)valueNames
+                      values:(const int32_t *)values
+                       count:(uint32_t)valueCount
+                enumVerifier:(GPBEnumValidationFunc)enumVerifier;
+@end
+
+@interface GPBExtensionDescriptor () {
+ @package
+  GPBExtensionDescription *description_;
+}
+@property(nonatomic, readonly) GPBWireFormat wireType;
+
+// For repeated extensions, alternateWireType is the wireType with the opposite
+// value for the packable property.  i.e. - if the extension was marked packed
+// it would be the wire type for unpacked; if the extension was marked unpacked,
+// it would be the wire type for packed.
+@property(nonatomic, readonly) GPBWireFormat alternateWireType;
+
+// description has to be long lived, it is held as a raw pointer.
+- (instancetype)initWithExtensionDescription:
+    (GPBExtensionDescription *)description;
+- (NSComparisonResult)compareByFieldNumber:(GPBExtensionDescriptor *)other;
+@end
+
+CF_EXTERN_C_BEGIN
+
+// Direct access is use for speed, to avoid even internally declaring things
+// read/write, etc. The warning is enabled in the project to ensure code calling
+// protos can turn on -Wdirect-ivar-access without issues.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdirect-ivar-access"
+
+GPB_INLINE BOOL GPBFieldIsMapOrArray(GPBFieldDescriptor *field) {
+  return (field->description_->flags &
+          (GPBFieldRepeated | GPBFieldMapKeyMask)) != 0;
+}
+
+GPB_INLINE GPBDataType GPBGetFieldDataType(GPBFieldDescriptor *field) {
+  return field->description_->dataType;
+}
+
+GPB_INLINE int32_t GPBFieldHasIndex(GPBFieldDescriptor *field) {
+  return field->description_->hasIndex;
+}
+
+GPB_INLINE uint32_t GPBFieldNumber(GPBFieldDescriptor *field) {
+  return field->description_->number;
+}
+
+#pragma clang diagnostic pop
+
+uint32_t GPBFieldTag(GPBFieldDescriptor *self);
+
+// For repeated fields, alternateWireType is the wireType with the opposite
+// value for the packable property.  i.e. - if the field was marked packed it
+// would be the wire type for unpacked; if the field was marked unpacked, it
+// would be the wire type for packed.
+uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self);
+
+GPB_INLINE BOOL GPBHasPreservingUnknownEnumSemantics(GPBFileSyntax syntax) {
+  return syntax == GPBFileSyntaxProto3;
+}
+
+GPB_INLINE BOOL GPBExtensionIsRepeated(GPBExtensionDescription *description) {
+  return (description->options & GPBExtensionRepeated) != 0;
+}
+
+GPB_INLINE BOOL GPBExtensionIsPacked(GPBExtensionDescription *description) {
+  return (description->options & GPBExtensionPacked) != 0;
+}
+
+GPB_INLINE BOOL GPBExtensionIsWireFormat(GPBExtensionDescription *description) {
+  return (description->options & GPBExtensionSetWireFormat) != 0;
+}
+
+// Helper for compile time assets.
+#ifndef GPBInternalCompileAssert
+  #if __has_feature(c_static_assert) || __has_extension(c_static_assert)
+    #define GPBInternalCompileAssert(test, msg) _Static_assert((test), #msg)
+  #else
+    // Pre-Xcode 7 support.
+    #define GPBInternalCompileAssertSymbolInner(line, msg) GPBInternalCompileAssert ## line ## __ ## msg
+    #define GPBInternalCompileAssertSymbol(line, msg) GPBInternalCompileAssertSymbolInner(line, msg)
+    #define GPBInternalCompileAssert(test, msg) \
+        typedef char GPBInternalCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ]
+  #endif  // __has_feature(c_static_assert) || __has_extension(c_static_assert)
+#endif // GPBInternalCompileAssert
+
+// Sanity check that there isn't padding between the field description
+// structures with and without a default.
+GPBInternalCompileAssert(sizeof(GPBMessageFieldDescriptionWithDefault) ==
+                         (sizeof(GPBGenericValue) +
+                          sizeof(GPBMessageFieldDescription)),
+                         DescriptionsWithDefault_different_size_than_expected);
+
+CF_EXTERN_C_END

+ 5770 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBDictionary.h

@@ -0,0 +1,5770 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+#import "GPBRuntimeTypes.h"
+
+// Note on naming: for the classes holding numeric values, a more natural
+// naming of the method might be things like "-valueForKey:",
+// "-setValue:forKey:"; etc. But those selectors are also defined by Key Value
+// Coding (KVC) as categories on NSObject. So "overloading" the selectors with
+// other meanings can cause warnings (based on compiler settings), but more
+// importantly, some of those selector get called as KVC breaks up keypaths.
+// So if those selectors are used, using KVC will compile cleanly, but could
+// crash as it invokes those selectors with the wrong types of arguments.
+
+NS_ASSUME_NONNULL_BEGIN
+
+//%PDDM-EXPAND DECLARE_DICTIONARIES()
+// This block of code is generated, do not edit it directly.
+
+#pragma mark - UInt32 -> UInt32
+
+/**
+ * Class used for map fields of <uint32_t, uint32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32UInt32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values
+                        forKeys:(const uint32_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt32sUsingBlock:
+    (void (^)(uint32_t key, uint32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt32UInt32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt32:(uint32_t)value forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt32ForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt32 -> Int32
+
+/**
+ * Class used for map fields of <uint32_t, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32Int32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt32s:(const int32_t [__nullable])values
+                       forKeys:(const uint32_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32Int32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt32:(nullable int32_t *)value forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt32sUsingBlock:
+    (void (^)(uint32_t key, int32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt32Int32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt32:(int32_t)value forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt32ForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt32 -> UInt64
+
+/**
+ * Class used for map fields of <uint32_t, uint64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32UInt64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values
+                        forKeys:(const uint32_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt64sUsingBlock:
+    (void (^)(uint32_t key, uint64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt32UInt64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt64:(uint64_t)value forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt64ForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt32 -> Int64
+
+/**
+ * Class used for map fields of <uint32_t, int64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32Int64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt64s:(const int64_t [__nullable])values
+                       forKeys:(const uint32_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32Int64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt64:(nullable int64_t *)value forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt64sUsingBlock:
+    (void (^)(uint32_t key, int64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt32Int64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt64:(int64_t)value forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt64ForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt32 -> Bool
+
+/**
+ * Class used for map fields of <uint32_t, BOOL>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32BoolDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithBools:(const BOOL [__nullable])values
+                      forKeys:(const uint32_t [__nullable])keys
+                        count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32BoolDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getBool:(nullable BOOL *)value forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndBoolsUsingBlock:
+    (void (^)(uint32_t key, BOOL value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt32BoolDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setBool:(BOOL)value forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeBoolForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt32 -> Float
+
+/**
+ * Class used for map fields of <uint32_t, float>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32FloatDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithFloats:(const float [__nullable])values
+                       forKeys:(const uint32_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32FloatDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getFloat:(nullable float *)value forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndFloatsUsingBlock:
+    (void (^)(uint32_t key, float value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt32FloatDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setFloat:(float)value forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeFloatForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt32 -> Double
+
+/**
+ * Class used for map fields of <uint32_t, double>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32DoubleDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithDoubles:(const double [__nullable])values
+                        forKeys:(const uint32_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32DoubleDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getDouble:(nullable double *)value forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndDoublesUsingBlock:
+    (void (^)(uint32_t key, double value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt32DoubleDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setDouble:(double)value forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeDoubleForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt32 -> Enum
+
+/**
+ * Class used for map fields of <uint32_t, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32EnumDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+/** The validation function to check if the enums are valid. */
+@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+
+/**
+ * Initializes a dictionary with the given validation function.
+ *
+ * @param func The enum validation function for the dictionary.
+ *
+ * @return A newly initialized dictionary.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+
+/**
+ * Initializes a dictionary with the entries given.
+ *
+ * @param func   The enum validation function for the dictionary.
+ * @param values The raw enum values values to be placed in the dictionary.
+ * @param keys   The keys under which to store the values.
+ * @param count  The number of entries to store in the dictionary.
+ *
+ * @return A newly initialized dictionary with the keys and values in it.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                 rawValues:(const int32_t [__nullable])values
+                                   forKeys:(const uint32_t [__nullable])keys
+                                     count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes a dictionary with the entries from the given.
+ * dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to the dictionary.
+ *
+ * @return A newly initialized dictionary with the entries from the given
+ *         dictionary in it.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32EnumDictionary *)dictionary;
+
+/**
+ * Initializes a dictionary with the given capacity.
+ *
+ * @param func     The enum validation function for the dictionary.
+ * @param numItems Capacity needed for the dictionary.
+ *
+ * @return A newly initialized dictionary with the given capacity.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                  capacity:(NSUInteger)numItems;
+
+// These will return kGPBUnrecognizedEnumeratorValue if the value for the key
+// is not a valid enumerator as defined by validationFunc. If the actual value is
+// desired, use "raw" version of the method.
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getEnum:(nullable int32_t *)value forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndEnumsUsingBlock:
+    (void (^)(uint32_t key, int32_t value, BOOL *stop))block;
+
+/**
+ * Gets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue Pointer into which the value will be set, if found.
+ * @param key      Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:      The key for the current entry.
+ *   **rawValue**: The value for the current entry
+ *   **stop**:     A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndRawValuesUsingBlock:
+    (void (^)(uint32_t key, int32_t rawValue, BOOL *stop))block;
+
+/**
+ * Adds the keys and raw enum values from another dictionary.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addRawEntriesFromDictionary:(GPBUInt32EnumDictionary *)otherDictionary;
+
+// If value is not a valid enumerator as defined by validationFunc, these
+// methods will assert in debug, and will log in release and assign the value
+// to the default value. Use the rawValue methods below to assign non enumerator
+// values.
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setEnum:(int32_t)value forKey:(uint32_t)key;
+
+/**
+ * Sets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue The raw enum value to set.
+ * @param key      The key under which to store the raw enum value.
+ **/
+- (void)setRawValue:(int32_t)rawValue forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeEnumForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt32 -> Object
+
+/**
+ * Class used for map fields of <uint32_t, ObjectType>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt32ObjectDictionary<__covariant ObjectType> : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param objects      The values to be placed in this dictionary.
+ * @param keys         The keys under which to store the values.
+ * @param count        The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects
+                        forKeys:(const uint32_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt32ObjectDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Fetches the object stored under the given key.
+ *
+ * @param key Key under which the value is stored, if present.
+ *
+ * @return The object if found, nil otherwise.
+ **/
+- (ObjectType)objectForKey:(uint32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:         The key for the current entry.
+ *   **object**:      The value for the current entry
+ *   **stop**:        A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndObjectsUsingBlock:
+    (void (^)(uint32_t key, ObjectType object, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt32ObjectDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param object     The value to set.
+ * @param key        The key under which to store the value.
+ **/
+- (void)setObject:(ObjectType)object forKey:(uint32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeObjectForKey:(uint32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> UInt32
+
+/**
+ * Class used for map fields of <int32_t, uint32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32UInt32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values
+                        forKeys:(const int32_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32UInt32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt32sUsingBlock:
+    (void (^)(int32_t key, uint32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt32UInt32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt32:(uint32_t)value forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt32ForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> Int32
+
+/**
+ * Class used for map fields of <int32_t, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32Int32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt32s:(const int32_t [__nullable])values
+                       forKeys:(const int32_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32Int32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt32:(nullable int32_t *)value forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt32sUsingBlock:
+    (void (^)(int32_t key, int32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt32Int32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt32:(int32_t)value forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt32ForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> UInt64
+
+/**
+ * Class used for map fields of <int32_t, uint64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32UInt64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values
+                        forKeys:(const int32_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32UInt64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt64sUsingBlock:
+    (void (^)(int32_t key, uint64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt32UInt64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt64:(uint64_t)value forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt64ForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> Int64
+
+/**
+ * Class used for map fields of <int32_t, int64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32Int64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt64s:(const int64_t [__nullable])values
+                       forKeys:(const int32_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32Int64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt64:(nullable int64_t *)value forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt64sUsingBlock:
+    (void (^)(int32_t key, int64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt32Int64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt64:(int64_t)value forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt64ForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> Bool
+
+/**
+ * Class used for map fields of <int32_t, BOOL>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32BoolDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithBools:(const BOOL [__nullable])values
+                      forKeys:(const int32_t [__nullable])keys
+                        count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32BoolDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getBool:(nullable BOOL *)value forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndBoolsUsingBlock:
+    (void (^)(int32_t key, BOOL value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt32BoolDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setBool:(BOOL)value forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeBoolForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> Float
+
+/**
+ * Class used for map fields of <int32_t, float>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32FloatDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithFloats:(const float [__nullable])values
+                       forKeys:(const int32_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32FloatDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getFloat:(nullable float *)value forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndFloatsUsingBlock:
+    (void (^)(int32_t key, float value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt32FloatDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setFloat:(float)value forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeFloatForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> Double
+
+/**
+ * Class used for map fields of <int32_t, double>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32DoubleDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithDoubles:(const double [__nullable])values
+                        forKeys:(const int32_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32DoubleDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getDouble:(nullable double *)value forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndDoublesUsingBlock:
+    (void (^)(int32_t key, double value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt32DoubleDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setDouble:(double)value forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeDoubleForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> Enum
+
+/**
+ * Class used for map fields of <int32_t, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32EnumDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+/** The validation function to check if the enums are valid. */
+@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+
+/**
+ * Initializes a dictionary with the given validation function.
+ *
+ * @param func The enum validation function for the dictionary.
+ *
+ * @return A newly initialized dictionary.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+
+/**
+ * Initializes a dictionary with the entries given.
+ *
+ * @param func   The enum validation function for the dictionary.
+ * @param values The raw enum values values to be placed in the dictionary.
+ * @param keys   The keys under which to store the values.
+ * @param count  The number of entries to store in the dictionary.
+ *
+ * @return A newly initialized dictionary with the keys and values in it.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                 rawValues:(const int32_t [__nullable])values
+                                   forKeys:(const int32_t [__nullable])keys
+                                     count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes a dictionary with the entries from the given.
+ * dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to the dictionary.
+ *
+ * @return A newly initialized dictionary with the entries from the given
+ *         dictionary in it.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32EnumDictionary *)dictionary;
+
+/**
+ * Initializes a dictionary with the given capacity.
+ *
+ * @param func     The enum validation function for the dictionary.
+ * @param numItems Capacity needed for the dictionary.
+ *
+ * @return A newly initialized dictionary with the given capacity.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                  capacity:(NSUInteger)numItems;
+
+// These will return kGPBUnrecognizedEnumeratorValue if the value for the key
+// is not a valid enumerator as defined by validationFunc. If the actual value is
+// desired, use "raw" version of the method.
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getEnum:(nullable int32_t *)value forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndEnumsUsingBlock:
+    (void (^)(int32_t key, int32_t value, BOOL *stop))block;
+
+/**
+ * Gets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue Pointer into which the value will be set, if found.
+ * @param key      Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:      The key for the current entry.
+ *   **rawValue**: The value for the current entry
+ *   **stop**:     A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndRawValuesUsingBlock:
+    (void (^)(int32_t key, int32_t rawValue, BOOL *stop))block;
+
+/**
+ * Adds the keys and raw enum values from another dictionary.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addRawEntriesFromDictionary:(GPBInt32EnumDictionary *)otherDictionary;
+
+// If value is not a valid enumerator as defined by validationFunc, these
+// methods will assert in debug, and will log in release and assign the value
+// to the default value. Use the rawValue methods below to assign non enumerator
+// values.
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setEnum:(int32_t)value forKey:(int32_t)key;
+
+/**
+ * Sets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue The raw enum value to set.
+ * @param key      The key under which to store the raw enum value.
+ **/
+- (void)setRawValue:(int32_t)rawValue forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeEnumForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int32 -> Object
+
+/**
+ * Class used for map fields of <int32_t, ObjectType>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt32ObjectDictionary<__covariant ObjectType> : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param objects      The values to be placed in this dictionary.
+ * @param keys         The keys under which to store the values.
+ * @param count        The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects
+                        forKeys:(const int32_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt32ObjectDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Fetches the object stored under the given key.
+ *
+ * @param key Key under which the value is stored, if present.
+ *
+ * @return The object if found, nil otherwise.
+ **/
+- (ObjectType)objectForKey:(int32_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:         The key for the current entry.
+ *   **object**:      The value for the current entry
+ *   **stop**:        A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndObjectsUsingBlock:
+    (void (^)(int32_t key, ObjectType object, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt32ObjectDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param object     The value to set.
+ * @param key        The key under which to store the value.
+ **/
+- (void)setObject:(ObjectType)object forKey:(int32_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeObjectForKey:(int32_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> UInt32
+
+/**
+ * Class used for map fields of <uint64_t, uint32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64UInt32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values
+                        forKeys:(const uint64_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt32sUsingBlock:
+    (void (^)(uint64_t key, uint32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt64UInt32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt32:(uint32_t)value forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt32ForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> Int32
+
+/**
+ * Class used for map fields of <uint64_t, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64Int32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt32s:(const int32_t [__nullable])values
+                       forKeys:(const uint64_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64Int32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt32:(nullable int32_t *)value forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt32sUsingBlock:
+    (void (^)(uint64_t key, int32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt64Int32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt32:(int32_t)value forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt32ForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> UInt64
+
+/**
+ * Class used for map fields of <uint64_t, uint64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64UInt64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values
+                        forKeys:(const uint64_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt64sUsingBlock:
+    (void (^)(uint64_t key, uint64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt64UInt64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt64:(uint64_t)value forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt64ForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> Int64
+
+/**
+ * Class used for map fields of <uint64_t, int64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64Int64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt64s:(const int64_t [__nullable])values
+                       forKeys:(const uint64_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64Int64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt64:(nullable int64_t *)value forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt64sUsingBlock:
+    (void (^)(uint64_t key, int64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt64Int64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt64:(int64_t)value forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt64ForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> Bool
+
+/**
+ * Class used for map fields of <uint64_t, BOOL>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64BoolDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithBools:(const BOOL [__nullable])values
+                      forKeys:(const uint64_t [__nullable])keys
+                        count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64BoolDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getBool:(nullable BOOL *)value forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndBoolsUsingBlock:
+    (void (^)(uint64_t key, BOOL value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt64BoolDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setBool:(BOOL)value forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeBoolForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> Float
+
+/**
+ * Class used for map fields of <uint64_t, float>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64FloatDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithFloats:(const float [__nullable])values
+                       forKeys:(const uint64_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64FloatDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getFloat:(nullable float *)value forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndFloatsUsingBlock:
+    (void (^)(uint64_t key, float value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt64FloatDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setFloat:(float)value forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeFloatForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> Double
+
+/**
+ * Class used for map fields of <uint64_t, double>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64DoubleDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithDoubles:(const double [__nullable])values
+                        forKeys:(const uint64_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64DoubleDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getDouble:(nullable double *)value forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndDoublesUsingBlock:
+    (void (^)(uint64_t key, double value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt64DoubleDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setDouble:(double)value forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeDoubleForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> Enum
+
+/**
+ * Class used for map fields of <uint64_t, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64EnumDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+/** The validation function to check if the enums are valid. */
+@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+
+/**
+ * Initializes a dictionary with the given validation function.
+ *
+ * @param func The enum validation function for the dictionary.
+ *
+ * @return A newly initialized dictionary.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+
+/**
+ * Initializes a dictionary with the entries given.
+ *
+ * @param func   The enum validation function for the dictionary.
+ * @param values The raw enum values values to be placed in the dictionary.
+ * @param keys   The keys under which to store the values.
+ * @param count  The number of entries to store in the dictionary.
+ *
+ * @return A newly initialized dictionary with the keys and values in it.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                 rawValues:(const int32_t [__nullable])values
+                                   forKeys:(const uint64_t [__nullable])keys
+                                     count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes a dictionary with the entries from the given.
+ * dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to the dictionary.
+ *
+ * @return A newly initialized dictionary with the entries from the given
+ *         dictionary in it.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64EnumDictionary *)dictionary;
+
+/**
+ * Initializes a dictionary with the given capacity.
+ *
+ * @param func     The enum validation function for the dictionary.
+ * @param numItems Capacity needed for the dictionary.
+ *
+ * @return A newly initialized dictionary with the given capacity.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                  capacity:(NSUInteger)numItems;
+
+// These will return kGPBUnrecognizedEnumeratorValue if the value for the key
+// is not a valid enumerator as defined by validationFunc. If the actual value is
+// desired, use "raw" version of the method.
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getEnum:(nullable int32_t *)value forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndEnumsUsingBlock:
+    (void (^)(uint64_t key, int32_t value, BOOL *stop))block;
+
+/**
+ * Gets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue Pointer into which the value will be set, if found.
+ * @param key      Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:      The key for the current entry.
+ *   **rawValue**: The value for the current entry
+ *   **stop**:     A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndRawValuesUsingBlock:
+    (void (^)(uint64_t key, int32_t rawValue, BOOL *stop))block;
+
+/**
+ * Adds the keys and raw enum values from another dictionary.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addRawEntriesFromDictionary:(GPBUInt64EnumDictionary *)otherDictionary;
+
+// If value is not a valid enumerator as defined by validationFunc, these
+// methods will assert in debug, and will log in release and assign the value
+// to the default value. Use the rawValue methods below to assign non enumerator
+// values.
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setEnum:(int32_t)value forKey:(uint64_t)key;
+
+/**
+ * Sets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue The raw enum value to set.
+ * @param key      The key under which to store the raw enum value.
+ **/
+- (void)setRawValue:(int32_t)rawValue forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeEnumForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - UInt64 -> Object
+
+/**
+ * Class used for map fields of <uint64_t, ObjectType>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBUInt64ObjectDictionary<__covariant ObjectType> : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param objects      The values to be placed in this dictionary.
+ * @param keys         The keys under which to store the values.
+ * @param count        The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects
+                        forKeys:(const uint64_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBUInt64ObjectDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Fetches the object stored under the given key.
+ *
+ * @param key Key under which the value is stored, if present.
+ *
+ * @return The object if found, nil otherwise.
+ **/
+- (ObjectType)objectForKey:(uint64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:         The key for the current entry.
+ *   **object**:      The value for the current entry
+ *   **stop**:        A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndObjectsUsingBlock:
+    (void (^)(uint64_t key, ObjectType object, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBUInt64ObjectDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param object     The value to set.
+ * @param key        The key under which to store the value.
+ **/
+- (void)setObject:(ObjectType)object forKey:(uint64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeObjectForKey:(uint64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> UInt32
+
+/**
+ * Class used for map fields of <int64_t, uint32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64UInt32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values
+                        forKeys:(const int64_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64UInt32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt32sUsingBlock:
+    (void (^)(int64_t key, uint32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt64UInt32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt32:(uint32_t)value forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt32ForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> Int32
+
+/**
+ * Class used for map fields of <int64_t, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64Int32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt32s:(const int32_t [__nullable])values
+                       forKeys:(const int64_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64Int32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt32:(nullable int32_t *)value forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt32sUsingBlock:
+    (void (^)(int64_t key, int32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt64Int32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt32:(int32_t)value forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt32ForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> UInt64
+
+/**
+ * Class used for map fields of <int64_t, uint64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64UInt64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values
+                        forKeys:(const int64_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64UInt64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt64sUsingBlock:
+    (void (^)(int64_t key, uint64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt64UInt64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt64:(uint64_t)value forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt64ForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> Int64
+
+/**
+ * Class used for map fields of <int64_t, int64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64Int64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt64s:(const int64_t [__nullable])values
+                       forKeys:(const int64_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64Int64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt64:(nullable int64_t *)value forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt64sUsingBlock:
+    (void (^)(int64_t key, int64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt64Int64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt64:(int64_t)value forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt64ForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> Bool
+
+/**
+ * Class used for map fields of <int64_t, BOOL>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64BoolDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithBools:(const BOOL [__nullable])values
+                      forKeys:(const int64_t [__nullable])keys
+                        count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64BoolDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getBool:(nullable BOOL *)value forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndBoolsUsingBlock:
+    (void (^)(int64_t key, BOOL value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt64BoolDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setBool:(BOOL)value forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeBoolForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> Float
+
+/**
+ * Class used for map fields of <int64_t, float>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64FloatDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithFloats:(const float [__nullable])values
+                       forKeys:(const int64_t [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64FloatDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getFloat:(nullable float *)value forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndFloatsUsingBlock:
+    (void (^)(int64_t key, float value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt64FloatDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setFloat:(float)value forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeFloatForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> Double
+
+/**
+ * Class used for map fields of <int64_t, double>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64DoubleDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithDoubles:(const double [__nullable])values
+                        forKeys:(const int64_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64DoubleDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getDouble:(nullable double *)value forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndDoublesUsingBlock:
+    (void (^)(int64_t key, double value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt64DoubleDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setDouble:(double)value forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeDoubleForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> Enum
+
+/**
+ * Class used for map fields of <int64_t, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64EnumDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+/** The validation function to check if the enums are valid. */
+@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+
+/**
+ * Initializes a dictionary with the given validation function.
+ *
+ * @param func The enum validation function for the dictionary.
+ *
+ * @return A newly initialized dictionary.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+
+/**
+ * Initializes a dictionary with the entries given.
+ *
+ * @param func   The enum validation function for the dictionary.
+ * @param values The raw enum values values to be placed in the dictionary.
+ * @param keys   The keys under which to store the values.
+ * @param count  The number of entries to store in the dictionary.
+ *
+ * @return A newly initialized dictionary with the keys and values in it.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                 rawValues:(const int32_t [__nullable])values
+                                   forKeys:(const int64_t [__nullable])keys
+                                     count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes a dictionary with the entries from the given.
+ * dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to the dictionary.
+ *
+ * @return A newly initialized dictionary with the entries from the given
+ *         dictionary in it.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64EnumDictionary *)dictionary;
+
+/**
+ * Initializes a dictionary with the given capacity.
+ *
+ * @param func     The enum validation function for the dictionary.
+ * @param numItems Capacity needed for the dictionary.
+ *
+ * @return A newly initialized dictionary with the given capacity.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                  capacity:(NSUInteger)numItems;
+
+// These will return kGPBUnrecognizedEnumeratorValue if the value for the key
+// is not a valid enumerator as defined by validationFunc. If the actual value is
+// desired, use "raw" version of the method.
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getEnum:(nullable int32_t *)value forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndEnumsUsingBlock:
+    (void (^)(int64_t key, int32_t value, BOOL *stop))block;
+
+/**
+ * Gets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue Pointer into which the value will be set, if found.
+ * @param key      Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:      The key for the current entry.
+ *   **rawValue**: The value for the current entry
+ *   **stop**:     A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndRawValuesUsingBlock:
+    (void (^)(int64_t key, int32_t rawValue, BOOL *stop))block;
+
+/**
+ * Adds the keys and raw enum values from another dictionary.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addRawEntriesFromDictionary:(GPBInt64EnumDictionary *)otherDictionary;
+
+// If value is not a valid enumerator as defined by validationFunc, these
+// methods will assert in debug, and will log in release and assign the value
+// to the default value. Use the rawValue methods below to assign non enumerator
+// values.
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setEnum:(int32_t)value forKey:(int64_t)key;
+
+/**
+ * Sets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue The raw enum value to set.
+ * @param key      The key under which to store the raw enum value.
+ **/
+- (void)setRawValue:(int32_t)rawValue forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeEnumForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Int64 -> Object
+
+/**
+ * Class used for map fields of <int64_t, ObjectType>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBInt64ObjectDictionary<__covariant ObjectType> : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param objects      The values to be placed in this dictionary.
+ * @param keys         The keys under which to store the values.
+ * @param count        The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects
+                        forKeys:(const int64_t [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBInt64ObjectDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Fetches the object stored under the given key.
+ *
+ * @param key Key under which the value is stored, if present.
+ *
+ * @return The object if found, nil otherwise.
+ **/
+- (ObjectType)objectForKey:(int64_t)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:         The key for the current entry.
+ *   **object**:      The value for the current entry
+ *   **stop**:        A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndObjectsUsingBlock:
+    (void (^)(int64_t key, ObjectType object, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBInt64ObjectDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param object     The value to set.
+ * @param key        The key under which to store the value.
+ **/
+- (void)setObject:(ObjectType)object forKey:(int64_t)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeObjectForKey:(int64_t)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> UInt32
+
+/**
+ * Class used for map fields of <BOOL, uint32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolUInt32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values
+                        forKeys:(const BOOL [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolUInt32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt32sUsingBlock:
+    (void (^)(BOOL key, uint32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBBoolUInt32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt32:(uint32_t)value forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt32ForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> Int32
+
+/**
+ * Class used for map fields of <BOOL, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolInt32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt32s:(const int32_t [__nullable])values
+                       forKeys:(const BOOL [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolInt32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt32:(nullable int32_t *)value forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt32sUsingBlock:
+    (void (^)(BOOL key, int32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBBoolInt32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt32:(int32_t)value forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt32ForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> UInt64
+
+/**
+ * Class used for map fields of <BOOL, uint64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolUInt64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values
+                        forKeys:(const BOOL [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolUInt64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt64sUsingBlock:
+    (void (^)(BOOL key, uint64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBBoolUInt64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt64:(uint64_t)value forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt64ForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> Int64
+
+/**
+ * Class used for map fields of <BOOL, int64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolInt64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt64s:(const int64_t [__nullable])values
+                       forKeys:(const BOOL [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolInt64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt64:(nullable int64_t *)value forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt64sUsingBlock:
+    (void (^)(BOOL key, int64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBBoolInt64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt64:(int64_t)value forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt64ForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> Bool
+
+/**
+ * Class used for map fields of <BOOL, BOOL>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolBoolDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithBools:(const BOOL [__nullable])values
+                      forKeys:(const BOOL [__nullable])keys
+                        count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolBoolDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getBool:(nullable BOOL *)value forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndBoolsUsingBlock:
+    (void (^)(BOOL key, BOOL value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBBoolBoolDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setBool:(BOOL)value forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeBoolForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> Float
+
+/**
+ * Class used for map fields of <BOOL, float>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolFloatDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithFloats:(const float [__nullable])values
+                       forKeys:(const BOOL [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolFloatDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getFloat:(nullable float *)value forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndFloatsUsingBlock:
+    (void (^)(BOOL key, float value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBBoolFloatDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setFloat:(float)value forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeFloatForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> Double
+
+/**
+ * Class used for map fields of <BOOL, double>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolDoubleDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithDoubles:(const double [__nullable])values
+                        forKeys:(const BOOL [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolDoubleDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getDouble:(nullable double *)value forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndDoublesUsingBlock:
+    (void (^)(BOOL key, double value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBBoolDoubleDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setDouble:(double)value forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeDoubleForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> Enum
+
+/**
+ * Class used for map fields of <BOOL, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolEnumDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+/** The validation function to check if the enums are valid. */
+@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+
+/**
+ * Initializes a dictionary with the given validation function.
+ *
+ * @param func The enum validation function for the dictionary.
+ *
+ * @return A newly initialized dictionary.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+
+/**
+ * Initializes a dictionary with the entries given.
+ *
+ * @param func   The enum validation function for the dictionary.
+ * @param values The raw enum values values to be placed in the dictionary.
+ * @param keys   The keys under which to store the values.
+ * @param count  The number of entries to store in the dictionary.
+ *
+ * @return A newly initialized dictionary with the keys and values in it.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                 rawValues:(const int32_t [__nullable])values
+                                   forKeys:(const BOOL [__nullable])keys
+                                     count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes a dictionary with the entries from the given.
+ * dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to the dictionary.
+ *
+ * @return A newly initialized dictionary with the entries from the given
+ *         dictionary in it.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolEnumDictionary *)dictionary;
+
+/**
+ * Initializes a dictionary with the given capacity.
+ *
+ * @param func     The enum validation function for the dictionary.
+ * @param numItems Capacity needed for the dictionary.
+ *
+ * @return A newly initialized dictionary with the given capacity.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                  capacity:(NSUInteger)numItems;
+
+// These will return kGPBUnrecognizedEnumeratorValue if the value for the key
+// is not a valid enumerator as defined by validationFunc. If the actual value is
+// desired, use "raw" version of the method.
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getEnum:(nullable int32_t *)value forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndEnumsUsingBlock:
+    (void (^)(BOOL key, int32_t value, BOOL *stop))block;
+
+/**
+ * Gets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue Pointer into which the value will be set, if found.
+ * @param key      Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:      The key for the current entry.
+ *   **rawValue**: The value for the current entry
+ *   **stop**:     A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndRawValuesUsingBlock:
+    (void (^)(BOOL key, int32_t rawValue, BOOL *stop))block;
+
+/**
+ * Adds the keys and raw enum values from another dictionary.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addRawEntriesFromDictionary:(GPBBoolEnumDictionary *)otherDictionary;
+
+// If value is not a valid enumerator as defined by validationFunc, these
+// methods will assert in debug, and will log in release and assign the value
+// to the default value. Use the rawValue methods below to assign non enumerator
+// values.
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setEnum:(int32_t)value forKey:(BOOL)key;
+
+/**
+ * Sets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue The raw enum value to set.
+ * @param key      The key under which to store the raw enum value.
+ **/
+- (void)setRawValue:(int32_t)rawValue forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeEnumForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - Bool -> Object
+
+/**
+ * Class used for map fields of <BOOL, ObjectType>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBBoolObjectDictionary<__covariant ObjectType> : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param objects      The values to be placed in this dictionary.
+ * @param keys         The keys under which to store the values.
+ * @param count        The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects
+                        forKeys:(const BOOL [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBBoolObjectDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Fetches the object stored under the given key.
+ *
+ * @param key Key under which the value is stored, if present.
+ *
+ * @return The object if found, nil otherwise.
+ **/
+- (ObjectType)objectForKey:(BOOL)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:         The key for the current entry.
+ *   **object**:      The value for the current entry
+ *   **stop**:        A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndObjectsUsingBlock:
+    (void (^)(BOOL key, ObjectType object, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBBoolObjectDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param object     The value to set.
+ * @param key        The key under which to store the value.
+ **/
+- (void)setObject:(ObjectType)object forKey:(BOOL)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeObjectForKey:(BOOL)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - String -> UInt32
+
+/**
+ * Class used for map fields of <NSString, uint32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBStringUInt32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values
+                        forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBStringUInt32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt32sUsingBlock:
+    (void (^)(NSString *key, uint32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBStringUInt32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt32:(uint32_t)value forKey:(NSString *)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt32ForKey:(NSString *)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - String -> Int32
+
+/**
+ * Class used for map fields of <NSString, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBStringInt32Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt32s:(const int32_t [__nullable])values
+                       forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBStringInt32Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt32:(nullable int32_t *)value forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt32sUsingBlock:
+    (void (^)(NSString *key, int32_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBStringInt32Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt32:(int32_t)value forKey:(NSString *)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt32ForKey:(NSString *)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - String -> UInt64
+
+/**
+ * Class used for map fields of <NSString, uint64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBStringUInt64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values
+                        forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBStringUInt64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndUInt64sUsingBlock:
+    (void (^)(NSString *key, uint64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBStringUInt64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setUInt64:(uint64_t)value forKey:(NSString *)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeUInt64ForKey:(NSString *)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - String -> Int64
+
+/**
+ * Class used for map fields of <NSString, int64_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBStringInt64Dictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithInt64s:(const int64_t [__nullable])values
+                       forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBStringInt64Dictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getInt64:(nullable int64_t *)value forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndInt64sUsingBlock:
+    (void (^)(NSString *key, int64_t value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBStringInt64Dictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setInt64:(int64_t)value forKey:(NSString *)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeInt64ForKey:(NSString *)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - String -> Bool
+
+/**
+ * Class used for map fields of <NSString, BOOL>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBStringBoolDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithBools:(const BOOL [__nullable])values
+                      forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys
+                        count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBStringBoolDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getBool:(nullable BOOL *)value forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndBoolsUsingBlock:
+    (void (^)(NSString *key, BOOL value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBStringBoolDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setBool:(BOOL)value forKey:(NSString *)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeBoolForKey:(NSString *)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - String -> Float
+
+/**
+ * Class used for map fields of <NSString, float>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBStringFloatDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithFloats:(const float [__nullable])values
+                       forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys
+                         count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBStringFloatDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getFloat:(nullable float *)value forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndFloatsUsingBlock:
+    (void (^)(NSString *key, float value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBStringFloatDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setFloat:(float)value forKey:(NSString *)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeFloatForKey:(NSString *)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - String -> Double
+
+/**
+ * Class used for map fields of <NSString, double>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBStringDoubleDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+
+/**
+ * Initializes this dictionary, copying the given values and keys.
+ *
+ * @param values      The values to be placed in this dictionary.
+ * @param keys        The keys under which to store the values.
+ * @param count       The number of elements to copy into the dictionary.
+ *
+ * @return A newly initialized dictionary with a copy of the values and keys.
+ **/
+- (instancetype)initWithDoubles:(const double [__nullable])values
+                        forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys
+                          count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes this dictionary, copying the entries from the given dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to this dictionary.
+ *
+ * @return A newly initialized dictionary with the entries of the given dictionary.
+ **/
+- (instancetype)initWithDictionary:(GPBStringDoubleDictionary *)dictionary;
+
+/**
+ * Initializes this dictionary with the requested capacity.
+ *
+ * @param numItems Number of items needed for this dictionary.
+ *
+ * @return A newly initialized dictionary with the requested capacity.
+ **/
+- (instancetype)initWithCapacity:(NSUInteger)numItems;
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getDouble:(nullable double *)value forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndDoublesUsingBlock:
+    (void (^)(NSString *key, double value, BOOL *stop))block;
+
+/**
+ * Adds the keys and values from another dictionary.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addEntriesFromDictionary:(GPBStringDoubleDictionary *)otherDictionary;
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setDouble:(double)value forKey:(NSString *)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeDoubleForKey:(NSString *)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+#pragma mark - String -> Enum
+
+/**
+ * Class used for map fields of <NSString, int32_t>
+ * values. This performs better than boxing into NSNumbers in NSDictionaries.
+ *
+ * @note This class is not meant to be subclassed.
+ **/
+@interface GPBStringEnumDictionary : NSObject <NSCopying>
+
+/** Number of entries stored in this dictionary. */
+@property(nonatomic, readonly) NSUInteger count;
+/** The validation function to check if the enums are valid. */
+@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+
+/**
+ * Initializes a dictionary with the given validation function.
+ *
+ * @param func The enum validation function for the dictionary.
+ *
+ * @return A newly initialized dictionary.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+
+/**
+ * Initializes a dictionary with the entries given.
+ *
+ * @param func   The enum validation function for the dictionary.
+ * @param values The raw enum values values to be placed in the dictionary.
+ * @param keys   The keys under which to store the values.
+ * @param count  The number of entries to store in the dictionary.
+ *
+ * @return A newly initialized dictionary with the keys and values in it.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                 rawValues:(const int32_t [__nullable])values
+                                   forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys
+                                     count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+
+/**
+ * Initializes a dictionary with the entries from the given.
+ * dictionary.
+ *
+ * @param dictionary Dictionary containing the entries to add to the dictionary.
+ *
+ * @return A newly initialized dictionary with the entries from the given
+ *         dictionary in it.
+ **/
+- (instancetype)initWithDictionary:(GPBStringEnumDictionary *)dictionary;
+
+/**
+ * Initializes a dictionary with the given capacity.
+ *
+ * @param func     The enum validation function for the dictionary.
+ * @param numItems Capacity needed for the dictionary.
+ *
+ * @return A newly initialized dictionary with the given capacity.
+ **/
+- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+                                  capacity:(NSUInteger)numItems;
+
+// These will return kGPBUnrecognizedEnumeratorValue if the value for the key
+// is not a valid enumerator as defined by validationFunc. If the actual value is
+// desired, use "raw" version of the method.
+
+/**
+ * Gets the value for the given key.
+ *
+ * @param value Pointer into which the value will be set, if found.
+ * @param key   Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getEnum:(nullable int32_t *)value forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:        The key for the current entry.
+ *   **value**:      The value for the current entry
+ *   **stop**:       A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndEnumsUsingBlock:
+    (void (^)(NSString *key, int32_t value, BOOL *stop))block;
+
+/**
+ * Gets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue Pointer into which the value will be set, if found.
+ * @param key      Key under which the value is stored, if present.
+ *
+ * @return YES if the key was found and the value was copied, NO otherwise.
+ **/
+- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(NSString *)key;
+
+/**
+ * Enumerates the keys and values on this dictionary with the given block.
+ *
+ * @note This method bypass the validationFunc to enable the access of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param block The block to enumerate with.
+ *   **key**:      The key for the current entry.
+ *   **rawValue**: The value for the current entry
+ *   **stop**:     A pointer to a boolean that when set stops the enumeration.
+ **/
+- (void)enumerateKeysAndRawValuesUsingBlock:
+    (void (^)(NSString *key, int32_t rawValue, BOOL *stop))block;
+
+/**
+ * Adds the keys and raw enum values from another dictionary.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param otherDictionary Dictionary containing entries to be added to this
+ *                        dictionary.
+ **/
+- (void)addRawEntriesFromDictionary:(GPBStringEnumDictionary *)otherDictionary;
+
+// If value is not a valid enumerator as defined by validationFunc, these
+// methods will assert in debug, and will log in release and assign the value
+// to the default value. Use the rawValue methods below to assign non enumerator
+// values.
+
+/**
+ * Sets the value for the given key.
+ *
+ * @param value     The value to set.
+ * @param key       The key under which to store the value.
+ **/
+- (void)setEnum:(int32_t)value forKey:(NSString *)key;
+
+/**
+ * Sets the raw enum value for the given key.
+ *
+ * @note This method bypass the validationFunc to enable the setting of values that
+ *       were not known at the time the binary was compiled.
+ *
+ * @param rawValue The raw enum value to set.
+ * @param key      The key under which to store the raw enum value.
+ **/
+- (void)setRawValue:(int32_t)rawValue forKey:(NSString *)key;
+
+/**
+ * Removes the entry for the given key.
+ *
+ * @param aKey Key to be removed from this dictionary.
+ **/
+- (void)removeEnumForKey:(NSString *)aKey;
+
+/**
+ * Removes all entries in this dictionary.
+ **/
+- (void)removeAll;
+
+@end
+
+//%PDDM-EXPAND-END DECLARE_DICTIONARIES()
+
+NS_ASSUME_NONNULL_END
+
+//%PDDM-DEFINE DECLARE_DICTIONARIES()
+//%DICTIONARY_INTERFACES_FOR_POD_KEY(UInt32, uint32_t)
+//%DICTIONARY_INTERFACES_FOR_POD_KEY(Int32, int32_t)
+//%DICTIONARY_INTERFACES_FOR_POD_KEY(UInt64, uint64_t)
+//%DICTIONARY_INTERFACES_FOR_POD_KEY(Int64, int64_t)
+//%DICTIONARY_INTERFACES_FOR_POD_KEY(Bool, BOOL)
+//%DICTIONARY_POD_INTERFACES_FOR_KEY(String, NSString, *, OBJECT)
+//%PDDM-DEFINE DICTIONARY_INTERFACES_FOR_POD_KEY(KEY_NAME, KEY_TYPE)
+//%DICTIONARY_POD_INTERFACES_FOR_KEY(KEY_NAME, KEY_TYPE, , POD)
+//%DICTIONARY_POD_KEY_TO_OBJECT_INTERFACE(KEY_NAME, KEY_TYPE, Object, ObjectType)
+//%PDDM-DEFINE DICTIONARY_POD_INTERFACES_FOR_KEY(KEY_NAME, KEY_TYPE, KisP, KHELPER)
+//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, UInt32, uint32_t)
+//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Int32, int32_t)
+//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, UInt64, uint64_t)
+//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Int64, int64_t)
+//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Bool, BOOL)
+//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Float, float)
+//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Double, double)
+//%DICTIONARY_KEY_TO_ENUM_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Enum, int32_t)
+//%PDDM-DEFINE DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE)
+//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, POD, VALUE_NAME, value)
+//%PDDM-DEFINE DICTIONARY_POD_KEY_TO_OBJECT_INTERFACE(KEY_NAME, KEY_TYPE, VALUE_NAME, VALUE_TYPE)
+//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, , POD, VALUE_NAME, VALUE_TYPE, OBJECT, Object, object)
+//%PDDM-DEFINE VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE, VNAME)
+//%/**
+//% * Gets the value for the given key.
+//% *
+//% * @param value Pointer into which the value will be set, if found.
+//% * @param key   Key under which the value is stored, if present.
+//% *
+//% * @return YES if the key was found and the value was copied, NO otherwise.
+//% **/
+//%- (BOOL)get##VNAME##:(nullable VALUE_TYPE *)value forKey:(KEY_TYPE)key;
+//%PDDM-DEFINE VALUE_FOR_KEY_OBJECT(KEY_TYPE, VALUE_TYPE, VNAME)
+//%/**
+//% * Fetches the object stored under the given key.
+//% *
+//% * @param key Key under which the value is stored, if present.
+//% *
+//% * @return The object if found, nil otherwise.
+//% **/
+//%- (VALUE_TYPE)objectForKey:(KEY_TYPE)key;
+//%PDDM-DEFINE VALUE_FOR_KEY_Enum(KEY_TYPE, VALUE_TYPE, VNAME)
+//%VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE, VNAME)
+//%PDDM-DEFINE ARRAY_ARG_MODIFIERPOD()
+// Nothing
+//%PDDM-DEFINE ARRAY_ARG_MODIFIEREnum()
+// Nothing
+//%PDDM-DEFINE ARRAY_ARG_MODIFIEROBJECT()
+//%__nonnull GPB_UNSAFE_UNRETAINED ##
+//%PDDM-DEFINE DICTIONARY_CLASS_DECLPOD(KEY_NAME, VALUE_NAME, VALUE_TYPE)
+//%GPB##KEY_NAME##VALUE_NAME##Dictionary
+//%PDDM-DEFINE DICTIONARY_CLASS_DECLEnum(KEY_NAME, VALUE_NAME, VALUE_TYPE)
+//%GPB##KEY_NAME##VALUE_NAME##Dictionary
+//%PDDM-DEFINE DICTIONARY_CLASS_DECLOBJECT(KEY_NAME, VALUE_NAME, VALUE_TYPE)
+//%GPB##KEY_NAME##VALUE_NAME##Dictionary<__covariant VALUE_TYPE>
+//%PDDM-DEFINE DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR)
+//%#pragma mark - KEY_NAME -> VALUE_NAME
+//%
+//%/**
+//% * Class used for map fields of <##KEY_TYPE##, ##VALUE_TYPE##>
+//% * values. This performs better than boxing into NSNumbers in NSDictionaries.
+//% *
+//% * @note This class is not meant to be subclassed.
+//% **/
+//%@interface DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) : NSObject <NSCopying>
+//%
+//%/** Number of entries stored in this dictionary. */
+//%@property(nonatomic, readonly) NSUInteger count;
+//%
+//%/**
+//% * Initializes this dictionary, copying the given values and keys.
+//% *
+//% * @param ##VNAME_VAR##s      The values to be placed in this dictionary.
+//% * @param keys ##VNAME_VAR$S##  The keys under which to store the values.
+//% * @param count ##VNAME_VAR$S## The number of elements to copy into the dictionary.
+//% *
+//% * @return A newly initialized dictionary with a copy of the values and keys.
+//% **/
+//%- (instancetype)initWith##VNAME##s:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[__nullable])##VNAME_VAR##s
+//%                ##VNAME$S##  forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[__nullable])keys
+//%                ##VNAME$S##    count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+//%
+//%/**
+//% * Initializes this dictionary, copying the entries from the given dictionary.
+//% *
+//% * @param dictionary Dictionary containing the entries to add to this dictionary.
+//% *
+//% * @return A newly initialized dictionary with the entries of the given dictionary.
+//% **/
+//%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary;
+//%
+//%/**
+//% * Initializes this dictionary with the requested capacity.
+//% *
+//% * @param numItems Number of items needed for this dictionary.
+//% *
+//% * @return A newly initialized dictionary with the requested capacity.
+//% **/
+//%- (instancetype)initWithCapacity:(NSUInteger)numItems;
+//%
+//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR)
+//%
+//%/**
+//% * Adds the keys and values from another dictionary.
+//% *
+//% * @param otherDictionary Dictionary containing entries to be added to this
+//% *                        dictionary.
+//% **/
+//%- (void)addEntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary;
+//%
+//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR)
+//%
+//%@end
+//%
+
+//%PDDM-DEFINE DICTIONARY_KEY_TO_ENUM_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE)
+//%DICTIONARY_KEY_TO_ENUM_INTERFACE2(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, Enum)
+//%PDDM-DEFINE DICTIONARY_KEY_TO_ENUM_INTERFACE2(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER)
+//%#pragma mark - KEY_NAME -> VALUE_NAME
+//%
+//%/**
+//% * Class used for map fields of <##KEY_TYPE##, ##VALUE_TYPE##>
+//% * values. This performs better than boxing into NSNumbers in NSDictionaries.
+//% *
+//% * @note This class is not meant to be subclassed.
+//% **/
+//%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary : NSObject <NSCopying>
+//%
+//%/** Number of entries stored in this dictionary. */
+//%@property(nonatomic, readonly) NSUInteger count;
+//%/** The validation function to check if the enums are valid. */
+//%@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc;
+//%
+//%/**
+//% * Initializes a dictionary with the given validation function.
+//% *
+//% * @param func The enum validation function for the dictionary.
+//% *
+//% * @return A newly initialized dictionary.
+//% **/
+//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func;
+//%
+//%/**
+//% * Initializes a dictionary with the entries given.
+//% *
+//% * @param func   The enum validation function for the dictionary.
+//% * @param values The raw enum values values to be placed in the dictionary.
+//% * @param keys   The keys under which to store the values.
+//% * @param count  The number of entries to store in the dictionary.
+//% *
+//% * @return A newly initialized dictionary with the keys and values in it.
+//% **/
+//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+//%                                 rawValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[__nullable])values
+//%                                   forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[__nullable])keys
+//%                                     count:(NSUInteger)count NS_DESIGNATED_INITIALIZER;
+//%
+//%/**
+//% * Initializes a dictionary with the entries from the given.
+//% * dictionary.
+//% *
+//% * @param dictionary Dictionary containing the entries to add to the dictionary.
+//% *
+//% * @return A newly initialized dictionary with the entries from the given
+//% *         dictionary in it.
+//% **/
+//%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary;
+//%
+//%/**
+//% * Initializes a dictionary with the given capacity.
+//% *
+//% * @param func     The enum validation function for the dictionary.
+//% * @param numItems Capacity needed for the dictionary.
+//% *
+//% * @return A newly initialized dictionary with the given capacity.
+//% **/
+//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func
+//%                                  capacity:(NSUInteger)numItems;
+//%
+//%// These will return kGPBUnrecognizedEnumeratorValue if the value for the key
+//%// is not a valid enumerator as defined by validationFunc. If the actual value is
+//%// desired, use "raw" version of the method.
+//%
+//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, Enum, value)
+//%
+//%/**
+//% * Gets the raw enum value for the given key.
+//% *
+//% * @note This method bypass the validationFunc to enable the access of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param rawValue Pointer into which the value will be set, if found.
+//% * @param key      Key under which the value is stored, if present.
+//% *
+//% * @return YES if the key was found and the value was copied, NO otherwise.
+//% **/
+//%- (BOOL)getRawValue:(nullable VALUE_TYPE *)rawValue forKey:(KEY_TYPE##KisP$S##KisP)key;
+//%
+//%/**
+//% * Enumerates the keys and values on this dictionary with the given block.
+//% *
+//% * @note This method bypass the validationFunc to enable the access of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param block The block to enumerate with.
+//% *   **key**:      The key for the current entry.
+//% *   **rawValue**: The value for the current entry
+//% *   **stop**:     A pointer to a boolean that when set stops the enumeration.
+//% **/
+//%- (void)enumerateKeysAndRawValuesUsingBlock:
+//%    (void (^)(KEY_TYPE KisP##key, VALUE_TYPE rawValue, BOOL *stop))block;
+//%
+//%/**
+//% * Adds the keys and raw enum values from another dictionary.
+//% *
+//% * @note This method bypass the validationFunc to enable the setting of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param otherDictionary Dictionary containing entries to be added to this
+//% *                        dictionary.
+//% **/
+//%- (void)addRawEntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary;
+//%
+//%// If value is not a valid enumerator as defined by validationFunc, these
+//%// methods will assert in debug, and will log in release and assign the value
+//%// to the default value. Use the rawValue methods below to assign non enumerator
+//%// values.
+//%
+//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, Enum, value)
+//%
+//%@end
+//%
+
+//%PDDM-DEFINE DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR)
+//%VALUE_FOR_KEY_##VHELPER(KEY_TYPE##KisP$S##KisP, VALUE_TYPE, VNAME)
+//%
+//%/**
+//% * Enumerates the keys and values on this dictionary with the given block.
+//% *
+//% * @param block The block to enumerate with.
+//% *   **key**: ##VNAME_VAR$S##  The key for the current entry.
+//% *   **VNAME_VAR**:      The value for the current entry
+//% *   **stop**: ##VNAME_VAR$S## A pointer to a boolean that when set stops the enumeration.
+//% **/
+//%- (void)enumerateKeysAnd##VNAME##sUsingBlock:
+//%    (void (^)(KEY_TYPE KisP##key, VALUE_TYPE VNAME_VAR, BOOL *stop))block;
+
+//%PDDM-DEFINE DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR)
+//%/**
+//% * Sets the value for the given key.
+//% *
+//% * @param ##VNAME_VAR     The value to set.
+//% * @param key ##VNAME_VAR$S## The key under which to store the value.
+//% **/
+//%- (void)set##VNAME##:(VALUE_TYPE)##VNAME_VAR forKey:(KEY_TYPE##KisP$S##KisP)key;
+//%DICTIONARY_EXTRA_MUTABLE_METHODS_##VHELPER(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
+//%/**
+//% * Removes the entry for the given key.
+//% *
+//% * @param aKey Key to be removed from this dictionary.
+//% **/
+//%- (void)remove##VNAME##ForKey:(KEY_TYPE##KisP$S##KisP)aKey;
+//%
+//%/**
+//% * Removes all entries in this dictionary.
+//% **/
+//%- (void)removeAll;
+
+//%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_POD(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
+// Empty
+//%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_OBJECT(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
+// Empty
+//%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_Enum(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE)
+//%
+//%/**
+//% * Sets the raw enum value for the given key.
+//% *
+//% * @note This method bypass the validationFunc to enable the setting of values that
+//% *       were not known at the time the binary was compiled.
+//% *
+//% * @param rawValue The raw enum value to set.
+//% * @param key      The key under which to store the raw enum value.
+//% **/
+//%- (void)setRawValue:(VALUE_TYPE)rawValue forKey:(KEY_TYPE##KisP$S##KisP)key;
+//%

+ 488 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBDictionary_PackagePrivate.h

@@ -0,0 +1,488 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+#import "GPBDictionary.h"
+
+@class GPBCodedInputStream;
+@class GPBCodedOutputStream;
+@class GPBExtensionRegistry;
+@class GPBFieldDescriptor;
+
+@protocol GPBDictionaryInternalsProtocol
+- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field;
+- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream
+                         asField:(GPBFieldDescriptor *)field;
+- (void)setGPBGenericValue:(GPBGenericValue *)value
+     forGPBGenericValueKey:(GPBGenericValue *)key;
+- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block;
+@end
+
+//%PDDM-DEFINE DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(KEY_NAME)
+//%DICTIONARY_POD_PRIV_INTERFACES_FOR_KEY(KEY_NAME)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Object, Object)
+//%PDDM-DEFINE DICTIONARY_POD_PRIV_INTERFACES_FOR_KEY(KEY_NAME)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, UInt32, Basic)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Int32, Basic)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, UInt64, Basic)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Int64, Basic)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Bool, Basic)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Float, Basic)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Double, Basic)
+//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Enum, Enum)
+
+//%PDDM-DEFINE DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, VALUE_NAME, HELPER)
+//%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary () <GPBDictionaryInternalsProtocol> {
+//% @package
+//%  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+//%}
+//%EXTRA_DICTIONARY_PRIVATE_INTERFACES_##HELPER()@end
+//%
+
+//%PDDM-DEFINE EXTRA_DICTIONARY_PRIVATE_INTERFACES_Basic()
+// Empty
+//%PDDM-DEFINE EXTRA_DICTIONARY_PRIVATE_INTERFACES_Object()
+//%- (BOOL)isInitialized;
+//%- (instancetype)deepCopyWithZone:(NSZone *)zone
+//%    __attribute__((ns_returns_retained));
+//%
+//%PDDM-DEFINE EXTRA_DICTIONARY_PRIVATE_INTERFACES_Enum()
+//%- (NSData *)serializedDataForUnknownValue:(int32_t)value
+//%                                   forKey:(GPBGenericValue *)key
+//%                              keyDataType:(GPBDataType)keyDataType;
+//%
+
+//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(UInt32)
+// This block of code is generated, do not edit it directly.
+
+@interface GPBUInt32UInt32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt32Int32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt32UInt64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt32Int64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt32BoolDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt32FloatDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt32DoubleDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt32EnumDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (NSData *)serializedDataForUnknownValue:(int32_t)value
+                                   forKey:(GPBGenericValue *)key
+                              keyDataType:(GPBDataType)keyDataType;
+@end
+
+@interface GPBUInt32ObjectDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (BOOL)isInitialized;
+- (instancetype)deepCopyWithZone:(NSZone *)zone
+    __attribute__((ns_returns_retained));
+@end
+
+//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Int32)
+// This block of code is generated, do not edit it directly.
+
+@interface GPBInt32UInt32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt32Int32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt32UInt64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt32Int64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt32BoolDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt32FloatDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt32DoubleDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt32EnumDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (NSData *)serializedDataForUnknownValue:(int32_t)value
+                                   forKey:(GPBGenericValue *)key
+                              keyDataType:(GPBDataType)keyDataType;
+@end
+
+@interface GPBInt32ObjectDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (BOOL)isInitialized;
+- (instancetype)deepCopyWithZone:(NSZone *)zone
+    __attribute__((ns_returns_retained));
+@end
+
+//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(UInt64)
+// This block of code is generated, do not edit it directly.
+
+@interface GPBUInt64UInt32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt64Int32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt64UInt64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt64Int64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt64BoolDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt64FloatDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt64DoubleDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBUInt64EnumDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (NSData *)serializedDataForUnknownValue:(int32_t)value
+                                   forKey:(GPBGenericValue *)key
+                              keyDataType:(GPBDataType)keyDataType;
+@end
+
+@interface GPBUInt64ObjectDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (BOOL)isInitialized;
+- (instancetype)deepCopyWithZone:(NSZone *)zone
+    __attribute__((ns_returns_retained));
+@end
+
+//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Int64)
+// This block of code is generated, do not edit it directly.
+
+@interface GPBInt64UInt32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt64Int32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt64UInt64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt64Int64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt64BoolDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt64FloatDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt64DoubleDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBInt64EnumDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (NSData *)serializedDataForUnknownValue:(int32_t)value
+                                   forKey:(GPBGenericValue *)key
+                              keyDataType:(GPBDataType)keyDataType;
+@end
+
+@interface GPBInt64ObjectDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (BOOL)isInitialized;
+- (instancetype)deepCopyWithZone:(NSZone *)zone
+    __attribute__((ns_returns_retained));
+@end
+
+//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Bool)
+// This block of code is generated, do not edit it directly.
+
+@interface GPBBoolUInt32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBBoolInt32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBBoolUInt64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBBoolInt64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBBoolBoolDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBBoolFloatDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBBoolDoubleDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBBoolEnumDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (NSData *)serializedDataForUnknownValue:(int32_t)value
+                                   forKey:(GPBGenericValue *)key
+                              keyDataType:(GPBDataType)keyDataType;
+@end
+
+@interface GPBBoolObjectDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (BOOL)isInitialized;
+- (instancetype)deepCopyWithZone:(NSZone *)zone
+    __attribute__((ns_returns_retained));
+@end
+
+//%PDDM-EXPAND DICTIONARY_POD_PRIV_INTERFACES_FOR_KEY(String)
+// This block of code is generated, do not edit it directly.
+
+@interface GPBStringUInt32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBStringInt32Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBStringUInt64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBStringInt64Dictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBStringBoolDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBStringFloatDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBStringDoubleDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+@interface GPBStringEnumDictionary () <GPBDictionaryInternalsProtocol> {
+ @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+- (NSData *)serializedDataForUnknownValue:(int32_t)value
+                                   forKey:(GPBGenericValue *)key
+                              keyDataType:(GPBDataType)keyDataType;
+@end
+
+//%PDDM-EXPAND-END (6 expansions)
+
+#pragma mark - NSDictionary Subclass
+
+@interface GPBAutocreatedDictionary : NSMutableDictionary {
+  @package
+  GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator;
+}
+@end
+
+#pragma mark - Helpers
+
+CF_EXTERN_C_BEGIN
+
+// Helper to compute size when an NSDictionary is used for the map instead
+// of a custom type.
+size_t GPBDictionaryComputeSizeInternalHelper(NSDictionary *dict,
+                                              GPBFieldDescriptor *field);
+
+// Helper to write out when an NSDictionary is used for the map instead
+// of a custom type.
+void GPBDictionaryWriteToStreamInternalHelper(
+    GPBCodedOutputStream *outputStream, NSDictionary *dict,
+    GPBFieldDescriptor *field);
+
+// Helper to check message initialization when an NSDictionary is used for
+// the map instead of a custom type.
+BOOL GPBDictionaryIsInitializedInternalHelper(NSDictionary *dict,
+                                              GPBFieldDescriptor *field);
+
+// Helper to read a map instead.
+void GPBDictionaryReadEntry(id mapDictionary, GPBCodedInputStream *stream,
+                            GPBExtensionRegistry *registry,
+                            GPBFieldDescriptor *field,
+                            GPBMessage *parentMessage);
+
+CF_EXTERN_C_END

+ 50 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBExtensionInternals.h

@@ -0,0 +1,50 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+#import "GPBDescriptor.h"
+
+@class GPBCodedInputStream;
+@class GPBCodedOutputStream;
+@class GPBExtensionRegistry;
+
+void GPBExtensionMergeFromInputStream(GPBExtensionDescriptor *extension,
+                                      BOOL isPackedOnStream,
+                                      GPBCodedInputStream *input,
+                                      GPBExtensionRegistry *extensionRegistry,
+                                      GPBMessage *message);
+
+size_t GPBComputeExtensionSerializedSizeIncludingTag(
+    GPBExtensionDescriptor *extension, id value);
+
+void GPBWriteExtensionValueToOutputStream(GPBExtensionDescriptor *extension,
+                                          id value,
+                                          GPBCodedOutputStream *output);

+ 87 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBExtensionRegistry.h

@@ -0,0 +1,87 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+@class GPBDescriptor;
+@class GPBExtensionDescriptor;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ * A table of known extensions, searchable by name or field number.  When
+ * parsing a protocol message that might have extensions, you must provide a
+ * GPBExtensionRegistry in which you have registered any extensions that you
+ * want to be able to parse. Otherwise, those extensions will just be treated
+ * like unknown fields.
+ *
+ * The *Root classes provide `+extensionRegistry` for the extensions defined
+ * in a given file *and* all files it imports. You can also create a
+ * GPBExtensionRegistry, and merge those registries to handle parsing
+ * extensions defined from non overlapping files.
+ *
+ * ```
+ * GPBExtensionRegistry *registry = [[MyProtoFileRoot extensionRegistry] copy];
+ * [registry addExtension:[OtherMessage neededExtension]]; // Not in MyProtoFile
+ * NSError *parseError;
+ * MyMessage *msg = [MyMessage parseData:data extensionRegistry:registry error:&parseError];
+ * ```
+ **/
+@interface GPBExtensionRegistry : NSObject<NSCopying>
+
+/**
+ * Adds the given GPBExtensionDescriptor to this registry.
+ *
+ * @param extension The extension description to add.
+ **/
+- (void)addExtension:(GPBExtensionDescriptor *)extension;
+
+/**
+ * Adds all the extensions from another registry to this registry.
+ *
+ * @param registry The registry to merge into this registry.
+ **/
+- (void)addExtensions:(GPBExtensionRegistry *)registry;
+
+/**
+ * Looks for the extension registered for the given field number on a given
+ * GPBDescriptor.
+ *
+ * @param descriptor  The descriptor to look for a registered extension on.
+ * @param fieldNumber The field number of the extension to look for.
+ *
+ * @return The registered GPBExtensionDescriptor or nil if none was found.
+ **/
+- (nullable GPBExtensionDescriptor *)extensionForDescriptor:(GPBDescriptor *)descriptor
+                                                fieldNumber:(NSInteger)fieldNumber;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 470 - 0
Libraries external/Firebase/Messaging/Protobuf.framework/Headers/GPBMessage.h

@@ -0,0 +1,470 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#import <Foundation/Foundation.h>
+
+#import "GPBBootstrap.h"
+
+@class GPBDescriptor;
+@class GPBCodedInputStream;
+@class GPBCodedOutputStream;
+@class GPBExtensionDescriptor;
+@class GPBExtensionRegistry;
+@class GPBFieldDescriptor;
+@class GPBUnknownFieldSet;
+
+NS_ASSUME_NONNULL_BEGIN
+
+CF_EXTERN_C_BEGIN
+
+/** NSError domain used for errors. */
+extern NSString *const GPBMessageErrorDomain;
+
+/** Error codes for NSErrors originated in GPBMessage. */
+typedef NS_ENUM(NSInteger, GPBMessageErrorCode) {
+  /** Uncategorized error. */
+  GPBMessageErrorCodeOther = -100,
+  /** Message couldn't be serialized because it is missing required fields. */
+  GPBMessageErrorCodeMissingRequiredField = -101,
+};
+
+/**
+ * Key under which the GPBMessage error's reason is stored inside the userInfo
+ * dictionary.
+ **/
+extern NSString *const GPBErrorReasonKey;
+
+CF_EXTERN_C_END
+
+/**
+ * Base class that each generated message subclasses from.
+ *
+ * @note @c NSCopying support is a "deep copy", in that all sub objects are
+ *       copied.  Just like you wouldn't want a UIView/NSView trying to
+ *       exist in two places, you don't want a sub message to be a property
+ *       property of two other messages.
+ *
+ * @note While the class support NSSecureCoding, if the message has any
+ *       extensions, they will end up reloaded in @c unknownFields as there is
+ *       no way for the @c NSCoding plumbing to pass through a
+ *       @c GPBExtensionRegistry. To support extensions, instead of passing the
+ *       calls off to the Message, simple store the result of @c data, and then
+ *       when loading, fetch the data and use
+ *       @c +parseFromData:extensionRegistry:error: to provide an extension
+ *       registry.
+ **/
+@interface GPBMessage : NSObject<NSSecureCoding, NSCopying>
+
+// If you add an instance method/property to this class that may conflict with
+// fields declared in protos, you need to update objective_helpers.cc. The main
+// cases are methods that take no arguments, or setFoo:/hasFoo: type methods.
+
+/**
+ * The set of unknown fields for this message.
+ *
+ * Only messages from proto files declared with "proto2" syntax support unknown
+ * fields. For "proto3" syntax, any unknown fields found while parsing are
+ * dropped.
+ **/
+@property(nonatomic, copy, nullable) GPBUnknownFieldSet *unknownFields;
+
+/**
+ * Whether the message, along with all submessages, have the required fields
+ * set. This is only applicable for files declared with "proto2" syntax, as
+ * there are no required fields for "proto3" syntax.
+ **/
+@property(nonatomic, readonly, getter=isInitialized) BOOL initialized;
+
+/**
+ * @return An autoreleased message with the default values set.
+ **/
++ (instancetype)message;
+
+/**
+ * Creates a new instance by parsing the provided data. This method should be
+ * sent to the generated message class that the data should be interpreted as.
+ * If there is an error the method returns nil and the error is returned in
+ * errorPtr (when provided).
+ *
+ * @note In DEBUG builds, the parsed message is checked to be sure all required
+ *       fields were provided, and the parse will fail if some are missing.
+ *
+ * @note The errors returned are likely coming from the domain and codes listed
+ *       at the top of this file and GPBCodedInputStream.h.
+ *
+ * @param data     The data to parse.
+ * @param errorPtr An optional error pointer to fill in with a failure reason if
+ *                 the data can not be parsed.
+ *
+ * @return A new instance of the generated class.
+ **/
++ (nullable instancetype)parseFromData:(NSData *)data error:(NSError **)errorPtr;
+
+/**
+ * Creates a new instance by parsing the data. This method should be sent to
+ * the generated message class that the data should be interpreted as. If
+ * there is an error the method returns nil and the error is returned in
+ * errorPtr (when provided).
+ *
+ * @note In DEBUG builds, the parsed message is checked to be sure all required
+ *       fields were provided, and the parse will fail if some are missing.
+ *
+ * @note The errors returned are likely coming from the domain and codes listed
+ *       at the top of this file and GPBCodedInputStream.h.
+ *
+ * @param data              The data to parse.
+ * @param extensionRegistry The extension registry to use to look up extensions.
+ * @param errorPtr          An optional error pointer to fill in with a failure
+ *                          reason if the data can not be parsed.
+ *
+ * @return A new instance of the generated class.
+ **/
++ (nullable instancetype)parseFromData:(NSData *)data
+                     extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry
+                                 error:(NSError **)errorPtr;
+
+/**
+ * Creates a new instance by parsing the data from the given input stream. This
+ * method should be sent to the generated message class that the data should
+ * be interpreted as. If there is an error the method returns nil and the error
+ * is returned in errorPtr (when provided).
+ *
+ * @note In DEBUG builds, the parsed message is checked to be sure all required
+ *       fields were provided, and the parse will fail if some are missing.
+ *
+ * @note The errors returned are likely coming from the domain and codes listed
+ *       at the top of this file and GPBCodedInputStream.h.
+ *
+ * @param input             The stream to read data from.
+ * @param extensionRegistry The extension registry to use to look up extensions.
+ * @param errorPtr          An optional error pointer to fill in with a failure
+ *                          reason if the data can not be parsed.
+ *
+ * @return A new instance of the generated class.
+ **/
++ (nullable instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input
+                                 extensionRegistry:
+                                     (nullable GPBExtensionRegistry *)extensionRegistry
+                                             error:(NSError **)errorPtr;
+
+/**
+ * Creates a new instance by parsing the data from the given input stream. This
+ * method should be sent to the generated message class that the data should
+ * be interpreted as. If there is an error the method returns nil and the error
+ * is returned in errorPtr (when provided).
+ *
+ * @note Unlike the parseFrom... methods, this never checks to see if all of
+ *       the required fields are set. So this method can be used to reload
+ *       messages that may not be complete.
+ *
+ * @note The errors returned are likely coming from the domain and codes listed
+ *       at the top of this file and GPBCodedInputStream.h.
+ *
+ * @param input             The stream to read data from.
+ * @param extensionRegistry The extension registry to use to look up extensions.
+ * @param errorPtr          An optional error pointer to fill in with a failure
+ *                          reason if the data can not be parsed.
+ *
+ * @return A new instance of the generated class.
+ **/
++ (nullable instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input
+                                          extensionRegistry:
+                                              (nullable GPBExtensionRegistry *)extensionRegistry
+                                                      error:(NSError **)errorPtr;
+
+/**
+ * Initializes an instance by parsing the data. This method should be sent to
+ * the generated message class that the data should be interpreted as. If
+ * there is an error the method returns nil and the error is returned in
+ * errorPtr (when provided).
+ *
+ * @note In DEBUG builds, the parsed message is checked to be sure all required
+ *       fields were provided, and the parse will fail if some are missing.
+ *
+ * @note The errors returned are likely coming from the domain and codes listed
+ *       at the top of this file and GPBCodedInputStream.h.
+ *
+ * @param data     The data to parse.
+ * @param errorPtr An optional error pointer to fill in with a failure reason if
+ *                 the data can not be parsed.
+ *
+ * @return An initialized instance of the generated class.
+ **/
+- (nullable instancetype)initWithData:(NSData *)data error:(NSError **)errorPtr;
+
+/**
+ * Initializes an instance by parsing the data. This method should be sent to
+ * the generated message class that the data should be interpreted as. If
+ * there is an error the method returns nil and the error is returned in
+ * errorPtr (when provided).
+ *
+ * @note In DEBUG builds, the parsed message is checked to be sure all required
+ *       fields were provided, and the parse will fail if some are missing.
+ *
+ * @note The errors returned are likely coming from the domain and codes listed
+ *       at the top of this file and GPBCodedInputStream.h.
+ *
+ * @param data              The data to parse.
+ * @param extensionRegistry The extension registry to use to look up extensions.
+ * @param errorPtr          An optional error pointer to fill in with a failure
+ *                          reason if the data can not be parsed.
+ *
+ * @return An initialized instance of the generated class.
+ **/
+- (nullable instancetype)initWithData:(NSData *)data
+                    extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry
+                                error:(NSError **)errorPtr;
+
+/**
+ * Initializes an instance by parsing the data from the given input stream. This
+ * method should be sent to the generated message class that the data should
+ * be interpreted as. If there is an error the method returns nil and the error
+ * is returned in errorPtr (when provided).
+ *
+ * @note Unlike the parseFrom... methods, this never checks to see if all of
+ *       the required fields are set. So this method can be used to reload
+ *       messages that may not be complete.
+ *
+ * @note The errors returned are likely coming from the domain and codes listed
+ *       at the top of this file and GPBCodedInputStream.h.
+ *
+ * @param input             The stream to read data from.
+ * @param extensionRegistry The extension registry to use to look up extensions.
+ * @param errorPtr          An optional error pointer to fill in with a failure
+ *                          reason if the data can not be parsed.
+ *
+ * @return An initialized instance of the generated class.
+ **/
+- (nullable instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input
+                                extensionRegistry:
+                                    (nullable GPBExtensionRegistry *)extensionRegistry
+                                            error:(NSError **)errorPtr;
+
+/**
+ * Parses the given data as this message's class, and merges those values into
+ * this message.
+ *
+ * @param data              The binary representation of the message to merge.
+ * @param extensionRegistry The extension registry to use to look up extensions.
+ *
+ * @exception GPBCodedInputStreamException Exception thrown when parsing was
+ *                                         unsuccessful.
+ **/
+- (void)mergeFromData:(NSData *)data
+    extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry;
+
+/**
+ * Merges the fields from another message (of the same type) into this
+ * message.
+ *
+ * @param other Message to merge into this message.
+ **/
+- (void)mergeFrom:(GPBMessage *)other;
+
+/**
+ * Writes out the message to the given coded output stream.
+ *
+ * @param output The coded output stream into which to write the message.
+ *
+ * @note This can raise the GPBCodedOutputStreamException_* exceptions.
+ *
+ **/
+- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)output;
+
+/**
+ * Writes out the message to the given output stream.
+ *
+ * @param output The output stream into which to write the message.
+ *
+ * @note This can raise the GPBCodedOutputStreamException_* exceptions.
+ **/
+- (void)writeToOutputStream:(NSOutputStream *)output;
+
+/**
+ * Writes out a varint for the message size followed by the the message to
+ * the given output stream.
+ *
+ * @param output The coded output stream into which to write the message.
+ *
+ * @note This can raise the GPBCodedOutputStreamException_* exceptions.
+ **/
+- (void)writeDelimitedToCodedOutputStream:(GPBCodedOutputStream *)output;
+
+/**
+ * Writes out a varint for the message size followed by the the message to
+ * the given output stream.
+ *
+ * @param output The output stream into which to write the message.
+ *
+ * @note This can raise the GPBCodedOutputStreamException_* exceptions.
+ **/
+- (void)writeDelimitedToOutputStream:(NSOutputStream *)output;
+
+/**
+ * Serializes the message to an NSData.
+ *
+ * If there is an error while generating the data, nil is returned.
+ *
+ * @note This value is not cached, so if you are using it repeatedly, cache
+ *       it yourself.
+ *
+ * @note In DEBUG ONLY, the message is also checked for all required field,
+ *       if one is missing, nil will be returned.
+ *
+ * @return The binary representation of the message.
+ **/
+- (nullable NSData *)data;
+
+/**
+ * Serializes a varint with the message size followed by the message data,
+ * returning that as an NSData.
+ *
+ * @note This value is not cached, so if you are using it repeatedly, it is
+ *       recommended to keep a local copy.
+ *
+ * @return The binary representation of the size along with the message.
+ **/
+- (NSData *)delimitedData;
+
+/**
+ * Calculates the size of the object if it were serialized.
+ *
+ * This is not a cached value. If you are following a pattern like this:
+ *
+ * ```
+ * size_t size = [aMsg serializedSize];
+ * NSMutableData *foo = [NSMutableData dataWithCapacity:size + sizeof(size)];
+ * [foo writeSize:size];
+ * [foo appendData:[aMsg data]];
+ * ```
+ *
+ * you would be better doing:
+ *
+ * ```
+ * NSData *data = [aMsg data];
+ * NSUInteger size = [aMsg length];
+ * NSMutableData *foo = [NSMutableData dataWithCapacity:size + sizeof(size)];
+ * [foo writeSize:size];
+ * [foo appendData:data];
+ * ```
+ *
+ * @return The size of the message in it's binary representation.
+ **/
+- (size_t)serializedSize;
+
+/**
+ * @return The descriptor for the message class.
+ **/
++ (GPBDescriptor *)descriptor;
+
+/**
+ * Return the descriptor for the message.
+ **/
+- (GPBDescriptor *)descriptor;
+
+/**
+ * @return An array with the extension descriptors that are currently set on the
+ * message.
+ **/
+- (NSArray *)extensionsCurrentlySet;
+
+/**
+ * Checks whether there is an extension set on the message which matches the
+ * given extension descriptor.
+ *
+ * @param extension Extension descriptor to check if it's set on the message.
+ *
+ * @return Whether the extension is currently set on the message.
+ **/
+- (BOOL)hasExtension:(GPBExtensionDescriptor *)extension;
+
+/*
+ * Fetches the given extension's value for this message.
+ *
+ * Extensions use boxed values (NSNumbers) for PODs and NSMutableArrays for
+ * repeated fields. If the extension is a Message one will be auto created for
+ * you and returned similar to fields.
+ *
+ * @param extension The extension descriptor of the extension to fetch.
+ *
+ * @return The extension matching the given descriptor, or nil if none found.
+ **/
+- (nullable id)getExtension:(GPBExtensionDescriptor *)extension;
+
+/**
+ * Sets the given extension's value for this message. This only applies for
+ * single field extensions (i.e. - not repeated fields).
+ *
+ * Extensions use boxed values (NSNumbers).
+ *
+ * @param extension The extension descriptor under which to set the value.
+ * @param value     The value to be set as the extension.
+ **/
+- (void)setExtension:(GPBExtensionDescriptor *)extension
+               value:(nullable id)value;
+
+/**
+ * Adds the given value to the extension for this message. This only applies
+ * to repeated field extensions. If the field is a repeated POD type, the value
+ * should be an NSNumber.
+ *
+ * @param extension The extension descriptor under which to add the value.
+ * @param value     The value to be added to the repeated extension.
+ **/
+- (void)addExtension:(GPBExtensionDescriptor *)extension value:(id)value;
+
+/**
+ * Replaces the value at the given index with the given value for the extension
+ * on this message. This only applies to repeated field extensions. If the field
+ * is a repeated POD type, the value is should be an NSNumber.
+ *
+ * @param extension The extension descriptor under which to replace the value.
+ * @param index     The index of the extension to be replaced.
+ * @param value     The value to be replaced in the repeated extension.
+ **/
+- (void)setExtension:(GPBExtensionDescriptor *)extension
+               index:(NSUInteger)index
+               value:(id)value;
+
+/**
+ * Clears the given extension for this message.
+ *
+ * @param extension The extension descriptor to be cleared from this message.
+ **/
+- (void)clearExtension:(GPBExtensionDescriptor *)extension;
+
+/**
+ * Resets all of the fields of this message to their default values.
+ **/
+- (void)clear;
+
+@end
+
+NS_ASSUME_NONNULL_END

部分文件因为文件数量过多而无法显示