├── .gitignore ├── LICENSE.txt ├── README.md ├── UDApp ├── .idea │ ├── .name │ ├── codeStyleSettings.xml │ ├── encodings.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations │ │ ├── UDApp.xml │ │ ├── Underdark.xml │ │ ├── Underdark_Device.xml │ │ ├── Underdark_Universal.xml │ │ └── tests.xml │ ├── udapp.iml │ └── xcode.xml ├── Podfile ├── UDApp.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── UDApp.xcscheme ├── UDApp.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── UDApp.xcscmblueprint ├── UDApp │ ├── AppDelegate.swift │ ├── AppModel.swift │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-1.png │ │ │ └── Icon.png │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── FormLogger.swift │ ├── Info.plist │ ├── LogFormatter.swift │ ├── LogViewController.swift │ ├── Node.swift │ ├── UDJackLogger.swift │ └── ViewController.swift └── UDAppTests │ ├── Info.plist │ └── UDAppTests.swift └── Underdark ├── 182F28E5-7081-362C-BA24-44DD6FE95CA3.bcsymbolmap ├── 62387A95-2491-37B9-91A2-5B7FC519244C.bcsymbolmap ├── 7859843D-56EC-3F5C-A721-3792E65301AF.bcsymbolmap ├── 92E25047-9429-33EC-A18B-509DD879A141.bcsymbolmap ├── 9AE90F5D-E41D-364C-B2E6-36CA2D143408.bcsymbolmap ├── B0653D07-2D72-365A-84EB-07437B69734E.bcsymbolmap ├── C00609BE-077A-32B4-AE73-C498AA857600.bcsymbolmap ├── C14AE5EC-90CA-3E41-83D6-5E40F2F03AC5.bcsymbolmap ├── C42CD59C-D2DF-3503-95A9-0E18934F8249.bcsymbolmap ├── CACDCDC1-210B-35FF-B72A-896B47C2D1E4.bcsymbolmap ├── DC119A03-1F3C-3395-92C8-5B93816CFDD9.bcsymbolmap ├── E0F25CA9-7774-3280-AD35-0E5BDC60B080.bcsymbolmap ├── E1CC59AE-8A2C-3055-8CC1-8CD1C74EE6A8.bcsymbolmap ├── EE6FBE4D-8240-339E-8399-7D29E9981194.bcsymbolmap ├── ProtocolBuffers.framework.dSYM └── Contents │ ├── Info.plist │ └── Resources │ └── DWARF │ └── ProtocolBuffers ├── ProtocolBuffers.framework ├── Headers │ ├── AbstractMessage.h │ ├── AbstractMessageBuilder.h │ ├── Bootstrap.h │ ├── CodedInputStream.h │ ├── CodedOutputStream.h │ ├── ConcreteExtensionField.h │ ├── Descriptor.pb.h │ ├── ExtendableMessage.h │ ├── ExtendableMessageBuilder.h │ ├── ExtensionField.h │ ├── ExtensionRegistry.h │ ├── Field.h │ ├── ForwardDeclarations.h │ ├── GeneratedMessage.h │ ├── GeneratedMessageBuilder.h │ ├── Message.h │ ├── MessageBuilder.h │ ├── MutableExtensionRegistry.h │ ├── MutableField.h │ ├── ObjectivecDescriptor.pb.h │ ├── PBArray.h │ ├── ProtocolBuffers.h │ ├── RingBuffer.h │ ├── TextFormat.h │ ├── UnknownFieldSet.h │ ├── UnknownFieldSetBuilder.h │ ├── Utilities.h │ └── WireFormat.h ├── Info.plist ├── Modules │ └── module.modulemap └── ProtocolBuffers ├── Underdark.framework.dSYM └── Contents │ ├── Info.plist │ └── Resources │ └── DWARF │ └── Underdark └── Underdark.framework ├── Headers ├── UDFuture.h ├── UDFutureAsync.h ├── UDFutureKnown.h ├── UDFutureLazy.h ├── UDFutureSource.h ├── UDLink.h ├── UDLogger.h ├── UDSource.h ├── UDTimer.h ├── UDTransport.h ├── UDTransport.m ├── UDUnderdark.h ├── UDUnderdark.m ├── UDUtil.h └── Underdark.h ├── Info.plist ├── Modules └── module.modulemap └── Underdark /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | udapp/Pods 28 | Podfile.lock 29 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Underdark License 3 | Version 1.0, January 2016 4 | http://underdark.io 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | "Architect" shall mean Vladimir L. Shabanov 68 | or individual or Legal Entity who received written permission 69 | from Vladimir L. Shabanov to act as Architect. 70 | 71 | 2. Grant of Copyright License. Subject to the terms and conditions of 72 | this License, each Contributor hereby grants to You a perpetual, 73 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 74 | copyright license to reproduce, prepare Derivative Works of, 75 | publicly display, publicly perform, sublicense, and distribute the 76 | Work and such Derivative Works in Source or Object form. 77 | 78 | 3. Grant of Patent License. Subject to the terms and conditions of 79 | this License, each Contributor hereby grants to You a perpetual, 80 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 81 | (except as stated in this section) patent license to make, have made, 82 | use, offer to sell, sell, import, and otherwise transfer the Work, 83 | where such license applies only to those patent claims licensable 84 | by such Contributor that are necessarily infringed by their 85 | Contribution(s) alone or by combination of their Contribution(s) 86 | with the Work to which such Contribution(s) was submitted. If You 87 | institute patent litigation against any entity (including a 88 | cross-claim or counterclaim in a lawsuit) alleging that the Work 89 | or a Contribution incorporated within the Work constitutes direct 90 | or contributory patent infringement, then any patent licenses 91 | granted to You under this License for that Work shall terminate 92 | as of the date such litigation is filed. 93 | 94 | 4. Redistribution. You may reproduce and distribute copies of the 95 | Work or Derivative Works thereof in any medium, with or without 96 | modifications, and in Source or Object form, provided that You 97 | meet the following conditions: 98 | 99 | (a) You must give any other recipients of the Work or 100 | Derivative Works a copy of this License; and 101 | 102 | (b) You must cause any modified files to carry prominent notices 103 | stating that You changed the files; and 104 | 105 | (c) You must retain, in the Source form of any Derivative Works 106 | that You distribute, all copyright, patent, trademark, and 107 | attribution notices from the Source form of the Work, 108 | excluding those notices that do not pertain to any part of 109 | the Derivative Works; and 110 | 111 | (d) If You distribute or publish the Work or Derivative Works 112 | in one or more software application stores, including 113 | but not limited to Apple App Store and/or Google Play Store, 114 | You must include in its store application description 115 | on store's application page the following line (without quotes): 116 | "Mesh networking by http://underdark.io" 117 | ; and 118 | 119 | (e) If You distribute or publish the Work or Derivative Works 120 | via website, You must include in its description on website 121 | the following line (without quotes): 122 | "Mesh networking by http://underdark.io" 123 | ; and 124 | 125 | (f) You can be exempted from conditions (d) and (e) via written 126 | permission from the Architect; and 127 | 128 | (g) If the Work includes a "NOTICE" text file as part of its 129 | distribution, then any Derivative Works that You distribute must 130 | include a readable copy of the attribution notices contained 131 | within such NOTICE file, excluding those notices that do not 132 | pertain to any part of the Derivative Works, in at least one 133 | of the following places: within a NOTICE text file distributed 134 | as part of the Derivative Works; within the Source form or 135 | documentation, if provided along with the Derivative Works; or, 136 | within a display generated by the Derivative Works, if and 137 | wherever such third-party notices normally appear. The contents 138 | of the NOTICE file are for informational purposes only and 139 | do not modify the License. You may add Your own attribution 140 | notices within Derivative Works that You distribute, alongside 141 | or as an addendum to the NOTICE text from the Work, provided 142 | that such additional attribution notices cannot be construed 143 | as modifying the License. 144 | 145 | You may add Your own copyright statement to Your modifications and 146 | may provide additional or different license terms and conditions 147 | for use, reproduction, or distribution of Your modifications, or 148 | for any such Derivative Works as a whole, provided Your use, 149 | reproduction, and distribution of the Work otherwise complies with 150 | the conditions stated in this License. 151 | 152 | 5. Submission of Contributions. Unless You explicitly state otherwise, 153 | any Contribution intentionally submitted for inclusion in the Work 154 | by You to the Licensor shall be under the terms and conditions of 155 | this License, without any additional terms or conditions. 156 | Notwithstanding the above, nothing herein shall supersede or modify 157 | the terms of any separate license agreement you may have executed 158 | with Licensor regarding such Contributions. 159 | 160 | 6. Trademarks. This License does not grant permission to use the trade 161 | names, trademarks, service marks, or product names of the Licensor, 162 | except as required for reasonable and customary use in describing the 163 | origin of the Work and reproducing the content of the NOTICE file. 164 | 165 | 7. Disclaimer of Warranty. Unless required by applicable law or 166 | agreed to in writing, Licensor provides the Work (and each 167 | Contributor provides its Contributions) on an "AS IS" BASIS, 168 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 169 | implied, including, without limitation, any warranties or conditions 170 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 171 | PARTICULAR PURPOSE. You are solely responsible for determining the 172 | appropriateness of using or redistributing the Work and assume any 173 | risks associated with Your exercise of permissions under this License. 174 | 175 | 8. Limitation of Liability. In no event and under no legal theory, 176 | whether in tort (including negligence), contract, or otherwise, 177 | unless required by applicable law (such as deliberate and grossly 178 | negligent acts) or agreed to in writing, shall any Contributor be 179 | liable to You for damages, including any direct, indirect, special, 180 | incidental, or consequential damages of any character arising as a 181 | result of this License or out of the use or inability to use the 182 | Work (including but not limited to damages for loss of goodwill, 183 | work stoppage, computer failure or malfunction, or any and all 184 | other commercial damages or losses), even if such Contributor 185 | has been advised of the possibility of such damages. 186 | 187 | 9. Accepting Warranty or Additional Liability. While redistributing 188 | the Work or Derivative Works thereof, You may choose to offer, 189 | and charge a fee for, acceptance of support, warranty, indemnity, 190 | or other liability obligations and/or rights consistent with this 191 | License. However, in accepting such obligations, You may act only 192 | on Your own behalf and on Your sole responsibility, not on behalf 193 | of any other Contributor, and only if You agree to indemnify, 194 | defend, and hold each Contributor harmless for any liability 195 | incurred by, or claims asserted against, such Contributor by reason 196 | of your accepting any such warranty or additional liability. 197 | 198 | END OF TERMS AND CONDITIONS 199 | 200 | APPENDIX: How to apply the Underdark License to your work. 201 | 202 | To apply the Underdark License to your work, attach the following 203 | boilerplate notice, with the fields enclosed by brackets "[]" 204 | replaced with your own identifying information. (Don't include 205 | the brackets!) The text should be enclosed in the appropriate 206 | comment syntax for the file format. We also recommend that a 207 | file or class name and description of purpose be included on the 208 | same "printed page" as the copyright notice for easier 209 | identification within third-party archives. 210 | 211 | Copyright [yyyy] [name of copyright owner] 212 | 213 | Licensed under the Underdark License, Version 1.0 (the "License"); 214 | you may not use this file except in compliance with the License. 215 | You may obtain a copy of the License at 216 | 217 | http://underdark.io/LICENSE.txt 218 | 219 | Unless required by applicable law or agreed to in writing, software 220 | distributed under the License is distributed on an "AS IS" BASIS, 221 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 222 | See the License for the specific language governing permissions and 223 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Underdark iOS 2 | http://underdark.io 3 | 4 | Peer-to-peer networking library for iOS and Android, with Wi-Fi and Bluetooth support. 5 | 6 | This repository contains library binaries, example app with sources and also short “Getting Started” guide below. 7 | 8 | ## License 9 | http://underdark.io/LICENSE.txt 10 | 11 | Underdark is published under the Underdark License, which is modified Apache 2.0 license with added requirement that applications that use the library must add to their app store description the following line: “Mesh networking by http://underdark.io” 12 | 13 | ## Demo apps 14 | * Android: https://play.google.com/store/apps/details?id=me.solidarity.app 15 | * iOS http://itunes.apple.com/app/id956548749 16 | 17 | Video demo: http://www.youtube.com/watch?v=ox4dh0s1XTw 18 | 19 | ## Author 20 | You can contact me via Telegram at http://telegram.me/virlof or by email at virlof@gmail.com 21 | 22 | ## Installation 23 | 1. Download latest version: [ ![Download](https://api.bintray.com/packages/underdark/ios/underdark/images/download.svg) ](https://bintray.com/underdark/ios/underdark/_latestVersion#files) or previous version: https://bintray.com/underdark/ios/underdark/ 24 | 2. Unarchive downloaded .zip file into your project subdirectoy. 25 | 3. Add all *.framework files/dirs from unarchive directory to “Embedded binaries” and “Linked Frameworks and Libraries” in your project target’s settings in Xcode. 26 | 4. Add unarchived directory to "Framework Search Paths" in your Xcode Target's Build Settings. 27 | 4. When using framework’s classes, import them with ```@import Underdark;``` in Objective-C or ```import Underdark``` in Swift. 28 | 29 | ## Publishing your app to App Store 30 | 1. Install Carthage https://github.com/Carthage/Carthage 31 | 2. Add "Run Script" build phase to your app target's build phases with ```/usr/local/bin/carthage copy-frameworks``` code. 32 | 3. As its input files list paths to all *.framework files in previously unarchived directory like that: 33 | ``` 34 | $(SRCROOT)/../underdark/Underdark.framework 35 | $(SRCROOT)/../underdark/ProtocolBuffers.framework 36 | ``` 37 | 4. Place that Run Script build phase AFTER "Embed Frameworks" build phase. 38 | 5. See more here: https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos 39 | 40 | ## Getting started 41 | Underdark API is very simple — it consists of entry class `UDUnderdark` with method `configureTransport*` — it allows you to create `UDTransport` instance with desired parameters (like network interface type) and specify UDTransportDelegate implementation for callbacks. 42 | 43 | Full documentation resides in appledoc of Underdark.framework, starting from `UDUnderdark` class. 44 | -------------------------------------------------------------------------------- /UDApp/.idea/.name: -------------------------------------------------------------------------------- 1 | UDApp -------------------------------------------------------------------------------- /UDApp/.idea/codeStyleSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 42 | 44 | -------------------------------------------------------------------------------- /UDApp/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /UDApp/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /UDApp/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UDApp/.idea/runConfigurations/UDApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UDApp/.idea/runConfigurations/Underdark.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UDApp/.idea/runConfigurations/Underdark_Device.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UDApp/.idea/runConfigurations/Underdark_Universal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UDApp/.idea/runConfigurations/tests.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /UDApp/.idea/xcode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /UDApp/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '9.0' 3 | 4 | use_frameworks! 5 | inhibit_all_warnings! 6 | 7 | target 'UDApp' do 8 | 9 | pod 'CocoaLumberjack/Swift', '~> 3.2.1' 10 | pod 'XCDLumberjackNSLogger', '~> 1.1.1' 11 | 12 | end 13 | 14 | post_install do |installer| 15 | installer.pods_project.targets.each do |target| 16 | target.build_configurations.each do |config| 17 | config.build_settings['SWIFT_VERSION'] = '4.0' 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /UDApp/UDApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6F213EE9A2F2F9AA5F486E3F /* Pods_UDApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 095F6AF6F7476E32D0DFEA6C /* Pods_UDApp.framework */; }; 11 | D5077F661CA2F1DA00AA3B24 /* AppModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5077F651CA2F1DA00AA3B24 /* AppModel.swift */; }; 12 | D5077F6C1CA2F3B400AA3B24 /* UDJackLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5077F6B1CA2F3B400AA3B24 /* UDJackLogger.swift */; }; 13 | D5077F701CA2FC6200AA3B24 /* LogViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5077F6F1CA2FC6200AA3B24 /* LogViewController.swift */; }; 14 | D531646C1FA1D00D0078C16B /* ProtocolBuffers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D531646A1FA1D00D0078C16B /* ProtocolBuffers.framework */; }; 15 | D531646D1FA1D00D0078C16B /* Underdark.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D531646B1FA1D00D0078C16B /* Underdark.framework */; }; 16 | D531646E1FA1D1E80078C16B /* ProtocolBuffers.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D531646A1FA1D00D0078C16B /* ProtocolBuffers.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | D531646F1FA1D1E80078C16B /* Underdark.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D531646B1FA1D00D0078C16B /* Underdark.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | D5C068071D5A11C6009F41D6 /* FormLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C068061D5A11C6009F41D6 /* FormLogger.swift */; }; 19 | D5C0681A1D5A14C1009F41D6 /* LogFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5C068191D5A14C1009F41D6 /* LogFormatter.swift */; }; 20 | D5D0712E1BAEF02500AF0161 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D0712D1BAEF02500AF0161 /* AppDelegate.swift */; }; 21 | D5D071301BAEF02500AF0161 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D0712F1BAEF02500AF0161 /* ViewController.swift */; }; 22 | D5D071331BAEF02500AF0161 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D5D071311BAEF02500AF0161 /* Main.storyboard */; }; 23 | D5D071351BAEF02500AF0161 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D5D071341BAEF02500AF0161 /* Assets.xcassets */; }; 24 | D5D071381BAEF02500AF0161 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D5D071361BAEF02500AF0161 /* LaunchScreen.storyboard */; }; 25 | D5D071431BAEF02500AF0161 /* UDAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D071421BAEF02500AF0161 /* UDAppTests.swift */; }; 26 | D5D071641BAEF2DE00AF0161 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5D071631BAEF2DE00AF0161 /* Node.swift */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | D5D0713F1BAEF02500AF0161 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = D5D071221BAEF02500AF0161 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = D5D071291BAEF02500AF0161; 35 | remoteInfo = UDApp; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXCopyFilesBuildPhase section */ 40 | D53888121D01D1240074AA75 /* Embed Frameworks */ = { 41 | isa = PBXCopyFilesBuildPhase; 42 | buildActionMask = 2147483647; 43 | dstPath = ""; 44 | dstSubfolderSpec = 10; 45 | files = ( 46 | D531646E1FA1D1E80078C16B /* ProtocolBuffers.framework in Embed Frameworks */, 47 | D531646F1FA1D1E80078C16B /* Underdark.framework in Embed Frameworks */, 48 | ); 49 | name = "Embed Frameworks"; 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXCopyFilesBuildPhase section */ 53 | 54 | /* Begin PBXFileReference section */ 55 | 095F6AF6F7476E32D0DFEA6C /* Pods_UDApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_UDApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | A993B8AA75AE16CA611B2BAC /* Pods-UDApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UDApp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-UDApp/Pods-UDApp.debug.xcconfig"; sourceTree = ""; }; 57 | D2CB1E3203AC68D9B24A0043 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 58 | D5077F651CA2F1DA00AA3B24 /* AppModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppModel.swift; sourceTree = ""; }; 59 | D5077F6B1CA2F3B400AA3B24 /* UDJackLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UDJackLogger.swift; sourceTree = ""; }; 60 | D5077F6F1CA2FC6200AA3B24 /* LogViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LogViewController.swift; sourceTree = ""; }; 61 | D531646A1FA1D00D0078C16B /* ProtocolBuffers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ProtocolBuffers.framework; path = ../Underdark/ProtocolBuffers.framework; sourceTree = ""; }; 62 | D531646B1FA1D00D0078C16B /* Underdark.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Underdark.framework; path = ../Underdark/Underdark.framework; sourceTree = ""; }; 63 | D54A1D841D50835B00FC6B6A /* ProtocolBuffers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ProtocolBuffers.framework; path = Carthage/Build/iOS/ProtocolBuffers.framework; sourceTree = ""; }; 64 | D5C068061D5A11C6009F41D6 /* FormLogger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FormLogger.swift; sourceTree = ""; }; 65 | D5C068091D5A1260009F41D6 /* CocoaLumberjack.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaLumberjack.framework; path = Carthage/Build/iOS/CocoaLumberjack.framework; sourceTree = ""; }; 66 | D5C0680A1D5A1260009F41D6 /* CocoaLumberjackSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaLumberjackSwift.framework; path = Carthage/Build/iOS/CocoaLumberjackSwift.framework; sourceTree = ""; }; 67 | D5C0680B1D5A1260009F41D6 /* NSLogger.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NSLogger.framework; path = Carthage/Build/iOS/NSLogger.framework; sourceTree = ""; }; 68 | D5C0680C1D5A1260009F41D6 /* XCDLumberjackNSLogger.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCDLumberjackNSLogger.framework; path = Carthage/Build/iOS/XCDLumberjackNSLogger.framework; sourceTree = ""; }; 69 | D5C068191D5A14C1009F41D6 /* LogFormatter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LogFormatter.swift; sourceTree = ""; }; 70 | D5D0712A1BAEF02500AF0161 /* UDApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UDApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | D5D0712D1BAEF02500AF0161 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 72 | D5D0712F1BAEF02500AF0161 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 73 | D5D071321BAEF02500AF0161 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 74 | D5D071341BAEF02500AF0161 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 75 | D5D071371BAEF02500AF0161 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 76 | D5D071391BAEF02500AF0161 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 77 | D5D0713E1BAEF02500AF0161 /* UDAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UDAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | D5D071421BAEF02500AF0161 /* UDAppTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UDAppTests.swift; sourceTree = ""; }; 79 | D5D071441BAEF02500AF0161 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 80 | D5D071631BAEF2DE00AF0161 /* Node.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Node.swift; sourceTree = ""; }; 81 | F4F5492F906C8B1DC02D15A2 /* Pods-UDApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UDApp.release.xcconfig"; path = "Pods/Target Support Files/Pods-UDApp/Pods-UDApp.release.xcconfig"; sourceTree = ""; }; 82 | /* End PBXFileReference section */ 83 | 84 | /* Begin PBXFrameworksBuildPhase section */ 85 | D5D071271BAEF02500AF0161 /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | 6F213EE9A2F2F9AA5F486E3F /* Pods_UDApp.framework in Frameworks */, 90 | D531646C1FA1D00D0078C16B /* ProtocolBuffers.framework in Frameworks */, 91 | D531646D1FA1D00D0078C16B /* Underdark.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | D5D0713B1BAEF02500AF0161 /* Frameworks */ = { 96 | isa = PBXFrameworksBuildPhase; 97 | buildActionMask = 2147483647; 98 | files = ( 99 | ); 100 | runOnlyForDeploymentPostprocessing = 0; 101 | }; 102 | /* End PBXFrameworksBuildPhase section */ 103 | 104 | /* Begin PBXGroup section */ 105 | 99AC6183B1B59A9AACCC8379 /* Frameworks */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | D531646A1FA1D00D0078C16B /* ProtocolBuffers.framework */, 109 | D531646B1FA1D00D0078C16B /* Underdark.framework */, 110 | D5C068091D5A1260009F41D6 /* CocoaLumberjack.framework */, 111 | D5C0680A1D5A1260009F41D6 /* CocoaLumberjackSwift.framework */, 112 | D5C0680B1D5A1260009F41D6 /* NSLogger.framework */, 113 | D5C0680C1D5A1260009F41D6 /* XCDLumberjackNSLogger.framework */, 114 | D54A1D841D50835B00FC6B6A /* ProtocolBuffers.framework */, 115 | D2CB1E3203AC68D9B24A0043 /* Pods.framework */, 116 | 095F6AF6F7476E32D0DFEA6C /* Pods_UDApp.framework */, 117 | ); 118 | name = Frameworks; 119 | sourceTree = ""; 120 | }; 121 | D5077F691CA2F36200AA3B24 /* Logging */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | D5C068061D5A11C6009F41D6 /* FormLogger.swift */, 125 | D5077F6B1CA2F3B400AA3B24 /* UDJackLogger.swift */, 126 | D5C068191D5A14C1009F41D6 /* LogFormatter.swift */, 127 | ); 128 | name = Logging; 129 | sourceTree = ""; 130 | }; 131 | D5D071211BAEF02500AF0161 = { 132 | isa = PBXGroup; 133 | children = ( 134 | D5D0712C1BAEF02500AF0161 /* UDApp */, 135 | D5D071411BAEF02500AF0161 /* UDAppTests */, 136 | D5D0712B1BAEF02500AF0161 /* Products */, 137 | 99AC6183B1B59A9AACCC8379 /* Frameworks */, 138 | FB44DF87592C81C1AE739E7E /* Pods */, 139 | ); 140 | sourceTree = ""; 141 | }; 142 | D5D0712B1BAEF02500AF0161 /* Products */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | D5D0712A1BAEF02500AF0161 /* UDApp.app */, 146 | D5D0713E1BAEF02500AF0161 /* UDAppTests.xctest */, 147 | ); 148 | name = Products; 149 | sourceTree = ""; 150 | }; 151 | D5D0712C1BAEF02500AF0161 /* UDApp */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | D5077F691CA2F36200AA3B24 /* Logging */, 155 | D5D071611BAEF2B600AF0161 /* Model */, 156 | D5D071621BAEF2BF00AF0161 /* Controllers */, 157 | D5D0712D1BAEF02500AF0161 /* AppDelegate.swift */, 158 | D5077F651CA2F1DA00AA3B24 /* AppModel.swift */, 159 | D5D071311BAEF02500AF0161 /* Main.storyboard */, 160 | D5D071341BAEF02500AF0161 /* Assets.xcassets */, 161 | D5D071361BAEF02500AF0161 /* LaunchScreen.storyboard */, 162 | D5D071391BAEF02500AF0161 /* Info.plist */, 163 | ); 164 | path = UDApp; 165 | sourceTree = ""; 166 | }; 167 | D5D071411BAEF02500AF0161 /* UDAppTests */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | D5D071421BAEF02500AF0161 /* UDAppTests.swift */, 171 | D5D071441BAEF02500AF0161 /* Info.plist */, 172 | ); 173 | path = UDAppTests; 174 | sourceTree = ""; 175 | }; 176 | D5D071611BAEF2B600AF0161 /* Model */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | D5D071631BAEF2DE00AF0161 /* Node.swift */, 180 | ); 181 | name = Model; 182 | sourceTree = ""; 183 | }; 184 | D5D071621BAEF2BF00AF0161 /* Controllers */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | D5D0712F1BAEF02500AF0161 /* ViewController.swift */, 188 | D5077F6F1CA2FC6200AA3B24 /* LogViewController.swift */, 189 | ); 190 | name = Controllers; 191 | sourceTree = ""; 192 | }; 193 | FB44DF87592C81C1AE739E7E /* Pods */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | A993B8AA75AE16CA611B2BAC /* Pods-UDApp.debug.xcconfig */, 197 | F4F5492F906C8B1DC02D15A2 /* Pods-UDApp.release.xcconfig */, 198 | ); 199 | name = Pods; 200 | sourceTree = ""; 201 | }; 202 | /* End PBXGroup section */ 203 | 204 | /* Begin PBXNativeTarget section */ 205 | D5D071291BAEF02500AF0161 /* UDApp */ = { 206 | isa = PBXNativeTarget; 207 | buildConfigurationList = D5D071521BAEF02500AF0161 /* Build configuration list for PBXNativeTarget "UDApp" */; 208 | buildPhases = ( 209 | 5210F41F98DB0E215EB3D826 /* [CP] Check Pods Manifest.lock */, 210 | D5D071261BAEF02500AF0161 /* Sources */, 211 | D5D071271BAEF02500AF0161 /* Frameworks */, 212 | D5D071281BAEF02500AF0161 /* Resources */, 213 | EFB20F7920B70D3FCB45E192 /* [CP] Embed Pods Frameworks */, 214 | 43613718EBEA278528DD1DD3 /* [CP] Copy Pods Resources */, 215 | D53888121D01D1240074AA75 /* Embed Frameworks */, 216 | D54A1D7F1D50805900FC6B6A /* Carthage Copy Frameworks */, 217 | ); 218 | buildRules = ( 219 | ); 220 | dependencies = ( 221 | ); 222 | name = UDApp; 223 | productName = UDApp; 224 | productReference = D5D0712A1BAEF02500AF0161 /* UDApp.app */; 225 | productType = "com.apple.product-type.application"; 226 | }; 227 | D5D0713D1BAEF02500AF0161 /* UDAppTests */ = { 228 | isa = PBXNativeTarget; 229 | buildConfigurationList = D5D071551BAEF02500AF0161 /* Build configuration list for PBXNativeTarget "UDAppTests" */; 230 | buildPhases = ( 231 | D5D0713A1BAEF02500AF0161 /* Sources */, 232 | D5D0713B1BAEF02500AF0161 /* Frameworks */, 233 | D5D0713C1BAEF02500AF0161 /* Resources */, 234 | ); 235 | buildRules = ( 236 | ); 237 | dependencies = ( 238 | D5D071401BAEF02500AF0161 /* PBXTargetDependency */, 239 | ); 240 | name = UDAppTests; 241 | productName = UDAppTests; 242 | productReference = D5D0713E1BAEF02500AF0161 /* UDAppTests.xctest */; 243 | productType = "com.apple.product-type.bundle.unit-test"; 244 | }; 245 | /* End PBXNativeTarget section */ 246 | 247 | /* Begin PBXProject section */ 248 | D5D071221BAEF02500AF0161 /* Project object */ = { 249 | isa = PBXProject; 250 | attributes = { 251 | CLASSPREFIX = ""; 252 | LastUpgradeCheck = 0900; 253 | ORGANIZATIONNAME = Underdark; 254 | TargetAttributes = { 255 | D5D071291BAEF02500AF0161 = { 256 | CreatedOnToolsVersion = 7.0; 257 | DevelopmentTeam = RRTBW4XF74; 258 | LastSwiftMigration = 0900; 259 | ProvisioningStyle = Automatic; 260 | }; 261 | D5D0713D1BAEF02500AF0161 = { 262 | CreatedOnToolsVersion = 7.0; 263 | TestTargetID = D5D071291BAEF02500AF0161; 264 | }; 265 | }; 266 | }; 267 | buildConfigurationList = D5D071251BAEF02500AF0161 /* Build configuration list for PBXProject "UDApp" */; 268 | compatibilityVersion = "Xcode 3.2"; 269 | developmentRegion = English; 270 | hasScannedForEncodings = 0; 271 | knownRegions = ( 272 | en, 273 | Base, 274 | ); 275 | mainGroup = D5D071211BAEF02500AF0161; 276 | productRefGroup = D5D0712B1BAEF02500AF0161 /* Products */; 277 | projectDirPath = ""; 278 | projectRoot = ""; 279 | targets = ( 280 | D5D071291BAEF02500AF0161 /* UDApp */, 281 | D5D0713D1BAEF02500AF0161 /* UDAppTests */, 282 | ); 283 | }; 284 | /* End PBXProject section */ 285 | 286 | /* Begin PBXResourcesBuildPhase section */ 287 | D5D071281BAEF02500AF0161 /* Resources */ = { 288 | isa = PBXResourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | D5D071381BAEF02500AF0161 /* LaunchScreen.storyboard in Resources */, 292 | D5D071351BAEF02500AF0161 /* Assets.xcassets in Resources */, 293 | D5D071331BAEF02500AF0161 /* Main.storyboard in Resources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | D5D0713C1BAEF02500AF0161 /* Resources */ = { 298 | isa = PBXResourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | ); 302 | runOnlyForDeploymentPostprocessing = 0; 303 | }; 304 | /* End PBXResourcesBuildPhase section */ 305 | 306 | /* Begin PBXShellScriptBuildPhase section */ 307 | 43613718EBEA278528DD1DD3 /* [CP] Copy Pods Resources */ = { 308 | isa = PBXShellScriptBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | ); 312 | inputPaths = ( 313 | ); 314 | name = "[CP] Copy Pods Resources"; 315 | outputPaths = ( 316 | ); 317 | runOnlyForDeploymentPostprocessing = 0; 318 | shellPath = /bin/sh; 319 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-UDApp/Pods-UDApp-resources.sh\"\n"; 320 | showEnvVarsInLog = 0; 321 | }; 322 | 5210F41F98DB0E215EB3D826 /* [CP] Check Pods Manifest.lock */ = { 323 | isa = PBXShellScriptBuildPhase; 324 | buildActionMask = 2147483647; 325 | files = ( 326 | ); 327 | inputPaths = ( 328 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 329 | "${PODS_ROOT}/Manifest.lock", 330 | ); 331 | name = "[CP] Check Pods Manifest.lock"; 332 | outputPaths = ( 333 | "$(DERIVED_FILE_DIR)/Pods-UDApp-checkManifestLockResult.txt", 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | shellPath = /bin/sh; 337 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 338 | showEnvVarsInLog = 0; 339 | }; 340 | D54A1D7F1D50805900FC6B6A /* Carthage Copy Frameworks */ = { 341 | isa = PBXShellScriptBuildPhase; 342 | buildActionMask = 2147483647; 343 | files = ( 344 | ); 345 | inputPaths = ( 346 | "$(SRCROOT)/../Underdark/ProtocolBuffers.framework", 347 | "$(SRCROOT)/../Underdark/Underdark.framework", 348 | ); 349 | name = "Carthage Copy Frameworks"; 350 | outputPaths = ( 351 | ); 352 | runOnlyForDeploymentPostprocessing = 0; 353 | shellPath = /bin/sh; 354 | shellScript = "/usr/local/bin/carthage copy-frameworks"; 355 | }; 356 | EFB20F7920B70D3FCB45E192 /* [CP] Embed Pods Frameworks */ = { 357 | isa = PBXShellScriptBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | ); 361 | inputPaths = ( 362 | "${SRCROOT}/Pods/Target Support Files/Pods-UDApp/Pods-UDApp-frameworks.sh", 363 | "${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework", 364 | "${BUILT_PRODUCTS_DIR}/NSLogger/NSLogger.framework", 365 | "${BUILT_PRODUCTS_DIR}/XCDLumberjackNSLogger/XCDLumberjackNSLogger.framework", 366 | ); 367 | name = "[CP] Embed Pods Frameworks"; 368 | outputPaths = ( 369 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework", 370 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NSLogger.framework", 371 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/XCDLumberjackNSLogger.framework", 372 | ); 373 | runOnlyForDeploymentPostprocessing = 0; 374 | shellPath = /bin/sh; 375 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-UDApp/Pods-UDApp-frameworks.sh\"\n"; 376 | showEnvVarsInLog = 0; 377 | }; 378 | /* End PBXShellScriptBuildPhase section */ 379 | 380 | /* Begin PBXSourcesBuildPhase section */ 381 | D5D071261BAEF02500AF0161 /* Sources */ = { 382 | isa = PBXSourcesBuildPhase; 383 | buildActionMask = 2147483647; 384 | files = ( 385 | D5077F6C1CA2F3B400AA3B24 /* UDJackLogger.swift in Sources */, 386 | D5D071641BAEF2DE00AF0161 /* Node.swift in Sources */, 387 | D5D071301BAEF02500AF0161 /* ViewController.swift in Sources */, 388 | D5C0681A1D5A14C1009F41D6 /* LogFormatter.swift in Sources */, 389 | D5077F701CA2FC6200AA3B24 /* LogViewController.swift in Sources */, 390 | D5D0712E1BAEF02500AF0161 /* AppDelegate.swift in Sources */, 391 | D5077F661CA2F1DA00AA3B24 /* AppModel.swift in Sources */, 392 | D5C068071D5A11C6009F41D6 /* FormLogger.swift in Sources */, 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | }; 396 | D5D0713A1BAEF02500AF0161 /* Sources */ = { 397 | isa = PBXSourcesBuildPhase; 398 | buildActionMask = 2147483647; 399 | files = ( 400 | D5D071431BAEF02500AF0161 /* UDAppTests.swift in Sources */, 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | }; 404 | /* End PBXSourcesBuildPhase section */ 405 | 406 | /* Begin PBXTargetDependency section */ 407 | D5D071401BAEF02500AF0161 /* PBXTargetDependency */ = { 408 | isa = PBXTargetDependency; 409 | target = D5D071291BAEF02500AF0161 /* UDApp */; 410 | targetProxy = D5D0713F1BAEF02500AF0161 /* PBXContainerItemProxy */; 411 | }; 412 | /* End PBXTargetDependency section */ 413 | 414 | /* Begin PBXVariantGroup section */ 415 | D5D071311BAEF02500AF0161 /* Main.storyboard */ = { 416 | isa = PBXVariantGroup; 417 | children = ( 418 | D5D071321BAEF02500AF0161 /* Base */, 419 | ); 420 | name = Main.storyboard; 421 | sourceTree = ""; 422 | }; 423 | D5D071361BAEF02500AF0161 /* LaunchScreen.storyboard */ = { 424 | isa = PBXVariantGroup; 425 | children = ( 426 | D5D071371BAEF02500AF0161 /* Base */, 427 | ); 428 | name = LaunchScreen.storyboard; 429 | sourceTree = ""; 430 | }; 431 | /* End PBXVariantGroup section */ 432 | 433 | /* Begin XCBuildConfiguration section */ 434 | D5D071501BAEF02500AF0161 /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ALWAYS_SEARCH_USER_PATHS = NO; 438 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 439 | CLANG_CXX_LIBRARY = "libc++"; 440 | CLANG_ENABLE_MODULES = YES; 441 | CLANG_ENABLE_OBJC_ARC = YES; 442 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 443 | CLANG_WARN_BOOL_CONVERSION = YES; 444 | CLANG_WARN_COMMA = YES; 445 | CLANG_WARN_CONSTANT_CONVERSION = YES; 446 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INFINITE_RECURSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 452 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 453 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 454 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 455 | CLANG_WARN_STRICT_PROTOTYPES = YES; 456 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 457 | CLANG_WARN_UNREACHABLE_CODE = YES; 458 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 459 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 460 | COPY_PHASE_STRIP = NO; 461 | DEBUG_INFORMATION_FORMAT = dwarf; 462 | ENABLE_STRICT_OBJC_MSGSEND = YES; 463 | ENABLE_TESTABILITY = YES; 464 | GCC_C_LANGUAGE_STANDARD = gnu99; 465 | GCC_DYNAMIC_NO_PIC = NO; 466 | GCC_NO_COMMON_BLOCKS = YES; 467 | GCC_OPTIMIZATION_LEVEL = 0; 468 | GCC_PREPROCESSOR_DEFINITIONS = ( 469 | "DEBUG=1", 470 | "$(inherited)", 471 | ); 472 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 473 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 474 | GCC_WARN_UNDECLARED_SELECTOR = YES; 475 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 476 | GCC_WARN_UNUSED_FUNCTION = YES; 477 | GCC_WARN_UNUSED_VARIABLE = YES; 478 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 479 | MTL_ENABLE_DEBUG_INFO = YES; 480 | ONLY_ACTIVE_ARCH = YES; 481 | SDKROOT = iphoneos; 482 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 483 | }; 484 | name = Debug; 485 | }; 486 | D5D071511BAEF02500AF0161 /* Release */ = { 487 | isa = XCBuildConfiguration; 488 | buildSettings = { 489 | ALWAYS_SEARCH_USER_PATHS = NO; 490 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 491 | CLANG_CXX_LIBRARY = "libc++"; 492 | CLANG_ENABLE_MODULES = YES; 493 | CLANG_ENABLE_OBJC_ARC = YES; 494 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 495 | CLANG_WARN_BOOL_CONVERSION = YES; 496 | CLANG_WARN_COMMA = YES; 497 | CLANG_WARN_CONSTANT_CONVERSION = YES; 498 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 499 | CLANG_WARN_EMPTY_BODY = YES; 500 | CLANG_WARN_ENUM_CONVERSION = YES; 501 | CLANG_WARN_INFINITE_RECURSION = YES; 502 | CLANG_WARN_INT_CONVERSION = YES; 503 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 504 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 505 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 506 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 507 | CLANG_WARN_STRICT_PROTOTYPES = YES; 508 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 509 | CLANG_WARN_UNREACHABLE_CODE = YES; 510 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 511 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; 512 | COPY_PHASE_STRIP = NO; 513 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 514 | ENABLE_NS_ASSERTIONS = NO; 515 | ENABLE_STRICT_OBJC_MSGSEND = YES; 516 | GCC_C_LANGUAGE_STANDARD = gnu99; 517 | GCC_NO_COMMON_BLOCKS = YES; 518 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 519 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 520 | GCC_WARN_UNDECLARED_SELECTOR = YES; 521 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 522 | GCC_WARN_UNUSED_FUNCTION = YES; 523 | GCC_WARN_UNUSED_VARIABLE = YES; 524 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 525 | MTL_ENABLE_DEBUG_INFO = NO; 526 | SDKROOT = iphoneos; 527 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 528 | VALIDATE_PRODUCT = YES; 529 | }; 530 | name = Release; 531 | }; 532 | D5D071531BAEF02500AF0161 /* Debug */ = { 533 | isa = XCBuildConfiguration; 534 | baseConfigurationReference = A993B8AA75AE16CA611B2BAC /* Pods-UDApp.debug.xcconfig */; 535 | buildSettings = { 536 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 537 | CODE_SIGN_IDENTITY = "iPhone Developer"; 538 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 539 | DEVELOPMENT_TEAM = RRTBW4XF74; 540 | FRAMEWORK_SEARCH_PATHS = ( 541 | "$(inherited)", 542 | "$(PROJECT_DIR)/../Underdark", 543 | ); 544 | INFOPLIST_FILE = UDApp/Info.plist; 545 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) '@executable_path/Frameworks'"; 546 | PRODUCT_BUNDLE_IDENTIFIER = io.underdark.udapp; 547 | PRODUCT_NAME = "$(TARGET_NAME)"; 548 | PROVISIONING_PROFILE = ""; 549 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 550 | SWIFT_VERSION = 4.0; 551 | }; 552 | name = Debug; 553 | }; 554 | D5D071541BAEF02500AF0161 /* Release */ = { 555 | isa = XCBuildConfiguration; 556 | baseConfigurationReference = F4F5492F906C8B1DC02D15A2 /* Pods-UDApp.release.xcconfig */; 557 | buildSettings = { 558 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 559 | CODE_SIGN_IDENTITY = "iPhone Distribution"; 560 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 561 | DEVELOPMENT_TEAM = RRTBW4XF74; 562 | FRAMEWORK_SEARCH_PATHS = ( 563 | "$(inherited)", 564 | "$(PROJECT_DIR)/../Underdark", 565 | ); 566 | INFOPLIST_FILE = UDApp/Info.plist; 567 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) '@executable_path/Frameworks'"; 568 | PRODUCT_BUNDLE_IDENTIFIER = io.underdark.udapp; 569 | PRODUCT_NAME = "$(TARGET_NAME)"; 570 | PROVISIONING_PROFILE = ""; 571 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 572 | SWIFT_VERSION = 4.0; 573 | }; 574 | name = Release; 575 | }; 576 | D5D071561BAEF02500AF0161 /* Debug */ = { 577 | isa = XCBuildConfiguration; 578 | buildSettings = { 579 | FRAMEWORK_SEARCH_PATHS = ( 580 | "$(inherited)", 581 | "$(PROJECT_DIR)/Carthage/Build/iOS", 582 | ); 583 | INFOPLIST_FILE = UDAppTests/Info.plist; 584 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 585 | PRODUCT_BUNDLE_IDENTIFIER = io.underdark.UDAppTests; 586 | PRODUCT_NAME = "$(TARGET_NAME)"; 587 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UDApp.app/UDApp"; 588 | }; 589 | name = Debug; 590 | }; 591 | D5D071571BAEF02500AF0161 /* Release */ = { 592 | isa = XCBuildConfiguration; 593 | buildSettings = { 594 | FRAMEWORK_SEARCH_PATHS = ( 595 | "$(inherited)", 596 | "$(PROJECT_DIR)/Carthage/Build/iOS", 597 | ); 598 | INFOPLIST_FILE = UDAppTests/Info.plist; 599 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 600 | PRODUCT_BUNDLE_IDENTIFIER = io.underdark.UDAppTests; 601 | PRODUCT_NAME = "$(TARGET_NAME)"; 602 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UDApp.app/UDApp"; 603 | }; 604 | name = Release; 605 | }; 606 | /* End XCBuildConfiguration section */ 607 | 608 | /* Begin XCConfigurationList section */ 609 | D5D071251BAEF02500AF0161 /* Build configuration list for PBXProject "UDApp" */ = { 610 | isa = XCConfigurationList; 611 | buildConfigurations = ( 612 | D5D071501BAEF02500AF0161 /* Debug */, 613 | D5D071511BAEF02500AF0161 /* Release */, 614 | ); 615 | defaultConfigurationIsVisible = 0; 616 | defaultConfigurationName = Release; 617 | }; 618 | D5D071521BAEF02500AF0161 /* Build configuration list for PBXNativeTarget "UDApp" */ = { 619 | isa = XCConfigurationList; 620 | buildConfigurations = ( 621 | D5D071531BAEF02500AF0161 /* Debug */, 622 | D5D071541BAEF02500AF0161 /* Release */, 623 | ); 624 | defaultConfigurationIsVisible = 0; 625 | defaultConfigurationName = Release; 626 | }; 627 | D5D071551BAEF02500AF0161 /* Build configuration list for PBXNativeTarget "UDAppTests" */ = { 628 | isa = XCConfigurationList; 629 | buildConfigurations = ( 630 | D5D071561BAEF02500AF0161 /* Debug */, 631 | D5D071571BAEF02500AF0161 /* Release */, 632 | ); 633 | defaultConfigurationIsVisible = 0; 634 | defaultConfigurationName = Release; 635 | }; 636 | /* End XCConfigurationList section */ 637 | }; 638 | rootObject = D5D071221BAEF02500AF0161 /* Project object */; 639 | } 640 | -------------------------------------------------------------------------------- /UDApp/UDApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UDApp/UDApp.xcodeproj/xcshareddata/xcschemes/UDApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 47 | 49 | 55 | 56 | 57 | 58 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /UDApp/UDApp.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /UDApp/UDApp.xcworkspace/xcshareddata/UDApp.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "4CA53D06DCD80C79B690645E396372112DDA0422", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "859C3B54A6409A16490F30528EA917721A07A918" : 0, 8 | "4CA53D06DCD80C79B690645E396372112DDA0422" : 0 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "41516C71-32E9-4A39-AD86-50ED5CEF88C2", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "859C3B54A6409A16490F30528EA917721A07A918" : "solidarity\/", 13 | "4CA53D06DCD80C79B690645E396372112DDA0422" : "underdark-cocoa\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "UDApp", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "udapp\/UDApp.xcworkspace", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/udark\/underdark-cocoa.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "4CA53D06DCD80C79B690645E396372112DDA0422" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/bitbucket.org\/glint\/solidarity.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "859C3B54A6409A16490F30528EA917721A07A918" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /UDApp/UDApp/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // UDApp 4 | // 5 | // Created by Virl on 20/09/15. 6 | // Copyright © 2015 Underdark. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | 20 | AppModel.shared.configure() 21 | 22 | //AppModel.shared.udlogger.log("app didFinishLaunchingWithOptions") 23 | 24 | return true 25 | } 26 | 27 | func applicationWillResignActive(_ application: UIApplication) { 28 | //AppModel.shared.udlogger.log("app applicationWillResignActive") 29 | } 30 | 31 | func applicationDidEnterBackground(_ application: UIApplication) { 32 | //AppModel.shared.udlogger.log("app applicationDidEnterBackground") 33 | } 34 | 35 | func applicationWillEnterForeground(_ application: UIApplication) { 36 | //AppModel.shared.udlogger.log("app applicationWillEnterForeground") 37 | } 38 | 39 | func applicationDidBecomeActive(_ application: UIApplication) { 40 | //AppModel.shared.udlogger.log("app applicationDidBecomeActive") 41 | } 42 | 43 | func applicationWillTerminate(_ application: UIApplication) { 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /UDApp/UDApp/AppModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppModel.swift 3 | // UDApp 4 | // 5 | // Created by Virl on 23/03/16. 6 | // Copyright © 2016 Underdark. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import CocoaLumberjack 12 | import XCDLumberjackNSLogger 13 | import Underdark 14 | 15 | class AppModel 16 | { 17 | static let shared = AppModel() 18 | 19 | var node: Node! 20 | var formLogger = FormLogger() 21 | 22 | init() 23 | { 24 | 25 | } 26 | 27 | func configure() 28 | { 29 | configureLogging() 30 | 31 | node = Node() 32 | } 33 | 34 | func configureLogging() 35 | { 36 | DDTTYLogger.sharedInstance.logFormatter = LogFormatter() 37 | DDLog.add(DDTTYLogger.sharedInstance) 38 | 39 | let xcdlogger = XCDLumberjackNSLogger(bonjourServiceName: "solidlog") 40 | LoggerSetViewerHost(xcdlogger.logger, "192.168.4.148" as CFString, 50000) 41 | DDLog.add(xcdlogger) 42 | 43 | formLogger.logFormatter = LogFormatter() 44 | DDLog.add(formLogger) 45 | 46 | UDUnderdark.setLogger(UDJackLogger()) 47 | } 48 | } // AppModel 49 | -------------------------------------------------------------------------------- /UDApp/UDApp/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "Icon-1.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "size" : "60x60", 31 | "idiom" : "iphone", 32 | "filename" : "Icon.png", 33 | "scale" : "3x" 34 | } 35 | ], 36 | "info" : { 37 | "version" : 1, 38 | "author" : "xcode" 39 | } 40 | } -------------------------------------------------------------------------------- /UDApp/UDApp/Assets.xcassets/AppIcon.appiconset/Icon-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udark/underdark-cocoa/cc7729df9d58515463ea53335e88e0424f43821e/UDApp/UDApp/Assets.xcassets/AppIcon.appiconset/Icon-1.png -------------------------------------------------------------------------------- /UDApp/UDApp/Assets.xcassets/AppIcon.appiconset/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udark/underdark-cocoa/cc7729df9d58515463ea53335e88e0424f43821e/UDApp/UDApp/Assets.xcassets/AppIcon.appiconset/Icon.png -------------------------------------------------------------------------------- /UDApp/UDApp/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UDApp/UDApp/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 41 | 50 | 69 | 88 | 97 | 116 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | -------------------------------------------------------------------------------- /UDApp/UDApp/FormLogger.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UILogger.swift 3 | // UDApp 4 | // 5 | // Created by Virl on 09/08/16. 6 | // Copyright © 2016 Underdark. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import CocoaLumberjack 12 | 13 | protocol FormLoggerDelegate : class { 14 | func logMessage(_ message: String) 15 | } 16 | 17 | @objc 18 | class FormLogger: NSObject, DDLogger 19 | { 20 | fileprivate weak var delegate : FormLoggerDelegate? 21 | fileprivate var messages = [String]() 22 | 23 | override init() 24 | { 25 | } 26 | 27 | func updateDelegate(_ delegate: FormLoggerDelegate?) 28 | { 29 | // Main thread. 30 | 31 | self.delegate = delegate 32 | 33 | guard delegate != nil else { 34 | return 35 | } 36 | 37 | for message in messages { 38 | self.delegate?.logMessage(message) 39 | } 40 | 41 | messages.removeAll() 42 | } 43 | 44 | func appendMessage(_ message: String) 45 | { 46 | // Main thread. 47 | 48 | guard self.delegate != nil else { 49 | self.messages.append(message) 50 | return 51 | } 52 | 53 | self.delegate?.logMessage(message) 54 | } 55 | 56 | // MARK: - DDLogger 57 | 58 | var logFormatter: DDLogFormatter = LogFormatter() 59 | var loggerName: String = "UDApp" 60 | 61 | func log(message logMessage: DDLogMessage) 62 | { 63 | guard let message = logFormatter.format(message: logMessage) else { 64 | return 65 | } 66 | 67 | DispatchQueue.main.async { 68 | self.appendMessage(message) 69 | } 70 | } 71 | } 72 | 73 | func LogDebug(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: AnyObject? = nil, asynchronous async: Bool = true, ddlog: DDLog = DDLog.sharedInstance) 74 | { 75 | _DDLogMessage(message, level: level, flag: .debug, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) 76 | } 77 | 78 | func LogInfo(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: AnyObject? = nil, asynchronous async: Bool = true, ddlog: DDLog = DDLog.sharedInstance) { 79 | _DDLogMessage(message, level: level, flag: .info, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) 80 | } 81 | 82 | func LogWarn(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: AnyObject? = nil, asynchronous async: Bool = true, ddlog: DDLog = DDLog.sharedInstance) { 83 | _DDLogMessage(message, level: level, flag: .warning, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) 84 | } 85 | 86 | func LogVerbose(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: AnyObject? = nil, asynchronous async: Bool = true, ddlog: DDLog = DDLog.sharedInstance) { 87 | _DDLogMessage(message, level: level, flag: .verbose, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) 88 | } 89 | 90 | func LogError(_ message: @autoclosure () -> String, level: DDLogLevel = defaultDebugLevel, context: Int = 0, file: StaticString = #file, function: StaticString = #function, line: UInt = #line, tag: AnyObject? = nil, asynchronous async: Bool = false, ddlog: DDLog = DDLog.sharedInstance) { 91 | _DDLogMessage(message, level: level, flag: .error, context: context, file: file, function: function, line: line, tag: tag, asynchronous: async, ddlog: ddlog) 92 | } 93 | -------------------------------------------------------------------------------- /UDApp/UDApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 10 23 | ITSAppUsesNonExemptEncryption 24 | 25 | LSRequiresIPhoneOS 26 | 27 | NSBluetoothPeripheralUsageDescription 28 | Communication with nearby peers. 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UIRequiresFullScreen 38 | 39 | UISupportedInterfaceOrientations 40 | 41 | UIInterfaceOrientationPortrait 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /UDApp/UDApp/LogFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LogFormatter.swift 3 | // UDApp 4 | // 5 | // Created by Virl on 09/08/16. 6 | // Copyright © 2016 Underdark. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CocoaLumberjack 11 | 12 | class LogFormatter: NSObject, DDLogFormatter 13 | { 14 | let dateFormatter = DateFormatter() 15 | 16 | override init() 17 | { 18 | super.init() 19 | 20 | //dateFormatter.dateStyle = .NoStyle 21 | //dateFormatter.timeStyle = .MediumStyle 22 | 23 | //[_dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4]; 24 | //[_dateFormatter setDateFormat:@"dd.MM.yyyy HH:mm:ss:SSS"]; 25 | 26 | dateFormatter.formatterBehavior = DateFormatter.Behavior.behavior10_4 27 | dateFormatter.dateFormat = "HH:mm:ss.SSS" 28 | } 29 | 30 | /** 31 | * Formatters may optionally be added to any logger. 32 | * This allows for increased flexibility in the logging environment. 33 | * For example, log messages for log files may be formatted differently than log messages for the console. 34 | * 35 | * For more information about formatters, see the "Custom Formatters" page: 36 | * Documentation/CustomFormatters.md 37 | * 38 | * The formatter may also optionally filter the log message by returning nil, 39 | * in which case the logger will not log the message. 40 | **/ 41 | func format(message logMessage: DDLogMessage) -> String? 42 | { 43 | let level: String 44 | 45 | if(logMessage.flag.contains(DDLogFlag.debug)) { 46 | level = "" 47 | } else if(logMessage.flag.contains(DDLogFlag.info)) { 48 | level = "" 49 | } else if(logMessage.flag.contains(DDLogFlag.warning)) { 50 | level = "WARN" 51 | } else if(logMessage.flag.contains(DDLogFlag.error)) { 52 | level = "ERROR" 53 | } else { 54 | level = "" 55 | } 56 | 57 | let date = dateFormatter.string(from: logMessage.timestamp) 58 | 59 | let result = "\(date) \(level)\t\(logMessage.message)" 60 | return result 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /UDApp/UDApp/LogViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LogViewController.swift 3 | // UDApp 4 | // 5 | // Created by Virl on 23/03/16. 6 | // Copyright © 2016 Underdark. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class LogViewController: UIViewController, FormLoggerDelegate { 12 | 13 | @IBOutlet weak var textView: UITextView! 14 | 15 | fileprivate let formatter = DateFormatter() 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | formatter.dateStyle = .none 21 | formatter.timeStyle = .medium 22 | 23 | AppModel.shared.formLogger.updateDelegate(self) 24 | } 25 | 26 | override func didReceiveMemoryWarning() { 27 | super.didReceiveMemoryWarning() 28 | } 29 | 30 | // MARK: - Navigation 31 | 32 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 33 | 34 | } 35 | 36 | @IBAction func clearLog(_ sender: AnyObject) { 37 | textView.text = "" 38 | } 39 | 40 | func scrollToBottom() { 41 | let range = NSMakeRange(textView.text.characters.count - 1, 1); 42 | textView.scrollRangeToVisible(range); 43 | } 44 | 45 | // MARK: - UDLoggerDelegate 46 | 47 | func logMessage(_ message: String) 48 | { 49 | textView.text = textView.text + message + "\n"// + "\n" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /UDApp/UDApp/Node.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Node.swift 3 | // UDApp 4 | // 5 | // Created by Virl on 20/09/15. 6 | // Copyright © 2015 Underdark. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | import Underdark; 12 | 13 | class Node: NSObject, UDTransportDelegate 14 | { 15 | let appId: Int32 = 234235 16 | let nodeId: Int64 17 | let queue = DispatchQueue.main 18 | var transport: UDTransport 19 | 20 | var peers = [String:[UDLink]]() // nodeId to links to it. 21 | 22 | weak var controller: ViewController? 23 | 24 | var peersCount = 0 25 | var linksCount = 0 26 | var framesCount = 0 27 | 28 | var bytesCount = 0 29 | var timeStart : TimeInterval = 0 30 | var timeEnd : TimeInterval = 0 31 | 32 | override init() 33 | { 34 | var buf : Int64 = 0 35 | repeat 36 | { 37 | arc4random_buf(&buf, MemoryLayout.size(ofValue: buf)) 38 | } while buf == 0 39 | 40 | if(buf < 0) { 41 | buf = -buf; 42 | } 43 | 44 | nodeId = buf; 45 | 46 | let transportKinds = [UDTransportKind.wifi.rawValue, UDTransportKind.bluetooth.rawValue] 47 | //let transportKinds = [UDTransportKind.Wifi.rawValue]; 48 | //let transportKinds = [UDTransportKind.Bluetooth.rawValue]; 49 | 50 | transport = UDUnderdark.configureTransport(withAppId: appId, nodeId: nodeId, queue: queue, kinds: transportKinds) 51 | 52 | super.init() 53 | 54 | transport.delegate = self 55 | } 56 | 57 | func start() 58 | { 59 | controller?.updateFramesCount() 60 | controller?.updatePeersCount() 61 | 62 | transport.start() 63 | } 64 | 65 | func stop() 66 | { 67 | transport.stop() 68 | 69 | framesCount = 0 70 | controller?.updateFramesCount() 71 | } 72 | 73 | func broadcastFrame(_ frameData: UDSource) 74 | { 75 | if(peers.isEmpty) { return; } 76 | 77 | controller?.updateFramesCount() 78 | 79 | for links in peers.values 80 | { 81 | guard let link = links.first else { 82 | continue 83 | } 84 | 85 | link.sendFrame(with: frameData as! UDSource) 86 | } 87 | } 88 | 89 | func broadcastFrames(_ sources: [UDSource]) 90 | { 91 | for source in sources 92 | { 93 | broadcastFrame(source) 94 | } 95 | } 96 | 97 | func longTransferBegin() { 98 | for links in peers.values { 99 | for link in links { 100 | link.longTransferBegin() 101 | } 102 | } 103 | } 104 | 105 | func longTransferEnd() { 106 | for links in peers.values { 107 | for link in links { 108 | link.longTransferEnd() 109 | } 110 | } 111 | } 112 | 113 | // MARK: - UDTransportDelegate 114 | 115 | func transport(_ transport: UDTransport, linkConnected link: UDLink) 116 | { 117 | if(peers[String(link.nodeId)] == nil) { 118 | peers[String(link.nodeId)] = [UDLink]() 119 | peersCount += 1 120 | } 121 | 122 | var links: [UDLink] = peers[String(link.nodeId)]! 123 | links.append(link) 124 | links.sort { (link1, link2) -> Bool in 125 | return link1.priority < link2.priority 126 | } 127 | 128 | peers[String(link.nodeId)] = links 129 | linksCount += 1 130 | 131 | controller?.updatePeersCount(); 132 | } 133 | 134 | func transport(_ transport: UDTransport, linkDisconnected link: UDLink) 135 | { 136 | guard var links = peers[String(link.nodeId)] else { 137 | return 138 | } 139 | 140 | links = links.filter() { $0 !== link } 141 | 142 | if(links.isEmpty) { 143 | peers.removeValue(forKey: String(link.nodeId)) 144 | peersCount -= 1 145 | } else { 146 | peers[String(link.nodeId)] = links 147 | } 148 | 149 | linksCount -= 1 150 | controller?.updatePeersCount(); 151 | } 152 | 153 | func transport(_ transport: UDTransport, link: UDLink, didReceiveFrame data: Data) 154 | { 155 | if(data.count == 1) { 156 | framesCount = 0 157 | bytesCount = 0 158 | timeStart = Date.timeIntervalSinceReferenceDate 159 | timeEnd = Date.timeIntervalSinceReferenceDate 160 | } 161 | else { 162 | framesCount += 1 163 | bytesCount += data.count 164 | timeEnd = Date.timeIntervalSinceReferenceDate 165 | } 166 | 167 | controller?.updateFramesCount(); 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /UDApp/UDApp/UDJackLogger.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UnderdarkLogger.swift 3 | // UDApp 4 | // 5 | // Created by Virl on 23/03/16. 6 | // Copyright © 2016 Underdark. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import CocoaLumberjack 12 | import Underdark 13 | 14 | @objc 15 | class UDJackLogger: NSObject, UDLogger 16 | { 17 | override init() 18 | { 19 | } 20 | 21 | func log( 22 | _ asynchronous: Bool, 23 | level: UDLogLevel, 24 | flag: UDLogFlag, 25 | context: Int, 26 | file: UnsafePointer!, 27 | function: UnsafePointer!, 28 | line: UInt, 29 | tag: Any?, 30 | message: String) 31 | { 32 | // Any thread. 33 | 34 | withVaList([message]) { pointer in 35 | DDLog.log( 36 | asynchronous: asynchronous, 37 | level: DDLogLevel(rawValue: level.rawValue) ?? DDLogLevel.info, 38 | flag: DDLogFlag(rawValue: flag.rawValue), 39 | context: context, 40 | file: file, 41 | function: function, 42 | line: line, 43 | tag: tag, 44 | format: "%@", 45 | arguments: pointer 46 | ) 47 | } 48 | } // log 49 | } 50 | -------------------------------------------------------------------------------- /UDApp/UDApp/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // UDApp 4 | // 5 | // Created by Virl on 20/09/15. 6 | // Copyright © 2015 Underdark. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | import Underdark; 12 | 13 | class ViewController: UIViewController 14 | { 15 | @IBOutlet weak var navItem: UINavigationItem! 16 | 17 | @IBOutlet weak var framesCountLabel: UILabel! 18 | @IBOutlet weak var timeLabel: UILabel! 19 | @IBOutlet weak var speedLabel: UILabel! 20 | 21 | @IBOutlet weak var progressView: UIProgressView! 22 | @IBOutlet weak var progressHeight: NSLayoutConstraint! 23 | 24 | fileprivate var node: Node! 25 | 26 | //MARK: - Initialization 27 | 28 | required init?(coder aDecoder: NSCoder) 29 | { 30 | super.init(coder: aDecoder) 31 | } 32 | 33 | deinit 34 | { 35 | node.stop() 36 | } 37 | 38 | override func viewDidLoad() 39 | { 40 | super.viewDidLoad() 41 | 42 | self.node = AppModel.shared.node 43 | node.controller = self 44 | 45 | progressHeight.constant = 9 46 | 47 | for vc in self.tabBarController!.viewControllers! 48 | { 49 | let _ = vc.view 50 | } 51 | 52 | updatePeersCount() 53 | 54 | node.start() 55 | } 56 | 57 | override func didReceiveMemoryWarning() 58 | { 59 | super.didReceiveMemoryWarning() 60 | } 61 | 62 | func updatePeersCount() 63 | { 64 | let peersSuffix = ((AppModel.shared.node.peersCount == 1) ? "peer" : "peers") 65 | let linksSuffix = ((AppModel.shared.node.linksCount == 1) ? "link" : "links") 66 | 67 | navItem.title = "\(AppModel.shared.node.peersCount) " + peersSuffix 68 | + " | \(AppModel.shared.node.linksCount) " + linksSuffix 69 | } 70 | 71 | func updateFramesCount() 72 | { 73 | framesCountLabel.text = "\(AppModel.shared.node.framesCount) frames"; 74 | 75 | let timeval = AppModel.shared.node.timeEnd - AppModel.shared.node.timeStart 76 | timeLabel.text = NSString(format: "%.2f seconds", timeval) as String 77 | 78 | let speed = Int( Double(AppModel.shared.node.bytesCount) / (AppModel.shared.node.timeEnd - AppModel.shared.node.timeStart + 0.0001) ) 79 | speedLabel.text = "\(speed / 1024) kb/sec" 80 | } 81 | 82 | //MARK: - Actions 83 | 84 | let bgqueue = DispatchQueue.global(qos: DispatchQoS.QoSClass.background) 85 | 86 | func frameData(_ dataLength:Int) -> UDSource 87 | { 88 | let future = UDFutureLazy(queue: bgqueue) { (context) -> AnyObject in 89 | let data = NSMutableData(length: dataLength); 90 | arc4random_buf(data!.mutableBytes, data!.length) 91 | return data! 92 | } 93 | 94 | /*let data = NSMutableData(length: dataLength); 95 | arc4random_buf(data!.mutableBytes, data!.length) 96 | let result = UDFutureKnown(data: data!)*/ 97 | 98 | return UDSource(future: future) 99 | } 100 | 101 | func frameData2(_ dataLength:Int) -> UDSource 102 | { 103 | let data = NSMutableData(length: dataLength); 104 | arc4random_buf(data!.mutableBytes, data!.length) 105 | 106 | let future = UDFutureKnown(result: data) 107 | 108 | return UDSource(future: future) 109 | } 110 | 111 | @IBAction func sendFramesSmall(_ sender: AnyObject) 112 | { 113 | autoreleasepool { 114 | node.broadcastFrame(frameData(1)) 115 | 116 | node.longTransferBegin() 117 | 118 | for _ in 0 ..< 2000 119 | { 120 | node.broadcastFrame(frameData(1024)); 121 | } 122 | 123 | node.longTransferEnd() 124 | } 125 | } 126 | 127 | @IBAction func sendFramesLarge(_ sender: AnyObject) 128 | { 129 | autoreleasepool { 130 | node.broadcastFrame(frameData(1)) 131 | 132 | node.longTransferBegin() 133 | 134 | for _ in 0 ..< 20 135 | { 136 | AppModel.shared.node.broadcastFrame(frameData(100 * 1024)); 137 | } 138 | 139 | node.longTransferEnd() 140 | } 141 | } 142 | 143 | @IBAction func sendFramesVeryLarge(_ sender: AnyObject) 144 | { 145 | autoreleasepool { 146 | node.broadcastFrame(frameData(1)) 147 | 148 | node.longTransferBegin() 149 | 150 | for _ in 0 ..< 2 151 | { 152 | node.broadcastFrame(frameData(2 * 1024 * 1024)); 153 | } 154 | 155 | node.longTransferEnd() 156 | } 157 | } 158 | 159 | @IBAction func sendFramesGigantic(_ sender: AnyObject) 160 | { 161 | autoreleasepool { 162 | node.broadcastFrame(frameData(1)) 163 | 164 | node.longTransferBegin() 165 | 166 | var frames = [UDSource]() 167 | 168 | for _ in 0 ..< 1000 169 | { 170 | autoreleasepool { 171 | frames.append(frameData(1024 * 1024)) 172 | } 173 | } 174 | 175 | node.broadcastFrames(frames) 176 | 177 | node.longTransferEnd() 178 | } 179 | } 180 | } // ViewController 181 | 182 | -------------------------------------------------------------------------------- /UDApp/UDAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /UDApp/UDAppTests/UDAppTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UDAppTests.swift 3 | // UDAppTests 4 | // 5 | // Created by Virl on 20/09/15. 6 | // Copyright © 2015 Underdark. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import UDApp 11 | 12 | class UDAppTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.com.wire.ProtocolBuffers 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework.dSYM/Contents/Resources/DWARF/ProtocolBuffers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udark/underdark-cocoa/cc7729df9d58515463ea53335e88e0424f43821e/Underdark/ProtocolBuffers.framework.dSYM/Contents/Resources/DWARF/ProtocolBuffers -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/AbstractMessage.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "Message.h" 19 | 20 | /** 21 | * A partial implementation of the {@link Message} interface which implements 22 | * as many methods of that interface as possible in terms of other methods. 23 | * 24 | * @author Cyrus Najmabadi 25 | */ 26 | @interface PBAbstractMessage : NSObject { 27 | @private 28 | } 29 | 30 | /** 31 | * Writes a string description of the message into the given mutable string 32 | * respecting a given indent. 33 | */ 34 | - (void)writeDescriptionTo:(NSMutableString*) output 35 | withIndent:(NSString*) indent; 36 | 37 | - (void) storeInDictionary: (NSMutableDictionary *) dic; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/AbstractMessageBuilder.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "MessageBuilder.h" 19 | 20 | /** 21 | * A partial implementation of the {@link Message.Builder} interface which 22 | * implements as many methods of that interface as possible in terms of 23 | * other methods. 24 | */ 25 | @interface PBAbstractMessageBuilder : NSObject { 26 | } 27 | 28 | @end 29 | 30 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/Bootstrap.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import 19 | 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | 32 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/CodedInputStream.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | @class PBExtensionRegistry; 19 | @class PBUnknownFieldSetBuilder; 20 | @protocol PBMessageBuilder; 21 | 22 | /** 23 | * Reads and decodes protocol message fields. 24 | * 25 | * This class contains two kinds of methods: methods that read specific 26 | * protocol message constructs and field types (e.g. {@link #readTag()} and 27 | * {@link #readInt32()}) and methods that read low-level values (e.g. 28 | * {@link #readRawVarint32()} and {@link #readRawBytes}). If you are reading 29 | * encoded protocol messages, you should use the former methods, but if you are 30 | * reading some other format of your own design, use the latter. 31 | * 32 | * @author Cyrus Najmabadi 33 | */ 34 | @interface PBCodedInputStream : NSObject { 35 | @private 36 | NSMutableData* buffer; 37 | SInt32 bufferSize; 38 | SInt32 bufferSizeAfterLimit; 39 | SInt32 bufferPos; 40 | NSInputStream* input; 41 | SInt32 lastTag; 42 | 43 | /** 44 | * The total number of bytes read before the current buffer. The total 45 | * bytes read up to the current position can be computed as 46 | * {@code totalBytesRetired + bufferPos}. 47 | */ 48 | SInt32 totalBytesRetired; 49 | 50 | /** The absolute position of the end of the current message. */ 51 | SInt32 currentLimit; 52 | 53 | /** See setRecursionLimit() */ 54 | SInt32 recursionDepth; 55 | SInt32 recursionLimit; 56 | 57 | /** See setSizeLimit() */ 58 | SInt32 sizeLimit; 59 | } 60 | 61 | + (PBCodedInputStream*) streamWithData:(NSData*) data; 62 | + (PBCodedInputStream*) streamWithInputStream:(NSInputStream*) input; 63 | 64 | /** 65 | * Attempt to read a field tag, returning zero if we have reached EOF. 66 | * Protocol message parsers use this to read tags, since a protocol message 67 | * may legally end wherever a tag occurs, and zero is not a valid tag number. 68 | */ 69 | - (SInt32) readTag; 70 | - (BOOL) refillBuffer:(BOOL) mustSucceed; 71 | 72 | - (Float64) readDouble; 73 | - (Float32) readFloat; 74 | - (SInt64) readUInt64; 75 | - (SInt32) readUInt32; 76 | - (SInt64) readInt64; 77 | - (SInt32) readInt32; 78 | - (SInt64) readFixed64; 79 | - (SInt32) readFixed32; 80 | - (SInt32) readEnum; 81 | - (SInt32) readSFixed32; 82 | - (SInt64) readSFixed64; 83 | - (SInt32) readSInt32; 84 | - (SInt64) readSInt64; 85 | 86 | /** 87 | * Read one byte from the input. 88 | * 89 | * @throws InvalidProtocolBuffer The end of the stream or the current 90 | * limit was reached. 91 | */ 92 | - (int8_t) readRawByte; 93 | 94 | /** 95 | * Read a raw Varint from the stream. If larger than 32 bits, discard the 96 | * upper bits. 97 | */ 98 | - (SInt32) readRawVarint32; 99 | - (SInt64) readRawVarint64; 100 | - (SInt32) readRawLittleEndian32; 101 | - (SInt64) readRawLittleEndian64; 102 | 103 | /** 104 | * Read a fixed size of bytes from the input. 105 | * 106 | * @throws InvalidProtocolBuffer The end of the stream or the current 107 | * limit was reached. 108 | */ 109 | - (NSData*) readRawData:(SInt32) size; 110 | 111 | /** 112 | * Reads and discards a single field, given its tag value. 113 | * 114 | * @return {@code false} if the tag is an endgroup tag, in which case 115 | * nothing is skipped. Otherwise, returns {@code true}. 116 | */ 117 | - (BOOL) skipField:(SInt32) tag; 118 | 119 | 120 | /** 121 | * Reads and discards {@code size} bytes. 122 | * 123 | * @throws InvalidProtocolBuffer The end of the stream or the current 124 | * limit was reached. 125 | */ 126 | - (void) skipRawData:(SInt32) size; 127 | 128 | /** 129 | * Reads and discards an entire message. This will read either until EOF 130 | * or until an endgroup tag, whichever comes first. 131 | */ 132 | - (void) skipMessage; 133 | 134 | - (BOOL) isAtEnd; 135 | - (SInt32) pushLimit:(SInt32) byteLimit; 136 | - (void) recomputeBufferSizeAfterLimit; 137 | - (void) popLimit:(SInt32) oldLimit; 138 | - (SInt32) bytesUntilLimit; 139 | 140 | 141 | /** Read an embedded message field value from the stream. */ 142 | - (void) readMessage:(id) builder extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 143 | 144 | - (BOOL) readBool; 145 | - (NSString*) readString; 146 | - (NSData*) readData; 147 | 148 | - (void) readGroup:(SInt32) fieldNumber builder:(id) builder extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 149 | 150 | /** 151 | * Reads a {@code group} field value from the stream and merges it into the 152 | * given {@link UnknownFieldSet}. 153 | */ 154 | - (void) readUnknownGroup:(SInt32) fieldNumber builder:(PBUnknownFieldSetBuilder*) builder; 155 | 156 | /** 157 | * Verifies that the last call to readTag() returned the given tag value. 158 | * This is used to verify that a nested group ended with the correct 159 | * end tag. 160 | * 161 | * @throws InvalidProtocolBuffer {@code value} does not match the 162 | * last tag. 163 | */ 164 | - (void) checkLastTagWas:(SInt32) value; 165 | 166 | @end 167 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/CodedOutputStream.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | /** 19 | * Encodes and writes protocol message fields. 20 | * 21 | *

This class contains two kinds of methods: methods that write specific 22 | * protocol message constructs and field types (e.g. {@link #writeTag} and 23 | * {@link #writeInt32}) and methods that write low-level values (e.g. 24 | * {@link #writeRawVarint32} and {@link #writeRawBytes}). If you are 25 | * writing encoded protocol messages, you should use the former methods, but if 26 | * you are writing some other format of your own design, use the latter. 27 | * 28 | *

This class is totally unsynchronized. 29 | * 30 | * @author Cyrus Najmabadi 31 | */ 32 | 33 | @class PBUnknownFieldSet; 34 | @class RingBuffer; 35 | @protocol PBMessage; 36 | 37 | @interface PBCodedOutputStream : NSObject { 38 | NSOutputStream *output; 39 | RingBuffer *buffer; 40 | } 41 | 42 | + (PBCodedOutputStream*) streamWithData:(NSMutableData*) data; 43 | + (PBCodedOutputStream*) streamWithOutputStream:(NSOutputStream*) output; 44 | + (PBCodedOutputStream*) streamWithOutputStream:(NSOutputStream*) output bufferSize:(SInt32) bufferSize; 45 | 46 | /** 47 | * Flushes the stream and forces any buffered bytes to be written. This 48 | * does not flush the underlying NSOutputStream. Returns free space in buffer. 49 | */ 50 | - (void) flush; 51 | 52 | /** Write a single byte. */ 53 | - (void) writeRawByte:(uint8_t) value; 54 | 55 | /** Encode and write a tag. */ 56 | - (void) writeTag:(SInt32) fieldNumber format:(SInt32) format; 57 | 58 | /** Write a little-endian 32-bit integer. */ 59 | - (void) writeRawLittleEndian32:(SInt32) value; 60 | /** Write a little-endian 64-bit integer. */ 61 | - (void) writeRawLittleEndian64:(SInt64) value; 62 | 63 | /** 64 | * Encode and write a varint. {@code value} is treated as 65 | * unsigned, so it won't be sign-extended if negative. 66 | */ 67 | - (void) writeRawVarint32:(SInt32) value; 68 | /** Encode and write a varint. */ 69 | - (void) writeRawVarint64:(SInt64) value; 70 | 71 | //- (void) writeRawLittleEndian32:(SInt32) value; 72 | //- (void) writeRawLittleEndian64:(SInt64) value; 73 | 74 | /** Write an array of bytes. */ 75 | - (void) writeRawData:(const NSData*) data; 76 | - (void) writeRawData:(const NSData*) data offset:(SInt32) offset length:(SInt32) length; 77 | 78 | - (void) writeData:(SInt32) fieldNumber value:(const NSData*) value; 79 | 80 | - (void) writeDouble:(SInt32) fieldNumber value:(Float64) value; 81 | - (void) writeFloat:(SInt32) fieldNumber value:(Float32) value; 82 | - (void) writeUInt64:(SInt32) fieldNumber value:(SInt64) value; 83 | - (void) writeInt64:(SInt32) fieldNumber value:(SInt64) value; 84 | - (void) writeInt32:(SInt32) fieldNumber value:(SInt32) value; 85 | - (void) writeFixed64:(SInt32) fieldNumber value:(SInt64) value; 86 | - (void) writeFixed32:(SInt32) fieldNumber value:(SInt32) value; 87 | - (void) writeBool:(SInt32) fieldNumber value:(BOOL) value; 88 | - (void) writeString:(SInt32) fieldNumber value:(const NSString*) value; 89 | - (void) writeGroup:(SInt32) fieldNumber value:(const id) value; 90 | - (void) writeUnknownGroup:(SInt32) fieldNumber value:(const PBUnknownFieldSet*) value; 91 | - (void) writeMessage:(SInt32) fieldNumber value:(const id) value; 92 | - (void) writeUInt32:(SInt32) fieldNumber value:(SInt32) value; 93 | - (void) writeSFixed32:(SInt32) fieldNumber value:(SInt32) value; 94 | - (void) writeSFixed64:(SInt32) fieldNumber value:(SInt64) value; 95 | - (void) writeSInt32:(SInt32) fieldNumber value:(SInt32) value; 96 | - (void) writeSInt64:(SInt32) fieldNumber value:(SInt64) value; 97 | 98 | - (void) writeDoubleNoTag:(Float64) value; 99 | - (void) writeFloatNoTag:(Float32) value; 100 | - (void) writeUInt64NoTag:(SInt64) value; 101 | - (void) writeInt64NoTag:(SInt64) value; 102 | - (void) writeInt32NoTag:(SInt32) value; 103 | - (void) writeFixed64NoTag:(SInt64) value; 104 | - (void) writeFixed32NoTag:(SInt32) value; 105 | - (void) writeBoolNoTag:(BOOL) value; 106 | - (void) writeStringNoTag:(const NSString*) value; 107 | - (void) writeGroupNoTag:(SInt32) fieldNumber value:(const id) value; 108 | - (void) writeUnknownGroupNoTag:(SInt32) fieldNumber value:(const PBUnknownFieldSet*) value; 109 | - (void) writeMessageNoTag:(const id) value; 110 | - (void) writeDataNoTag:(const NSData*) value; 111 | - (void) writeUInt32NoTag:(SInt32) value; 112 | - (void) writeEnumNoTag:(SInt32) value; 113 | - (void) writeSFixed32NoTag:(SInt32) value; 114 | - (void) writeSFixed64NoTag:(SInt64) value; 115 | - (void) writeSInt32NoTag:(SInt32) value; 116 | - (void) writeSInt64NoTag:(SInt64) value; 117 | 118 | 119 | /** 120 | * Write a MessageSet extension field to the stream. For historical reasons, 121 | * the wire format differs from normal fields. 122 | */ 123 | - (void) writeMessageSetExtension:(SInt32) fieldNumber value:(const id) value; 124 | 125 | /** 126 | * Write an unparsed MessageSet extension field to the stream. For 127 | * historical reasons, the wire format differs from normal fields. 128 | */ 129 | - (void) writeRawMessageSetExtension:(SInt32) fieldNumber value:(const NSData*) value; 130 | 131 | /** 132 | * Write an enum field, including tag, to the stream. Caller is responsible 133 | * for converting the enum value to its numeric value. 134 | */ 135 | - (void) writeEnum:(SInt32) fieldNumber value:(SInt32) value; 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/ConcreteExtensionField.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "ExtensionField.h" 19 | 20 | typedef enum { 21 | PBExtensionTypeBool, 22 | PBExtensionTypeFixed32, 23 | PBExtensionTypeSFixed32, 24 | PBExtensionTypeFloat, 25 | PBExtensionTypeFixed64, 26 | PBExtensionTypeSFixed64, 27 | PBExtensionTypeDouble, 28 | PBExtensionTypeInt32, 29 | PBExtensionTypeInt64, 30 | PBExtensionTypeSInt32, 31 | PBExtensionTypeSInt64, 32 | PBExtensionTypeUInt32, 33 | PBExtensionTypeUInt64, 34 | PBExtensionTypeBytes, 35 | PBExtensionTypeString, 36 | PBExtensionTypeMessage, 37 | PBExtensionTypeGroup, 38 | PBExtensionTypeEnum 39 | } PBExtensionType; 40 | 41 | @interface PBConcreteExtensionField : NSObject { 42 | @private 43 | PBExtensionType type; 44 | 45 | Class extendedClass; 46 | SInt32 fieldNumber; 47 | id defaultValue; 48 | 49 | Class messageOrGroupClass; 50 | 51 | BOOL isRepeated; 52 | BOOL isPacked; 53 | BOOL isMessageSetWireFormat; 54 | } 55 | 56 | + (PBConcreteExtensionField*) extensionWithType:(PBExtensionType) type 57 | extendedClass:(Class) extendedClass 58 | fieldNumber:(SInt32) fieldNumber 59 | defaultValue:(id) defaultValue 60 | messageOrGroupClass:(Class) messageOrGroupClass 61 | isRepeated:(BOOL) isRepeated 62 | isPacked:(BOOL) isPacked 63 | isMessageSetWireFormat:(BOOL) isMessageSetWireFormat; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/ExtendableMessage.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "GeneratedMessage.h" 19 | 20 | #import "ExtensionField.h" 21 | 22 | /** 23 | * Generated message classes for message types that contain extension ranges 24 | * subclass this. 25 | * 26 | *

This class implements type-safe accessors for extensions. They 27 | * implement all the same operations that you can do with normal fields -- 28 | * e.g. "has", "get", and "getCount" -- but for extensions. The extensions 29 | * are identified using instances of the class {@link GeneratedExtension}; 30 | * the protocol compiler generates a static instance of this class for every 31 | * extension in its input. Through the magic of generics, all is made 32 | * type-safe. 33 | * 34 | *

For example, imagine you have the {@code .proto} file: 35 | * 36 | *

37 |  * option java_class = "MyProto";
38 |  *
39 |  * message Foo {
40 |  *   extensions 1000 to max;
41 |  * }
42 |  *
43 |  * extend Foo {
44 |  *   optional int32 bar;
45 |  * }
46 |  * 
47 | * 48 | *

Then you might write code like: 49 | * 50 | *

51 |  * MyProto.Foo foo = getFoo();
52 |  * int i = foo.getExtension(MyProto.bar);
53 |  * 
54 | * 55 | *

See also {@link ExtendableBuilder}. 56 | */ 57 | @interface PBExtendableMessage : PBGeneratedMessage { 58 | @private 59 | NSMutableDictionary* extensionMap; 60 | NSMutableDictionary* extensionRegistry; 61 | } 62 | 63 | @property (strong) NSMutableDictionary* extensionMap; 64 | @property (strong) NSMutableDictionary* extensionRegistry; 65 | 66 | - (BOOL) hasExtension:(id) extension; 67 | - (id) getExtension:(id) extension; 68 | 69 | //@protected 70 | - (BOOL) extensionsAreInitialized; 71 | - (SInt32) extensionsSerializedSize; 72 | - (void) writeExtensionsToCodedOutputStream:(PBCodedOutputStream*) output 73 | from:(SInt32) startInclusive 74 | to:(SInt32) endExclusive; 75 | - (void) writeExtensionDescriptionToMutableString:(NSMutableString*) output 76 | from:(SInt32) startInclusive 77 | to:(SInt32) endExclusive 78 | withIndent:(NSString*) indent; 79 | - (void) addExtensionDictionaryEntriesToMutableDictionary:(NSMutableDictionary*) output 80 | from:(int32_t) startInclusive 81 | to:(int32_t) endExclusive; 82 | - (BOOL) isEqualExtensionsInOther:(PBExtendableMessage*)otherMessage 83 | from:(SInt32) startInclusive 84 | to:(SInt32) endExclusive; 85 | - (NSUInteger) hashExtensionsFrom:(SInt32) startInclusive 86 | to:(SInt32) endExclusive; 87 | 88 | 89 | 90 | /* @internal */ 91 | - (void) ensureExtensionIsRegistered:(id) extension; 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/ExtendableMessageBuilder.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "GeneratedMessageBuilder.h" 19 | 20 | #import "ExtensionField.h" 21 | 22 | @class PBExtendableMessage; 23 | 24 | /** 25 | * Generated message builders for message types that contain extension ranges 26 | * subclass this. 27 | * 28 | *

This class implements type-safe accessors for extensions. They 29 | * implement all the same operations that you can do with normal fields -- 30 | * e.g. "get", "set", and "add" -- but for extensions. The extensions are 31 | * identified using instances of the class {@link GeneratedExtension}; the 32 | * protocol compiler generates a static instance of this class for every 33 | * extension in its input. Through the magic of generics, all is made 34 | * type-safe. 35 | * 36 | *

For example, imagine you have the {@code .proto} file: 37 | * 38 | *

39 |  * option java_class = "MyProto";
40 |  *
41 |  * message Foo {
42 |  *   extensions 1000 to max;
43 |  * }
44 |  *
45 |  * extend Foo {
46 |  *   optional int32 bar;
47 |  * }
48 |  * 
49 | * 50 | *

Then you might write code like: 51 | * 52 | *

53 |  * MyProto.Foo foo =
54 |  *   MyProto.Foo.newBuilder()
55 |  *     .setExtension(MyProto.bar, 123)
56 |  *     .build();
57 |  * 
58 | * 59 | *

See also {@link ExtendableMessage}. 60 | */ 61 | @interface PBExtendableMessageBuilder : PBGeneratedMessageBuilder { 62 | } 63 | 64 | - (id) getExtension:(id) extension; 65 | - (BOOL) hasExtension:(id) extension; 66 | - (PBExtendableMessageBuilder*) setExtension:(id) extension 67 | value:(id) value; 68 | - (PBExtendableMessageBuilder*) addExtension:(id) extension 69 | value:(id) value; 70 | - (PBExtendableMessageBuilder*) setExtension:(id) extension 71 | index:(SInt32) index 72 | value:(id) value; 73 | - (PBExtendableMessageBuilder*) clearExtension:(id) extension; 74 | 75 | /* @protected */ 76 | - (void) mergeExtensionFields:(PBExtendableMessage*) other; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/ExtensionField.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "WireFormat.h" 19 | 20 | @class PBCodedInputStream; 21 | @class PBCodedOutputStream; 22 | @class PBExtendableMessageBuilder; 23 | @class PBExtensionRegistry; 24 | @class PBUnknownFieldSetBuilder; 25 | 26 | @protocol PBExtensionField 27 | - (SInt32) fieldNumber; 28 | - (PBWireFormat) wireType; 29 | - (BOOL) isRepeated; 30 | - (Class) extendedClass; 31 | - (instancetype) defaultValue; 32 | 33 | - (void) mergeFromCodedInputStream:(PBCodedInputStream*) input 34 | unknownFields:(PBUnknownFieldSetBuilder*) unknownFields 35 | extensionRegistry:(PBExtensionRegistry*) extensionRegistry 36 | builder:(PBExtendableMessageBuilder*) builder 37 | tag:(SInt32) tag; 38 | - (void) writeValue:(id) value includingTagToCodedOutputStream:(PBCodedOutputStream*) output; 39 | - (SInt32) computeSerializedSizeIncludingTag:(id) value; 40 | - (void) writeDescriptionOf:(id) value 41 | to:(NSMutableString*) output 42 | withIndent:(NSString*) indent; 43 | - (void) addDictionaryEntriesOf:(id) value 44 | to:(NSMutableDictionary*) dictionary; 45 | @end 46 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/ExtensionRegistry.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | /** 19 | * A table of known extensions, searchable by name or field number. When 20 | * parsing a protocol message that might have extensions, you must provide 21 | * an {@code ExtensionRegistry} in which you have registered any extensions 22 | * that you want to be able to parse. Otherwise, those extensions will just 23 | * be treated like unknown fields. 24 | * 25 | *

For example, if you had the {@code .proto} file: 26 | * 27 | *

28 |  * option java_class = "MyProto";
29 |  *
30 |  * message Foo {
31 |  *   extensions 1000 to max;
32 |  * }
33 |  *
34 |  * extend Foo {
35 |  *   optional int32 bar;
36 |  * }
37 |  * 
38 | * 39 | * Then you might write code like: 40 | * 41 | *
42 |  * ExtensionRegistry registry = ExtensionRegistry.newInstance();
43 |  * registry.add(MyProto.bar);
44 |  * MyProto.Foo message = MyProto.Foo.parseFrom(input, registry);
45 |  * 
46 | * 47 | *

Background: 48 | * 49 | *

You might wonder why this is necessary. Two alternatives might come to 50 | * mind. First, you might imagine a system where generated extensions are 51 | * automatically registered when their containing classes are loaded. This 52 | * is a popular technique, but is bad design; among other things, it creates a 53 | * situation where behavior can change depending on what classes happen to be 54 | * loaded. It also introduces a security vulnerability, because an 55 | * unprivileged class could cause its code to be called unexpectedly from a 56 | * privileged class by registering itself as an extension of the right type. 57 | * 58 | *

Another option you might consider is lazy parsing: do not parse an 59 | * extension until it is first requested, at which point the caller must 60 | * provide a type to use. This introduces a different set of problems. First, 61 | * it would require a mutex lock any time an extension was accessed, which 62 | * would be slow. Second, corrupt data would not be detected until first 63 | * access, at which point it would be much harder to deal with it. Third, it 64 | * could violate the expectation that message objects are immutable, since the 65 | * type provided could be any arbitrary message class. An unpriviledged user 66 | * could take advantage of this to inject a mutable object into a message 67 | * belonging to priviledged code and create mischief. 68 | * 69 | * @author Cyrus Najmabadi 70 | */ 71 | 72 | #import "ExtensionField.h" 73 | 74 | @interface PBExtensionRegistry : NSObject { 75 | @protected 76 | NSDictionary* classMap; 77 | } 78 | 79 | + (PBExtensionRegistry*) emptyRegistry; 80 | - (id) getExtension:(Class) clazz fieldNumber:(SInt32) fieldNumber; 81 | 82 | /* @protected */ 83 | - (instancetype) initWithClassMap:(NSDictionary*) classMap; 84 | - (id) keyForClass:(Class) clazz; 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/Field.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import 19 | 20 | @class PBArray; 21 | @class PBAppendableArray; 22 | @class PBCodedOutputStream; 23 | 24 | @interface PBField : NSObject 25 | { 26 | @protected 27 | PBAppendableArray * _varintArray; 28 | PBAppendableArray * _fixed32Array; 29 | PBAppendableArray * _fixed64Array; 30 | NSMutableArray * _lengthDelimitedArray; 31 | NSMutableArray * _groupArray; 32 | } 33 | 34 | @property (nonatomic,strong,readonly) PBArray * varintArray; 35 | @property (nonatomic,strong,readonly) PBArray * fixed32Array; 36 | @property (nonatomic,strong,readonly) PBArray * fixed64Array; 37 | @property (nonatomic,strong,readonly) NSArray * lengthDelimitedArray; 38 | @property (nonatomic,strong,readonly) NSArray * groupArray; 39 | 40 | + (PBField *)defaultInstance; 41 | 42 | - (SInt32)getSerializedSize:(SInt32)fieldNumber; 43 | - (SInt32)getSerializedSizeAsMessageSetExtension:(SInt32)fieldNumber; 44 | 45 | - (void)writeTo:(SInt32) fieldNumber output:(PBCodedOutputStream *)output; 46 | - (void)writeAsMessageSetExtensionTo:(SInt32)fieldNumber output:(PBCodedOutputStream *)output; 47 | - (void)writeDescriptionFor:(SInt32) fieldNumber 48 | to:(NSMutableString*) output 49 | withIndent:(NSString*) indent; 50 | @end 51 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/ForwardDeclarations.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | @protocol PBMessage; 19 | @protocol PBMessageBuilder; 20 | @protocol PBExtensionField; 21 | 22 | @class PBAbstractMessage; 23 | @class PBCodedInputStream; 24 | @class PBCodedOutputStream; 25 | @class PBConcreteExtensionField; 26 | @class PBExtendableMessageBuilder; 27 | @class PBExtendableMessage; 28 | @class PBExtensionRegistry; 29 | @class PBField; 30 | @class PBGeneratedMessage; 31 | @class PBGeneratedMessageBuilder; 32 | @class PBMutableExtensionRegistry; 33 | @class PBMutableField; 34 | @class PBUnknownFieldSet; 35 | @class PBUnknownFieldSetBuilder; 36 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/GeneratedMessage.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "AbstractMessage.h" 19 | 20 | /** 21 | * All generated protocol message classes extend this class. This class 22 | * implements most of the Message and Builder interfaces using Java reflection. 23 | * Users can ignore this class and pretend that generated messages implement 24 | * the Message interface directly. 25 | * 26 | * @author Cyrus Najmabadi 27 | */ 28 | @class PBExtensionRegistry; 29 | @class PBCodedInputStream; 30 | @protocol GeneratedMessageProtocol 31 | + (id) parseFromData:(NSData*) data; 32 | + (id) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*)extensionRegistry; 33 | + (id) parseFromInputStream:(NSInputStream*) input; 34 | + (id) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 35 | + (id) parseFromCodedInputStream:(PBCodedInputStream*) input; 36 | + (id) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 37 | @end 38 | 39 | @interface PBGeneratedMessage : PBAbstractMessage { 40 | @private 41 | PBUnknownFieldSet* unknownFields; 42 | 43 | @protected 44 | SInt32 memoizedSerializedSize; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/GeneratedMessageBuilder.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "AbstractMessageBuilder.h" 19 | 20 | @class PBUnknownFieldSetBuilder; 21 | 22 | @interface PBGeneratedMessageBuilder : PBAbstractMessageBuilder { 23 | } 24 | 25 | /* @protected */ 26 | - (BOOL) parseUnknownField:(PBCodedInputStream*) input 27 | unknownFields:(PBUnknownFieldSetBuilder*) unknownFields 28 | extensionRegistry:(PBExtensionRegistry*) extensionRegistry 29 | tag:(SInt32) tag; 30 | 31 | - (void) checkInitialized; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/Message.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | @class PBCodedOutputStream; 19 | @class PBUnknownFieldSet; 20 | @protocol PBMessageBuilder; 21 | 22 | /** 23 | * Abstract interface implemented by Protocol Message objects. 24 | * 25 | * @author Cyrus Najmabadi 26 | */ 27 | @protocol PBMessage 28 | /** 29 | * Get an instance of the type with all fields set to their default values. 30 | * This may or may not be a singleton. This differs from the 31 | * {@code getDefaultInstance()} method of generated message classes in that 32 | * this method is an abstract method of the {@code Message} interface 33 | * whereas {@code getDefaultInstance()} is a static method of a specific 34 | * class. They return the same thing. 35 | */ 36 | - (id) defaultInstance; 37 | 38 | /** 39 | * Get the {@code UnknownFieldSet} 40 | */ 41 | - (PBUnknownFieldSet*) unknownFields; 42 | 43 | /** 44 | * Get the number of bytes required to encode this message. The result 45 | * is only computed on the first call and memoized after that. 46 | */ 47 | - (SInt32) serializedSize; 48 | 49 | /** 50 | * Returns true if all required fields in the message and all embedded 51 | * messages are set, false otherwise. 52 | */ 53 | - (BOOL) isInitialized; 54 | 55 | /** 56 | * Serializes the message and writes it to {@code output}. This does not 57 | * flush or close the stream. 58 | */ 59 | - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; 60 | - (void) writeToOutputStream:(NSOutputStream*) output; 61 | 62 | /** 63 | * Serializes the message to a {@code ByteString} and returns it. This is 64 | * just a trivial wrapper around 65 | * {@link #writeTo(CodedOutputStream)}. 66 | */ 67 | - (NSData*) data; 68 | 69 | /** 70 | * Constructs a new builder for a message of the same type as this message. 71 | */ 72 | - (id) builder; 73 | 74 | /** 75 | * Constructs a builder initialized with the current message. Use this to 76 | * derive a new message from the current one. 77 | */ 78 | - (id) toBuilder; 79 | 80 | /** 81 | * Returns a string description of the message. 82 | */ 83 | - (NSString*) description; 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/MessageBuilder.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "Message.h" 19 | 20 | @class PBCodedInputStream; 21 | @class PBExtensionRegistry; 22 | 23 | /** 24 | * Abstract interface implemented by Protocol Message builders. 25 | */ 26 | @protocol PBMessageBuilder 27 | /** Resets all fields to their default values. */ 28 | - (id) clear; 29 | 30 | /** 31 | * Construct the final message. Once this is called, the Builder is no 32 | * longer valid, and calling any other method may throw a 33 | * NullPointerException. If you need to continue working with the builder 34 | * after calling {@code build()}, {@code clone()} it first. 35 | * @throws UninitializedMessageException The message is missing one or more 36 | * required fields (i.e. {@link #isInitialized()} returns false). 37 | * Use {@link #buildPartial()} to bypass this check. 38 | */ 39 | - (id) build; 40 | 41 | /** 42 | * Like {@link #build()}, but does not throw an exception if the message 43 | * is missing required fields. Instead, a partial message is returned. 44 | */ 45 | - (id) buildPartial; 46 | - (id) clone; 47 | 48 | /** 49 | * Returns true if all required fields in the message and all embedded 50 | * messages are set, false otherwise. 51 | */ 52 | - (BOOL) isInitialized; 53 | 54 | /** 55 | * Get the message's type's default instance. 56 | * See {@link Message#getDefaultInstanceForType()}. 57 | */ 58 | - (id) defaultInstance; 59 | 60 | - (PBUnknownFieldSet*) unknownFields; 61 | - (id) setUnknownFields:(PBUnknownFieldSet*) unknownFields; 62 | 63 | /** 64 | * Merge some unknown fields into the {@link UnknownFieldSet} for this 65 | * message. 66 | */ 67 | - (id) mergeUnknownFields:(PBUnknownFieldSet*) unknownFields; 68 | 69 | /** 70 | * Parses a message of this type from the input and merges it with this 71 | * message, as if using {@link Builder#mergeFrom(Message)}. 72 | * 73 | *

Warning: This does not verify that all required fields are present in 74 | * the input message. If you call {@link #build()} without setting all 75 | * required fields, it will throw an {@link UninitializedMessageException}, 76 | * which is a {@code RuntimeException} and thus might not be caught. There 77 | * are a few good ways to deal with this: 78 | *

    79 | *
  • Call {@link #isInitialized()} to verify that all required fields 80 | * are set before building. 81 | *
  • Parse the message separately using one of the static 82 | * {@code parseFrom} methods, then use {@link #mergeFrom(Message)} 83 | * to merge it with this one. {@code parseFrom} will throw an 84 | * {@link InvalidProtocolBufferException} (an {@code IOException}) 85 | * if some required fields are missing. 86 | *
  • Use {@code buildPartial()} to build, which ignores missing 87 | * required fields. 88 | *
89 | * 90 | *

Note: The caller should call 91 | * {@link CodedInputStream#checkLastTagWas(int)} after calling this to 92 | * verify that the last tag seen was the appropriate end-group tag, 93 | * or zero for EOF. 94 | */ 95 | - (id) mergeFromCodedInputStream:(PBCodedInputStream*) input; 96 | 97 | /** 98 | * Like {@link Builder#mergeFrom(CodedInputStream)}, but also 99 | * parses extensions. The extensions that you want to be able to parse 100 | * must be registered in {@code extensionRegistry}. Extensions not in 101 | * the registry will be treated as unknown fields. 102 | */ 103 | - (id) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 104 | 105 | /** 106 | * Parse {@code data} as a message of this type and merge it with the 107 | * message being built. This is just a small wrapper around 108 | * {@link #mergeFrom(CodedInputStream)}. 109 | */ 110 | - (id) mergeFromData:(NSData*) data; 111 | 112 | /** 113 | * Parse {@code data} as a message of this type and merge it with the 114 | * message being built. This is just a small wrapper around 115 | * {@link #mergeFrom(CodedInputStream,ExtensionRegistry)}. 116 | */ 117 | - (id) mergeFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 118 | 119 | /** 120 | * Parse a message of this type from {@code input} and merge it with the 121 | * message being built. This is just a small wrapper around 122 | * {@link #mergeFrom(CodedInputStream)}. Note that this method always 123 | * reads the entire input (unless it throws an exception). If you 124 | * want it to stop earlier, you will need to wrap your input in some 125 | * wrapper stream that limits reading. Despite usually reading the entire 126 | * input, this does not close the stream. 127 | */ 128 | - (id) mergeFromInputStream:(NSInputStream*) input; 129 | 130 | /** 131 | * Parse a message of this type from {@code input} and merge it with the 132 | * message being built. This is just a small wrapper around 133 | * {@link #mergeFrom(CodedInputStream,ExtensionRegistry)}. 134 | */ 135 | - (id) mergeFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 136 | @end 137 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/MutableExtensionRegistry.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "ExtensionRegistry.h" 19 | 20 | @interface PBMutableExtensionRegistry : PBExtensionRegistry { 21 | @private 22 | NSMutableDictionary* mutableClassMap; 23 | } 24 | 25 | + (PBMutableExtensionRegistry*) registry; 26 | 27 | - (void) addExtension:(id) extension; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/MutableField.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "Field.h" 19 | 20 | @class PBUnknownFieldSet; 21 | 22 | @interface PBMutableField : PBField 23 | 24 | + (PBMutableField *)field; 25 | 26 | - (PBMutableField *)mergeFromField:(PBField *)other; 27 | 28 | - (PBMutableField *)clear; 29 | - (PBMutableField *)addVarint:(SInt64)value; 30 | - (PBMutableField *)addFixed32:(SInt32)value; 31 | - (PBMutableField *)addFixed64:(SInt64)value; 32 | - (PBMutableField *)addLengthDelimited:(NSData *)value; 33 | - (PBMutableField *)addGroup:(PBUnknownFieldSet *)value; 34 | 35 | @end -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/ObjectivecDescriptor.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | 3 | #import 4 | 5 | #import "Descriptor.pb.h" 6 | // @@protoc_insertion_point(imports) 7 | 8 | @class ObjectiveCFileOptions; 9 | @class ObjectiveCFileOptionsBuilder; 10 | @class PBDescriptorProto; 11 | @class PBDescriptorProtoBuilder; 12 | @class PBDescriptorProtoExtensionRange; 13 | @class PBDescriptorProtoExtensionRangeBuilder; 14 | @class PBEnumDescriptorProto; 15 | @class PBEnumDescriptorProtoBuilder; 16 | @class PBEnumOptions; 17 | @class PBEnumOptionsBuilder; 18 | @class PBEnumValueDescriptorProto; 19 | @class PBEnumValueDescriptorProtoBuilder; 20 | @class PBEnumValueOptions; 21 | @class PBEnumValueOptionsBuilder; 22 | @class PBFieldDescriptorProto; 23 | @class PBFieldDescriptorProtoBuilder; 24 | @class PBFieldOptions; 25 | @class PBFieldOptionsBuilder; 26 | @class PBFileDescriptorProto; 27 | @class PBFileDescriptorProtoBuilder; 28 | @class PBFileDescriptorSet; 29 | @class PBFileDescriptorSetBuilder; 30 | @class PBFileOptions; 31 | @class PBFileOptionsBuilder; 32 | @class PBMessageOptions; 33 | @class PBMessageOptionsBuilder; 34 | @class PBMethodDescriptorProto; 35 | @class PBMethodDescriptorProtoBuilder; 36 | @class PBMethodOptions; 37 | @class PBMethodOptionsBuilder; 38 | @class PBOneofDescriptorProto; 39 | @class PBOneofDescriptorProtoBuilder; 40 | @class PBServiceDescriptorProto; 41 | @class PBServiceDescriptorProtoBuilder; 42 | @class PBServiceOptions; 43 | @class PBServiceOptionsBuilder; 44 | @class PBSourceCodeInfo; 45 | @class PBSourceCodeInfoBuilder; 46 | @class PBSourceCodeInfoLocation; 47 | @class PBSourceCodeInfoLocationBuilder; 48 | @class PBUninterpretedOption; 49 | @class PBUninterpretedOptionBuilder; 50 | @class PBUninterpretedOptionNamePart; 51 | @class PBUninterpretedOptionNamePartBuilder; 52 | 53 | 54 | 55 | @interface ObjectivecDescriptorRoot : NSObject { 56 | } 57 | + (PBExtensionRegistry*) extensionRegistry; 58 | + (void) registerAllExtensions:(PBMutableExtensionRegistry*) registry; 59 | + (id) objectivecFileOptions; 60 | @end 61 | 62 | #define ObjectiveCFileOptions_package @"package" 63 | #define ObjectiveCFileOptions_class_prefix @"classPrefix" 64 | #define ObjectiveCFileOptions_relax_camel_case @"relaxCamelCase" 65 | @interface ObjectiveCFileOptions : PBGeneratedMessage { 66 | @private 67 | BOOL hasRelaxCamelCase_:1; 68 | BOOL hasPackage_:1; 69 | BOOL hasClassPrefix_:1; 70 | BOOL relaxCamelCase_:1; 71 | NSString* package; 72 | NSString* classPrefix; 73 | } 74 | - (BOOL) hasPackage; 75 | - (BOOL) hasClassPrefix; 76 | - (BOOL) hasRelaxCamelCase; 77 | @property (readonly, strong) NSString* package; 78 | @property (readonly, strong) NSString* classPrefix; 79 | - (BOOL) relaxCamelCase; 80 | 81 | + (instancetype) defaultInstance; 82 | - (instancetype) defaultInstance; 83 | 84 | - (BOOL) isInitialized; 85 | - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; 86 | - (ObjectiveCFileOptionsBuilder*) builder; 87 | + (ObjectiveCFileOptionsBuilder*) builder; 88 | + (ObjectiveCFileOptionsBuilder*) builderWithPrototype:(ObjectiveCFileOptions*) prototype; 89 | - (ObjectiveCFileOptionsBuilder*) toBuilder; 90 | 91 | + (ObjectiveCFileOptions*) parseFromData:(NSData*) data; 92 | + (ObjectiveCFileOptions*) parseFromData:(NSData*) data extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 93 | + (ObjectiveCFileOptions*) parseFromInputStream:(NSInputStream*) input; 94 | + (ObjectiveCFileOptions*) parseFromInputStream:(NSInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 95 | + (ObjectiveCFileOptions*) parseFromCodedInputStream:(PBCodedInputStream*) input; 96 | + (ObjectiveCFileOptions*) parseFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 97 | @end 98 | 99 | @interface ObjectiveCFileOptionsBuilder : PBGeneratedMessageBuilder { 100 | @private 101 | ObjectiveCFileOptions* resultObjectiveCfileOptions; 102 | } 103 | 104 | - (ObjectiveCFileOptions*) defaultInstance; 105 | 106 | - (ObjectiveCFileOptionsBuilder*) clear; 107 | - (ObjectiveCFileOptionsBuilder*) clone; 108 | 109 | - (ObjectiveCFileOptions*) build; 110 | - (ObjectiveCFileOptions*) buildPartial; 111 | 112 | - (ObjectiveCFileOptionsBuilder*) mergeFrom:(ObjectiveCFileOptions*) other; 113 | - (ObjectiveCFileOptionsBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; 114 | - (ObjectiveCFileOptionsBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input extensionRegistry:(PBExtensionRegistry*) extensionRegistry; 115 | 116 | - (BOOL) hasPackage; 117 | - (NSString*) package; 118 | - (ObjectiveCFileOptionsBuilder*) setPackage:(NSString*) value; 119 | - (ObjectiveCFileOptionsBuilder*) clearPackage; 120 | 121 | - (BOOL) hasClassPrefix; 122 | - (NSString*) classPrefix; 123 | - (ObjectiveCFileOptionsBuilder*) setClassPrefix:(NSString*) value; 124 | - (ObjectiveCFileOptionsBuilder*) clearClassPrefix; 125 | 126 | - (BOOL) hasRelaxCamelCase; 127 | - (BOOL) relaxCamelCase; 128 | - (ObjectiveCFileOptionsBuilder*) setRelaxCamelCase:(BOOL) value; 129 | - (ObjectiveCFileOptionsBuilder*) clearRelaxCamelCase; 130 | @end 131 | 132 | 133 | // @@protoc_insertion_point(global_scope) 134 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/PBArray.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // 17 | // Author: Jon Parise 18 | 19 | #import 20 | 21 | extern NSString * const PBArrayTypeMismatchException; 22 | extern NSString * const PBArrayNumberExpectedException; 23 | extern NSString * const PBArrayAllocationFailureException; 24 | 25 | typedef enum _PBArrayValueType 26 | { 27 | PBArrayValueTypeBool, 28 | PBArrayValueTypeInt32, 29 | PBArrayValueTypeUInt32, 30 | PBArrayValueTypeInt64, 31 | PBArrayValueTypeUInt64, 32 | PBArrayValueTypeFloat, 33 | PBArrayValueTypeDouble, 34 | } PBArrayValueType; 35 | 36 | // PBArray is an immutable array class that's optimized for storing primitive 37 | // values. All values stored in an PBArray instance must have the same type 38 | // (PBArrayValueType). Object values (PBArrayValueTypeObject) are retained. 39 | @interface PBArray : NSObject 40 | { 41 | @protected 42 | PBArrayValueType _valueType; 43 | NSUInteger _capacity; 44 | NSUInteger _count; 45 | void * _data; 46 | 47 | } 48 | 49 | - (NSUInteger)count; 50 | - (BOOL)boolAtIndex:(NSUInteger)index; 51 | - (SInt32)int32AtIndex:(NSUInteger)index; 52 | - (SInt32)enumAtIndex:(NSUInteger)index; 53 | - (UInt32)uint32AtIndex:(NSUInteger)index; 54 | - (SInt64)int64AtIndex:(NSUInteger)index; 55 | - (UInt64)uint64AtIndex:(NSUInteger)index; 56 | - (Float32)floatAtIndex:(NSUInteger)index; 57 | - (Float64)doubleAtIndex:(NSUInteger)index; 58 | - (BOOL)isEqualToArray:(PBArray *)array; 59 | - (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block; 60 | - (NSUInteger)indexOfObjectPassingTest:(BOOL (^)(id obj, NSUInteger idx, BOOL *stop))predicate; 61 | 62 | //This Methods automaticaly pack/unpack in NSNumber primitive values 63 | - (id)firstObject; 64 | - (id)lastObject; 65 | - (id)objectAtIndexedSubscript:(NSUInteger)idx; 66 | 67 | @property (nonatomic,assign,readonly) PBArrayValueType valueType; 68 | @property (nonatomic,assign,readonly) const void * data; 69 | @property (nonatomic,assign,readonly,getter=count) NSUInteger count; 70 | 71 | @end 72 | 73 | @interface PBArray (PBArrayExtended) 74 | 75 | - (instancetype)arrayByAppendingArray:(PBArray *)array; 76 | - (PBArray *)filteredArrayUsingPredicate:(NSPredicate *)predicate; 77 | @end 78 | 79 | @interface PBArray (PBArrayCreation) 80 | 81 | + (instancetype)arrayWithValueType:(PBArrayValueType)valueType; 82 | + (instancetype)arrayWithValues:(const void *)values count:(NSUInteger)count valueType:(PBArrayValueType)valueType; 83 | + (instancetype)arrayWithArray:(NSArray *)array valueType:(PBArrayValueType)valueType; 84 | - (instancetype)initWithValueType:(PBArrayValueType)valueType; 85 | - (instancetype)initWithValues:(const void *)values count:(NSUInteger)count valueType:(PBArrayValueType)valueType; 86 | - (instancetype)initWithArray:(NSArray *)array valueType:(PBArrayValueType)valueType; 87 | 88 | @end 89 | 90 | // PBAppendableArray extends PBArray with the ability to append new values to 91 | // the end of the array. 92 | @interface PBAppendableArray : PBArray 93 | 94 | - (void)addBool:(BOOL)value; 95 | - (void)addInt32:(SInt32)value; 96 | - (void)addUint32:(UInt32)value; 97 | - (void)addInt64:(SInt64)value; 98 | - (void)addUint64:(UInt64)value; 99 | - (void)addFloat:(Float32)value; 100 | - (void)addDouble:(Float64)value; 101 | - (void)addEnum:(SInt32)value; 102 | 103 | - (void)appendArray:(PBArray *)array; 104 | - (void)appendValues:(const void *)values count:(UInt32)count; 105 | 106 | @end 107 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/ProtocolBuffers.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProtocolBuffers.framework.h 3 | // ProtocolBuffers.framework 4 | // 5 | // Created by Ilya Puchka on 24/08/15. 6 | // 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ProtocolBuffers.framework. 12 | FOUNDATION_EXPORT double ProtocolBuffers_frameworkVersionNumber; 13 | 14 | //! Project version string for ProtocolBuffers.framework. 15 | FOUNDATION_EXPORT const unsigned char ProtocolBuffers_frameworkVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | #import 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | #import 33 | #import 34 | #import 35 | #import 36 | #import 37 | #import 38 | #import 39 | #import 40 | #import 41 | #import 42 | #import 43 | #import 44 | #import 45 | 46 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/RingBuffer.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface RingBuffer : NSObject { 4 | NSMutableData *buffer; 5 | SInt32 position; 6 | SInt32 tail; 7 | } 8 | @property (nonatomic, readonly) UInt32 freeSpace; 9 | 10 | - (instancetype)initWithData:(NSMutableData*)data; 11 | 12 | // Returns false if there is not enough free space in buffer 13 | - (BOOL)appendByte:(uint8_t)byte; 14 | 15 | // Returns number of bytes written 16 | - (SInt32)appendData:(const NSData*)value offset:(SInt32)offset length:(SInt32)length; 17 | 18 | // Returns number of bytes written 19 | - (SInt32)flushToOutputStream:(NSOutputStream*)stream; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/TextFormat.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | @interface PBTextFormat : NSObject { 19 | 20 | } 21 | 22 | + (SInt32) parseInt32:(NSString*) text; 23 | + (SInt32) parseUInt32:(NSString*) text; 24 | + (SInt64) parseInt64:(NSString*) text; 25 | + (SInt64) parseUInt64:(NSString*) text; 26 | 27 | + (NSData*) unescapeBytes:(NSString*) input; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/UnknownFieldSet.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | @class PBCodedOutputStream; 19 | @class PBField; 20 | @class PBUnknownFieldSetBuilder; 21 | 22 | @interface PBUnknownFieldSet : NSObject { 23 | @private 24 | NSDictionary* fields; 25 | } 26 | 27 | @property (readonly, strong) NSDictionary* fields; 28 | 29 | + (PBUnknownFieldSet*) defaultInstance; 30 | 31 | + (PBUnknownFieldSet*) setWithFields:(NSMutableDictionary*) fields; 32 | + (PBUnknownFieldSet*) parseFromData:(NSData*) data; 33 | 34 | + (PBUnknownFieldSetBuilder*) builder; 35 | + (PBUnknownFieldSetBuilder*) builderWithUnknownFields:(PBUnknownFieldSet*) other; 36 | 37 | - (void) writeAsMessageSetTo:(PBCodedOutputStream*) output; 38 | - (void) writeToCodedOutputStream:(PBCodedOutputStream*) output; 39 | - (NSData*) data; 40 | 41 | - (SInt32) serializedSize; 42 | - (SInt32) serializedSizeAsMessageSet; 43 | 44 | - (BOOL) hasField:(SInt32) number; 45 | - (PBField*) getField:(SInt32) number; 46 | 47 | - (void) writeDescriptionTo:(NSMutableString*) output 48 | withIndent:(NSString*) indent; 49 | 50 | - (void) storeInDictionary: (NSMutableDictionary *) dic; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/UnknownFieldSetBuilder.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "MessageBuilder.h" 19 | 20 | @class PBField; 21 | @class PBMutableField; 22 | 23 | @interface PBUnknownFieldSetBuilder : NSObject { 24 | @private 25 | NSMutableDictionary* fields; 26 | 27 | // Optimization: We keep around a builder for the last field that was 28 | // modified so that we can efficiently add to it multiple times in a 29 | // row (important when parsing an unknown repeated field). 30 | SInt32 lastFieldNumber; 31 | 32 | PBMutableField* lastField; 33 | } 34 | 35 | + (PBUnknownFieldSetBuilder*) createBuilder:(PBUnknownFieldSet*) unknownFields; 36 | 37 | - (PBUnknownFieldSet*) build; 38 | - (PBUnknownFieldSetBuilder*) mergeUnknownFields:(PBUnknownFieldSet*) other; 39 | 40 | - (PBUnknownFieldSetBuilder*) mergeFromCodedInputStream:(PBCodedInputStream*) input; 41 | - (PBUnknownFieldSetBuilder*) mergeFromData:(NSData*) data; 42 | - (PBUnknownFieldSetBuilder*) mergeFromInputStream:(NSInputStream*) input; 43 | 44 | - (PBUnknownFieldSetBuilder*) mergeVarintField:(SInt32) number value:(SInt32) value; 45 | 46 | - (BOOL) mergeFieldFrom:(SInt32) tag input:(PBCodedInputStream*) input; 47 | 48 | - (PBUnknownFieldSetBuilder*) addField:(PBField*) field forNumber:(SInt32) number; 49 | 50 | - (PBUnknownFieldSetBuilder*) clear; 51 | - (PBUnknownFieldSetBuilder*) mergeField:(PBField*) field forNumber:(SInt32) number; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/Utilities.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | #import "Message.h" 19 | 20 | SInt64 convertFloat64ToInt64(Float64 f); 21 | SInt32 convertFloat32ToInt32(Float32 f); 22 | Float64 convertInt64ToFloat64(SInt64 f); 23 | Float32 convertInt32ToFloat32(SInt32 f); 24 | 25 | UInt64 convertInt64ToUInt64(SInt64 i); 26 | SInt64 convertUInt64ToInt64(UInt64 u); 27 | UInt32 convertInt32ToUInt32(SInt32 i); 28 | SInt32 convertUInt32ToInt32(UInt32 u); 29 | 30 | SInt32 logicalRightShift32(SInt32 value, SInt32 spaces); 31 | SInt64 logicalRightShift64(SInt64 value, SInt32 spaces); 32 | 33 | 34 | /** 35 | * Decode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers 36 | * into values that can be efficiently encoded with varint. (Otherwise, 37 | * negative values must be sign-extended to 64 bits to be varint encoded, 38 | * thus always taking 10 bytes on the wire.) 39 | * 40 | * @param n An unsigned 32-bit integer, stored in a signed int. 41 | * @return A signed 32-bit integer. 42 | */ 43 | SInt32 decodeZigZag32(SInt32 n); 44 | 45 | /** 46 | * Decode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers 47 | * into values that can be efficiently encoded with varint. (Otherwise, 48 | * negative values must be sign-extended to 64 bits to be varint encoded, 49 | * thus always taking 10 bytes on the wire.) 50 | * 51 | * @param n An unsigned 64-bit integer, stored in a signed int. 52 | * @return A signed 64-bit integer. 53 | */ 54 | SInt64 decodeZigZag64(SInt64 n); 55 | 56 | 57 | /** 58 | * Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers 59 | * into values that can be efficiently encoded with varint. (Otherwise, 60 | * negative values must be sign-extended to 64 bits to be varint encoded, 61 | * thus always taking 10 bytes on the wire.) 62 | * 63 | * @param n A signed 32-bit integer. 64 | * @return An unsigned 32-bit integer, stored in a signed int. 65 | */ 66 | SInt32 encodeZigZag32(SInt32 n); 67 | 68 | /** 69 | * Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers 70 | * into values that can be efficiently encoded with varint. (Otherwise, 71 | * negative values must be sign-extended to 64 bits to be varint encoded, 72 | * thus always taking 10 bytes on the wire.) 73 | * 74 | * @param n A signed 64-bit integer. 75 | * @return An unsigned 64-bit integer, stored in a signed int. 76 | */ 77 | SInt64 encodeZigZag64(SInt64 n); 78 | 79 | /** 80 | * Compute the number of bytes that would be needed to encode a 81 | * {@code double} field, including tag. 82 | */ 83 | SInt32 computeDoubleSize(SInt32 fieldNumber, Float64 value); 84 | 85 | /** 86 | * Compute the number of bytes that would be needed to encode a 87 | * {@code float} field, including tag. 88 | */ 89 | SInt32 computeFloatSize(SInt32 fieldNumber, Float32 value); 90 | 91 | /** 92 | * Compute the number of bytes that would be needed to encode a 93 | * {@code uint64} field, including tag. 94 | */ 95 | SInt32 computeUInt64Size(SInt32 fieldNumber, SInt64 value); 96 | 97 | /** 98 | * Compute the number of bytes that would be needed to encode an 99 | * {@code int64} field, including tag. 100 | */ 101 | SInt32 computeInt64Size(SInt32 fieldNumber, SInt64 value); 102 | 103 | /** 104 | * Compute the number of bytes that would be needed to encode an 105 | * {@code int32} field, including tag. 106 | */ 107 | SInt32 computeInt32Size(SInt32 fieldNumber, SInt32 value); 108 | 109 | /** 110 | * Compute the number of bytes that would be needed to encode a 111 | * {@code fixed64} field, including tag. 112 | */ 113 | SInt32 computeFixed64Size(SInt32 fieldNumber, SInt64 value); 114 | 115 | /** 116 | * Compute the number of bytes that would be needed to encode a 117 | * {@code fixed32} field, including tag. 118 | */ 119 | SInt32 computeFixed32Size(SInt32 fieldNumber, SInt32 value); 120 | 121 | /** 122 | * Compute the number of bytes that would be needed to encode a 123 | * {@code bool} field, including tag. 124 | */ 125 | SInt32 computeBoolSize(SInt32 fieldNumber, BOOL value); 126 | 127 | /** 128 | * Compute the number of bytes that would be needed to encode a 129 | * {@code string} field, including tag. 130 | */ 131 | SInt32 computeStringSize(SInt32 fieldNumber, const NSString* value); 132 | 133 | /** 134 | * Compute the number of bytes that would be needed to encode a 135 | * {@code group} field, including tag. 136 | */ 137 | SInt32 computeGroupSize(SInt32 fieldNumber, const id value); 138 | 139 | /** 140 | * Compute the number of bytes that would be needed to encode a 141 | * {@code group} field represented by an {@code PBUnknownFieldSet}, including 142 | * tag. 143 | */ 144 | SInt32 computeUnknownGroupSize(SInt32 fieldNumber, const PBUnknownFieldSet* value); 145 | 146 | /** 147 | * Compute the number of bytes that would be needed to encode an 148 | * embedded message field, including tag. 149 | */ 150 | SInt32 computeMessageSize(SInt32 fieldNumber, const id value); 151 | 152 | /** 153 | * Compute the number of bytes that would be needed to encode a 154 | * {@code bytes} field, including tag. 155 | */ 156 | SInt32 computeDataSize(SInt32 fieldNumber, const NSData* value); 157 | 158 | /** 159 | * Compute the number of bytes that would be needed to encode a 160 | * {@code uint32} field, including tag. 161 | */ 162 | SInt32 computeUInt32Size(SInt32 fieldNumber, SInt32 value); 163 | 164 | /** 165 | * Compute the number of bytes that would be needed to encode an 166 | * {@code sfixed32} field, including tag. 167 | */ 168 | SInt32 computeSFixed32Size(SInt32 fieldNumber, SInt32 value); 169 | 170 | /** 171 | * Compute the number of bytes that would be needed to encode an 172 | * {@code sfixed64} field, including tag. 173 | */ 174 | SInt32 computeSFixed64Size(SInt32 fieldNumber, SInt64 value); 175 | 176 | /** 177 | * Compute the number of bytes that would be needed to encode an 178 | * {@code sint32} field, including tag. 179 | */ 180 | SInt32 computeSInt32Size(SInt32 fieldNumber, SInt32 value); 181 | 182 | /** 183 | * Compute the number of bytes that would be needed to encode an 184 | * {@code sint64} field, including tag. 185 | */ 186 | SInt32 computeSInt64Size(SInt32 fieldNumber, SInt64 value); 187 | 188 | /** Compute the number of bytes that would be needed to encode a tag. */ 189 | SInt32 computeTagSize(SInt32 fieldNumber); 190 | 191 | /** 192 | * Compute the number of bytes that would be needed to encode a 193 | * {@code double} field, including tag. 194 | */ 195 | SInt32 computeDoubleSizeNoTag(Float64 value); 196 | 197 | /** 198 | * Compute the number of bytes that would be needed to encode a 199 | * {@code float} field, including tag. 200 | */ 201 | SInt32 computeFloatSizeNoTag(Float32 value); 202 | 203 | /** 204 | * Compute the number of bytes that would be needed to encode a 205 | * {@code uint64} field, including tag. 206 | */ 207 | SInt32 computeUInt64SizeNoTag(SInt64 value); 208 | 209 | /** 210 | * Compute the number of bytes that would be needed to encode an 211 | * {@code int64} field, including tag. 212 | */ 213 | SInt32 computeInt64SizeNoTag(SInt64 value); 214 | /** 215 | * Compute the number of bytes that would be needed to encode an 216 | * {@code int32} field, including tag. 217 | */ 218 | SInt32 computeInt32SizeNoTag(SInt32 value); 219 | 220 | /** 221 | * Compute the number of bytes that would be needed to encode a 222 | * {@code fixed64} field, including tag. 223 | */ 224 | SInt32 computeFixed64SizeNoTag(SInt64 value); 225 | 226 | /** 227 | * Compute the number of bytes that would be needed to encode a 228 | * {@code fixed32} field, including tag. 229 | */ 230 | SInt32 computeFixed32SizeNoTag(SInt32 value); 231 | 232 | /** 233 | * Compute the number of bytes that would be needed to encode a 234 | * {@code bool} field, including tag. 235 | */ 236 | SInt32 computeBoolSizeNoTag(BOOL value); 237 | 238 | /** 239 | * Compute the number of bytes that would be needed to encode a 240 | * {@code string} field, including tag. 241 | */ 242 | SInt32 computeStringSizeNoTag(const NSString* value); 243 | 244 | /** 245 | * Compute the number of bytes that would be needed to encode a 246 | * {@code group} field, including tag. 247 | */ 248 | SInt32 computeGroupSizeNoTag(const id value); 249 | 250 | /** 251 | * Compute the number of bytes that would be needed to encode a 252 | * {@code group} field represented by an {@code PBUnknownFieldSet}, including 253 | * tag. 254 | */ 255 | SInt32 computeUnknownGroupSizeNoTag(const PBUnknownFieldSet* value); 256 | 257 | /** 258 | * Compute the number of bytes that would be needed to encode an 259 | * embedded message field, including tag. 260 | */ 261 | SInt32 computeMessageSizeNoTag(const id value); 262 | 263 | /** 264 | * Compute the number of bytes that would be needed to encode a 265 | * {@code bytes} field, including tag. 266 | */ 267 | SInt32 computeDataSizeNoTag(const NSData* value); 268 | 269 | /** 270 | * Compute the number of bytes that would be needed to encode a 271 | * {@code uint32} field, including tag. 272 | */ 273 | SInt32 computeUInt32SizeNoTag(SInt32 value); 274 | 275 | /** 276 | * Compute the number of bytes that would be needed to encode an 277 | * enum field, including tag. Caller is responsible for converting the 278 | * enum value to its numeric value. 279 | */ 280 | SInt32 computeEnumSizeNoTag(SInt32 value); 281 | 282 | /** 283 | * Compute the number of bytes that would be needed to encode an 284 | * {@code sfixed32} field, including tag. 285 | */ 286 | SInt32 computeSFixed32SizeNoTag(SInt32 value); 287 | 288 | /** 289 | * Compute the number of bytes that would be needed to encode an 290 | * {@code sfixed64} field, including tag. 291 | */ 292 | SInt32 computeSFixed64SizeNoTag(SInt64 value); 293 | 294 | /** 295 | * Compute the number of bytes that would be needed to encode an 296 | * {@code sint32} field, including tag. 297 | */ 298 | SInt32 computeSInt32SizeNoTag(SInt32 value); 299 | 300 | /** 301 | * Compute the number of bytes that would be needed to encode an 302 | * {@code sint64} field, including tag. 303 | */ 304 | SInt32 computeSInt64SizeNoTag(SInt64 value); 305 | 306 | /** 307 | * Compute the number of bytes that would be needed to encode a varint. 308 | * {@code value} is treated as unsigned, so it won't be sign-extended if 309 | * negative. 310 | */ 311 | SInt32 computeRawVarint32Size(SInt32 value); 312 | 313 | /** Compute the number of bytes that would be needed to encode a varint. */ 314 | SInt32 computeRawVarint64Size(SInt64 value); 315 | 316 | /** 317 | * Compute the number of bytes that would be needed to encode a 318 | * MessageSet extension to the stream. For historical reasons, 319 | * the wire format differs from normal fields. 320 | */ 321 | SInt32 computeMessageSetExtensionSize(SInt32 fieldNumber, const id value); 322 | 323 | /** 324 | * Compute the number of bytes that would be needed to encode an 325 | * unparsed MessageSet extension field to the stream. For 326 | * historical reasons, the wire format differs from normal fields. 327 | */ 328 | SInt32 computeRawMessageSetExtensionSize(SInt32 fieldNumber, const NSData* value); 329 | 330 | /** 331 | * Compute the number of bytes that would be needed to encode an 332 | * enum field, including tag. Caller is responsible for converting the 333 | * enum value to its numeric value. 334 | */ 335 | SInt32 computeEnumSize(SInt32 fieldNumber, SInt32 value); 336 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Headers/WireFormat.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers for Objective C 2 | // 3 | // Copyright 2010 Booyah Inc. 4 | // Copyright 2008 Cyrus Najmabadi 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // 10 | // http://www.apache.org/licenses/LICENSE-2.0 11 | // 12 | // Unless required by applicable law or agreed to in writing, software 13 | // distributed under the License is distributed on an "AS IS" BASIS, 14 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | // See the License for the specific language governing permissions and 16 | // limitations under the License. 17 | 18 | typedef enum { 19 | PBWireFormatVarint = 0, 20 | PBWireFormatFixed64 = 1, 21 | PBWireFormatLengthDelimited = 2, 22 | PBWireFormatStartGroup = 3, 23 | PBWireFormatEndGroup = 4, 24 | PBWireFormatFixed32 = 5, 25 | 26 | PBWireFormatTagTypeBits = 3, 27 | PBWireFormatTagTypeMask = 7 /* = (1 << PBWireFormatTagTypeBits) - 1*/, 28 | 29 | PBWireFormatMessageSetItem = 1, 30 | PBWireFormatMessageSetTypeId = 2, 31 | PBWireFormatMessageSetMessage = 3 32 | } PBWireFormat; 33 | 34 | SInt32 PBWireFormatMakeTag(SInt32 fieldNumber, SInt32 wireType); 35 | SInt32 PBWireFormatGetTagWireType(SInt32 tag); 36 | SInt32 PBWireFormatGetTagFieldNumber(SInt32 tag); 37 | 38 | #define PBWireFormatMessageSetItemTag (PBWireFormatMakeTag(PBWireFormatMessageSetItem, PBWireFormatStartGroup)) 39 | #define PBWireFormatMessageSetItemEndTag (PBWireFormatMakeTag(PBWireFormatMessageSetItem, PBWireFormatEndGroup)) 40 | #define PBWireFormatMessageSetTypeIdTag (PBWireFormatMakeTag(PBWireFormatMessageSetTypeId, PBWireFormatVarint)) 41 | #define PBWireFormatMessageSetMessageTag (PBWireFormatMakeTag(PBWireFormatMessageSetMessage, PBWireFormatLengthDelimited)) 42 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udark/underdark-cocoa/cc7729df9d58515463ea53335e88e0424f43821e/Underdark/ProtocolBuffers.framework/Info.plist -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module ProtocolBuffers { 2 | umbrella header "ProtocolBuffers.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Underdark/ProtocolBuffers.framework/ProtocolBuffers: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udark/underdark-cocoa/cc7729df9d58515463ea53335e88e0424f43821e/Underdark/ProtocolBuffers.framework/ProtocolBuffers -------------------------------------------------------------------------------- /Underdark/Underdark.framework.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.io.underdark.lib 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 1.0.7 17 | CFBundleVersion 18 | 8 19 | 20 | 21 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework.dSYM/Contents/Resources/DWARF/Underdark: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udark/underdark-cocoa/cc7729df9d58515463ea53335e88e0424f43821e/Underdark/Underdark.framework.dSYM/Contents/Resources/DWARF/Underdark -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDFuture.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Virl on 31/07/16. 3 | // Copyright (c) 2016 Underdark. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | typedef void (^UDFutureCallback)(bool success, id _Nullable result, id _Nullable error); 9 | 10 | @interface UDFuture : NSObject 11 | 12 | - (void) listen:(nullable dispatch_queue_t)queue 13 | block:(nonnull void (^)(bool success, ResultType _Nullable result, ErrorType _Nullable error))block; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDFutureAsync.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Virl on 05/08/16. 3 | // Copyright (c) 2016 Underdark. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | #import "UDFuture.h" 9 | 10 | @class UDFutureAsync; 11 | 12 | typedef void (^UDFutureAsyncHandler)(id _Nullable result); 13 | typedef void (^UDFutureAsyncRetriever)(id _Nullable context, UDFutureAsyncHandler _Nonnull handler); 14 | 15 | @interface UDFutureAsync : UDFuture 16 | 17 | - (nonnull instancetype) init NS_UNAVAILABLE; 18 | 19 | - (nonnull instancetype) initWithQueue:(nullable dispatch_queue_t)queue 20 | context:(nullable id)context 21 | block:(nonnull UDFutureAsyncRetriever)block NS_DESIGNATED_INITIALIZER; 22 | 23 | - (nonnull instancetype) initWithQueue:(nullable dispatch_queue_t)queue 24 | block:(nonnull UDFutureAsyncRetriever)block; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDFutureKnown.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | #import "UDFuture.h" 20 | 21 | @interface UDFutureKnown : UDFuture 22 | 23 | - (nonnull instancetype) init NS_UNAVAILABLE; 24 | - (nonnull instancetype) initWithResult:(nullable ResultType)result NS_DESIGNATED_INITIALIZER; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDFutureLazy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | #import "UDFuture.h" 20 | 21 | @class UDFutureLazy; 22 | 23 | typedef id _Nullable (^UDFutureLazyRetriever)(id _Nullable context); 24 | 25 | @interface UDFutureLazy : UDFuture 26 | 27 | - (nonnull instancetype) init NS_UNAVAILABLE; 28 | 29 | - (nonnull instancetype) initWithQueue:(nullable dispatch_queue_t)queue 30 | context:(nullable id)context 31 | block:(nonnull UDFutureLazyRetriever)block NS_DESIGNATED_INITIALIZER; 32 | 33 | - (nonnull instancetype) initWithQueue:(nullable dispatch_queue_t)queue block:(nonnull UDFutureLazyRetriever)block; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDFutureSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | #import "UDFuture.h" 20 | 21 | @interface UDFutureSource : NSObject 22 | 23 | @property (nonatomic, readonly, getter=future, nonnull) UDFuture* future; 24 | 25 | - (nonnull instancetype) init; 26 | 27 | - (void) succeed:(nullable id)result; 28 | - (void) fail:(nullable id)error; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDLink.h: -------------------------------------------------------------------------------- 1 | // 2 | // UDLink.h 3 | // Underdark 4 | // 5 | // Created by Virl on 01/07/15. 6 | // Copyright (c) 2015 Underdark. All rights reserved. 7 | // 8 | 9 | #ifndef Underdark_UDLink_h 10 | #define Underdark_UDLink_h 11 | 12 | #import "UDSource.h" 13 | #import "UDFuture.h" 14 | 15 | /** 16 | * Class for the connection objects with discovered remote devices. 17 | * All methods and properties of this class must be accessed 18 | * only on the delegate queue of corresponding UDTransport. 19 | */ 20 | @protocol UDLink 21 | 22 | /** 23 | * nodeId of remote device 24 | */ 25 | @property (nonatomic, readonly) int64_t nodeId; 26 | 27 | @property (nonatomic, readonly) int16_t priority; // Lower value means higher priority (like unix nice). 28 | 29 | @property (nonatomic, readonly) bool slowLink; 30 | 31 | /** 32 | * Disconnects remote device after all pending output frame have been sent to it. 33 | */ 34 | - (void) disconnect; 35 | 36 | /** 37 | * Begins long transfer. 38 | * Specifically, disables Bluetooth discovery and advertisement 39 | * for the duration of the transfer to speed it up. 40 | * Each call to this method must be balanced by call to [longTransferEnd]. 41 | * If link disconnects, you don't need to call this method 42 | * — all previous calls to [longTransferBegin] are balanced automatically. 43 | * * @see longTransferEnd 44 | */ 45 | - (void) longTransferBegin; 46 | 47 | /** 48 | * Finishes long transfer. 49 | * Specifically, enables back Bluetooth discovery and advertisement. 50 | * Each call to this method must correspond to 51 | * previously called [longTransferBegin]. 52 | * If link disconnects, you don't need to call this method 53 | * — all previous calls to [longTransferBegin] are balanced automatically. 54 | * @see longTransferBegin 55 | */ 56 | - (void) longTransferEnd; 57 | 58 | /** 59 | * Sends bytes to remote device as single atomic frame. 60 | * @param frameData bytes to send. 61 | */ 62 | - (nonnull UDFuture*) sendFrame:(nonnull NSData*)frameData; 63 | 64 | /** 65 | * Sends bytes to remote device as single atomic frame. 66 | * @param dataSource data source with bytes to send. 67 | */ 68 | - (nonnull UDFuture*) sendFrameWithSource:(nonnull UDSource*)source; 69 | 70 | @end 71 | 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDLogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | typedef NS_OPTIONS(NSUInteger, UDLogFlag) { 18 | UDLogFlagError = (1 << 0), // 0...00001 19 | UDLogFlagWarning = (1 << 1), // 0...00010 20 | UDLogFlagInfo = (1 << 2), // 0...00100 21 | UDLogFlagDebug = (1 << 3), // 0...01000 22 | UDLogFlagVerbose = (1 << 4) // 0...10000 23 | }; 24 | 25 | typedef NS_ENUM(NSUInteger, UDLogLevel) { 26 | UDLogLevelOff = 0, 27 | UDLogLevelError = (UDLogFlagError), // 0...00001 28 | UDLogLevelWarning = (UDLogLevelError | UDLogFlagWarning), // 0...00011 29 | UDLogLevelInfo = (UDLogLevelWarning | UDLogFlagInfo), // 0...00111 30 | UDLogLevelDebug = (UDLogLevelInfo | UDLogFlagDebug), // 0...01111 31 | UDLogLevelVerbose = (UDLogLevelDebug | UDLogFlagVerbose), // 0...11111 32 | UDLogLevelAll = NSUIntegerMax // 1111....11111 (DDLogLevelVerbose plus any other flags) 33 | }; 34 | 35 | @protocol UDLogger 36 | 37 | - (void)log:(BOOL)asynchronous 38 | level:(UDLogLevel)level 39 | flag:(UDLogFlag)flag 40 | context:(NSInteger)context 41 | file:(const char * _Null_unspecified)file 42 | function:(const char * _Null_unspecified)function 43 | line:(NSUInteger)line 44 | tag:(id _Nullable)tag 45 | message:(NSString * _Nonnull)message; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "UDFuture.h" 18 | 19 | @import Foundation; 20 | 21 | @interface UDSource : NSObject 22 | 23 | /** 24 | * Future that retrieves source's data. 25 | */ 26 | @property (nonatomic, readonly, nonnull) UDFuture* future; 27 | 28 | /** 29 | * Unique ID for the data being sent (can be nil). 30 | * Used for automatic data sharing between links. 31 | */ 32 | @property (nonatomic, readonly, nullable) NSString* dataId; 33 | 34 | - (nullable instancetype) init NS_UNAVAILABLE; 35 | 36 | - (nonnull instancetype) initWithFuture:(nonnull UDFuture*)future 37 | dataId:(nullable NSString*)dataId NS_DESIGNATED_INITIALIZER; 38 | - (nonnull instancetype) initWithFuture:(nonnull UDFuture*)future; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDTimer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013 MindSnacks 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | */ 10 | 11 | #import 12 | 13 | /** 14 | `UDTimer` behaves similar to an `NSTimer` but doesn't retain the target. 15 | This timer is implemented using GCD, so you can schedule and unschedule it on arbitrary queues (unlike regular NSTimers!) 16 | */ 17 | @interface UDTimer : NSObject 18 | 19 | /** 20 | * Creates a timer with the specified parameters and waits for a call to `-schedule` to start ticking. 21 | * @note It's safe to retain the returned timer by the object that is also the target. 22 | * or the provided `dispatchQueue`. 23 | * @param timeInterval how frequently `selector` will be invoked on `target`. If the timer doens't repeat, it will only be invoked once, approximately `timeInterval` seconds from the time you call this method. 24 | * @param repeats if `YES`, `selector` will be invoked on `target` until the `UDTimer` object is deallocated or until you call `invalidate`. If `NO`, it will only be invoked once. 25 | * @param dispatchQueue the queue where the delegate method will be dispatched. It can be either a serial or concurrent queue. 26 | * @see `invalidate`. 27 | */ 28 | - (id)initWithTimeInterval:(NSTimeInterval)timeInterval 29 | target:(id)target 30 | selector:(SEL)selector 31 | userInfo:(id)userInfo 32 | repeats:(BOOL)repeats 33 | dispatchQueue:(dispatch_queue_t)dispatchQueue; 34 | 35 | /** 36 | * Creates an `UDTimer` object and schedules it to start ticking inmediately. 37 | */ 38 | + (instancetype)scheduledTimerWithTimeInterval:(NSTimeInterval)timeInterval 39 | target:(id)target 40 | selector:(SEL)selector 41 | userInfo:(id)userInfo 42 | repeats:(BOOL)repeats 43 | dispatchQueue:(dispatch_queue_t)dispatchQueue; 44 | 45 | /** 46 | * Starts the timer if it hadn't been schedule yet. 47 | * @warning calling this method on an already scheduled timer results in undefined behavior. 48 | */ 49 | - (void)schedule; 50 | 51 | /** 52 | * Sets the amount of time after the scheduled fire date that the timer may fire to the given interval. 53 | * @discussion Setting a tolerance for a timer allows it to fire later than the scheduled fire date, improving the ability of the system to optimize for increased power savings and responsiveness. The timer may fire at any time between its scheduled fire date and the scheduled fire date plus the tolerance. The timer will not fire before the scheduled fire date. For repeating timers, the next fire date is calculated from the original fire date regardless of tolerance applied at individual fire times, to avoid drift. The default value is zero, which means no additional tolerance is applied. The system reserves the right to apply a small amount of tolerance to certain timers regardless of the value of this property. 54 | As the user of the timer, you will have the best idea of what an appropriate tolerance for a timer may be. A general rule of thumb, though, is to set the tolerance to at least 10% of the interval, for a repeating timer. Even a small amount of tolerance will have a significant positive impact on the power usage of your application. The system may put a maximum value of the tolerance. 55 | */ 56 | @property (atomic, assign) NSTimeInterval tolerance; 57 | 58 | /** 59 | * Causes the timer to be fired synchronously manually on the queue from which you call this method. 60 | * You can use this method to fire a repeating timer without interrupting its regular firing schedule. 61 | * If the timer is non-repeating, it is automatically invalidated after firing, even if its scheduled fire date has not arrived. 62 | */ 63 | - (void)fire; 64 | 65 | /** 66 | * You can call this method on repeatable timers in order to stop it from running and trying 67 | * to call the delegate method. 68 | * @note `UDTimer` won't invoke the `selector` on `target` again after calling this method. 69 | * You can call this method from any queue, it doesn't have to be the queue from where you scheduled it. 70 | * Since it doesn't retain the delegate, unlike a regular `NSTimer`, your `dealloc` method will actually be called 71 | * and it's easier to place the `invalidate` call there, instead of figuring out a safe place to do it. 72 | */ 73 | - (void)invalidate; 74 | 75 | - (id)userInfo; 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDTransport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "UDLink.h" 18 | 19 | extern NSString* _Nonnull UDBluetoothRequiredNotification; 20 | extern NSString* _Nonnull UDBeaconDetectedNotification; 21 | 22 | /** 23 | * Abstract transport protocol, which can aggregate multiple 24 | * network communication protocols. 25 | * All methods of this class must be called via same queue 26 | * that was supplied when creating its object. 27 | */ 28 | @protocol UDTransport; 29 | 30 | /** 31 | * UDTransport callback delegate. 32 | * All methods of this interface will be called on UDTransport's queue. 33 | * @see UDLink 34 | * @see UDTransport 35 | */ 36 | @protocol UDTransportDelegate 37 | 38 | /** 39 | * Called when transport discovered new device and established connection with it. 40 | * @param transport transport instance that discovered the device 41 | * @param link connection object to discovered device 42 | */ 43 | - (void) transport:(nonnull id)transport linkConnected:(nonnull id)link; 44 | 45 | /** 46 | * Called when connection to device is closed explicitly from either side 47 | * or because device is out of range. 48 | * @param transport transport instance that lost the device 49 | * @param link connection object to disconnected device 50 | */ 51 | - (void) transport:(nonnull id)transport linkDisconnected:(nonnull id)link; 52 | 53 | /** 54 | * Called when new data frame is received from remote device. 55 | * @param transport transport instance that connected to the device 56 | * @param link connection object for the device 57 | * @param frameData frame data received from remote device 58 | * @see [UDLink sendFrame:] 59 | */ 60 | - (void) transport:(nonnull id)transport link:(nonnull id)link didReceiveFrame:(nonnull NSData*)frameData; 61 | 62 | @end 63 | 64 | @protocol UDTransport 65 | 66 | @property (nonatomic, weak, nullable) id delegate; 67 | @property (nonatomic, readonly, nonnull) dispatch_queue_t queue; 68 | 69 | /** 70 | * Starts underlying network advertising and discovery. 71 | * For each call of this method there must be corresponding 72 | * stop call. 73 | */ 74 | - (void) start; 75 | 76 | /** 77 | * Stops network advertising and discovery 78 | * and disconnects all links. 79 | * For each call of this method there must be corresponding 80 | * start call previously. 81 | */ 82 | - (void) stop; 83 | 84 | @end 85 | 86 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDTransport.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | #import "UDTransport.h" 20 | 21 | NSString* UDBluetoothRequiredNotification = @"UDBluetoothRequiredNotification"; 22 | NSString* UDBeaconDetectedNotification = @"UDBeaconDetectedNotification"; 23 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDUnderdark.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | #import "UDLogger.h" 20 | #import "UDTransport.h" 21 | 22 | typedef NS_ENUM(NSUInteger, UDTransportKind) { 23 | UDTransportKindWifi = (1 << 0), 24 | UDTransportKindBluetooth = (1 << 1) 25 | }; 26 | 27 | /** 28 | * Entry point for Underdark framework. 29 | * Methods of this class allow you to configure transport object 30 | * for communitcation with apps on other devices. 31 | */ 32 | @interface UDUnderdark : NSObject 33 | 34 | + (nullable id) logger; 35 | + (void) setLogger:(nullable id)logger; 36 | 37 | /** 38 | * Configures aggregate UDTransport that supports communication through given protocols. 39 | * It must be started via [UDTransport start] before use 40 | * and stopped via [UDTransport stop] when is no longer needed. 41 | * You must set transport's delegate property before using it. 42 | * @param appId identifier for current application. Must be same across all devices. 43 | * @param nodeId globally unique identifier of curent device. 44 | * @param queue queue which will be used to dispatch delegate callbacks. 45 | * Supply nil if you want to receive callbacks on main thread. 46 | * @param kinds 0 or more NSNumber values of UDTransportKind 47 | * for communication protocols. 48 | * @return transport that communicates via specified protocols and uses given delegate for callbacks. 49 | * All methods of returned UDTransport object must be called on supplied queue. 50 | */ 51 | + (nonnull id) configureTransportWithAppId:(int32_t)appId 52 | nodeId:(int64_t)nodeId 53 | queue:(nonnull dispatch_queue_t)queue 54 | kinds:(nonnull NSArray*)kinds; 55 | @end 56 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDUnderdark.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "UDUnderdark.h" 18 | 19 | #import "UDLogging.h" 20 | #import "UDAggTransport.h" 21 | #import "UDBonjourAdapter.h" 22 | #import "UDNsdAdapter.h" 23 | 24 | static id underdarkLogger = nil; 25 | 26 | @interface UDUnderdark() 27 | 28 | @end 29 | 30 | @implementation UDUnderdark 31 | 32 | + (id) logger 33 | { 34 | return underdarkLogger; 35 | } 36 | 37 | + (void) setLogger:(id)logger 38 | { 39 | underdarkLogger = logger; 40 | } 41 | 42 | + (id) configureTransportWithAppId:(int32_t)appId 43 | nodeId:(int64_t)nodeId 44 | queue:(dispatch_queue_t)queue 45 | kinds:(NSArray*)kinds 46 | { 47 | if(appId < 0) 48 | appId = -appId; 49 | 50 | if (queue == nil) { 51 | queue = dispatch_get_main_queue(); 52 | } 53 | 54 | UDAggTransport* transport = 55 | [[UDAggTransport alloc] initWithAppId:appId nodeId:nodeId queue:queue]; 56 | 57 | /*id adapter = [[UDNsdAdapter alloc] initWithDelegate:aggTransport appId:appId nodeId:nodeId peerToPeer:false queue:aggTransport.ioqueue]; 58 | [transport addAdapter:adapter]; 59 | return transport;*/ 60 | 61 | if([kinds containsObject:@(UDTransportKindBluetooth)]) 62 | { 63 | id adapter = [[UDBonjourAdapter alloc] initWithAppId:appId nodeId:nodeId delegate:transport queue:transport.ioqueue peerToPeer:true]; 64 | 65 | [transport addAdapter:adapter]; 66 | } 67 | 68 | if([kinds containsObject:@(UDTransportKindWifi)]) 69 | { 70 | id adapter = [[UDBonjourAdapter alloc] initWithAppId:appId nodeId:nodeId delegate:transport queue:transport.ioqueue peerToPeer:false]; 71 | 72 | [transport addAdapter:adapter]; 73 | } 74 | 75 | return transport; 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/UDUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface UDUtil : NSObject 20 | 21 | + (int64_t) generateId; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Headers/Underdark.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Vladimir L. Shabanov 3 | * 4 | * Licensed under the Underdark License, Version 1.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://underdark.io/LICENSE.txt 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | //! Project version number for Underdark. 20 | FOUNDATION_EXPORT double UnderdarkVersionNumber; 21 | 22 | //! Project version string for Underdark. 23 | FOUNDATION_EXPORT const unsigned char UnderdarkVersionString[]; 24 | 25 | // In this header, you should import all the public headers of your framework using statements like #import 26 | 27 | #import 28 | #import 29 | #import 30 | #import 31 | #import 32 | 33 | #import 34 | 35 | #import 36 | #import 37 | #import 38 | #import 39 | #import 40 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udark/underdark-cocoa/cc7729df9d58515463ea53335e88e0424f43821e/Underdark/Underdark.framework/Info.plist -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Underdark { 2 | umbrella header "Underdark.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Underdark/Underdark.framework/Underdark: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/udark/underdark-cocoa/cc7729df9d58515463ea53335e88e0424f43821e/Underdark/Underdark.framework/Underdark --------------------------------------------------------------------------------