diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-09-26 01:35:13 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-09-26 01:35:13 +0200 |
| commit | 597fa051833ca3df6eb185c0143ff82e02dacba1 (patch) | |
| tree | cb25347477c57f82e955b054b70f4bb5359fb0d2 | |
| parent | 6a9186aea6b85beef28e3eb765fbf2322a1c7890 (diff) | |
push plugin ugh
808 files changed, 64981 insertions, 14148 deletions
diff --git a/StoneIsland/.ruby-version b/StoneIsland/.ruby-version index bec3a35e..197c4d5c 100644 --- a/StoneIsland/.ruby-version +++ b/StoneIsland/.ruby-version @@ -1 +1 @@ -system +2.4.0 diff --git a/StoneIsland/config.xml b/StoneIsland/config.xml index 5126ce0e..2a2871f1 100755 --- a/StoneIsland/config.xml +++ b/StoneIsland/config.xml @@ -41,25 +41,24 @@ <preference name="BackupWebStorage" value="local" /> <preference name="KeyboardDisplayRequiresUserAction" value="false" /> </platform> - <plugin name="cordova-plugin-inappbrowser" spec="~1.5.0" /> - <plugin name="cordova-plugin-x-socialsharing" spec="~5.1.3" /> + <engine name="android" spec="^6.2.3" /> + <engine name="ios" spec="^4.4.0" /> + <plugin name="cordova-plugin-app-name" spec="^1.0.4"> + <variable name="APP_NAME" value="Stone Island" /> + </plugin> + <plugin name="cordova-plugin-console" spec="~1.0.4" /> <plugin name="cordova-plugin-customurlscheme" spec="~4.2.0"> <variable name="URL_SCHEME" value="stoneisland" /> </plugin> - <plugin name="cordova-plugin-whitelist" spec="1" /> - <plugin name="cordova-plugin-console" spec="~1.0.4" /> <plugin name="cordova-plugin-device" spec="~1.1.3" /> - <plugin name="cordova-plugin-network-information" spec="~1.3.0" /> <plugin name="cordova-plugin-dialogs" spec="~1.3.0" /> - <plugin name="cordova-plugin-splashscreen" spec="~4.0.0" /> <plugin name="cordova-plugin-geolocation" spec="~2.4.0" /> + <plugin name="cordova-plugin-inappbrowser" spec="~1.5.0" /> + <plugin name="cordova-plugin-network-information" spec="~1.3.0" /> + <plugin name="cordova-plugin-splashscreen" spec="~4.0.0" /> + <plugin name="cordova-plugin-statusbar" spec="^2.2.3" /> + <plugin name="cordova-plugin-whitelist" spec="1" /> + <plugin name="cordova-plugin-x-socialsharing" spec="~5.1.3" /> <plugin name="ionic-plugin-keyboard" spec="~2.2.1" /> - <plugin name="phonegap-plugin-push" spec="~1.9.2"> - <variable name="SENDER_ID" value="XXXXXXX" /> - </plugin> - <plugin name="cordova-plugin-statusbar" spec="~2.2.3" /> - <plugin name="cordova-plugin-firebase" spec="~0.1.24" /> - <plugin name="cordova-plugin-app-name" spec="~1.0.4"> - <variable name="APP_NAME" value="Stone Island" /> - </plugin> + <plugin name="phonegap-plugin-push" spec="^2.0.0" /> </widget> diff --git a/StoneIsland/package-lock.json b/StoneIsland/package-lock.json index 7de9b28c..617a395b 100644 --- a/StoneIsland/package-lock.json +++ b/StoneIsland/package-lock.json @@ -137,6 +137,11 @@ "version": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" }, + "babel-plugin-add-header-comment": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/babel-plugin-add-header-comment/-/babel-plugin-add-header-comment-1.0.3.tgz", + "integrity": "sha1-URxJAQYmQNWkgLSsPt1pRBlYUOw=" + }, "balanced-match": { "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=" @@ -592,6 +597,215 @@ "update-notifier": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz" } }, + "cordova-android": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/cordova-android/-/cordova-android-6.2.3.tgz", + "integrity": "sha1-JJ8hts5fHxyEenq4OxaQnb7Vqig=", + "requires": { + "cordova-common": "2.0.2", + "elementtree": "0.1.6", + "nopt": "3.0.6", + "properties-parser": "0.2.3", + "q": "1.5.0", + "shelljs": "0.5.3" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true + }, + "ansi": { + "version": "0.3.1", + "bundled": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true + }, + "base64-js": { + "version": "0.0.8", + "bundled": true + }, + "big-integer": { + "version": "1.6.22", + "bundled": true + }, + "bplist-parser": { + "version": "0.1.1", + "bundled": true, + "requires": { + "big-integer": "1.6.22" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "cordova-common": { + "version": "2.0.2", + "bundled": true, + "requires": { + "ansi": "0.3.1", + "bplist-parser": "0.1.1", + "cordova-registry-mapper": "1.1.15", + "elementtree": "0.1.6", + "glob": "5.0.15", + "minimatch": "3.0.3", + "osenv": "0.1.4", + "plist": "1.2.0", + "q": "1.5.0", + "semver": "5.3.0", + "shelljs": "0.5.3", + "underscore": "1.8.3", + "unorm": "1.4.1" + } + }, + "cordova-registry-mapper": { + "version": "1.1.15", + "bundled": true + }, + "elementtree": { + "version": "0.1.6", + "bundled": true, + "requires": { + "sax": "0.3.5" + } + }, + "glob": { + "version": "5.0.15", + "bundled": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.3", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "lodash": { + "version": "3.10.1", + "bundled": true + }, + "minimatch": { + "version": "3.0.3", + "bundled": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "nopt": { + "version": "3.0.6", + "bundled": true, + "requires": { + "abbrev": "1.1.0" + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "plist": { + "version": "1.2.0", + "bundled": true, + "requires": { + "base64-js": "0.0.8", + "util-deprecate": "1.0.2", + "xmlbuilder": "4.0.0", + "xmldom": "0.1.27" + } + }, + "properties-parser": { + "version": "0.2.3", + "bundled": true + }, + "q": { + "version": "1.5.0", + "bundled": true + }, + "sax": { + "version": "0.3.5", + "bundled": true + }, + "semver": { + "version": "5.3.0", + "bundled": true + }, + "shelljs": { + "version": "0.5.3", + "bundled": true + }, + "underscore": { + "version": "1.8.3", + "bundled": true + }, + "unorm": { + "version": "1.4.1", + "bundled": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "xmlbuilder": { + "version": "4.0.0", + "bundled": true, + "requires": { + "lodash": "3.10.1" + } + }, + "xmldom": { + "version": "0.1.27", + "bundled": true + } + } + }, "cordova-app-hello-world": { "version": "https://registry.npmjs.org/cordova-app-hello-world/-/cordova-app-hello-world-3.11.0.tgz", "integrity": "sha1-khT+ud1xPKSBocurzuymCWbBwM8=" @@ -682,291 +896,353 @@ } }, "cordova-ios": { - "version": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-4.3.1.tgz", - "integrity": "sha1-e+zJUBROx6wfVgzphesHv+4bd/E=", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-4.4.0.tgz", + "integrity": "sha1-XNbvciRQXbVYRG5GN62X0IeMdO8=", "requires": { - "cordova-common": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.5.1.tgz", - "ios-sim": "https://registry.npmjs.org/ios-sim/-/ios-sim-5.0.12.tgz", - "nopt": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "plist": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz", - "q": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "shelljs": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", - "xcode": "https://registry.npmjs.org/xcode/-/xcode-0.8.9.tgz" + "cordova-common": "2.0.2", + "ios-sim": "5.0.12", + "nopt": "3.0.6", + "plist": "1.2.0", + "q": "1.4.1", + "shelljs": "0.5.3", + "xcode": "0.9.3", + "xml-escape": "1.1.0" }, "dependencies": { "abbrev": { - "version": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=" + "version": "1.0.9", + "bundled": true }, "ansi": { - "version": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", - "integrity": "sha1-DELU+xcWDVqa8eSEus4cZpIsGyE=" + "version": "0.3.1", + "bundled": true }, "balanced-match": { - "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=" + "version": "0.4.2", + "bundled": true }, "base64-js": { - "version": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", - "integrity": "sha1-EQHpVE9KdrG8OybUUsqW16NeeXg=" + "version": "0.0.8", + "bundled": true }, "big-integer": { - "version": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.17.tgz", - "integrity": "sha1-8Nz1EJqUnkKpk+4+j7IHBFKBe1E=" + "version": "1.6.17", + "bundled": true }, "bplist-creator": { - "version": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.4.tgz", - "integrity": "sha1-SsBJZ4LhJ6hcHSAmpPXrIqev+ZE=", + "version": "0.0.4", + "bundled": true, "requires": { - "stream-buffers": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-0.2.6.tgz" + "stream-buffers": "0.2.6" } }, "bplist-parser": { - "version": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz", - "integrity": "sha1-1g1dzCDLptx+HymbNdPh+V2vuuY=", + "version": "0.1.1", + "bundled": true, "requires": { - "big-integer": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.17.tgz" + "big-integer": "1.6.17" } }, "brace-expansion": { - "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "integrity": "sha1-cZfX6qm4fmSDkOph/GbIRCdCDfk=", + "version": "1.1.6", + "bundled": true, "requires": { - "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "0.4.2", + "concat-map": "0.0.1" } }, "concat-map": { - "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "version": "0.0.1", + "bundled": true }, "cordova-common": { - "version": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.5.1.tgz", - "integrity": "sha1-Z3DeDWIArW+Uoavok5tb2ezhOeM=", + "version": "2.0.2", + "bundled": true, "requires": { - "ansi": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", - "bplist-parser": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz", - "cordova-registry-mapper": "https://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz", - "elementtree": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz", - "glob": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "osenv": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz", - "plist": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz", - "q": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "semver": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "shelljs": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", - "underscore": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "unorm": "https://registry.npmjs.org/unorm/-/unorm-1.4.1.tgz" + "ansi": "0.3.1", + "bplist-parser": "0.1.1", + "cordova-registry-mapper": "1.1.15", + "elementtree": "0.1.6", + "glob": "5.0.15", + "minimatch": "3.0.3", + "osenv": "0.1.3", + "plist": "1.2.0", + "q": "1.4.1", + "semver": "5.3.0", + "shelljs": "0.5.3", + "underscore": "1.8.3", + "unorm": "1.4.1" } }, "cordova-registry-mapper": { - "version": "https://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz", - "integrity": "sha1-4kS5GFuBdUc7/2B5MkkFEV+D3Hw=" + "version": "1.1.15", + "bundled": true }, "elementtree": { - "version": "https://registry.npmjs.org/elementtree/-/elementtree-0.1.6.tgz", - "integrity": "sha1-KsTEbqMFFsjEy9teOsdBjlkt4gw=", + "version": "0.1.6", + "bundled": true, "requires": { - "sax": "https://registry.npmjs.org/sax/-/sax-0.3.5.tgz" + "sax": "0.3.5" } }, "glob": { - "version": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "version": "5.0.15", + "bundled": true, "requires": { - "inflight": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.3", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } }, "inflight": { - "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "version": "1.0.6", + "bundled": true, "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "once": "1.4.0", + "wrappy": "1.0.2" } }, "inherits": { - "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "version": "2.0.3", + "bundled": true }, "ios-sim": { - "version": "https://registry.npmjs.org/ios-sim/-/ios-sim-5.0.12.tgz", - "integrity": "sha1-CwdDbOG/Zjvamj+3VBL0Gh3sRls=", + "version": "5.0.12", + "bundled": true, "requires": { - "bplist-parser": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz", - "nopt": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz", - "plist": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz", - "simctl": "https://registry.npmjs.org/simctl/-/simctl-0.1.0.tgz" + "bplist-parser": "0.0.6", + "nopt": "1.0.9", + "plist": "1.2.0", + "simctl": "0.1.0" }, "dependencies": { "bplist-parser": { - "version": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz", - "integrity": "sha1-ONo0cYF9+dRKs4kuJ3B7u9daEbk=" + "version": "0.0.6", + "bundled": true }, "nopt": { - "version": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz", - "integrity": "sha1-O8DXy6e/sNWmdtvtfA6+SKT9RU4=", + "version": "1.0.9", + "bundled": true, "requires": { - "abbrev": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz" + "abbrev": "1.0.9" } } } }, "lodash": { - "version": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=" + "version": "3.10.1", + "bundled": true }, "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", + "version": "3.0.3", + "bundled": true, "requires": { - "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + "brace-expansion": "1.1.6" } }, "node-uuid": { - "version": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "integrity": "sha1-baWhdmjEs91ZYjvaEc9/pMH2Cm8=" + "version": "1.4.7", + "bundled": true }, "nopt": { - "version": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "version": "3.0.6", + "bundled": true, "requires": { - "abbrev": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz" + "abbrev": "1.0.9" } }, "once": { - "version": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "version": "1.4.0", + "bundled": true, "requires": { - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "wrappy": "1.0.2" } }, "os-homedir": { - "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + "version": "1.0.2", + "bundled": true }, "os-tmpdir": { - "version": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "version": "1.0.2", + "bundled": true }, "osenv": { - "version": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz", - "integrity": "sha1-g88FxtZFj8TVrGNi6jJdkvJ1Qhc=", + "version": "0.1.3", + "bundled": true, "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" } }, "path-is-absolute": { - "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "version": "1.0.1", + "bundled": true }, "pegjs": { - "version": "https://registry.npmjs.org/pegjs/-/pegjs-0.9.0.tgz", - "integrity": "sha1-9q76LjzlYWkgjlIXnf5B+JFBo2k=" + "version": "0.9.0", + "bundled": true }, "plist": { - "version": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz", - "integrity": "sha1-CEtQk93JJQbiWfh0uNmxr7jHlZM=", + "version": "1.2.0", + "bundled": true, "requires": { - "base64-js": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", - "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "xmlbuilder": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-4.0.0.tgz", - "xmldom": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz" + "base64-js": "0.0.8", + "util-deprecate": "1.0.2", + "xmlbuilder": "4.0.0", + "xmldom": "0.1.27" } }, "q": { - "version": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", - "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=" + "version": "1.4.1", + "bundled": true }, "sax": { - "version": "https://registry.npmjs.org/sax/-/sax-0.3.5.tgz", - "integrity": "sha1-iPz8H3PAyLvVt8d2ttPzUB7tBz0=" + "version": "0.3.5", + "bundled": true }, "semver": { - "version": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" + "version": "5.3.0", + "bundled": true }, "shelljs": { - "version": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", - "integrity": "sha1-xUmCuZbHbvDB5rWfvcWCX1txMRM=" + "version": "0.5.3", + "bundled": true }, "simctl": { - "version": "https://registry.npmjs.org/simctl/-/simctl-0.1.0.tgz", - "integrity": "sha1-reEzthbid/6ly8m6Q4qAUpuqaW0=", + "version": "0.1.0", + "bundled": true, "requires": { - "shelljs": "https://registry.npmjs.org/shelljs/-/shelljs-0.2.6.tgz", - "tail": "https://registry.npmjs.org/tail/-/tail-0.4.0.tgz" + "shelljs": "0.2.6", + "tail": "0.4.0" }, "dependencies": { "shelljs": { - "version": "https://registry.npmjs.org/shelljs/-/shelljs-0.2.6.tgz", - "integrity": "sha1-kEktcv/MgVmXa6umL7D2iE8MM3g=" + "version": "0.2.6", + "bundled": true } } }, "simple-plist": { - "version": "https://registry.npmjs.org/simple-plist/-/simple-plist-0.1.4.tgz", - "integrity": "sha1-EOtRtH4zxVbrjsRtXuZNZOcX210=", + "version": "0.1.4", + "bundled": true, "requires": { - "bplist-creator": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.4.tgz", - "bplist-parser": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz", - "plist": "https://registry.npmjs.org/plist/-/plist-1.2.0.tgz" + "bplist-creator": "0.0.4", + "bplist-parser": "0.0.6", + "plist": "1.2.0" }, "dependencies": { "bplist-parser": { - "version": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz", - "integrity": "sha1-ONo0cYF9+dRKs4kuJ3B7u9daEbk=" + "version": "0.0.6", + "bundled": true } } }, "stream-buffers": { - "version": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-0.2.6.tgz", - "integrity": "sha1-GBwI1bs2kARfaUAbmuanoM8zE/w=" + "version": "0.2.6", + "bundled": true }, "tail": { - "version": "https://registry.npmjs.org/tail/-/tail-0.4.0.tgz", - "integrity": "sha1-0p3nJ1DMmdseBTr/E8NZ7PtxMAI=" + "version": "0.4.0", + "bundled": true }, "underscore": { - "version": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + "version": "1.8.3", + "bundled": true }, "unorm": { - "version": "https://registry.npmjs.org/unorm/-/unorm-1.4.1.tgz", - "integrity": "sha1-NkIA1fE2RsqLzURJAnEzVhR5IwA=" + "version": "1.4.1", + "bundled": true }, "util-deprecate": { - "version": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "version": "1.0.2", + "bundled": true }, "wrappy": { - "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "version": "1.0.2", + "bundled": true }, "xcode": { - "version": "https://registry.npmjs.org/xcode/-/xcode-0.8.9.tgz", - "integrity": "sha1-7Gdl9w6dzMzJ9umlubTn6BS0zzU=", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/xcode/-/xcode-0.9.3.tgz", + "integrity": "sha1-kQqJwWrubMC0LKgFptC0z4chHPM=", "requires": { - "node-uuid": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", - "pegjs": "https://registry.npmjs.org/pegjs/-/pegjs-0.9.0.tgz", - "simple-plist": "https://registry.npmjs.org/simple-plist/-/simple-plist-0.1.4.tgz" + "pegjs": "0.10.0", + "simple-plist": "0.2.1", + "uuid": "3.0.1" + }, + "dependencies": { + "base64-js": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.1.2.tgz", + "integrity": "sha1-1kAMrBxMZgl22Q0HoENR2JOV9eg=" + }, + "bplist-creator": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.7.tgz", + "integrity": "sha1-N98VNgkoJLh8QvlXsBNEEXNyrkU=", + "requires": { + "stream-buffers": "2.2.0" + } + }, + "pegjs": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", + "integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=" + }, + "plist": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/plist/-/plist-2.0.1.tgz", + "integrity": "sha1-CjLKlIGxw2TpLhjcVch23p0B2os=", + "requires": { + "base64-js": "1.1.2", + "xmlbuilder": "8.2.2", + "xmldom": "0.1.27" + } + }, + "simple-plist": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-0.2.1.tgz", + "integrity": "sha1-cXZts1IyaSjPOoByQrp2IyJjZyM=", + "requires": { + "bplist-creator": "0.0.7", + "bplist-parser": "0.1.1", + "plist": "2.0.1" + } + }, + "stream-buffers": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", + "integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=" + }, + "uuid": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.0.1.tgz", + "integrity": "sha1-ZUS7ot/ajBzxfmKaOjBeK7H+5sE=" + }, + "xmlbuilder": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", + "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=" + } } }, + "xml-escape": { + "version": "1.1.0", + "bundled": true + }, "xmlbuilder": { - "version": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-4.0.0.tgz", - "integrity": "sha1-mLj2UcowqmJANvEn0RzGbce5B6M=", + "version": "4.0.0", + "bundled": true, "requires": { - "lodash": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz" + "lodash": "3.10.1" } }, "xmldom": { - "version": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", - "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + "version": "0.1.27", + "bundled": true } } }, @@ -1048,10 +1324,45 @@ "xml2js": "0.4.19" } }, - "cordova-plugin-firebase": { - "version": "0.1.24", - "resolved": "https://registry.npmjs.org/cordova-plugin-firebase/-/cordova-plugin-firebase-0.1.24.tgz", - "integrity": "sha1-qZk6XHZxFQJM2IIJDuiBT6TvuYQ=" + "cordova-plugin-console": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cordova-plugin-console/-/cordova-plugin-console-1.0.7.tgz", + "integrity": "sha1-ibepLtHDNYiN/ADZAtxBcgHPOws=" + }, + "cordova-plugin-customurlscheme": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-customurlscheme/-/cordova-plugin-customurlscheme-4.2.0.tgz", + "integrity": "sha1-t6Zu5fwmrGN0iDVTdgZHFjo30Hs=" + }, + "cordova-plugin-device": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-1.1.6.tgz", + "integrity": "sha1-LSF2TK18m4AVI+TgmjDgJLJJM0s=" + }, + "cordova-plugin-dialogs": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/cordova-plugin-dialogs/-/cordova-plugin-dialogs-1.3.3.tgz", + "integrity": "sha1-Uy/y61yGEzpYeFUNrlnHarOX+Mk=" + }, + "cordova-plugin-geolocation": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/cordova-plugin-geolocation/-/cordova-plugin-geolocation-2.4.3.tgz", + "integrity": "sha1-HdAAI9Hxos4zD4dn7Qj3tzj+cYQ=" + }, + "cordova-plugin-inappbrowser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-inappbrowser/-/cordova-plugin-inappbrowser-1.5.0.tgz", + "integrity": "sha1-oq4xWM3YtGIc7LkdZHhDYCSci4o=" + }, + "cordova-plugin-network-information": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/cordova-plugin-network-information/-/cordova-plugin-network-information-1.3.3.tgz", + "integrity": "sha1-DqmqXBEkz3y9b4T4KKVCy9JKhRg=" + }, + "cordova-plugin-splashscreen": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/cordova-plugin-splashscreen/-/cordova-plugin-splashscreen-4.0.3.tgz", + "integrity": "sha1-dzzRNjwfO6y5kBZj6eN5PdPgoZ0=" }, "cordova-plugin-statusbar": { "version": "2.2.3", @@ -1063,6 +1374,11 @@ "resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.2.tgz", "integrity": "sha1-W2M1/rn1MB88ATuQlsuIhb29UHY=" }, + "cordova-plugin-x-socialsharing": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/cordova-plugin-x-socialsharing/-/cordova-plugin-x-socialsharing-5.1.8.tgz", + "integrity": "sha1-Q5odL0c2YnYogm5Rla5Tm1TmJIo=" + }, "cordova-registry-mapper": { "version": "https://registry.npmjs.org/cordova-registry-mapper/-/cordova-registry-mapper-1.1.15.tgz", "integrity": "sha1-4kS5GFuBdUc7/2B5MkkFEV+D3Hw=" @@ -1875,10 +2191,20 @@ } } }, + "install": { + "version": "0.8.9", + "resolved": "https://registry.npmjs.org/install/-/install-0.8.9.tgz", + "integrity": "sha1-n0tcDRhR74cunfheT3Fi1OXc2+0=" + }, "interpret": { "version": "https://registry.npmjs.org/interpret/-/interpret-1.0.1.tgz", "integrity": "sha1-1Xn7f2k7hYAElHrzn6DbSfeVYCw=" }, + "ionic-plugin-keyboard": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ionic-plugin-keyboard/-/ionic-plugin-keyboard-2.2.1.tgz", + "integrity": "sha1-8qnhabvptVIkADR8n9bTRn7j+hI=" + }, "ios-deploy": { "version": "https://registry.npmjs.org/ios-deploy/-/ios-deploy-1.9.1.tgz", "integrity": "sha1-597JUIu0ZKHy1Ua7B/raQdJwjmY=" @@ -3907,6 +4233,15 @@ "version": "https://registry.npmjs.org/pegjs/-/pegjs-0.9.0.tgz", "integrity": "sha1-9q76LjzlYWkgjlIXnf5B+JFBo2k=" }, + "phonegap-plugin-push": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/phonegap-plugin-push/-/phonegap-plugin-push-2.0.0.tgz", + "integrity": "sha1-FhKJtP3r0LUqTVoQUg0VYIPuz3M=", + "requires": { + "babel-plugin-add-header-comment": "1.0.3", + "install": "0.8.9" + } + }, "pinkie": { "version": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" diff --git a/StoneIsland/package.json b/StoneIsland/package.json index 5228669d..ae147cb7 100644 --- a/StoneIsland/package.json +++ b/StoneIsland/package.json @@ -5,12 +5,23 @@ "main": "index.js", "dependencies": { "cordova": "^6.4.0", - "cordova-ios": "^4.3.1", + "cordova-android": "^6.2.3", + "cordova-ios": "^4.4.0", "cordova-plugin-app-name": "^1.0.4", - "cordova-plugin-firebase": "^0.1.24", + "cordova-plugin-console": "~1.0.4", + "cordova-plugin-customurlscheme": "~4.2.0", + "cordova-plugin-device": "~1.1.3", + "cordova-plugin-dialogs": "~1.3.0", + "cordova-plugin-geolocation": "~2.4.0", + "cordova-plugin-inappbrowser": "~1.5.0", + "cordova-plugin-network-information": "~1.3.0", + "cordova-plugin-splashscreen": "~4.0.0", "cordova-plugin-statusbar": "^2.2.3", "cordova-plugin-whitelist": "1", - "ios-deploy": "^1.9.0" + "cordova-plugin-x-socialsharing": "~5.1.3", + "ionic-plugin-keyboard": "~2.2.1", + "ios-deploy": "^1.9.0", + "phonegap-plugin-push": "^2.0.0" }, "devDependencies": {}, "scripts": { @@ -23,10 +34,26 @@ "plugins": { "cordova-plugin-whitelist": {}, "cordova-plugin-statusbar": {}, - "cordova-plugin-firebase": {}, "cordova-plugin-app-name": { "APP_NAME": "Stone Island" - } - } + }, + "cordova-plugin-console": {}, + "cordova-plugin-customurlscheme": { + "URL_SCHEME": "stoneisland" + }, + "cordova-plugin-device": {}, + "cordova-plugin-dialogs": {}, + "cordova-plugin-geolocation": {}, + "cordova-plugin-inappbrowser": {}, + "cordova-plugin-network-information": {}, + "cordova-plugin-splashscreen": {}, + "cordova-plugin-x-socialsharing": {}, + "ionic-plugin-keyboard": {}, + "phonegap-plugin-push": {} + }, + "platforms": [ + "android", + "ios" + ] } }
\ No newline at end of file diff --git a/StoneIsland/platforms/android/AndroidManifest.xml b/StoneIsland/platforms/android/AndroidManifest.xml index dbd8afc1..bb6ffaef 100755 --- a/StoneIsland/platforms/android/AndroidManifest.xml +++ b/StoneIsland/platforms/android/AndroidManifest.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<manifest android:hardwareAccelerated="true" android:versionCode="6000" android:versionName="0.8.4" package="us.okfoc.stoneisland" xmlns:android="http://schemas.android.com/apk/res/android"> +<manifest android:hardwareAccelerated="true" android:versionCode="6090" android:versionName="0.9.0" package="us.okfoc.stoneisland" xmlns:android="http://schemas.android.com/apk/res/android"> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true"> @@ -23,48 +23,23 @@ </activity> <activity android:exported="true" android:name="com.adobe.phonegap.push.PushHandlerActivity" android:permission="${applicationId}.permission.PushHandlerActivity" /> <receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler" /> - <receiver android:exported="true" android:name="com.google.android.gms.gcm.GcmReceiver" android:permission="com.google.android.c2dm.permission.SEND"> - <intent-filter> - <action android:name="com.google.android.c2dm.intent.RECEIVE" /> - <category android:name="${applicationId}" /> - </intent-filter> - </receiver> - <service android:exported="false" android:name="com.adobe.phonegap.push.GCMIntentService"> - <intent-filter> - <action android:name="com.google.android.c2dm.intent.RECEIVE" /> - </intent-filter> - </service> - <service android:exported="false" android:name="com.adobe.phonegap.push.PushInstanceIDListenerService"> - <intent-filter> - <action android:name="com.google.android.gms.iid.InstanceID" /> - </intent-filter> - </service> - <service android:exported="false" android:name="com.adobe.phonegap.push.RegistrationIntentService" /> - <service android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementService" /> - <service android:name="org.apache.cordova.firebase.FirebasePluginMessagingService"> + <receiver android:name="com.adobe.phonegap.push.PushDismissedHandler" /> + <service android:name="com.adobe.phonegap.push.FCMService"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> - <service android:name="org.apache.cordova.firebase.FirebasePluginInstanceIDService"> + <service android:name="com.adobe.phonegap.push.PushInstanceIDListenerService"> <intent-filter> <action android:name="com.google.firebase.INSTANCE_ID_EVENT" /> </intent-filter> </service> - <receiver android:name="org.apache.cordova.firebase.OnNotificationOpenReceiver" /> </application> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="22" /> - <uses-permission android:name="android.permission.WAKE_LOCK" /> - <uses-permission android:name="android.permission.VIBRATE" /> - <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> - <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-feature android:name="android.hardware.location.gps" /> - <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /> - <uses-permission android:name="${applicationId}.permission.PushHandlerActivity" /> - <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" /> - <permission android:name="${applicationId}.permission.PushHandlerActivity" android:protectionLevel="signature" /> - <uses-permission android:name="android.permission.INTERNET" /> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> + <uses-permission android:name="android.permission.VIBRATE" /> </manifest> diff --git a/StoneIsland/platforms/android/CordovaLib/build.gradle b/StoneIsland/platforms/android/CordovaLib/build.gradle index 3ff6191b..da3b45bf 100644 --- a/StoneIsland/platforms/android/CordovaLib/build.gradle +++ b/StoneIsland/platforms/android/CordovaLib/build.gradle @@ -16,27 +16,31 @@ under the License. */ - +ext { + apply from: 'cordova.gradle' + cdvCompileSdkVersion = privateHelpers.getProjectTarget() + cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools() +} buildscript { repositories { mavenCentral() - jcenter(); + jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' } - } apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' +apply plugin: 'com.jfrog.bintray' -ext { - apply from: 'cordova.gradle' - cdvCompileSdkVersion = privateHelpers.getProjectTarget() - cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools() -} +group = 'org.apache.cordova' +version = '6.2.3' android { compileSdkVersion cdvCompileSdkVersion @@ -59,4 +63,73 @@ android { assets.srcDirs = ['assets'] } } + + packagingOptions { + exclude 'META-INF/LICENSE' + exclude 'META-INF/LICENSE.txt' + exclude 'META-INF/DEPENDENCIES' + exclude 'META-INF/NOTICE' + } +} + +install { + repositories.mavenInstaller { + pom { + project { + packaging 'aar' + name 'Cordova' + url 'https://cordova.apache.org' + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + developers { + developer { + id 'stevengill' + name 'Steve Gill' + } + } + scm { + connection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git' + developerConnection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git' + url 'https://git-wip-us.apache.org/repos/asf?p=cordova-android' + + } + } + } + } +} + +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +artifacts { + archives sourcesJar +} + +bintray { + user = System.getenv('BINTRAY_USER') + key = System.getenv('BINTRAY_KEY') + configurations = ['archives'] + pkg { + repo = 'maven' + name = 'cordova-android' + userOrg = 'cordova' + licenses = ['Apache-2.0'] + vcsUrl = 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git' + websiteUrl = 'https://cordova.apache.org' + issueTrackerUrl = 'https://issues.apache.org/jira/browse/CB' + publicDownloadNumbers = true + licenses = ['Apache-2.0'] + labels = ['android', 'cordova', 'phonegap'] + version { + name = '6.2.3' + released = new Date() + vcsTag = '6.2.3' + } + } } diff --git a/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java b/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java index 2eebd0d3..713884b9 100644 --- a/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java +++ b/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java @@ -31,7 +31,7 @@ import android.webkit.WebChromeClient.CustomViewCallback; * are not expected to implement it. */ public interface CordovaWebView { - public static final String CORDOVA_VERSION = "6.1.2"; + public static final String CORDOVA_VERSION = "6.2.3"; void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, CordovaPreferences preferences); diff --git a/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java b/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java index 61d04f17..a8f59fad 100755 --- a/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java +++ b/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/NativeToJsMessageQueue.java @@ -488,6 +488,34 @@ public class NativeToJsMessageQueue { encodeAsMessageHelper(sb, pluginResult); } + void buildJsMessage(StringBuilder sb) { + switch (pluginResult.getMessageType()) { + case PluginResult.MESSAGE_TYPE_MULTIPART: + int size = pluginResult.getMultipartMessagesSize(); + for (int i=0; i<size; i++) { + PluginResult subresult = pluginResult.getMultipartMessage(i); + JsMessage submessage = new JsMessage(subresult, jsPayloadOrCallbackId); + submessage.buildJsMessage(sb); + if (i < (size-1)) { + sb.append(","); + } + } + break; + case PluginResult.MESSAGE_TYPE_BINARYSTRING: + sb.append("atob('") + .append(pluginResult.getMessage()) + .append("')"); + break; + case PluginResult.MESSAGE_TYPE_ARRAYBUFFER: + sb.append("cordova.require('cordova/base64').toArrayBuffer('") + .append(pluginResult.getMessage()) + .append("')"); + break; + default: + sb.append(pluginResult.getMessage()); + } + } + void encodeAsJsMessage(StringBuilder sb) { if (pluginResult == null) { sb.append(jsPayloadOrCallbackId); @@ -495,29 +523,16 @@ public class NativeToJsMessageQueue { int status = pluginResult.getStatus(); boolean success = (status == PluginResult.Status.OK.ordinal()) || (status == PluginResult.Status.NO_RESULT.ordinal()); sb.append("cordova.callbackFromNative('") - .append(jsPayloadOrCallbackId) - .append("',") - .append(success) - .append(",") - .append(status) - .append(",["); - switch (pluginResult.getMessageType()) { - case PluginResult.MESSAGE_TYPE_BINARYSTRING: - sb.append("atob('") - .append(pluginResult.getMessage()) - .append("')"); - break; - case PluginResult.MESSAGE_TYPE_ARRAYBUFFER: - sb.append("cordova.require('cordova/base64').toArrayBuffer('") - .append(pluginResult.getMessage()) - .append("')"); - break; - default: - sb.append(pluginResult.getMessage()); - } + .append(jsPayloadOrCallbackId) + .append("',") + .append(success) + .append(",") + .append(status) + .append(",["); + buildJsMessage(sb); sb.append("],") - .append(pluginResult.getKeepCallback()) - .append(");"); + .append(pluginResult.getKeepCallback()) + .append(");"); } } } diff --git a/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java b/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java index 0fa02767..3be7d940 100755 --- a/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java +++ b/StoneIsland/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java @@ -210,6 +210,11 @@ public class SystemWebViewEngine implements CordovaWebViewEngine { settings.setAppCachePath(databasePath); settings.setAppCacheEnabled(true); + // Enable scaling + // Fix for CB-12015 + settings.setUseWideViewPort(true); + settings.setLoadWithOverviewMode(true); + // Fix for CB-1405 // Google issue 4641 String defaultUserAgent = settings.getUserAgentString(); diff --git a/StoneIsland/platforms/android/android.json b/StoneIsland/platforms/android/android.json index 11c3ca04..d0e21212 100755 --- a/StoneIsland/platforms/android/android.json +++ b/StoneIsland/platforms/android/android.json @@ -49,15 +49,11 @@ "count": 1 }, { - "xml": "<feature name=\"PushNotification\"><param name=\"android-package\" value=\"com.adobe.phonegap.push.PushPlugin\" /></feature>", - "count": 1 - }, - { "xml": "<feature name=\"StatusBar\"><param name=\"android-package\" value=\"org.apache.cordova.statusbar.StatusBar\" /><param name=\"onload\" value=\"true\" /></feature>", "count": 1 }, { - "xml": "<feature name=\"FirebasePlugin\"><param name=\"android-package\" value=\"org.apache.cordova.firebase.FirebasePlugin\" /><param name=\"onload\" value=\"true\" /></feature>", + "xml": "<feature name=\"PushNotification\"><param name=\"android-package\" value=\"com.adobe.phonegap.push.PushPlugin\" /></feature>", "count": 1 } ] @@ -75,35 +71,15 @@ "count": 1 }, { - "xml": "<receiver android:exported=\"true\" android:name=\"com.google.android.gms.gcm.GcmReceiver\" android:permission=\"com.google.android.c2dm.permission.SEND\"><intent-filter><action android:name=\"com.google.android.c2dm.intent.RECEIVE\" /><category android:name=\"${applicationId}\" /></intent-filter></receiver>", + "xml": "<receiver android:name=\"com.adobe.phonegap.push.PushDismissedHandler\" />", "count": 1 }, { - "xml": "<service android:exported=\"false\" android:name=\"com.adobe.phonegap.push.GCMIntentService\"><intent-filter><action android:name=\"com.google.android.c2dm.intent.RECEIVE\" /></intent-filter></service>", + "xml": "<service android:name=\"com.adobe.phonegap.push.FCMService\"><intent-filter><action android:name=\"com.google.firebase.MESSAGING_EVENT\" /></intent-filter></service>", "count": 1 }, { - "xml": "<service android:exported=\"false\" android:name=\"com.adobe.phonegap.push.PushInstanceIDListenerService\"><intent-filter><action android:name=\"com.google.android.gms.iid.InstanceID\" /></intent-filter></service>", - "count": 1 - }, - { - "xml": "<service android:exported=\"false\" android:name=\"com.adobe.phonegap.push.RegistrationIntentService\" />", - "count": 1 - }, - { - "xml": "<service android:enabled=\"true\" android:exported=\"false\" android:name=\"com.google.android.gms.measurement.AppMeasurementService\" />", - "count": 1 - }, - { - "xml": "<service android:name=\"org.apache.cordova.firebase.FirebasePluginMessagingService\"><intent-filter><action android:name=\"com.google.firebase.MESSAGING_EVENT\" /></intent-filter></service>", - "count": 1 - }, - { - "xml": "<service android:name=\"org.apache.cordova.firebase.FirebasePluginInstanceIDService\"><intent-filter><action android:name=\"com.google.firebase.INSTANCE_ID_EVENT\" /></intent-filter></service>", - "count": 1 - }, - { - "xml": "<receiver android:name=\"org.apache.cordova.firebase.OnNotificationOpenReceiver\" />", + "xml": "<service android:name=\"com.adobe.phonegap.push.PushInstanceIDListenerService\"><intent-filter><action android:name=\"com.google.firebase.INSTANCE_ID_EVENT\" /></intent-filter></service>", "count": 1 } ], @@ -123,26 +99,6 @@ { "xml": "<uses-permission android:name=\"android.permission.VIBRATE\" />", "count": 1 - }, - { - "xml": "<uses-permission android:name=\"com.google.android.c2dm.permission.RECEIVE\" />", - "count": 1 - }, - { - "xml": "<uses-permission android:name=\"${applicationId}.permission.C2D_MESSAGE\" />", - "count": 1 - }, - { - "xml": "<uses-permission android:name=\"${applicationId}.permission.PushHandlerActivity\" />", - "count": 1 - }, - { - "xml": "<permission android:name=\"${applicationId}.permission.C2D_MESSAGE\" android:protectionLevel=\"signature\" />", - "count": 1 - }, - { - "xml": "<permission android:name=\"${applicationId}.permission.PushHandlerActivity\" android:protectionLevel=\"signature\" />", - "count": 1 } ], "/*/application/activity": [], @@ -153,7 +109,7 @@ }, { "xml": "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />", - "count": 2 + "count": 1 }, { "xml": "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />", @@ -166,14 +122,6 @@ { "xml": "<uses-feature android:name=\"android.hardware.location.gps\" />", "count": 1 - }, - { - "xml": "<uses-permission android:name=\"android.permission.INTERNET\" />", - "count": 1 - }, - { - "xml": "<uses-permission android:name=\"android.permission.WAKE_LOCK\" />", - "count": 1 } ], "/manifest/application/activity": [ @@ -195,20 +143,7 @@ }, "res/values/strings.xml": { "parents": { - "/resources": [ - { - "xml": "<string name=\"google_app_id\">XXXXXXX</string>", - "count": 1 - }, - { - "xml": "<string name=\"google_app_id\">@string/google_app_id</string>", - "count": 1 - }, - { - "xml": "<string name=\"google_api_key\">@string/google_api_key</string>", - "count": 1 - } - ] + "/resources": [] } }, "config.xml": { @@ -264,19 +199,15 @@ "ionic-plugin-keyboard": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, - "phonegap-plugin-push": { - "SENDER_ID": "XXXXXXX", - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, "cordova-plugin-statusbar": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, - "cordova-plugin-firebase": { - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, "cordova-plugin-app-name": { "APP_NAME": "Stone Island", "PACKAGE_NAME": "us.okfoc.stoneisland" + }, + "phonegap-plugin-push": { + "PACKAGE_NAME": "us.okfoc.stoneisland" } }, "dependent_plugins": {}, @@ -379,14 +310,6 @@ "runs": true }, { - "id": "phonegap-plugin-push.PushNotification", - "file": "plugins/phonegap-plugin-push/www/push.js", - "pluginId": "phonegap-plugin-push", - "clobbers": [ - "PushNotification" - ] - }, - { "id": "cordova-plugin-statusbar.statusbar", "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", "pluginId": "cordova-plugin-statusbar", @@ -395,11 +318,11 @@ ] }, { - "id": "cordova-plugin-firebase.FirebasePlugin", - "file": "plugins/cordova-plugin-firebase/www/firebase.js", - "pluginId": "cordova-plugin-firebase", + "id": "phonegap-plugin-push.PushNotification", + "file": "plugins/phonegap-plugin-push/www/push.js", + "pluginId": "phonegap-plugin-push", "clobbers": [ - "FirebasePlugin" + "PushNotification" ] } ], @@ -416,9 +339,8 @@ "cordova-plugin-compat": "1.1.0", "cordova-plugin-geolocation": "2.4.0", "ionic-plugin-keyboard": "2.2.1", - "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24", - "cordova-plugin-app-name": "1.0.4" + "cordova-plugin-app-name": "1.0.4", + "phonegap-plugin-push": "2.0.0" } }
\ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/cordova.js b/StoneIsland/platforms/android/assets/www/cordova.js index 18c020e7..bda7c3e5 100644 --- a/StoneIsland/platforms/android/assets/www/cordova.js +++ b/StoneIsland/platforms/android/assets/www/cordova.js @@ -1,5 +1,5 @@ // Platform: android -// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20 +// 7ef9f9c03167a4dde4372d869472241b6816fee9 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '6.1.2'; +var PLATFORM_VERSION_BUILD_LABEL = '6.2.3'; // file: src/scripts/require.js /*jshint -W079 */ @@ -330,7 +330,7 @@ module.exports = cordova; }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js +// file: /Users/maj/src/cordova-android/cordova-js-src/android/nativeapiprovider.js define("cordova/android/nativeapiprovider", function(require, exports, module) { /** @@ -353,7 +353,7 @@ module.exports = { }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js +// file: /Users/maj/src/cordova-android/cordova-js-src/android/promptbasednativeapi.js define("cordova/android/promptbasednativeapi", function(require, exports, module) { /** @@ -886,7 +886,7 @@ module.exports = channel; }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js +// file: /Users/maj/src/cordova-android/cordova-js-src/exec.js define("cordova/exec", function(require, exports, module) { /** @@ -1649,7 +1649,7 @@ exports.reset(); }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js +// file: /Users/maj/src/cordova-android/cordova-js-src/platform.js define("cordova/platform", function(require, exports, module) { // The last resume event that was received that had the result of a plugin call. @@ -1759,7 +1759,7 @@ function onMessageFromNative(msg) { }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js +// file: /Users/maj/src/cordova-android/cordova-js-src/plugin/android/app.js define("cordova/plugin/android/app", function(require, exports, module) { var exec = require('cordova/exec'); diff --git a/StoneIsland/platforms/android/assets/www/cordova_plugins.js b/StoneIsland/platforms/android/assets/www/cordova_plugins.js index ea5e1643..8aaece20 100755 --- a/StoneIsland/platforms/android/assets/www/cordova_plugins.js +++ b/StoneIsland/platforms/android/assets/www/cordova_plugins.js @@ -98,14 +98,6 @@ module.exports = [ "runs": true }, { - "id": "phonegap-plugin-push.PushNotification", - "file": "plugins/phonegap-plugin-push/www/push.js", - "pluginId": "phonegap-plugin-push", - "clobbers": [ - "PushNotification" - ] - }, - { "id": "cordova-plugin-statusbar.statusbar", "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", "pluginId": "cordova-plugin-statusbar", @@ -114,11 +106,11 @@ module.exports = [ ] }, { - "id": "cordova-plugin-firebase.FirebasePlugin", - "file": "plugins/cordova-plugin-firebase/www/firebase.js", - "pluginId": "cordova-plugin-firebase", + "id": "phonegap-plugin-push.PushNotification", + "file": "plugins/phonegap-plugin-push/www/push.js", + "pluginId": "phonegap-plugin-push", "clobbers": [ - "FirebasePlugin" + "PushNotification" ] } ]; @@ -137,10 +129,9 @@ module.exports.metadata = "cordova-plugin-compat": "1.1.0", "cordova-plugin-geolocation": "2.4.0", "ionic-plugin-keyboard": "2.2.1", - "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24", - "cordova-plugin-app-name": "1.0.4" + "cordova-plugin-app-name": "1.0.4", + "phonegap-plugin-push": "2.0.0" }; // BOTTOM OF METADATA });
\ No newline at end of file diff --git a/StoneIsland/platforms/android/assets/www/css/nav.css b/StoneIsland/platforms/android/assets/www/css/nav.css index 9445f5cb..28385680 100755 --- a/StoneIsland/platforms/android/assets/www/css/nav.css +++ b/StoneIsland/platforms/android/assets/www/css/nav.css @@ -17,11 +17,6 @@ -webkit-transform: translateZ(0) translateX(0px); -webkit-transition: -webkit-transform 0.1s; } -.ios #nav, -.ios #content { - top: 20px; - height: -webkit-calc(100% - 20px); -} .nav #nav { -webkit-transform: translateZ(0) translateX(0); } diff --git a/StoneIsland/platforms/android/assets/www/css/products.css b/StoneIsland/platforms/android/assets/www/css/products.css index bdfed42a..c4599866 100755 --- a/StoneIsland/platforms/android/assets/www/css/products.css +++ b/StoneIsland/platforms/android/assets/www/css/products.css @@ -24,6 +24,11 @@ height: 126vw; } +#collection .item .product-title { + padding-bottom: 18px; + display: inline-block; +} + .product #product { display: block } #product { display: none; @@ -104,6 +109,20 @@ position:relative; font-weight:bold; } +.product .product-header.wide { + max-width:100%; +} + +.product-group { + margin-top: 28px; + margin-bottom: 18px; + font-weight: bold; + text-align: center; + font-size: 17px; +} +.product-group:first-child { + margin-top: 0; +} #product::before { content:''; @@ -224,6 +243,9 @@ padding-bottom:45px; #collection h1 { background-color: white; +} + +#collection h1.single-dept { background-image: url(../img/angle-down.png); background-size: contain; background-position: top right; @@ -231,6 +253,6 @@ padding-bottom:45px; } #selector { -z-index:9 + z-index:9 } diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/db.json b/StoneIsland/platforms/android/assets/www/db.json index 7e0fa471..7e0fa471 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/db.json +++ b/StoneIsland/platforms/android/assets/www/db.json diff --git a/StoneIsland/platforms/android/assets/www/index.html b/StoneIsland/platforms/android/assets/www/index.html index 28c4f8c6..0b10cd52 100755 --- a/StoneIsland/platforms/android/assets/www/index.html +++ b/StoneIsland/platforms/android/assets/www/index.html @@ -262,7 +262,6 @@ <div class="gallery-right"></div> <div class="content"> <div class="product-header"> - <span class="num"></span> <span class="title"></span> </div> <div class="type-price"> @@ -293,10 +292,9 @@ <div id="closed"> <div class="closed_store_msg"> <h3> - THIS STORE IS CURRENTLY CLOSED + LOADING THE STORE, PLEASE WAIT </h3> <h4> - WE WILL REOPEN FEBRUARY 1ST </h4> <div class="website_link"> visit<br> @@ -1138,6 +1136,7 @@ <script src="js/lib/products/CollectionView.js"></script> <script src="js/lib/products/filters/CategoryFilter.js"></script> <script src="js/lib/products/filters/DepartmentFilter.js"></script> +<script src="js/lib/products/filters/SizeFilter.js"></script> <script src="js/lib/products/ClosedStoreView.js"></script> <script src="js/lib/products/ProductView.js"></script> <script src="js/lib/products/GalleryView.js"></script> diff --git a/StoneIsland/platforms/android/assets/www/js/index.js b/StoneIsland/platforms/android/assets/www/js/index.js index 06bfaaac..a28faabf 100755 --- a/StoneIsland/platforms/android/assets/www/js/index.js +++ b/StoneIsland/platforms/android/assets/www/js/index.js @@ -4,7 +4,13 @@ var app = (function(){ app.init = function(){ console.log("init") - sdk.init({ env: "production" }) + if (window.location.hostname === 'lvh.me' || window.location.hostname === 'stone.giraffe.life' || window.location.hostname === 'dev.stone.giraffe.life') { + console.log('launching in test mode') + sdk.init({ env: "test" }) + } + else { + sdk.init({ env: "production" }) + } app.bind() app.build() diff --git a/StoneIsland/platforms/android/assets/www/js/lib/_router.js b/StoneIsland/platforms/android/assets/www/js/lib/_router.js index 9927712a..43438854 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/_router.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/_router.js @@ -87,6 +87,9 @@ var SiteRouter = Router.extend({ else { app.view = app[name] } + + window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) + app.header.set_back( !! app.view.back ) app.view.show() }.bind(this) diff --git a/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js b/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js index 9e6f1714..80738be0 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/account/AccountView.js @@ -22,6 +22,7 @@ var AccountView = View.extend({ ccLookup: {}, listAddresses: function(opt){ + opt = opt || {} sdk.address.list({ success: function(data){ this.populateAddresses(data, opt.success) diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js index 5ee7f641..fd7b5212 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/BlogView.js @@ -9,8 +9,8 @@ var BlogView = View.extend({ fetch: function(fn){ $.ajax({ method: "GET", -// url: sdk.env == 'test' ? '/db.json' : "https://stone.sup.land/db.json", - url: "https://stone.sup.land/db.json", + url: sdk.env === 'test' ? '/db.json' : sdk.cms() + '/db.json', + // url: "https://stone.giraffe.life/db.json", success: function(data){ this.success(data) fn && fn() @@ -31,24 +31,41 @@ var BlogView = View.extend({ this.loaded = true this.data = data = typeof data == "string" ? JSON.parse(data) : data - switch (data.store[0].DepartmentStoreStatus) { + // sdk.env = 'test' + + if (sdk.env === 'test') { + app.store = data.store[1] + } + else { + app.store = data.store[0] + } + + switch (app.store.DepartmentStoreStatus) { case "open": app.closed.storeIsClosed = false break case "closed": app.closed.storeIsClosed = true - app.closed.storeClosedMessageOne = data.store[0].StoreClosedMessageOne - app.closed.storeClosedMessageTwo = data.store[0].StoreClosedMessageTwo + app.closed.storeClosedMessageOne = app.store.StoreClosedMessageOne + app.closed.storeClosedMessageTwo = app.store.StoreClosedMessageTwo break } - - if (app.closed.storeIsClosed) { - app.closed.populate(data.store[0].ClosedStoreImages) + + if (app.closed.storeIsClosed && sdk.env !== 'test') { + app.closed.populate(app.store.ClosedStoreImages) } else { - app.departments = data.store[0].Departments - app.department_id = data.store[0].Departments[0].uri - app.collection.setCollectionName( data.store[0].Departments[0].text ) + app.departments = app.store.Departments + app.department_id = app.store.Departments[0].uri + $("#collections h1").toggleClass("single-dept", app.store.Departments.length == 1) + app.collection.setCollectionName( app.store.Departments[0].text ) + //// demo department for shoes with weird SizeTypeId + // app.department_id = "NKDrtSC" + if (sdk.env === 'test') { + app.department_id = window.location.search.substr(1) || app.department_id + console.log('using test department id', app.department_id) + // app.department_id = 'TSTSZS' + } app.collection.loaded = false app.collection.fetch() } @@ -69,16 +86,16 @@ var BlogView = View.extend({ app[page.tag].populate(page) }) - console.log(data.store[0].StoreStatus) + console.log(app.store.StoreStatus) app.product.fitLargeCodes = {} - if (data.store[0].FittingCodes.length) { - data.store[0].FittingCodes.split("\n").forEach(function(code){ + if (app.store.FittingCodes.length) { + app.store.FittingCodes.split("\n").forEach(function(code){ app.product.fitLargeCodes[code] = true }) } - if (data.store[0].BackgroundIsGray === "true") { + if (app.store.BackgroundIsGray === "true") { app.collection.$el.addClass("gray") app.product.gallery.$el.addClass("gray") } diff --git a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js index 013c2b45..38a7eecf 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/blogs/HubView.js @@ -140,6 +140,7 @@ var HubView = ScrollableView.extend({ var HubLoader = (function(){ var queue, view, item, loader + var count = 0 var HubLoader = {} var loader HubLoader.init = function(v){ @@ -151,6 +152,7 @@ var HubLoader = (function(){ } HubLoader.load = function(){ item = queue.shift() + count++ if (! item) return if (item.image && item.image.length) { loader = new Loader (HubLoader.build) @@ -159,7 +161,7 @@ var HubLoader = (function(){ }).filter(function(img){ return img.uri }) - loader.preloadImages(images) + loader.preloadImages(images, true) } else { HubLoader.build() @@ -168,7 +170,7 @@ var HubLoader = (function(){ HubLoader.build = function(){ view.append(item) view.scroller.refresh() - setTimeout(HubLoader.load, 20) + setTimeout(HubLoader.load, count < 4 ? 50 : 5000) } return HubLoader })() diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/backup_db.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/backup_db.js index eec5c415..dce8835a 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/etc/backup_db.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/backup_db.js @@ -310,11 +310,11 @@ var BACKUP_DB = { ], "hub": [ { - "id": "ss_-016-collection-preview", + "id": "loading", "date": "Tue, 12 Jan 2016 12:00:00 GMT", - "title": "SS_'016 COLLECTION PREVIEW", - "subtitle": "Stone Island App exclusive 1/12-1/19", - "body": "The unrelenting research by Stone Island results in a collection full of textiles evolutions, finishing and dyeing, featuring pop colors and extraordinary visual effects.\r\n\r\n44447 NYLON METAL WATRO\r\nHooded blouson in Nylon Metal. Hood with half lining in cotton and half in nylon mesh. Slanting hand pockets with windproof entrance and zip fastening. Adjustable strap at cuffs. Drawstring in bottom hem. Zip fastening. \r\nNYLON METAL WATRO: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. The fabric is resin treated inside to achieve a mild wind and water resistance The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n10544 NYLON METAL \r\nOver shirt in Nylon Metal. Garment dyed. Hook fastening collar. On seam pocket along central placket, with snaps fastening. Snap-fastened cuffs. Hidden zip and snap fastening.\r\nNYLON METAL: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n70532 POLYESTER SHANTUNG\r\nParka in an organic looking polyester. Hood with visor and chin strap adjustable with Velcro. Two bellows pockets on chest with flap closed by hidden snaps. Two welt pockets closed by a zip with a second snap opening that holds a cotton tape belt. Snap fasteners at cuffs. Zip and hidden button fastening.\r\nPOLYESTER SHANTUNG: organic looking polyester material with a shantung effect. The organic look is given by the highly technological spinning of the raw material and by its super tight weaving. The pieces are sewn and then garment dyed under pressure at 130°C with the addition of an anti-drop agent. The high pressure dye process compacts the material and induces the high absorption of the color recipe.\r\n\r\n41923 MEMBRANA 3L TC\r\nHooded jacket in a light 3 layers fabric. Garment dyed. Adjustable straps on hood with elasticated gathering on back. Patch pockets with zip fastening. Adjustable straps at cuffs. Elasticated adjustable drawstring on bottom edge. Zip fastening. \r\nMEMBRANA 3L TC: 3 layer light performance fabric made from an opaque nylon outer face laminated to a breathable, water resistant, windproof membrane, protected by an impalpable polyester base. Stone Island’s expertise in garment dyeing gives an outstanding color to the outer face while preserving the performance features of the inner membrane. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n65260 T.CO+OLD\r\nHooded full zip sweatshirt in malfilé cotton, garment dyed to create the OLD effect, an exclusive dyeing treatment and subsequent fading on the finished garment to create a slightly worn and three-dimensional appearance. Hood drawstring in contrasting color. Pouch pockets. Ribbed side band, cuffs and bottom band. Zip fastening.\r\n\r\n530B0\r\nCardigan knit in plain stitching cotton nylon. Raised collar with concealed hood in Nylon Metal. Garment dyed. On seam pockets. Plain cuffs and bottom band with inner ribbing. Zip fastening.\r\nNYLON METAL: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. ", + "title": "STONE ISLAND", + "subtitle": "", + "body": "The unrelenting research by Stone Island results in a collection full of textiles evolutions, finishing and dyeing, featuring pop colors and extraordinary visual effects.", "link": "", "store": "true", "image": [ @@ -322,155 +322,9 @@ var BACKUP_DB = { "uri": "https://ltho.s3.amazonaws.com/1ee6abef-0677-41a6-91eb-029303995073.png", "caption": "" }, - { - "uri": "https://ltho.s3.amazonaws.com/8cc1876a-10c7-4dc5-af66-18f5d1a30727.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/f83bf094-ddee-4d26-938e-d98eef0cb0eb.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/095b2d00-cda6-4275-a475-cf2b27965c29.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/b7b299c4-0f24-4d27-91c3-b2a0856e49f0.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/cb2378dd-2eff-4d92-a942-63da8f3afcea.png", - "caption": "" - } ], "__index": 1, "dateCreated": "Tue, 12 Jan 2016 15:55:24 GMT" - }, - { - "id": "nikelab-x-stone-island-windrunner", - "date": "Wed, 09 Dec 2015 12:00:00 GMT", - "title": "NikeLab x Stone Island Windrunner", - "subtitle": "", - "body": "<b>NikeLab partners with Stone Island to deliver a unique interpretation of its foremost apparel icon, to celebrate the beginning of “The Year of Windrunner.</b>\r\n\r\n “An exciting co-lab. Stone Island loves challenges. We source our strength from challenges. It’s a great satisfaction to share our knowhow and expertise with Nike”.\r\n<i>Carlo Rivetti – Stone Island President and Creative Director</i>\r\n \r\nThe Nike Windrunner was born during a time of firsts. Created by Nike’s first apparel designer in 1978 and revolutionary for its raglan sleeves and 26-degree chevron yoke, the jacket became the first piece of Nike apparel worn by athletes at track and field trials before and after competition. Today, to commemorate this running icon, the Nike Windrunner experiences another first, the fabric innovation, the engineering and garment dyeing techniques of Stone Island.\r\n \r\nIn 2016 Nike is celebrating its foremost apparel icon: the Nike Windrunner Jacket. Designed in the late ‘70s, the silhouette has been a fixture on medal stands and city streets ever since. In the launch edition of this yearlong celebration Nike and Stone Island merge the distinctiveness of two brands to create a unique garment.\r\n \r\nThe chevron and hood of the NikeLab x Stone Island Windrunner are constructed with water and wind-resistant Mussola Gommata fabric, formed by bonding lightweight cotton muslin to an opaque polyurethane film. Nylon Metal, a proprietary Stone Island fabric with a metallic sheen, is featured on the body of the garment, which is lined with PrimaLoft®.\r\n \r\nWhile the exterior of the jacket is monochromatic, it mimics the traditional Nike Windrunner color blocking through Stone Island’s garment dyeing process. The result is a subtle distinction between the shades of the Mussola Gommata and Nylon Metal fabrics. The silver PrimaLoft® lining provides a stunning contrast to the monochromatic exterior, while the oversized trims contribute to a rugged look.\r\n \r\nThe NikeLab x Stone Island Windrunner will be available on December 17th at 10am PST from the Stone Island App and selected NikeLab retailers and on nike.com/nikelab.", - "link": "http://www.stoneisland.com/experience/us/nikelab-x-stone-island/", - "store": "true", - "image": [ - { - "uri": "https://ltho.s3.amazonaws.com/de454e51-59d6-4442-9faa-70d95203f6dd.jpg", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/faeb5522-8793-4a81-882f-3c378cef3192.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/1c7b2292-f4c9-4d4e-869a-4d4cad2a3820.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/0444066e-e3e7-484f-b932-43c855e2fa96.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/d5577c40-4e42-4738-be8b-12066f7a4301.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/540f859f-9684-412d-a012-bb1c2bd45bf6.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/a92f9dd6-09d2-48fb-8858-7c12693c302e.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/a46824b3-90ad-466d-97ab-090022363fa7.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/e234f3cb-38d8-442a-9bb9-95a90b166d20.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/607814ee-1435-42f5-b52d-fb7fe2001b6d.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/21475b14-e216-438a-8673-106d9322bf3e.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/131e1276-aed1-4790-8ab9-333393c3885a.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/e2808d55-7d9a-4c99-842d-16a0a300c93d.png", - "caption": "" - } - ], - "__index": 4, - "dateCreated": "Tue, 12 Jan 2016 16:02:48 GMT" - }, - { - "id": "nikelab-x-stone-island-koth-ultra-mid-si", - "date": "Wed, 09 Dec 2015 12:00:00 GMT", - "title": "NikeLab x Stone Island Koth Ultra Mid SI", - "subtitle": "", - "body": "Inspired by the Nike Air Mowabb, the revolutionary 1991 sneaker-hiker hybrid, this all-weather Nike Koth Ultra Mid SI Shoe is made in Nike water resistant materials, real leather, and in Mussola Gommata, a fabric issued from the Stone Island research and treatment research, an exclusive panel dyed material made by bonding an extremely light cotton muslin to an opaque polyurethane film. The shoe features aggressive traction and flexible ankle support. Unitsole foam midsole for cushioning and durable support. Waffle rubber lugs for rugged traction and durability. Flex grooves allow for natural range of motion. Heel loop for easier on and off. Heel overlay for enhanced support. The shoe dust bag is made in 2 Stone Island fabrics, Nylon Metal, nylon canvas with a distinctive metallic and iridescent sheen, 50 Fili, a cotton/nylon canvas, both panel dyed.\r\n\r\nThe NikeLab x Stone Island Koth Ultra Mid SI will be available on December 17th at 10am PST from the Stone Island App and selected NikeLab retailers and on nike.com/nikelab.\r\n", - "link": "http://www.stoneisland.com/experience/us/nikelab-x-stone-island/", - "store": "true", - "image": [ - { - "uri": "https://ltho.s3.amazonaws.com/dd5f611f-3800-49ed-a6b1-9f6dd06cc103.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/34185ef2-1658-4472-bc3a-4d3f0c23ba2f.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/4767f114-1e8e-4ed3-856c-74f6c4342f0f.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/ed510070-9f60-45a6-aebf-2e7684b67cb3.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/c32af490-4ae5-4040-9327-02ce8808ee71.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/b913fc7d-d5d8-4047-b252-c2f404d9cb3e.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/3bea1cd4-2529-4a06-99ec-ec55c5a9f8d5.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/e29264fd-4236-4d16-938f-7dbe264c9b88.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/9c445717-dc18-4e0f-95f4-f695b13547a2.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/63cb328c-2624-4ed1-9d1e-113649be7f26.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/8ef50cce-c89d-4642-98b9-3be6ff798727.png", - "caption": "" - }, - { - "uri": "https://ltho.s3.amazonaws.com/46f320b1-b908-42b5-9cad-20689c4d0d23.png", - "caption": "" - } - ], - "__index": 5, - "dateCreated": "Tue, 12 Jan 2016 16:03:00 GMT" } ], "page": [ diff --git a/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js b/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js index da63fdd1..082692ec 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/etc/push.js @@ -2,28 +2,38 @@ var push = (function(){ var push = { settings: {}, disabled: false } var pushPlugin push.init = function(){ - if (device.platform !== "ios") { + if (! ('device' in window) || (device.platform || "").toLowerCase() !== "ios") { + console.log("push disabled") push.disabled = true return } - pushPlugin = PushNotification.init({ - ios: { - alert: true, - badge: true, - sound: false, - clearBadge: true, - }, - }) - console.log("push init") - PushNotification.hasPermission(push.did_initialize) - pushPlugin.on('registration', push.got_registration) - pushPlugin.on('notification', push.got_push_notification) + window.FirebasePlugin.hasPermission(function(data){ + push.did_initialize() + }) + + window.FirebasePlugin.getToken(function(token) { + push.got_registration(token); + }, function(error) { + console.error(error); + }); + + window.FirebasePlugin.onTokenRefresh(function(token) { + // save this server-side and use it to push notifications to this device + push.got_registration(token); + }, function(error) { + console.error(error); + }); + + // PushNotification.hasPermission(push.did_initialize) } push.did_initialize = function(data) { + console.log(data) if (! data.isEnabled) { + console.log("push did not initialize") + window.FirebasePlugin.grantPermission() return } console.log("push did initialize") @@ -41,8 +51,8 @@ var push = (function(){ push.subscribe("store") } } - push.got_registration = function(data){ - var registrationId = data.registrationId + push.got_registration = function(token){ + var registrationId = token var oldRegistrationId = localStorage.getItem("yoox.registrationId") console.log(registrationId, oldRegistrationId) @@ -62,12 +72,12 @@ var push = (function(){ channel: channel, platform: device.platform, } - pushPlugin.subscribe(channel, function(){ + window.FirebasePlugin.subscribe(channel, function(){ console.log("subscribed to", channel) }) $.ajax({ method: "POST", - url: "https://stone.sup.land/_services/push/add", + url: push.url('add'), data: data, contentType: 'application/x-www-form-urlencoded; charset=UTF-8', success: function(){ @@ -88,40 +98,55 @@ var push = (function(){ } $.ajax({ method: "POST", - url: "https://stone.sup.land/_services/push/remove", + url: push.url('remove'), data: data, contentType: 'application/x-www-form-urlencoded; charset=UTF-8', success: function(){ + window.FirebasePlugin.unsubscribe(channel) console.log("unsubscribed from", channel) cb && cb() }, error: push.error, }) } + push.url = function(key){ + return sdk.cms() + '/_services/push/' + key + } push.got_push_notification = function(push_obj) { - // alert('We received this push notification: ' + JSON.stringify(push_obj)); + // console.log('We received this push notification: ' + JSON.stringify(push_obj)); + app.blog.refresh() + + push_obj.additionalData = push_obj.additionalData || {} + + var is_hub = true try { - var is_hub = JSON.stringify(push_obj || {}).match(/hub/i) - if (is_hub) { - app.intro.$alert.show().html("[ HUB UPDATED ]") - } - else { - auth.clear_cart() - app.intro.$alert.show().html("[ STORE UPDATED ]") - } + is_hub = JSON.stringify(push_obj || {}).match(/hub/i) } catch (e) { + } + + if (is_hub) { app.intro.$alert.show().html("[ HUB UPDATED ]") } + else if (! push_obj.additionalData.url) { + auth.clear_cart() + app.intro.$alert.show().html("[ STORE UPDATED ]") + } if (push_obj.additionalData.foreground === false) { // TODO: route the user to the uri in push_obj - pushPlugin.finish(function(){}, function(){}) + // pushPlugin.finish(function(){}, function(){}) + if (push_obj.additionalData.url) { + app.router.go(push_obj.additionalData.url) + } + } + else if (is_hub) { + app.router.go("hub") } else { - app.route("intro") + app.router.go("intro") } } push.error = function(e){ diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js index 671d36b3..7c73d66f 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/CollectionView.js @@ -5,6 +5,7 @@ var CollectionView = ScrollableView.extend({ template: $("#collection .template").html(), loaded: false, data: null, + filtered_items: null, items: {}, events: { @@ -22,7 +23,8 @@ var CollectionView = ScrollableView.extend({ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#collection', app.iscroll_options) - this.filterView = new DepartmentFilter ({ parent: this }) + this.departmentFilterView = new DepartmentFilter ({ parent: this }) + this.sizeFilterView = new SizeFilter ({ parent: this }) }, show: function(){ @@ -34,11 +36,24 @@ var CollectionView = ScrollableView.extend({ if (sdk.env !== "test" && app.closed.storeIsClosed) { return app.closed.show() } + +// if (sdk.env === 'test' && this.data.SearchResponseFull.Results.Items.length < 4) { +// var items = this.data.SearchResponseFull.Results.Items +// items = items.concat(items).concat(items).concat(items) +// items = items.concat(items).concat(items).concat(items) +// this.data.SearchResponseFull.Results.Items = items +// } + if (this.data && this.data.SearchResponseFull.Results.Items.length < 4) { app.footer.hide() } - else { - app.footer.show("FILTER") + if (app.store.FilterBy !== "none") { + if (app.store.FilterBy === "category") { + app.footer.show("FILTER") + } + else { + app.footer.show("FILTER BY " + app.store.FilterBy.toUpperCase()) + } } document.body.className = "collection" if (this.loaded) { @@ -50,8 +65,16 @@ var CollectionView = ScrollableView.extend({ } }, + // called when footer is tapped - filter by (x) save: function(){ - this.filterView.filter() + switch (app.store.FilterBy) { + case 'none': + this.departmentFilterView.filter() + break + case 'size': + this.sizeFilterView.filter() + break + } }, fetch: function(){ @@ -82,7 +105,7 @@ var CollectionView = ScrollableView.extend({ console.log("populate 2") this.data = data this.loaded = false - console.log(data) + // console.log(data) } console.log(">>>>>>>> YES ") if (! this.loaded) { @@ -112,26 +135,75 @@ var CollectionView = ScrollableView.extend({ // } console.log( data.SearchResponseFull.Results.Items.length ) - data.SearchResponseFull.Results.Items.forEach(function(item){ - console.log(">>> ITEM") - this.append(item, is_single_product) - }.bind(this)) - this.deferScrollToTop() + + var items = this.filtered_items || data.SearchResponseFull.Results.Items + if (app.store.GroupBy === 'size') { + this.groupBySize( items, is_single_product ) + } + else { + this.appendItems( items, is_single_product ) + } + // this.restoreScroll() + // this.deferScrollToTop() } this.afterFetchCallback && this.afterFetchCallback() - app.collection.deferRefresh() + this.deferRefresh() + this.restoreScroll() + }, + + groupBySize: function(items, is_single_product){ + var groups = {} + items.forEach(function(item){ + if (! item.Sizes.length) return + var size = item.Sizes[0] + var id = size['Text'] + if ( ! (id in groups) ) { + groups[id] = { + label: SIZE_LOOKUP[ id ], + items: [], + } + } + groups[id].items.push( item ) + }.bind(this)) + + Object.keys(groups).sort(function(a,b){ + var ao = SIZE_ORDER.indexOf( a ) + var bo = SIZE_ORDER.indexOf( b ) + return ao - bo + }).forEach(function(id){ + var size = groups[id] + var $el = $("<div>") + $el.addClass("product-group") + $el.html( size.label ) + this.$content.append($el) + this.appendItems( size.items, is_single_product ) + }.bind(this)) + }, + + appendItems: function(items, is_single_product){ + items.forEach(function(item){ + this.append(item, is_single_product) + }.bind(this)) }, append: function(item, is_single_product){ this.items[ item['Code8'] ] = item var t = this.template.replace(/{{image}}/, sdk.image(item['DefaultCode10'], is_single_product ? '13_f' : '11_f')) .replace(/{{code8}}/, item['Code8']) - this.$content.append(t) + var $t = $(t) + if (app.store.ShowProductNameOnCollectionPage) { + var $title = $("<span>") + $title.addClass("product-title") + $title.html( item['ModelNames'] ) + $t.append($title) + } + this.$content.append($t) }, pick: function(e){ var code = $(e.currentTarget).data("code") var data = this.items[code] + this.saveScroll() app.product.load(code, data) }, @@ -141,8 +213,11 @@ var CollectionView = ScrollableView.extend({ this.$title.html(this.collectionName) }, + // filter by department showDepartmentSelector: function(){ - this.filterView.filter() + if (this.$("h1").hasClass("single-dept")) { + this.departmentFilterView.filter() + } }, firstTouch: { x: 0, y: 0, id: "" }, diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js b/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js index 81ad536d..2743946a 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/ProductView.js @@ -16,7 +16,7 @@ var ProductView = ScrollableView.extend({ this.gallery = new GalleryView () this.scroller = new IScroll('#product', app.iscroll_options) - this.$num = this.$(".num") + this.$productHeader = this.$(".product-header") this.$title = this.$(".title") this.$type = this.$(".type") this.$price = this.$(".price") @@ -113,12 +113,12 @@ var ProductView = ScrollableView.extend({ var descriptions = this.get_descriptions(details) - var name_partz = data['ModelNames'].split(' ') - var num = name_partz.shift() - var title = name_partz.join(' ') + var title = data['ModelNames'] var type = title_case( data['MicroCategory'] ) var price = "$" + data['DiscountedPrice'] + ".00" - var body = descriptions['Details'] + " " + descriptions['EditorialDescription'] + var details_description = descriptions['Details'] || "" + var editorial = descriptions['EditorialDescription'] || "" + var body = details_description + " " + editorial // body = body.replace(/<br>/g, "<br><br>").replace(/(<br>)+$/, "") var default_color_id = this.populate_selectors(data, details) @@ -162,11 +162,14 @@ var ProductView = ScrollableView.extend({ console.log( data['DefaultCode10'] ) - this.$num.html(num) this.$title.html(title) this.$type.html(type) this.$price.html(price) this.$body.html(body) + + window.FirebasePlugin && window.FirebasePlugin.setScreenName('product:' + code) + + this.$productHeader.toggleClass("wide", title.length > 48) var fits_large = !! this.fitLargeCodes[this.code] app.product.$fit.toggle( fits_large ) @@ -196,8 +199,11 @@ var ProductView = ScrollableView.extend({ populate_selectors: function(data, details){ var sizes = {}, colors = {}, size_lookup = {}, default_color - console.log(details['Item']['ModelColors'].length) - if (! details['Item']['ModelColors'].length) { + + var modelColors = details['Item']['ModelColors'] || [] + console.log('colors:', modelColors.length || "none") + + if (! modelColors.length) { this.not_available = true return } @@ -205,7 +211,7 @@ var ProductView = ScrollableView.extend({ this.not_available = false } - details['Item']['ModelColors'].forEach(function(color, index){ + modelColors.forEach(function(color, index){ if (! default_color || color['Code10'] == data['DefaultCode10']) { default_color = color['ColorId'] } @@ -218,10 +224,21 @@ var ProductView = ScrollableView.extend({ }) details['Item']['ModelSizes'].forEach(function(size){ - var label = SIZE_LOOKUP[ size['Default']['Text'] ] - if (! label && ! size['Default']['Labeled']) { + var label = "" + if (details['Item']['SizeTypeId'] == 412) { // shoes label = size['Default']['Text'] + " " + size['Default']['ClassFamily'] + console.log("shoes?", label) } + else { // everything else + label = SIZE_LOOKUP[ size['Default']['Text'] ] + } + if (! label) { + label = size['Default']['Text'] + if (size['Default']['Labeled']) { + label += " " + size['Default']['ClassFamily'] + } + } + console.log(size) size_lookup[ label ] = size['SizeId'] console.log( label ) sizes[ size['SizeId'] ] = { diff --git a/StoneIsland/platforms/android/assets/www/js/lib/products/filters/DepartmentFilter.js b/StoneIsland/platforms/android/assets/www/js/lib/products/filters/DepartmentFilter.js index cc0d925e..7d5ccf3d 100644 --- a/StoneIsland/platforms/android/assets/www/js/lib/products/filters/DepartmentFilter.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/filters/DepartmentFilter.js @@ -6,7 +6,6 @@ var DepartmentFilter = View.extend({ filter: function(){ var deps = app.departments.map(function(dep){ - console.log(dep) return { id: dep.uri, label: dep.text, diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/SizeFilter.js b/StoneIsland/platforms/android/assets/www/js/lib/products/filters/SizeFilter.js index d0231021..d0231021 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/SizeFilter.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/products/filters/SizeFilter.js diff --git a/StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js b/StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js index 0baff845..7f90929a 100755 --- a/StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js +++ b/StoneIsland/platforms/android/assets/www/js/lib/view/Scrollable.js @@ -5,9 +5,26 @@ var ScrollableView = View.extend({ }, deferScrollToTop: function(){ + this.scrollPosition = 0 setTimeout(this.scrollToTop.bind(this), 0) }, + scrollPosition: 0, + + resetScroll: function(){ + this.scrollPosition = 0 + }, + + saveScroll: function(){ + this.scrollPosition = this.scroller.y + }, + + restoreScroll: function(){ + setTimeout(function(){ + this.scroller.scrollTo(0, this.scrollPosition) + }.bind(this), 0) + }, + refreshScroller: function(){ this.scroller.refresh() clearTimeout( this.scrollerRefreshTimeout ) diff --git a/StoneIsland/platforms/android/assets/www/js/sdk/_sdk.js b/StoneIsland/platforms/android/assets/www/js/sdk/_sdk.js index 017df015..c251e364 100755 --- a/StoneIsland/platforms/android/assets/www/js/sdk/_sdk.js +++ b/StoneIsland/platforms/android/assets/www/js/sdk/_sdk.js @@ -9,7 +9,7 @@ var sdk = (function(){ sdk.init = function(opt){ switch (sdk.env = opt.env || "development") { case 'test': - endpoint = "http://lvh.me:9090/" + endpoint = window.location.origin + "/" break default: case 'development': @@ -26,7 +26,12 @@ var sdk = (function(){ } sdk.image = function(code, size){ - return "http://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_" + size + ".jpg" + return "https://cdn.yoox.biz/" + code.substr(0,2) + "/" + code + "_" + size + ".jpg" + } + + sdk.cms = function(){ + return "http://staging.stone.giraffe.life" + // return "https://stone.giraffe.life" } $.ajaxSetup({ diff --git a/StoneIsland/platforms/android/assets/www/js/sdk/auth.js b/StoneIsland/platforms/android/assets/www/js/sdk/auth.js index fa8dd71c..bcfb2d3a 100755 --- a/StoneIsland/platforms/android/assets/www/js/sdk/auth.js +++ b/StoneIsland/platforms/android/assets/www/js/sdk/auth.js @@ -51,6 +51,9 @@ var auth = sdk.auth = (function(){ localStorage.setItem("yoox.access_token", access_token) localStorage.setItem("yoox.user_id", user_id) + + window.FirebasePlugin && window.FirebasePlugin.setUserId(user_id) + cb && cb() } auth.get_user = function(cb){ @@ -63,6 +66,7 @@ var auth = sdk.auth = (function(){ auth.user_id = -1 localStorage.removeItem("yoox.access_token") localStorage.removeItem("yoox.user_id") + cb && cb() } diff --git a/StoneIsland/platforms/android/assets/www/js/vendor/loader.js b/StoneIsland/platforms/android/assets/www/js/vendor/loader.js index cc9644f8..ccfcdc9e 100755 --- a/StoneIsland/platforms/android/assets/www/js/vendor/loader.js +++ b/StoneIsland/platforms/android/assets/www/js/vendor/loader.js @@ -62,25 +62,28 @@ var Loader = Loader || (function(){ } // Preload the images in config.images - Loader.prototype.preloadImages = function(images){ + Loader.prototype.preloadImages = function(images, register){ this.register("preload"); for (var i = 0; i < images.length; i++) { - this.preloadImage(images[i]); + this.preloadImage(images[i], register); } this.ready("preload"); } Loader.prototype.preloadImage = function(src, register, cb){ if (! src || src == "none") return; var _this = this; - if (! cb && typeof register !== "string") { + if (! cb && typeof register !== "boolean") { cb = register register = null } if (register) { this.register(src); } - var img = new Image(); + var img = new Image() + var loaded = false img.onload = function(){ + if (loaded) return + loaded = true if (cb) { cb(img); } diff --git a/StoneIsland/platforms/android/assets/www/plugins/cordova-plugin-firebase/www/firebase.js b/StoneIsland/platforms/android/assets/www/plugins/cordova-plugin-firebase/www/firebase.js deleted file mode 100644 index e1e423d1..00000000 --- a/StoneIsland/platforms/android/assets/www/plugins/cordova-plugin-firebase/www/firebase.js +++ /dev/null @@ -1,124 +0,0 @@ -cordova.define("cordova-plugin-firebase.FirebasePlugin", function(require, exports, module) { -var exec = require('cordova/exec'); - -exports.getInstanceId = function(success, error) { - exec(success, error, "FirebasePlugin", "getInstanceId", []); -}; - -exports.getToken = function(success, error) { - exec(success, error, "FirebasePlugin", "getToken", []); -}; - -exports.onNotificationOpen = function(success, error) { - exec(success, error, "FirebasePlugin", "onNotificationOpen", []); -}; - -exports.onTokenRefresh = function(success, error) { - exec(success, error, "FirebasePlugin", "onTokenRefresh", []); -}; - -exports.grantPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "grantPermission", []); -}; - -exports.hasPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "hasPermission", []); -}; - -exports.setBadgeNumber = function(number, success, error) { - exec(success, error, "FirebasePlugin", "setBadgeNumber", [number]); -}; - -exports.getBadgeNumber = function(success, error) { - exec(success, error, "FirebasePlugin", "getBadgeNumber", []); -}; - -exports.subscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "subscribe", [topic]); -}; - -exports.unsubscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "unsubscribe", [topic]); -}; - -exports.unregister = function(success, error) { - exec(success, error, "FirebasePlugin", "unregister", []); -}; - -exports.logEvent = function(name, params, success, error) { - exec(success, error, "FirebasePlugin", "logEvent", [name, params]); -}; - -exports.logError = function(message, success, error) { - exec(success, error, "FirebasePlugin", "logError", [message]); -}; - -exports.setScreenName = function(name, success, error) { - exec(success, error, "FirebasePlugin", "setScreenName", [name]); -}; - -exports.setUserId = function(id, success, error) { - exec(success, error, "FirebasePlugin", "setUserId", [id]); -}; - -exports.setUserProperty = function(name, value, success, error) { - exec(success, error, "FirebasePlugin", "setUserProperty", [name, value]); -}; - -exports.activateFetched = function (success, error) { - exec(success, error, "FirebasePlugin", "activateFetched", []); -}; - -exports.fetch = function (cacheExpirationSeconds, success, error) { - var args = []; - if (typeof cacheExpirationSeconds === 'number') { - args.push(cacheExpirationSeconds); - } else { - error = success; - success = cacheExpirationSeconds; - } - exec(success, error, "FirebasePlugin", "fetch", args); -}; - -exports.getByteArray = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getByteArray", args); -}; - -exports.getValue = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getValue", args); -}; - -exports.getInfo = function (success, error) { - exec(success, error, "FirebasePlugin", "getInfo", []); -}; - -exports.setConfigSettings = function (settings, success, error) { - exec(success, error, "FirebasePlugin", "setConfigSettings", [settings]); -}; - -exports.setDefaults = function (defaults, namespace, success, error) { - var args = [defaults]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "setDefaults", args); -}; - -}); diff --git a/StoneIsland/platforms/android/assets/www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/android/assets/www/plugins/phonegap-plugin-push/www/push.js index a5315486..7234d474 100644 --- a/StoneIsland/platforms/android/assets/www/plugins/phonegap-plugin-push/www/push.js +++ b/StoneIsland/platforms/android/assets/www/plugins/phonegap-plugin-push/www/push.js @@ -1,4 +1,16 @@ cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { +/** +* This file has been generated by Babel. +* +* DO NOT EDIT IT DIRECTLY +* +* Edit the JS source file src/js/push.js +**/'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + /* global cordova:false */ /* globals window */ @@ -8,322 +20,358 @@ cordova.define("phonegap-plugin-push.PushNotification", function(require, export var exec = cordova.require('cordova/exec'); -/** - * PushNotification constructor. - * - * @param {Object} options to initiate Push Notifications. - * @return {PushNotification} instance that can be monitored and cancelled. - */ +var PushNotification = function () { + /** + * PushNotification constructor. + * + * @param {Object} options to initiate Push Notifications. + * @return {PushNotification} instance that can be monitored and cancelled. + */ + function PushNotification(options) { + var _this = this; + + _classCallCheck(this, PushNotification); -var PushNotification = function(options) { - this._handlers = { - 'registration': [], - 'notification': [], - 'error': [] + this.handlers = { + registration: [], + notification: [], + error: [] }; // require options parameter if (typeof options === 'undefined') { - throw new Error('The options argument is required.'); + throw new Error('The options argument is required.'); } // store the options to this object instance this.options = options; // triggered on registration and notification - var that = this; - var success = function(result) { - if (result && typeof result.registrationId !== 'undefined') { - that.emit('registration', result); - } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { - var executeFuctionOrEmitEventByName = function(callbackName, context, arg) { - var namespaces = callbackName.split('.'); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } + var success = function success(result) { + if (result && typeof result.registrationId !== 'undefined') { + _this.emit('registration', result); + } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { + var executeFuctionOrEmitEventByName = function executeFuctionOrEmitEventByName(functionName, context) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } - if (typeof context[func] === 'function') { - context[func].call(context, arg); - } else { - that.emit(callbackName, arg); - } - }; + var namespaces = functionName.split('.'); + var func = namespaces.pop(); + for (var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } - executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); - } else if (result) { - that.emit('notification', result); - } + if (typeof context[func] === 'function') { + context[func].call(context, args); + } else { + _this.emit(functionName, args); + } + }; + + executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); + } else if (result) { + _this.emit('notification', result); + } }; // triggered on error - var fail = function(msg) { - var e = (typeof msg === 'string') ? new Error(msg) : msg; - that.emit('error', e); + var fail = function fail(msg) { + var e = typeof msg === 'string' ? new Error(msg) : msg; + _this.emit('error', e); }; // wait at least one process tick to allow event subscriptions - setTimeout(function() { - exec(success, fail, 'PushNotification', 'init', [options]); + setTimeout(function () { + exec(success, fail, 'PushNotification', 'init', [options]); }, 10); -}; + } + + /** + * Unregister from push notifications + */ -/** - * Unregister from push notifications - */ -PushNotification.prototype.unregister = function(successCallback, errorCallback, options) { - if (!errorCallback) { errorCallback = function() {}; } + _createClass(PushNotification, [{ + key: 'unregister', + value: function unregister(successCallback) { + var _this2 = this; - if (typeof errorCallback !== 'function') { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var options = arguments[2]; + + if (typeof errorCallback !== 'function') { console.log('PushNotification.unregister failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unregister failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unregister failure: success callback parameter ' + ' must be a function'); return; - } + } - var that = this; - var cleanHandlersAndPassThrough = function() { + var cleanHandlersAndPassThrough = function cleanHandlersAndPassThrough() { if (!options) { - that._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; + _this2.handlers = { + registration: [], + notification: [], + error: [] + }; } successCallback(); - }; + }; - exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); -}; + exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); + } -/** - * subscribe to a topic - * @param {String} topic topic to subscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.subscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + /** + * subscribe to a topic + * @param {String} topic topic to subscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + + }, { + key: 'subscribe', + value: function subscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.subscribe failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.subscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'success callback parameter must be a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); } - exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); -}; + /** + * unsubscribe to a topic + * @param {String} topic topic to unsubscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ -/** - * unsubscribe to a topic - * @param {String} topic topic to unsubscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.unsubscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'unsubscribe', + value: function unsubscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('PushNotification.unsubscribe failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: ' + 'success callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); + } -/** - * Call this to set the application icon badge - */ + /** + * Call this to set the application icon badge + */ -PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'setApplicationIconBadgeNumber', + value: function setApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var badge = arguments[2]; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{badge: badge}]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{ badge: badge }]); + } -/** - * Get the application icon badge - */ + /** + * Get the application icon badge + */ -PushNotification.prototype.getApplicationIconBadgeNumber = function(successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'getApplicationIconBadgeNumber', + value: function getApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); -}; + exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); + } -/** - * Get the application icon badge - */ + /** + * Clear all notifications + */ -PushNotification.prototype.clearAllNotifications = function(successCallback, errorCallback) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'clearAllNotifications', + value: function clearAllNotifications() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: failure parameter ' + 'not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: success callback ' + 'parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); -}; - -/** - * Listen for an event. - * - * Any event is supported, but the following are built-in: - * - * - registration - * - notification - * - error - * - * @param {String} eventName to subscribe to. - * @param {Function} callback triggered on the event. - */ + exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); + } + /** + * Listen for an event. + * + * The following events are supported: + * + * - registration + * - notification + * - error + * + * @param {String} eventName to subscribe to. + * @param {Function} callback triggered on the event. + */ -PushNotification.prototype.on = function(eventName, callback) { - if (!this._handlers.hasOwnProperty(eventName)) { - this._handlers[eventName] = []; + }, { + key: 'on', + value: function on(eventName, callback) { + if (!this.handlers.hasOwnProperty(eventName)) { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(callback); } - this._handlers[eventName].push(callback); -}; -/** - * Remove event listener. - * - * @param {String} eventName to match subscription. - * @param {Function} handle function associated with event. - */ + /** + * Remove event listener. + * + * @param {String} eventName to match subscription. + * @param {Function} handle function associated with event. + */ -PushNotification.prototype.off = function (eventName, handle) { - if (this._handlers.hasOwnProperty(eventName)) { - var handleIndex = this._handlers[eventName].indexOf(handle); + }, { + key: 'off', + value: function off(eventName, handle) { + if (this.handlers.hasOwnProperty(eventName)) { + var handleIndex = this.handlers[eventName].indexOf(handle); if (handleIndex >= 0) { - this._handlers[eventName].splice(handleIndex, 1); + this.handlers[eventName].splice(handleIndex, 1); } + } } -}; -/** - * Emit an event. - * - * This is intended for internal use only. - * - * @param {String} eventName is the event to trigger. - * @param {*} all arguments are passed to the event listeners. - * - * @return {Boolean} is true when the event is triggered otherwise false. - */ + /** + * Emit an event. + * + * This is intended for internal use only. + * + * @param {String} eventName is the event to trigger. + * @param {*} all arguments are passed to the event listeners. + * + * @return {Boolean} is true when the event is triggered otherwise false. + */ -PushNotification.prototype.emit = function() { - var args = Array.prototype.slice.call(arguments); - var eventName = args.shift(); + }, { + key: 'emit', + value: function emit() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - if (!this._handlers.hasOwnProperty(eventName)) { + var eventName = args.shift(); + + if (!this.handlers.hasOwnProperty(eventName)) { return false; - } + } - for (var i = 0, length = this._handlers[eventName].length; i < length; i++) { - var callback = this._handlers[eventName][i]; + for (var i = 0, length = this.handlers[eventName].length; i < length; i++) { + var callback = this.handlers[eventName][i]; if (typeof callback === 'function') { - callback.apply(undefined,args); + callback.apply(undefined, args); } else { - console.log('event handler: ' + eventName + ' must be a function'); + console.log('event handler: ' + eventName + ' must be a function'); } - } + } - return true; -}; - -PushNotification.prototype.finish = function(successCallback, errorCallback, id) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - if (!id) { id = 'handler'; } + return true; + } + }, { + key: 'finish', + value: function finish() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'handler'; - if (typeof successCallback !== 'function') { + if (typeof successCallback !== 'function') { console.log('finish failure: success callback parameter must be a function'); return; - } + } - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('finish failure: failure parameter not a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); } + }]); - exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); -}; + return PushNotification; +}(); /*! * Push Notification Plugin. */ module.exports = { - /** - * Register for Push Notifications. - * - * This method will instantiate a new copy of the PushNotification object - * and start the registration process. - * - * @param {Object} options - * @return {PushNotification} instance - */ - - init: function(options) { - return new PushNotification(options); - }, + /** + * Register for Push Notifications. + * + * This method will instantiate a new copy of the PushNotification object + * and start the registration process. + * + * @param {Object} options + * @return {PushNotification} instance + */ - hasPermission: function(successCallback, errorCallback) { - exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); - }, + init: function init(options) { + return new PushNotification(options); + }, - /** - * PushNotification Object. - * - * Expose the PushNotification object for direct use - * and testing. Typically, you should use the - * .init helper method. - */ + hasPermission: function hasPermission(successCallback, errorCallback) { + exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); + }, - PushNotification: PushNotification + /** + * PushNotification Object. + * + * Expose the PushNotification object for direct use + * and testing. Typically, you should use the + * .init helper method. + */ + PushNotification: PushNotification }; - }); diff --git a/StoneIsland/platforms/android/build.gradle b/StoneIsland/platforms/android/build.gradle index c4752d60..dde2c8c1 100644 --- a/StoneIsland/platforms/android/build.gradle +++ b/StoneIsland/platforms/android/build.gradle @@ -30,8 +30,6 @@ buildscript { // http://tools.android.com/tech-docs/new-build-system/version-compatibility // and https://issues.apache.org/jira/browse/CB-8143 dependencies { - classpath "com.google.gms:google-services:3.0.0" - classpath "com.google.gms:google-services:3.0.0" classpath 'com.android.tools.build:gradle:2.2.3' } } @@ -91,7 +89,6 @@ ext { // PLUGIN GRADLE EXTENSIONS START apply from: "phonegap-plugin-push/stoneisland-push.gradle" -apply from: "cordova-plugin-firebase/stoneisland-build.gradle" // PLUGIN GRADLE EXTENSIONS END def hasBuildExtras = file('build-extras.gradle').exists() @@ -253,14 +250,9 @@ dependencies { // SUB-PROJECT DEPENDENCIES START debugCompile(project(path: "CordovaLib", configuration: "debug")) releaseCompile(project(path: "CordovaLib", configuration: "release")) - compile "com.android.support:support-v13:23+" - compile "com.google.android.gms:play-services-gcm:9.8+" - compile "me.leolin:ShortcutBadger:1.1.11@aar" - compile "com.google.gms:google-services:+" - compile "com.google.firebase:firebase-core:+" - compile "com.google.firebase:firebase-messaging:+" - compile "com.google.firebase:firebase-crash:+" - compile "com.google.firebase:firebase-config:+" + compile "com.android.support:support-v13:25.1.0" + compile "me.leolin:ShortcutBadger:1.1.17@aar" + compile "com.google.firebase:firebase-messaging:11.0.1" // SUB-PROJECT DEPENDENCIES END } diff --git a/StoneIsland/platforms/android/cordova-plugin-firebase/stoneisland-build.gradle b/StoneIsland/platforms/android/cordova-plugin-firebase/stoneisland-build.gradle deleted file mode 100755 index d5cb4edd..00000000 --- a/StoneIsland/platforms/android/cordova-plugin-firebase/stoneisland-build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.google.gms:google-services:3.0.0'
- }
-}
-repositories {
- mavenCentral()
-}
-dependencies {
- compile 'me.leolin:ShortcutBadger:1.1.4@aar'
- compile 'com.google.firebase:firebase-crash:+'
-}
diff --git a/StoneIsland/platforms/android/cordova/android_sdk_version b/StoneIsland/platforms/android/cordova/android_sdk_version index 547f41bd..34ed28fe 100755 --- a/StoneIsland/platforms/android/cordova/android_sdk_version +++ b/StoneIsland/platforms/android/cordova/android_sdk_version @@ -19,10 +19,10 @@ under the License. */ -var android_sdk_version = require('./lib/android_sdk_version'); +var android_sdk = require('./lib/android_sdk'); -android_sdk_version.run().done(null, function(err) { - console.log(err); +android_sdk.print_newest_available_sdk_target().done(null, function(err) { + console.error(err); process.exit(2); }); diff --git a/StoneIsland/platforms/android/cordova/android_sdk_version.bat b/StoneIsland/platforms/android/cordova/android_sdk_version.bat new file mode 100644 index 00000000..33a1fa25 --- /dev/null +++ b/StoneIsland/platforms/android/cordova/android_sdk_version.bat @@ -0,0 +1,26 @@ +:: Licensed to the Apache Software Foundation (ASF) under one +:: or more contributor license agreements. See the NOTICE file +:: distributed with this work for additional information +:: regarding copyright ownership. The ASF licenses this file +:: to you under the Apache License, Version 2.0 (the +:: "License"); you may not use this file except in compliance +:: with the License. You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, +:: software distributed under the License is distributed on an +:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +:: KIND, either express or implied. See the License for the +:: specific language governing permissions and limitations +:: under the License. + +@ECHO OFF +SET script_path="%~dp0android_sdk_version" +IF EXIST %script_path% ( + node "%script_path%" %* +) ELSE ( + ECHO. + ECHO ERROR: Could not find 'android_sdk_version' script in 'bin' folder, aborting...>&2 + EXIT /B 1 +) diff --git a/StoneIsland/platforms/android/cordova/lib/android_sdk.js b/StoneIsland/platforms/android/cordova/lib/android_sdk.js new file mode 100755 index 00000000..a1a806a6 --- /dev/null +++ b/StoneIsland/platforms/android/cordova/lib/android_sdk.js @@ -0,0 +1,106 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ + +var Q = require('q'), + superspawn = require('cordova-common').superspawn; + +var suffix_number_regex = /(\d+)$/; +// Used for sorting Android targets, example strings to sort: +// android-19 +// android-L +// Google Inc.:Google APIs:20 +// Google Inc.:Glass Development Kit Preview:20 +// The idea is to sort based on largest "suffix" number - meaning the bigger +// the number at the end, the more recent the target, the closer to the +// start of the array. +function sort_by_largest_numerical_suffix(a, b) { + var suffix_a = a.match(suffix_number_regex); + var suffix_b = b.match(suffix_number_regex); + if (suffix_a && suffix_b) { + // If the two targets being compared have suffixes, return less than + // zero, or greater than zero, based on which suffix is larger. + return (parseInt(suffix_a[1]) > parseInt(suffix_b[1]) ? -1 : 1); + } else { + // If no suffix numbers were detected, leave the order as-is between + // elements a and b. + return 0; + } +} + +module.exports.print_newest_available_sdk_target = function() { + return module.exports.list_targets() + .then(function(targets) { + targets.sort(sort_by_largest_numerical_suffix); + console.log(targets[0]); + }); +}; + +module.exports.version_string_to_api_level = { + '4.0': 14, + '4.0.3': 15, + '4.1': 16, + '4.2': 17, + '4.3': 18, + '4.4': 19, + '4.4W': 20, + '5.0': 21, + '5.1': 22, + '6.0': 23, + '7.0': 24, + '7.1.1': 25 +}; + +function parse_targets(output) { + var target_out = output.split('\n'); + var targets = []; + for (var i = target_out.length - 1; i >= 0; i--) { + if(target_out[i].match(/id:/)) { // if "id:" is in the line... + targets.push(target_out[i].match(/"(.+)"/)[1]); //.. match whatever is in quotes. + } + } + return targets; +} + +module.exports.list_targets_with_android = function() { + return superspawn.spawn('android', ['list', 'target']) + .then(parse_targets); +}; + +module.exports.list_targets_with_avdmanager = function() { + return superspawn.spawn('avdmanager', ['list', 'target']) + .then(parse_targets); +}; + +module.exports.list_targets = function() { + return module.exports.list_targets_with_avdmanager() + .catch(function(err) { + // If there's an error, like avdmanager could not be found, we can try + // as a last resort, to run `android`, in case this is a super old + // SDK installation. + if (err && (err.code == 'ENOENT' || (err.stderr && err.stderr.match(/not recognized/)))) { + return module.exports.list_targets_with_android(); + } else throw err; + }) + .then(function(targets) { + if (targets.length === 0) { + return Q.reject(new Error('No android targets (SDKs) installed!')); + } + return targets; + }); +}; diff --git a/StoneIsland/platforms/android/cordova/lib/android_sdk_version.js b/StoneIsland/platforms/android/cordova/lib/android_sdk_version.js deleted file mode 100755 index 79af2727..00000000 --- a/StoneIsland/platforms/android/cordova/lib/android_sdk_version.js +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env node - -/* - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -*/ - -var child_process = require('child_process'), - Q = require('q'); - -var get_highest_sdk = function(results){ - var reg = /\d+/; - var apiLevels = []; - for(var i=0;i<results.length;i++){ - apiLevels[i] = parseInt(results[i].match(reg)[0]); - } - apiLevels.sort(function(a,b){return b-a;}); - console.log(apiLevels[0]); -}; - -var get_sdks = function() { - var d = Q.defer(); - child_process.exec('android list targets', function(err, stdout, stderr) { - if (err) d.reject(stderr); - else d.resolve(stdout); - }); - - return d.promise.then(function(output) { - var reg = /android-\d+/gi; - var results = output.match(reg); - if(results.length===0){ - return Q.reject(new Error('No android sdks installed.')); - }else{ - get_highest_sdk(results); - } - - return Q(); - }, function(stderr) { - if (stderr.match(/command\snot\sfound/) || stderr.match(/'android' is not recognized/)) { - return Q.reject(new Error('The command \"android\" failed. Make sure you have the latest Android SDK installed, and the \"android\" command (inside the tools/ folder) is added to your path.')); - } else { - return Q.reject(new Error('An error occurred while listing Android targets')); - } - }); -}; - -module.exports.run = function() { - return Q.all([get_sdks()]); -}; - diff --git a/StoneIsland/platforms/android/cordova/lib/builders/GradleBuilder.js b/StoneIsland/platforms/android/cordova/lib/builders/GradleBuilder.js index f415646e..5b5ce13d 100644 --- a/StoneIsland/platforms/android/cordova/lib/builders/GradleBuilder.js +++ b/StoneIsland/platforms/android/cordova/lib/builders/GradleBuilder.js @@ -65,6 +65,21 @@ GradleBuilder.prototype.getArgs = function(cmd, opts) { return args; }; +/* + * This returns a promise + */ + +GradleBuilder.prototype.runGradleWrapper = function(gradle_cmd) { + var gradlePath = path.join(this.root, 'gradlew'); + var wrapperGradle = path.join(this.root, 'wrapper.gradle'); + if(fs.existsSync(gradlePath)) { + //Literally do nothing, for some reason this works, while !fs.existsSync didn't on Windows + } else { + return spawn(gradle_cmd, ['-p', this.root, 'wrapper', '-b', wrapperGradle], {stdio: 'inherit'}); + } +}; + + // Makes the project buildable, minus the gradle wrapper. GradleBuilder.prototype.prepBuildFiles = function() { // Update the version of build.gradle in each dependent library. @@ -159,17 +174,15 @@ GradleBuilder.prototype.prepBuildFiles = function() { GradleBuilder.prototype.prepEnv = function(opts) { var self = this; return check_reqs.check_gradle() - .then(function() { - return self.prepBuildFiles(); - }).then(function() { - // Copy the gradle wrapper on each build so that: - // A) we don't require the Android SDK at project creation time, and - // B) we always use the SDK's latest version of it. - // check_reqs ensures that this is set. - /*jshint -W069 */ - var sdkDir = process.env['ANDROID_HOME']; - /*jshint +W069 */ - var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper'); + .then(function(gradlePath) { + return self.runGradleWrapper(gradlePath); + }).then(function() { + return self.prepBuildFiles(); + }).then(function() { + // We now copy the gradle out of the framework + // This is a dirty patch to get the build working + /* + var wrapperDir = path.join(self.root, 'CordovaLib'); if (process.platform == 'win32') { shell.rm('-f', path.join(self.root, 'gradlew.bat')); shell.cp(path.join(wrapperDir, 'gradlew.bat'), self.root); @@ -180,13 +193,13 @@ GradleBuilder.prototype.prepEnv = function(opts) { shell.rm('-rf', path.join(self.root, 'gradle', 'wrapper')); shell.mkdir('-p', path.join(self.root, 'gradle')); shell.cp('-r', path.join(wrapperDir, 'gradle', 'wrapper'), path.join(self.root, 'gradle')); - +*/ // If the gradle distribution URL is set, make sure it points to version we want. // If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with. // For some reason, using ^ and $ don't work. This does the job, though. var distributionUrlRegex = /distributionUrl.*zip/; /*jshint -W069 */ - var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-2.14.1-all.zip'; + var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-3.3-all.zip'; /*jshint +W069 */ var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties'); shell.chmod('u+w', gradleWrapperPropertiesPath); diff --git a/StoneIsland/platforms/android/cordova/lib/check_reqs.js b/StoneIsland/platforms/android/cordova/lib/check_reqs.js index ac6fa4c1..1fd397ad 100644 --- a/StoneIsland/platforms/android/cordova/lib/check_reqs.js +++ b/StoneIsland/platforms/android/cordova/lib/check_reqs.js @@ -26,10 +26,12 @@ var shelljs = require('shelljs'), Q = require('q'), path = require('path'), fs = require('fs'), - ROOT = path.join(__dirname, '..', '..'); + os = require('os'), + REPO_ROOT = path.join(__dirname, '..', '..', '..', '..'), + PROJECT_ROOT = path.join(__dirname, '..', '..'); var CordovaError = require('cordova-common').CordovaError; - -var isWindows = process.platform == 'win32'; +var superspawn = require('cordova-common').superspawn; +var android_sdk = require('./android_sdk'); function forgivingWhichSync(cmd) { try { @@ -50,7 +52,16 @@ function tryCommand(cmd, errMsg, catchStderr) { return d.promise; } -// Get valid target from framework/project.properties +module.exports.isWindows = function() { + return (os.platform() == 'win32'); +}; + +module.exports.isDarwin = function() { + return (os.platform() == 'darwin'); +}; + +// Get valid target from framework/project.properties if run from this repo +// Otherwise get target from project.properties file within a generated cordova-android project module.exports.get_target = function() { function extractFromFile(filePath) { var target = shelljs.grep(/\btarget=/, filePath); @@ -59,38 +70,83 @@ module.exports.get_target = function() { } return target.split('=')[1].trim(); } - if (fs.existsSync(path.join(ROOT, 'framework', 'project.properties'))) { - return extractFromFile(path.join(ROOT, 'framework', 'project.properties')); + var repo_file = path.join(REPO_ROOT, 'framework', 'project.properties'); + if (fs.existsSync(repo_file)) { + return extractFromFile(repo_file); } - if (fs.existsSync(path.join(ROOT, 'project.properties'))) { - // if no target found, we're probably in a project and project.properties is in ROOT. - return extractFromFile(path.join(ROOT, 'project.properties')); + var project_file = path.join(PROJECT_ROOT, 'project.properties'); + if (fs.existsSync(project_file)) { + // if no target found, we're probably in a project and project.properties is in PROJECT_ROOT. + return extractFromFile(project_file); } - throw new Error('Could not find android target. File missing: ' + path.join(ROOT, 'project.properties')); + throw new Error('Could not find android target in either ' + repo_file + ' nor ' + project_file); }; // Returns a promise. Called only by build and clean commands. module.exports.check_ant = function() { - return tryCommand('ant -version', 'Failed to run "ant -version", make sure you have ant installed and added to your PATH.') - .then(function (output) { + return superspawn.spawn('ant', ['-version']) + .then(function(output) { // Parse Ant version from command output return /version ((?:\d+\.)+(?:\d+))/i.exec(output)[1]; + }).catch(function(err) { + throw new CordovaError('Failed to run `ant -version`. Make sure you have `ant` on your $PATH.'); }); }; +module.exports.get_gradle_wrapper = function() { + var androidStudioPath; + var i = 0; + var foundStudio = false; + var program_dir; + if (module.exports.isDarwin()) { + program_dir = fs.readdirSync('/Applications'); + while (i < program_dir.length && !foundStudio) { + if (program_dir[i].startsWith('Android Studio')) { + //TODO: Check for a specific Android Studio version, make sure it's not Canary + androidStudioPath = path.join('/Applications', program_dir[i], 'Contents', 'gradle'); + foundStudio = true; + } else { ++i; } + } + } else if (module.exports.isWindows()) { + var androidPath = path.join(process.env['ProgramFiles'], 'Android') + '/'; + if (fs.existsSync(androidPath)) { + program_dir = fs.readdirSync(androidPath); + while (i < program_dir.length && !foundStudio) { + if (program_dir[i].startsWith('Android Studio')) { + foundStudio = true; + androidStudioPath = path.join(process.env['ProgramFiles'], 'Android', program_dir[i], 'gradle'); + } else { ++i; } + } + } + } + + if (androidStudioPath !== null && fs.existsSync(androidStudioPath)) { + var dirs = fs.readdirSync(androidStudioPath); + if(dirs[0].split('-')[0] == 'gradle') { + return path.join(androidStudioPath, dirs[0], 'bin', 'gradle'); + } + } else { + //OK, let's try to check for Gradle! + return forgivingWhichSync('gradle'); + } +}; + // Returns a promise. Called only by build and clean commands. module.exports.check_gradle = function() { var sdkDir = process.env['ANDROID_HOME']; + var d = Q.defer(); if (!sdkDir) return Q.reject(new CordovaError('Could not find gradle wrapper within Android SDK. Could not find Android SDK directory.\n' + 'Might need to install Android SDK or set up \'ANDROID_HOME\' env variable.')); - var wrapperDir = path.join(sdkDir, 'tools', 'templates', 'gradle', 'wrapper'); - if (!fs.existsSync(wrapperDir)) { - return Q.reject(new CordovaError('Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.\n' + - 'Looked here: ' + wrapperDir)); - } - return Q.when(); + var gradlePath = module.exports.get_gradle_wrapper(); + if (gradlePath.length !== 0) + d.resolve(gradlePath); + else + d.reject(new CordovaError('Could not find an installed version of Gradle either in Android Studio,\n' + + 'or on your system to install the gradle wrapper. Please include gradle \n' + + 'in your path, or install Android Studio')); + return d.promise; }; // Returns a promise. @@ -105,12 +161,15 @@ module.exports.check_java = function() { } } else { if (javacPath) { - var msg = 'Failed to find \'JAVA_HOME\' environment variable. Try setting setting it manually.'; // OS X has a command for finding JAVA_HOME. - if (fs.existsSync('/usr/libexec/java_home')) { - return tryCommand('/usr/libexec/java_home', msg) + var find_java = '/usr/libexec/java_home'; + var default_java_error_msg = 'Failed to find \'JAVA_HOME\' environment variable. Try setting setting it manually.'; + if (fs.existsSync(find_java)) { + return superspawn.spawn(find_java) .then(function(stdout) { process.env['JAVA_HOME'] = stdout.trim(); + }).catch(function(err) { + throw new CordovaError(default_java_error_msg); }); } else { // See if we can derive it from javac's location. @@ -119,10 +178,10 @@ module.exports.check_java = function() { if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) { process.env['JAVA_HOME'] = maybeJavaHome; } else { - throw new CordovaError(msg); + throw new CordovaError(default_java_error_msg); } } - } else if (isWindows) { + } else if (module.exports.isWindows()) { // Try to auto-detect java in the default install paths. var oldSilent = shelljs.config.silent; shelljs.config.silent = true; @@ -142,28 +201,29 @@ module.exports.check_java = function() { } } }).then(function() { - var msg = - 'Failed to run "javac -version", make sure that you have a JDK installed.\n' + - 'You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.\n'; - if (process.env['JAVA_HOME']) { - msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME'] + '\n'; - } - // We use tryCommand with catchStderr = true, because - // javac writes version info to stderr instead of stdout - return tryCommand('javac -version', msg, true) - .then(function (output) { - //Let's check for at least Java 8, and keep it future proof so we can support Java 10 - var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output); - return match && match[1]; - }); + var msg = + 'Failed to run "javac -version", make sure that you have a JDK installed.\n' + + 'You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.\n'; + if (process.env['JAVA_HOME']) { + msg += 'Your JAVA_HOME is invalid: ' + process.env['JAVA_HOME'] + '\n'; + } + // We use tryCommand with catchStderr = true, because + // javac writes version info to stderr instead of stdout + return tryCommand('javac -version', msg, true) + .then(function (output) { + //Let's check for at least Java 8, and keep it future proof so we can support Java 10 + var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output); + return match && match[1]; }); + }); }; // Returns a promise. module.exports.check_android = function() { return Q().then(function() { var androidCmdPath = forgivingWhichSync('android'); - var adbInPath = !!forgivingWhichSync('adb'); + var adbInPath = forgivingWhichSync('adb'); + var avdmanagerInPath = forgivingWhichSync('avdmanager'); var hasAndroidHome = !!process.env['ANDROID_HOME'] && fs.existsSync(process.env['ANDROID_HOME']); function maybeSetAndroidHome(value) { if (!hasAndroidHome && fs.existsSync(value)) { @@ -171,8 +231,10 @@ module.exports.check_android = function() { process.env['ANDROID_HOME'] = value; } } - if (!hasAndroidHome && !androidCmdPath) { - if (isWindows) { + // First ensure ANDROID_HOME is set + // If we have no hints (nothing in PATH), try a few default locations + if (!hasAndroidHome && !androidCmdPath && !adbInPath && !avdmanagerInPath) { + if (module.exports.isWindows()) { // Android Studio 1.0 installer maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'sdk')); maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'sdk')); @@ -182,7 +244,7 @@ module.exports.check_android = function() { // Stand-alone installer maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'android-sdk')); maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'android-sdk')); - } else if (process.platform == 'darwin') { + } else if (module.exports.isDarwin()) { // Android Studio 1.0 installer maybeSetAndroidHome(path.join(process.env['HOME'], 'Library', 'Android', 'sdk')); // Android Studio pre-1.0 installer @@ -197,26 +259,42 @@ module.exports.check_android = function() { maybeSetAndroidHome(path.join(process.env['HOME'], 'android-sdk')); } } - if (hasAndroidHome && !androidCmdPath) { - process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools'); - } - if (androidCmdPath && !hasAndroidHome) { - var parentDir = path.dirname(androidCmdPath); - var grandParentDir = path.dirname(parentDir); - if (path.basename(parentDir) == 'tools') { - process.env['ANDROID_HOME'] = path.dirname(parentDir); - hasAndroidHome = true; - } else if (fs.existsSync(path.join(grandParentDir, 'tools', 'android'))) { - process.env['ANDROID_HOME'] = grandParentDir; - hasAndroidHome = true; - } else { - throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' + - 'Detected \'android\' command at ' + parentDir + ' but no \'tools\' directory found near.\n' + - 'Try reinstall Android SDK or update your PATH to include path to valid SDK directory.'); + if (!hasAndroidHome) { + // If we dont have ANDROID_HOME, but we do have some tools on the PATH, try to infer from the tooling PATH. + var parentDir, grandParentDir; + if (androidCmdPath) { + parentDir = path.dirname(androidCmdPath); + grandParentDir = path.dirname(parentDir); + if (path.basename(parentDir) == 'tools' || fs.existsSync(path.join(grandParentDir, 'tools', 'android'))) { + maybeSetAndroidHome(grandParentDir); + } else { + throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' + + 'Detected \'android\' command at ' + parentDir + ' but no \'tools\' directory found near.\n' + + 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'tools directory.'); + } + } + if (adbInPath) { + parentDir = path.dirname(adbInPath); + grandParentDir = path.dirname(parentDir); + if (path.basename(parentDir) == 'platform-tools') { + maybeSetAndroidHome(grandParentDir); + } else { + throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' + + 'Detected \'adb\' command at ' + parentDir + ' but no \'platform-tools\' directory found near.\n' + + 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'platform-tools directory.'); + } + } + if (avdmanagerInPath) { + parentDir = path.dirname(avdmanagerInPath); + grandParentDir = path.dirname(parentDir); + if (path.basename(parentDir) == 'bin' && path.basename(grandParentDir) == 'tools') { + maybeSetAndroidHome(path.dirname(grandParentDir)); + } else { + throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' + + 'Detected \'avdmanager\' command at ' + parentDir + ' but no \'tools' + path.sep + 'bin\' directory found near.\n' + + 'Try reinstall Android SDK or update your PATH to include valid path to SDK' + path.sep + 'tools' + path.sep + 'bin directory.'); + } } - } - if (hasAndroidHome && !adbInPath) { - process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'platform-tools'); } if (!process.env['ANDROID_HOME']) { throw new CordovaError('Failed to find \'ANDROID_HOME\' environment variable. Try setting setting it manually.\n' + @@ -226,13 +304,27 @@ module.exports.check_android = function() { throw new CordovaError('\'ANDROID_HOME\' environment variable is set to non-existent path: ' + process.env['ANDROID_HOME'] + '\nTry update it manually to point to valid SDK directory.'); } + // Next let's make sure relevant parts of the SDK tooling is in our PATH + if (hasAndroidHome && !androidCmdPath) { + process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools'); + } + if (hasAndroidHome && !adbInPath) { + process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'platform-tools'); + } + if (hasAndroidHome && !avdmanagerInPath) { + process.env['PATH'] += path.delimiter + path.join(process.env['ANDROID_HOME'], 'tools', 'bin'); + } return hasAndroidHome; }); }; +// TODO: is this actually needed? module.exports.getAbsoluteAndroidCmd = function () { var cmd = forgivingWhichSync('android'); - if (process.platform === 'win32') { + if (cmd.length === 0) { + cmd = forgivingWhichSync('sdkmanager'); + } + if (module.exports.isWindows()) { return '"' + cmd + '"'; } return cmd.replace(/(\s)/g, '\\$1'); @@ -244,20 +336,17 @@ module.exports.check_android_target = function(originalError) { // android-L // Google Inc.:Google APIs:20 // Google Inc.:Glass Development Kit Preview:20 - var valid_target = module.exports.get_target(); - var msg = 'Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.'; - return tryCommand('android list targets --compact', msg) - .then(function(output) { - var targets = output.split('\n'); - if (targets.indexOf(valid_target) >= 0) { + var desired_api_level = module.exports.get_target(); + return android_sdk.list_targets() + .then(function(targets) { + if (targets.indexOf(desired_api_level) >= 0) { return targets; } - var androidCmd = module.exports.getAbsoluteAndroidCmd(); - var msg = 'Please install Android target: "' + valid_target + '".\n\n' + + var msg = 'Please install Android target / API level: "' + desired_api_level + '".\n\n' + 'Hint: Open the SDK manager by running: ' + androidCmd + '\n' + 'You will require:\n' + - '1. "SDK Platform" for ' + valid_target + '\n' + + '1. "SDK Platform" for API level ' + desired_api_level + '\n' + '2. "Android SDK Platform-tools (latest)\n' + '3. "Android SDK Build-tools" (latest)'; if (originalError) { @@ -278,7 +367,6 @@ module.exports.run = function() { throw new CordovaError('Requirements check failed for JDK 1.8 or greater'); } - if (!values[1]) { throw new CordovaError('Requirements check failed for Android SDK'); } diff --git a/StoneIsland/platforms/android/cordova/lib/emulator.js b/StoneIsland/platforms/android/cordova/lib/emulator.js index ff1e261c..22209aa0 100644 --- a/StoneIsland/platforms/android/cordova/lib/emulator.js +++ b/StoneIsland/platforms/android/cordova/lib/emulator.js @@ -27,11 +27,15 @@ var path = require('path'); var Adb = require('./Adb'); var AndroidManifest = require('./AndroidManifest'); var events = require('cordova-common').events; -var spawn = require('cordova-common').superspawn.spawn; +var superspawn = require('cordova-common').superspawn; var CordovaError = require('cordova-common').CordovaError; +var shelljs = require('shelljs'); +var android_sdk = require('./android_sdk'); +var check_reqs = require('./check_reqs'); var Q = require('q'); var os = require('os'); +var fs = require('fs'); var child_process = require('child_process'); // constants @@ -42,18 +46,77 @@ var NUM_INSTALL_RETRIES = 3; var CHECK_BOOTED_INTERVAL = 3 * ONE_SECOND; // in milliseconds var EXEC_KILL_SIGNAL = 'SIGKILL'; -/** - * Returns a Promise for a list of emulator images in the form of objects - * { - name : <emulator_name>, - path : <path_to_emulator_image>, - target : <api_target>, - abi : <cpu>, - skin : <skin> - } - */ -module.exports.list_images = function() { - return spawn('android', ['list', 'avds']) +function forgivingWhichSync(cmd) { + try { + return fs.realpathSync(shelljs.which(cmd)); + } catch (e) { + return ''; + } +} + +module.exports.list_images_using_avdmanager = function () { + return superspawn.spawn('avdmanager', ['list', 'avd']) + .then(function(output) { + var response = output.split('\n'); + var emulator_list = []; + for (var i = 1; i < response.length; i++) { + // To return more detailed information use img_obj + var img_obj = {}; + if (response[i].match(/Name:\s/)) { + img_obj['name'] = response[i].split('Name: ')[1].replace('\r', ''); + if (response[i + 1].match(/Device:\s/)) { + i++; + img_obj['device'] = response[i].split('Device: ')[1].replace('\r', ''); + } + if (response[i + 1].match(/Path:\s/)) { + i++; + img_obj['path'] = response[i].split('Path: ')[1].replace('\r', ''); + } + if (response[i + 1].match(/Target:\s/)) { + i++; + if (response[i + 1].match(/ABI:\s/)) { + img_obj['abi'] = response[i + 1].split('ABI: ')[1].replace('\r', ''); + } + // This next conditional just aims to match the old output of `android list avd` + // We do so so that we don't have to change the logic when parsing for the + // best emulator target to spawn (see below in `best_image`) + // This allows us to transitionally support both `android` and `avdmanager` binaries, + // depending on what SDK version the user has + if (response[i + 1].match(/Based\son:\s/)) { + img_obj['target'] = response[i + 1].split('Based on:')[1]; + if (img_obj['target'].match(/Tag\/ABI:\s/)) { + img_obj['target'] = img_obj['target'].split('Tag/ABI:')[0].replace('\r', '').trim(); + if (img_obj['target'].indexOf('(') > -1) { + img_obj['target'] = img_obj['target'].substr(0, img_obj['target'].indexOf('(') - 1).trim(); + } + } + var version_string = img_obj['target'].replace(/Android\s+/, ''); + + var api_level = android_sdk.version_string_to_api_level[version_string]; + if (api_level) { + img_obj['target'] += ' (API level ' + api_level + ')'; + } + } + } + if (response[i + 1].match(/Skin:\s/)) { + i++; + img_obj['skin'] = response[i].split('Skin: ')[1].replace('\r', ''); + } + + emulator_list.push(img_obj); + } + /* To just return a list of names use this + if (response[i].match(/Name:\s/)) { + emulator_list.push(response[i].split('Name: ')[1].replace('\r', ''); + }*/ + + } + return emulator_list; + }); +}; + +module.exports.list_images_using_android = function() { + return superspawn.spawn('android', ['list', 'avd']) .then(function(output) { var response = output.split('\n'); var emulator_list = []; @@ -97,6 +160,29 @@ module.exports.list_images = function() { }; /** + * Returns a Promise for a list of emulator images in the form of objects + * { + name : <emulator_name>, + device : <device>, + path : <path_to_emulator_image>, + target : <api_target>, + abi : <cpu>, + skin : <skin> + } + */ +module.exports.list_images = function() { + if (forgivingWhichSync('avdmanager')) { + return module.exports.list_images_using_avdmanager(); + } else if (forgivingWhichSync('android')) { + return module.exports.list_images_using_android(); + } else { + return Q().then(function() { + throw new CordovaError('Could not find either `android` or `avdmanager` on your $PATH! Are you sure the Android SDK is installed and available?'); + }); + } +}; + +/** * Will return the closest avd to the projects target * or undefined if no avds exist. * Returns a promise. @@ -109,8 +195,7 @@ module.exports.best_image = function() { var closest = 9999; var best = images[0]; - // Loading check_reqs at run-time to avoid test-time vs run-time directory structure difference issue - var project_target = require('./check_reqs').get_target().replace('android-', ''); + var project_target = check_reqs.get_target().replace('android-', ''); for (var i in images) { var target = images[i].target; if(target) { @@ -133,8 +218,9 @@ module.exports.list_started = function() { }; // Returns a promise. +// TODO: we should remove this, there's a more robust method under android_sdk.js module.exports.list_targets = function() { - return spawn('android', ['list', 'targets'], {cwd: os.tmpdir()}) + return superspawn.spawn('android', ['list', 'targets'], {cwd: os.tmpdir()}) .then(function(output) { var target_out = output.split('\n'); var targets = []; @@ -189,8 +275,7 @@ module.exports.start = function(emulator_ID, boot_timeout) { return best.name; } - // Loading check_reqs at run-time to avoid test-time vs run-time directory structure difference issue - var androidCmd = require('./check_reqs').getAbsoluteAndroidCmd(); + var androidCmd = check_reqs.getAbsoluteAndroidCmd(); return Q.reject(new CordovaError('No emulator images (avds) found.\n' + '1. Download desired System Image by running: ' + androidCmd + ' sdk\n' + '2. Create an AVD by running: ' + androidCmd + ' avd\n' + @@ -199,10 +284,13 @@ module.exports.start = function(emulator_ID, boot_timeout) { }).then(function(emulatorId) { return self.get_available_port() .then(function (port) { + // Figure out the directory the emulator binary runs in, and set the cwd to that directory. + // Workaround for https://code.google.com/p/android/issues/detail?id=235461 + var emulator_dir = path.dirname(shelljs.which('emulator')); var args = ['-avd', emulatorId, '-port', port]; // Don't wait for it to finish, since the emulator will probably keep running for a long time. child_process - .spawn('emulator', args, { stdio: 'inherit', detached: true }) + .spawn('emulator', args, { stdio: 'inherit', detached: true, cwd: emulator_dir }) .unref(); // wait for emulator to start @@ -294,7 +382,7 @@ module.exports.wait_for_boot = function(emulator_id, time_remaining) { module.exports.create_image = function(name, target) { console.log('Creating new avd named ' + name); if (target) { - return spawn('android', ['create', 'avd', '--name', name, '--target', target]) + return superspawn.spawn('android', ['create', 'avd', '--name', name, '--target', target]) .then(null, function(error) { console.error('ERROR : Failed to create emulator image : '); console.error(' Do you have the latest android targets including ' + target + '?'); @@ -302,7 +390,8 @@ module.exports.create_image = function(name, target) { }); } else { console.log('WARNING : Project target not found, creating avd with a different target but the project may fail to install.'); - return spawn('android', ['create', 'avd', '--name', name, '--target', this.list_targets()[0]]) + // TODO: there's a more robust method for finding targets in android_sdk.js + return superspawn.spawn('android', ['create', 'avd', '--name', name, '--target', this.list_targets()[0]]) .then(function() { // TODO: This seems like another error case, even though it always happens. console.error('ERROR : Unable to create an avd emulator, no targets found.'); diff --git a/StoneIsland/platforms/android/cordova/lib/list-devices b/StoneIsland/platforms/android/cordova/lib/list-devices index fa84d7f6..8e22c7f2 100755 --- a/StoneIsland/platforms/android/cordova/lib/list-devices +++ b/StoneIsland/platforms/android/cordova/lib/list-devices @@ -22,7 +22,7 @@ var devices = require('./device'); // Usage support for when args are given -require('../lib/check_reqs').check_android().then(function() { +require('./check_reqs').check_android().then(function() { devices.list().done(function(device_list) { device_list && device_list.forEach(function(dev) { console.log(dev); diff --git a/StoneIsland/platforms/android/cordova/lib/list-emulator-images b/StoneIsland/platforms/android/cordova/lib/list-emulator-images index 03c827fe..25e5c81a 100755 --- a/StoneIsland/platforms/android/cordova/lib/list-emulator-images +++ b/StoneIsland/platforms/android/cordova/lib/list-emulator-images @@ -22,7 +22,7 @@ var emulators = require('./emulator'); // Usage support for when args are given -require('../lib/check_reqs').check_android().then(function() { +require('./check_reqs').check_android().then(function() { emulators.list_images().done(function(emulator_list) { emulator_list && emulator_list.forEach(function(emu) { console.log(emu.name); diff --git a/StoneIsland/platforms/android/cordova/lib/list-started-emulators b/StoneIsland/platforms/android/cordova/lib/list-started-emulators index a890dec6..43ebda25 100755 --- a/StoneIsland/platforms/android/cordova/lib/list-started-emulators +++ b/StoneIsland/platforms/android/cordova/lib/list-started-emulators @@ -22,7 +22,7 @@ var emulators = require('./emulator'); // Usage support for when args are given -require('../lib/check_reqs').check_android().then(function() { +require('./check_reqs').check_android().then(function() { emulators.list_started().done(function(emulator_list) { emulator_list && emulator_list.forEach(function(emu) { console.log(emu); diff --git a/StoneIsland/platforms/android/cordova/lib/prepare.js b/StoneIsland/platforms/android/cordova/lib/prepare.js index 10a69ea3..504eb612 100644 --- a/StoneIsland/platforms/android/cordova/lib/prepare.js +++ b/StoneIsland/platforms/android/cordova/lib/prepare.js @@ -48,6 +48,7 @@ module.exports.prepare = function (cordovaProject, options) { .then(function () { updateIcons(cordovaProject, path.relative(cordovaProject.root, self.locations.res)); updateSplashes(cordovaProject, path.relative(cordovaProject.root, self.locations.res)); + updateFileResources(cordovaProject, path.relative(cordovaProject.root, self.locations.root)); }) .then(function () { events.emit('verbose', 'Prepared android project successfully'); @@ -72,6 +73,7 @@ module.exports.clean = function (options) { cleanWww(projectRoot, self.locations); cleanIcons(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res)); cleanSplashes(projectRoot, projectConfig, path.relative(projectRoot, self.locations.res)); + cleanFileResources(projectRoot, projectConfig, path.relative(projectRoot, self.locations.root)); }); }; @@ -401,6 +403,44 @@ function mapImageResources(rootDir, subDir, type, resourceName) { return pathMap; } + +function updateFileResources(cordovaProject, platformDir) { + var files = cordovaProject.projectConfig.getFileResources('android'); + + // if there are resource-file elements in config.xml + if (files.length === 0) { + events.emit('verbose', 'This app does not have additional resource files defined'); + return; + } + + var resourceMap = {}; + files.forEach(function(res) { + var targetPath = path.join(platformDir, res.target); + resourceMap[targetPath] = res.src; + }); + + events.emit('verbose', 'Updating resource files at ' + platformDir); + FileUpdater.updatePaths( + resourceMap, { rootDir: cordovaProject.root }, logFileOp); +} + + +function cleanFileResources(projectRoot, projectConfig, platformDir) { + var files = projectConfig.getFileResources('android'); + if (files.length > 0) { + events.emit('verbose', 'Cleaning resource files at ' + platformDir); + + var resourceMap = {}; + files.forEach(function(res) { + var filePath = path.join(platformDir, res.target); + resourceMap[filePath] = null; + }); + + FileUpdater.updatePaths( + resourceMap, { rootDir: projectRoot, all: true}, logFileOp); + } +} + /** * Gets and validates 'AndroidLaunchMode' prepference from config.xml. Returns * preference value and warns if it doesn't seems to be valid diff --git a/StoneIsland/platforms/android/cordova/version b/StoneIsland/platforms/android/cordova/version index 9bf79a18..cdc2e80a 100755 --- a/StoneIsland/platforms/android/cordova/version +++ b/StoneIsland/platforms/android/cordova/version @@ -20,7 +20,7 @@ */ // Coho updates this line: -var VERSION = "6.1.2"; +var VERSION = "6.2.3"; module.exports.version = VERSION; diff --git a/StoneIsland/platforms/android/google-services.json b/StoneIsland/platforms/android/google-services.json deleted file mode 100644 index e69de29b..00000000 --- a/StoneIsland/platforms/android/google-services.json +++ /dev/null diff --git a/StoneIsland/platforms/android/phonegap-plugin-push/stoneisland-push.gradle b/StoneIsland/platforms/android/phonegap-plugin-push/stoneisland-push.gradle index 11e735ae..1506191b 100644 --- a/StoneIsland/platforms/android/phonegap-plugin-push/stoneisland-push.gradle +++ b/StoneIsland/platforms/android/phonegap-plugin-push/stoneisland-push.gradle @@ -16,6 +16,24 @@ android { } defaultConfig { + multiDexEnabled true applicationId = doExtractStringFromManifest("package") } } + +buildscript { + repositories { + jcenter() + mavenLocal() + } + dependencies { + classpath 'com.android.tools.build:gradle:+' + classpath 'com.google.gms:google-services:3.0.0' + } +} + +// apply plugin: 'com.google.gms.google-services' +// class must be used instead of id(string) to be able to apply plugin from non-root gradle file +ext.postBuildExtras = { + apply plugin: com.google.gms.googleservices.GoogleServicesPlugin +} diff --git a/StoneIsland/platforms/android/platform_www/cordova.js b/StoneIsland/platforms/android/platform_www/cordova.js index 18c020e7..bda7c3e5 100644 --- a/StoneIsland/platforms/android/platform_www/cordova.js +++ b/StoneIsland/platforms/android/platform_www/cordova.js @@ -1,5 +1,5 @@ // Platform: android -// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20 +// 7ef9f9c03167a4dde4372d869472241b6816fee9 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '6.1.2'; +var PLATFORM_VERSION_BUILD_LABEL = '6.2.3'; // file: src/scripts/require.js /*jshint -W079 */ @@ -330,7 +330,7 @@ module.exports = cordova; }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/nativeapiprovider.js +// file: /Users/maj/src/cordova-android/cordova-js-src/android/nativeapiprovider.js define("cordova/android/nativeapiprovider", function(require, exports, module) { /** @@ -353,7 +353,7 @@ module.exports = { }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/android/promptbasednativeapi.js +// file: /Users/maj/src/cordova-android/cordova-js-src/android/promptbasednativeapi.js define("cordova/android/promptbasednativeapi", function(require, exports, module) { /** @@ -886,7 +886,7 @@ module.exports = channel; }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/exec.js +// file: /Users/maj/src/cordova-android/cordova-js-src/exec.js define("cordova/exec", function(require, exports, module) { /** @@ -1649,7 +1649,7 @@ exports.reset(); }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/platform.js +// file: /Users/maj/src/cordova-android/cordova-js-src/platform.js define("cordova/platform", function(require, exports, module) { // The last resume event that was received that had the result of a plugin call. @@ -1759,7 +1759,7 @@ function onMessageFromNative(msg) { }); -// file: /Users/steveng/repo/cordova/cordova-android/cordova-js-src/plugin/android/app.js +// file: /Users/maj/src/cordova-android/cordova-js-src/plugin/android/app.js define("cordova/plugin/android/app", function(require, exports, module) { var exec = require('cordova/exec'); diff --git a/StoneIsland/platforms/android/platform_www/cordova_plugins.js b/StoneIsland/platforms/android/platform_www/cordova_plugins.js index ea5e1643..8aaece20 100755 --- a/StoneIsland/platforms/android/platform_www/cordova_plugins.js +++ b/StoneIsland/platforms/android/platform_www/cordova_plugins.js @@ -98,14 +98,6 @@ module.exports = [ "runs": true }, { - "id": "phonegap-plugin-push.PushNotification", - "file": "plugins/phonegap-plugin-push/www/push.js", - "pluginId": "phonegap-plugin-push", - "clobbers": [ - "PushNotification" - ] - }, - { "id": "cordova-plugin-statusbar.statusbar", "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", "pluginId": "cordova-plugin-statusbar", @@ -114,11 +106,11 @@ module.exports = [ ] }, { - "id": "cordova-plugin-firebase.FirebasePlugin", - "file": "plugins/cordova-plugin-firebase/www/firebase.js", - "pluginId": "cordova-plugin-firebase", + "id": "phonegap-plugin-push.PushNotification", + "file": "plugins/phonegap-plugin-push/www/push.js", + "pluginId": "phonegap-plugin-push", "clobbers": [ - "FirebasePlugin" + "PushNotification" ] } ]; @@ -137,10 +129,9 @@ module.exports.metadata = "cordova-plugin-compat": "1.1.0", "cordova-plugin-geolocation": "2.4.0", "ionic-plugin-keyboard": "2.2.1", - "phonegap-plugin-push": "1.9.2", "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24", - "cordova-plugin-app-name": "1.0.4" + "cordova-plugin-app-name": "1.0.4", + "phonegap-plugin-push": "2.0.0" }; // BOTTOM OF METADATA });
\ No newline at end of file diff --git a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-firebase/www/firebase.js b/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-firebase/www/firebase.js deleted file mode 100644 index e1e423d1..00000000 --- a/StoneIsland/platforms/android/platform_www/plugins/cordova-plugin-firebase/www/firebase.js +++ /dev/null @@ -1,124 +0,0 @@ -cordova.define("cordova-plugin-firebase.FirebasePlugin", function(require, exports, module) { -var exec = require('cordova/exec'); - -exports.getInstanceId = function(success, error) { - exec(success, error, "FirebasePlugin", "getInstanceId", []); -}; - -exports.getToken = function(success, error) { - exec(success, error, "FirebasePlugin", "getToken", []); -}; - -exports.onNotificationOpen = function(success, error) { - exec(success, error, "FirebasePlugin", "onNotificationOpen", []); -}; - -exports.onTokenRefresh = function(success, error) { - exec(success, error, "FirebasePlugin", "onTokenRefresh", []); -}; - -exports.grantPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "grantPermission", []); -}; - -exports.hasPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "hasPermission", []); -}; - -exports.setBadgeNumber = function(number, success, error) { - exec(success, error, "FirebasePlugin", "setBadgeNumber", [number]); -}; - -exports.getBadgeNumber = function(success, error) { - exec(success, error, "FirebasePlugin", "getBadgeNumber", []); -}; - -exports.subscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "subscribe", [topic]); -}; - -exports.unsubscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "unsubscribe", [topic]); -}; - -exports.unregister = function(success, error) { - exec(success, error, "FirebasePlugin", "unregister", []); -}; - -exports.logEvent = function(name, params, success, error) { - exec(success, error, "FirebasePlugin", "logEvent", [name, params]); -}; - -exports.logError = function(message, success, error) { - exec(success, error, "FirebasePlugin", "logError", [message]); -}; - -exports.setScreenName = function(name, success, error) { - exec(success, error, "FirebasePlugin", "setScreenName", [name]); -}; - -exports.setUserId = function(id, success, error) { - exec(success, error, "FirebasePlugin", "setUserId", [id]); -}; - -exports.setUserProperty = function(name, value, success, error) { - exec(success, error, "FirebasePlugin", "setUserProperty", [name, value]); -}; - -exports.activateFetched = function (success, error) { - exec(success, error, "FirebasePlugin", "activateFetched", []); -}; - -exports.fetch = function (cacheExpirationSeconds, success, error) { - var args = []; - if (typeof cacheExpirationSeconds === 'number') { - args.push(cacheExpirationSeconds); - } else { - error = success; - success = cacheExpirationSeconds; - } - exec(success, error, "FirebasePlugin", "fetch", args); -}; - -exports.getByteArray = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getByteArray", args); -}; - -exports.getValue = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getValue", args); -}; - -exports.getInfo = function (success, error) { - exec(success, error, "FirebasePlugin", "getInfo", []); -}; - -exports.setConfigSettings = function (settings, success, error) { - exec(success, error, "FirebasePlugin", "setConfigSettings", [settings]); -}; - -exports.setDefaults = function (defaults, namespace, success, error) { - var args = [defaults]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "setDefaults", args); -}; - -}); diff --git a/StoneIsland/platforms/android/platform_www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/android/platform_www/plugins/phonegap-plugin-push/www/push.js index a5315486..7234d474 100644 --- a/StoneIsland/platforms/android/platform_www/plugins/phonegap-plugin-push/www/push.js +++ b/StoneIsland/platforms/android/platform_www/plugins/phonegap-plugin-push/www/push.js @@ -1,4 +1,16 @@ cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { +/** +* This file has been generated by Babel. +* +* DO NOT EDIT IT DIRECTLY +* +* Edit the JS source file src/js/push.js +**/'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + /* global cordova:false */ /* globals window */ @@ -8,322 +20,358 @@ cordova.define("phonegap-plugin-push.PushNotification", function(require, export var exec = cordova.require('cordova/exec'); -/** - * PushNotification constructor. - * - * @param {Object} options to initiate Push Notifications. - * @return {PushNotification} instance that can be monitored and cancelled. - */ +var PushNotification = function () { + /** + * PushNotification constructor. + * + * @param {Object} options to initiate Push Notifications. + * @return {PushNotification} instance that can be monitored and cancelled. + */ + function PushNotification(options) { + var _this = this; + + _classCallCheck(this, PushNotification); -var PushNotification = function(options) { - this._handlers = { - 'registration': [], - 'notification': [], - 'error': [] + this.handlers = { + registration: [], + notification: [], + error: [] }; // require options parameter if (typeof options === 'undefined') { - throw new Error('The options argument is required.'); + throw new Error('The options argument is required.'); } // store the options to this object instance this.options = options; // triggered on registration and notification - var that = this; - var success = function(result) { - if (result && typeof result.registrationId !== 'undefined') { - that.emit('registration', result); - } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { - var executeFuctionOrEmitEventByName = function(callbackName, context, arg) { - var namespaces = callbackName.split('.'); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } + var success = function success(result) { + if (result && typeof result.registrationId !== 'undefined') { + _this.emit('registration', result); + } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { + var executeFuctionOrEmitEventByName = function executeFuctionOrEmitEventByName(functionName, context) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } - if (typeof context[func] === 'function') { - context[func].call(context, arg); - } else { - that.emit(callbackName, arg); - } - }; + var namespaces = functionName.split('.'); + var func = namespaces.pop(); + for (var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } - executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); - } else if (result) { - that.emit('notification', result); - } + if (typeof context[func] === 'function') { + context[func].call(context, args); + } else { + _this.emit(functionName, args); + } + }; + + executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); + } else if (result) { + _this.emit('notification', result); + } }; // triggered on error - var fail = function(msg) { - var e = (typeof msg === 'string') ? new Error(msg) : msg; - that.emit('error', e); + var fail = function fail(msg) { + var e = typeof msg === 'string' ? new Error(msg) : msg; + _this.emit('error', e); }; // wait at least one process tick to allow event subscriptions - setTimeout(function() { - exec(success, fail, 'PushNotification', 'init', [options]); + setTimeout(function () { + exec(success, fail, 'PushNotification', 'init', [options]); }, 10); -}; + } + + /** + * Unregister from push notifications + */ -/** - * Unregister from push notifications - */ -PushNotification.prototype.unregister = function(successCallback, errorCallback, options) { - if (!errorCallback) { errorCallback = function() {}; } + _createClass(PushNotification, [{ + key: 'unregister', + value: function unregister(successCallback) { + var _this2 = this; - if (typeof errorCallback !== 'function') { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var options = arguments[2]; + + if (typeof errorCallback !== 'function') { console.log('PushNotification.unregister failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unregister failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unregister failure: success callback parameter ' + ' must be a function'); return; - } + } - var that = this; - var cleanHandlersAndPassThrough = function() { + var cleanHandlersAndPassThrough = function cleanHandlersAndPassThrough() { if (!options) { - that._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; + _this2.handlers = { + registration: [], + notification: [], + error: [] + }; } successCallback(); - }; + }; - exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); -}; + exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); + } -/** - * subscribe to a topic - * @param {String} topic topic to subscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.subscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + /** + * subscribe to a topic + * @param {String} topic topic to subscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + + }, { + key: 'subscribe', + value: function subscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.subscribe failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.subscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'success callback parameter must be a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); } - exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); -}; + /** + * unsubscribe to a topic + * @param {String} topic topic to unsubscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ -/** - * unsubscribe to a topic - * @param {String} topic topic to unsubscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.unsubscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'unsubscribe', + value: function unsubscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('PushNotification.unsubscribe failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: ' + 'success callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); + } -/** - * Call this to set the application icon badge - */ + /** + * Call this to set the application icon badge + */ -PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'setApplicationIconBadgeNumber', + value: function setApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var badge = arguments[2]; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{badge: badge}]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{ badge: badge }]); + } -/** - * Get the application icon badge - */ + /** + * Get the application icon badge + */ -PushNotification.prototype.getApplicationIconBadgeNumber = function(successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'getApplicationIconBadgeNumber', + value: function getApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); -}; + exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); + } -/** - * Get the application icon badge - */ + /** + * Clear all notifications + */ -PushNotification.prototype.clearAllNotifications = function(successCallback, errorCallback) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'clearAllNotifications', + value: function clearAllNotifications() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: failure parameter ' + 'not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: success callback ' + 'parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); -}; - -/** - * Listen for an event. - * - * Any event is supported, but the following are built-in: - * - * - registration - * - notification - * - error - * - * @param {String} eventName to subscribe to. - * @param {Function} callback triggered on the event. - */ + exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); + } + /** + * Listen for an event. + * + * The following events are supported: + * + * - registration + * - notification + * - error + * + * @param {String} eventName to subscribe to. + * @param {Function} callback triggered on the event. + */ -PushNotification.prototype.on = function(eventName, callback) { - if (!this._handlers.hasOwnProperty(eventName)) { - this._handlers[eventName] = []; + }, { + key: 'on', + value: function on(eventName, callback) { + if (!this.handlers.hasOwnProperty(eventName)) { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(callback); } - this._handlers[eventName].push(callback); -}; -/** - * Remove event listener. - * - * @param {String} eventName to match subscription. - * @param {Function} handle function associated with event. - */ + /** + * Remove event listener. + * + * @param {String} eventName to match subscription. + * @param {Function} handle function associated with event. + */ -PushNotification.prototype.off = function (eventName, handle) { - if (this._handlers.hasOwnProperty(eventName)) { - var handleIndex = this._handlers[eventName].indexOf(handle); + }, { + key: 'off', + value: function off(eventName, handle) { + if (this.handlers.hasOwnProperty(eventName)) { + var handleIndex = this.handlers[eventName].indexOf(handle); if (handleIndex >= 0) { - this._handlers[eventName].splice(handleIndex, 1); + this.handlers[eventName].splice(handleIndex, 1); } + } } -}; -/** - * Emit an event. - * - * This is intended for internal use only. - * - * @param {String} eventName is the event to trigger. - * @param {*} all arguments are passed to the event listeners. - * - * @return {Boolean} is true when the event is triggered otherwise false. - */ + /** + * Emit an event. + * + * This is intended for internal use only. + * + * @param {String} eventName is the event to trigger. + * @param {*} all arguments are passed to the event listeners. + * + * @return {Boolean} is true when the event is triggered otherwise false. + */ -PushNotification.prototype.emit = function() { - var args = Array.prototype.slice.call(arguments); - var eventName = args.shift(); + }, { + key: 'emit', + value: function emit() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - if (!this._handlers.hasOwnProperty(eventName)) { + var eventName = args.shift(); + + if (!this.handlers.hasOwnProperty(eventName)) { return false; - } + } - for (var i = 0, length = this._handlers[eventName].length; i < length; i++) { - var callback = this._handlers[eventName][i]; + for (var i = 0, length = this.handlers[eventName].length; i < length; i++) { + var callback = this.handlers[eventName][i]; if (typeof callback === 'function') { - callback.apply(undefined,args); + callback.apply(undefined, args); } else { - console.log('event handler: ' + eventName + ' must be a function'); + console.log('event handler: ' + eventName + ' must be a function'); } - } + } - return true; -}; - -PushNotification.prototype.finish = function(successCallback, errorCallback, id) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - if (!id) { id = 'handler'; } + return true; + } + }, { + key: 'finish', + value: function finish() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'handler'; - if (typeof successCallback !== 'function') { + if (typeof successCallback !== 'function') { console.log('finish failure: success callback parameter must be a function'); return; - } + } - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('finish failure: failure parameter not a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); } + }]); - exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); -}; + return PushNotification; +}(); /*! * Push Notification Plugin. */ module.exports = { - /** - * Register for Push Notifications. - * - * This method will instantiate a new copy of the PushNotification object - * and start the registration process. - * - * @param {Object} options - * @return {PushNotification} instance - */ - - init: function(options) { - return new PushNotification(options); - }, + /** + * Register for Push Notifications. + * + * This method will instantiate a new copy of the PushNotification object + * and start the registration process. + * + * @param {Object} options + * @return {PushNotification} instance + */ - hasPermission: function(successCallback, errorCallback) { - exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); - }, + init: function init(options) { + return new PushNotification(options); + }, - /** - * PushNotification Object. - * - * Expose the PushNotification object for direct use - * and testing. Typically, you should use the - * .init helper method. - */ + hasPermission: function hasPermission(successCallback, errorCallback) { + exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); + }, - PushNotification: PushNotification + /** + * PushNotification Object. + * + * Expose the PushNotification object for direct use + * and testing. Typically, you should use the + * .init helper method. + */ + PushNotification: PushNotification }; - }); diff --git a/StoneIsland/platforms/android/project.properties b/StoneIsland/platforms/android/project.properties index c708ff82..0a077db0 100755 --- a/StoneIsland/platforms/android/project.properties +++ b/StoneIsland/platforms/android/project.properties @@ -11,14 +11,8 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. target=android-25 -android.library.reference.1=CordovaLib cordova.gradle.include.1=phonegap-plugin-push/stoneisland-push.gradle -cordova.system.library.1=com.android.support:support-v13:23+ -cordova.system.library.2=com.google.android.gms:play-services-gcm:9.8+ -cordova.system.library.3=me.leolin:ShortcutBadger:1.1.11@aar -cordova.gradle.include.2=cordova-plugin-firebase/stoneisland-build.gradle -cordova.system.library.4=com.google.gms:google-services:+ -cordova.system.library.5=com.google.firebase:firebase-core:+ -cordova.system.library.6=com.google.firebase:firebase-messaging:+ -cordova.system.library.7=com.google.firebase:firebase-crash:+ -cordova.system.library.8=com.google.firebase:firebase-config:+
\ No newline at end of file +cordova.system.library.1=com.android.support:support-v13:25.1.0 +cordova.system.library.2=me.leolin:ShortcutBadger:1.1.17@aar +cordova.system.library.3=com.google.firebase:firebase-messaging:11.0.1 +android.library.reference.1=CordovaLib diff --git a/StoneIsland/platforms/android/res/values/colors.xml b/StoneIsland/platforms/android/res/values/colors.xml deleted file mode 100644 index 6f1665a5..00000000 --- a/StoneIsland/platforms/android/res/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <color name="primary">#FFFFFF00</color> - <color name="primary_dark">#FF220022</color> - <color name="accent">#FF00FFFF</color> -</resources>
\ No newline at end of file diff --git a/StoneIsland/platforms/android/res/values/strings.xml b/StoneIsland/platforms/android/res/values/strings.xml index 84421037..bd922fe9 100755 --- a/StoneIsland/platforms/android/res/values/strings.xml +++ b/StoneIsland/platforms/android/res/values/strings.xml @@ -3,7 +3,4 @@ <string name="app_name">Stone Island</string> <string name="launcher_name">@string/app_name</string> <string name="activity_name">@string/launcher_name</string> - <string name="google_app_id">XXXXXXX</string> - <string name="google_app_id">@string/google_app_id</string> - <string name="google_api_key">@string/google_api_key</string> </resources> diff --git a/StoneIsland/platforms/android/res/xml/config.xml b/StoneIsland/platforms/android/res/xml/config.xml index 3125e402..549366ea 100644 --- a/StoneIsland/platforms/android/res/xml/config.xml +++ b/StoneIsland/platforms/android/res/xml/config.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-versionCode="6000" id="us.okfoc.stoneisland" version="0.8.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-versionCode="6090" id="us.okfoc.stoneisland" version="0.9.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <feature name="InAppBrowser"> <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" /> </feature> @@ -33,15 +33,16 @@ <param name="android-package" value="io.ionic.keyboard.IonicKeyboard" /> <param name="onload" value="true" /> </feature> - <feature name="PushNotification"> - <param name="android-package" value="com.adobe.phonegap.push.PushPlugin" /> + <feature name="StatusBar"> + <param name="android-package" value="org.apache.cordova.statusbar.StatusBar" /> + <param name="onload" value="true" /> </feature> - <name>Stone Island</name> + <name>StoneIsland</name> <description> Stone Island </description> - <author email="frontdesk@okfoc.us" href="http://okfoc.us/"> - OKFocus + <author email="julescarbon@gmail.com" href="http://asdf.us/"> + Jules Laplace </author> <content src="index.html" /> <access origin="*" /> @@ -53,6 +54,7 @@ <allow-intent href="geo:*" /> <allow-intent href="market:*" /> <preference name="loglevel" value="DEBUG" /> + <preference name="AppName" value="Stone Island" /> <preference name="EnableViewportScale" value="true" /> <preference name="BackupWebStorage" value="local" /> <preference name="TopActivityIndicator" value="white" /> @@ -61,21 +63,15 @@ <preference name="HideKeyboardFormAccessoryBar" value="false" /> <preference name="orientation" value="portrait" /> <preference name="StatusBarOverlaysWebView" value="false" /> - <preference name="StatusBarBackgroundColor" value="#000000" /> - <preference name="StatusBarStyle" value="lightcontent" /> + <preference name="StatusBarBackgroundColor" value="#ffffff" /> + <preference name="StatusBarStyle" value="default" /> <preference name="SplashMaintainAspectRatio" value="true" /> <preference name="ShowSplashScreenSpinner" value="false" /> <preference name="AutoHideSplashScreen" value="false" /> <preference name="AllowInlineMediaPlayback" value="true" /> <preference name="AndroidLaunchMode" value="singleTop" /> <preference name="android-minSdkVersion" value="21" /> - <feature name="StatusBar"> - <param name="android-package" value="org.apache.cordova.statusbar.StatusBar" /> - <param name="onload" value="true" /> - </feature> - <feature name="FirebasePlugin"> - <param name="android-package" value="org.apache.cordova.firebase.FirebasePlugin" /> - <param name="onload" value="true" /> + <feature name="PushNotification"> + <param name="android-package" value="com.adobe.phonegap.push.PushPlugin" /> </feature> - <preference name="AppName" value="Stone Island" /> </widget> diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/BackgroundActionButtonHandler.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/BackgroundActionButtonHandler.java index 3ccea6cb..4456f525 100644 --- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/BackgroundActionButtonHandler.java +++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/BackgroundActionButtonHandler.java @@ -9,7 +9,7 @@ import android.util.Log; import android.support.v4.app.RemoteInput; public class BackgroundActionButtonHandler extends BroadcastReceiver implements PushConstants { - private static String LOG_TAG = "PushPlugin_BackgroundActionButtonHandler"; + private static String LOG_TAG = "Push_BGActionButton"; @Override public void onReceive(Context context, Intent intent) { @@ -19,7 +19,7 @@ public class BackgroundActionButtonHandler extends BroadcastReceiver implements int notId = intent.getIntExtra(NOT_ID, 0); Log.d(LOG_TAG, "not id = " + notId); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.cancel(GCMIntentService.getAppName(context), notId); + notificationManager.cancel(FCMService.getAppName(context), notId); if (extras != null) { Bundle originalExtras = extras.getBundle(PUSH_BUNDLE); diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/GCMIntentService.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/FCMService.java index e1a2b75c..af328fb2 100644 --- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/GCMIntentService.java +++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/FCMService.java @@ -13,17 +13,23 @@ import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; +import android.graphics.RectF; +import android.graphics.Paint; +import android.graphics.Canvas; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; import android.support.v4.app.NotificationCompat.WearableExtender; import android.support.v4.app.RemoteInput; import android.text.Html; import android.text.Spanned; import android.util.Log; -import com.google.android.gms.gcm.GcmListenerService; +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; import org.json.JSONArray; import org.json.JSONException; @@ -36,12 +42,13 @@ import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.Map; import java.util.Random; @SuppressLint("NewApi") -public class GCMIntentService extends GcmListenerService implements PushConstants { +public class FCMService extends FirebaseMessagingService implements PushConstants { - private static final String LOG_TAG = "PushPlugin_GCMIntentService"; + private static final String LOG_TAG = "Push_FCMService"; private static HashMap<Integer, ArrayList<String>> messageMap = new HashMap<Integer, ArrayList<String>>(); public void setNotification(int notId, String message){ @@ -59,17 +66,31 @@ public class GCMIntentService extends GcmListenerService implements PushConstant } @Override - public void onMessageReceived(String from, Bundle extras) { + public void onMessageReceived(RemoteMessage message){ + + String from = message.getFrom(); Log.d(LOG_TAG, "onMessage - from: " + from); - if (extras != null) { + Bundle extras = new Bundle(); + + if (message.getNotification()!=null) { + extras.putString(TITLE,message.getNotification().getTitle()); + extras.putString(MESSAGE,message.getNotification().getBody()); + } + for (Map.Entry<String, String> entry : message.getData().entrySet()) { + extras.putString(entry.getKey(), entry.getValue()); + } + + if (extras != null && isAvailableSender(from)) { Context applicationContext = getApplicationContext(); SharedPreferences prefs = applicationContext.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean forceShow = prefs.getBoolean(FORCE_SHOW, false); boolean clearBadge = prefs.getBoolean(CLEAR_BADGE, false); + String messageKey = prefs.getString(MESSAGE_KEY, MESSAGE); + String titleKey = prefs.getString(TITLE_KEY, TITLE); - extras = normalizeExtras(applicationContext, extras); + extras = normalizeExtras(applicationContext, extras, messageKey, titleKey); if (clearBadge) { PushPlugin.setApplicationIconBadgeNumber(getApplicationContext(), 0); @@ -167,10 +188,10 @@ public class GCMIntentService extends GcmListenerService implements PushConstant /* * Replace alternate keys with our canonical value */ - private String normalizeKey(String key) { - if (key.equals(BODY) || key.equals(ALERT) || key.equals(GCM_NOTIFICATION_BODY) || key.equals(TWILIO_BODY)) { + private String normalizeKey(String key, String messageKey, String titleKey) { + if (key.equals(BODY) || key.equals(ALERT) || key.equals(MP_MESSAGE) || key.equals(GCM_NOTIFICATION_BODY) || key.equals(TWILIO_BODY) || key.equals(messageKey)) { return MESSAGE; - } else if (key.equals(TWILIO_TITLE)) { + } else if (key.equals(TWILIO_TITLE) || key.equals(SUBJECT) || key.equals(titleKey)) { return TITLE; }else if (key.equals(MSGCNT) || key.equals(BADGE)) { return COUNT; @@ -191,7 +212,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant /* * Parse bundle into normalized keys. */ - private Bundle normalizeExtras(Context context, Bundle extras) { + private Bundle normalizeExtras(Context context, Bundle extras, String messageKey, String titleKey) { Log.d(LOG_TAG, "normalize extras"); Iterator<String> it = extras.keySet().iterator(); Bundle newExtras = new Bundle(); @@ -203,7 +224,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant // If normalizeKeythe key is "data" or "message" and the value is a json object extract // This is to support parse.com and other services. Issue #147 and pull #218 - if (key.equals(PARSE_COM_DATA) || key.equals(MESSAGE)) { + if (key.equals(PARSE_COM_DATA) || key.equals(MESSAGE) || key.equals(messageKey)) { Object json = extras.get(key); // Make sure data is json object stringified if ( json instanceof String && ((String) json).startsWith("{") ) { @@ -211,7 +232,8 @@ public class GCMIntentService extends GcmListenerService implements PushConstant try { // If object contains message keys promote each value to the root of the bundle JSONObject data = new JSONObject((String) json); - if ( data.has(ALERT) || data.has(MESSAGE) || data.has(BODY) || data.has(TITLE) ) { + if ( data.has(ALERT) || data.has(MESSAGE) || data.has(BODY) || data.has(TITLE) || + data.has(messageKey) || data.has(titleKey) ) { Iterator<String> jsonIter = data.keys(); while (jsonIter.hasNext()) { String jsonKey = jsonIter.next(); @@ -219,7 +241,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant Log.d(LOG_TAG, "key = data/" + jsonKey); String value = data.getString(jsonKey); - jsonKey = normalizeKey(jsonKey); + jsonKey = normalizeKey(jsonKey, messageKey, titleKey); value = localizeKey(context, jsonKey, value); newExtras.putString(jsonKey, value); @@ -228,6 +250,10 @@ public class GCMIntentService extends GcmListenerService implements PushConstant } catch( JSONException e) { Log.e(LOG_TAG, "normalizeExtras: JSON exception"); } + } else { + String newKey = normalizeKey(key, messageKey, titleKey); + Log.d(LOG_TAG, "replace key " + key + " with " + newKey); + replaceKey(context, key, newKey, extras, newExtras); } } else if (key.equals(("notification"))) { Bundle value = extras.getBundle(key); @@ -236,7 +262,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant String notifkey = iterator.next(); Log.d(LOG_TAG, "notifkey = " + notifkey); - String newKey = normalizeKey(notifkey); + String newKey = normalizeKey(notifkey, messageKey, titleKey); Log.d(LOG_TAG, "replace key " + notifkey + " with " + newKey); String valueData = value.getString(notifkey); @@ -245,12 +271,17 @@ public class GCMIntentService extends GcmListenerService implements PushConstant newExtras.putString(newKey, valueData); } continue; + // In case we weren't working on the payload data node or the notification node, + // normalize the key. + // This allows to have "message" as the payload data key without colliding + // with the other "message" key (holding the body of the payload) + // See issue #1663 + } else { + String newKey = normalizeKey(key, messageKey, titleKey); + Log.d(LOG_TAG, "replace key " + key + " with " + newKey); + replaceKey(context, key, newKey, extras, newExtras); } - String newKey = normalizeKey(key); - Log.d(LOG_TAG, "replace key " + key + " with " + newKey); - replaceKey(context, key, newKey, extras, newExtras); - } // while return newExtras; @@ -301,15 +332,15 @@ public class GCMIntentService extends GcmListenerService implements PushConstant createNotification(context, extras); } - if(!PushPlugin.isActive() && "1".equals(forceStart)){ + if(!PushPlugin.isActive() && "1".equals(forceStart)){ Log.d(LOG_TAG, "app is not running but we should start it and put in background"); - Intent intent = new Intent(this, PushHandlerActivity.class); + Intent intent = new Intent(this, PushHandlerActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(PUSH_BUNDLE, extras); - intent.putExtra(START_IN_BACKGROUND, true); + intent.putExtra(START_IN_BACKGROUND, true); intent.putExtra(FOREGROUND, false); startActivity(intent); - } else if ("1".equals(contentAvailable)) { + } else if ("1".equals(contentAvailable)) { Log.d(LOG_TAG, "app is not running and content available true"); Log.d(LOG_TAG, "send notification event"); PushPlugin.sendExtras(extras); @@ -331,12 +362,22 @@ public class GCMIntentService extends GcmListenerService implements PushConstant int requestCode = new Random().nextInt(); PendingIntent contentIntent = PendingIntent.getActivity(this, requestCode, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); + Intent dismissedNotificationIntent = new Intent(this, PushDismissedHandler.class); + dismissedNotificationIntent.putExtra(PUSH_BUNDLE, extras); + dismissedNotificationIntent.putExtra(NOT_ID, notId); + dismissedNotificationIntent.putExtra(DISMISSED, true); + dismissedNotificationIntent.setAction(PUSH_DISMISSED); + + requestCode = new Random().nextInt(); + PendingIntent deleteIntent = PendingIntent.getBroadcast(this, requestCode, dismissedNotificationIntent, PendingIntent.FLAG_CANCEL_CURRENT); + NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setWhen(System.currentTimeMillis()) .setContentTitle(fromHtml(extras.getString(TITLE))) .setTicker(fromHtml(extras.getString(TITLE))) .setContentIntent(contentIntent) + .setDeleteIntent(deleteIntent) .setAutoCancel(true); SharedPreferences prefs = context.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); @@ -690,11 +731,46 @@ public class GCMIntentService extends GcmListenerService implements PushConstant } } + private Bitmap getCircleBitmap(Bitmap bitmap) { + if (bitmap == null) { + return null; + } + + final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); + final Canvas canvas = new Canvas(output); + final int color = Color.RED; + final Paint paint = new Paint(); + final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); + final RectF rectF = new RectF(rect); + + paint.setAntiAlias(true); + canvas.drawARGB(0, 0, 0, 0); + paint.setColor(color); + float cx = bitmap.getWidth()/2; + float cy = bitmap.getHeight()/2; + float radius = cx < cy ? cx : cy; + canvas.drawCircle(cx,cy,radius,paint); + + paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); + canvas.drawBitmap(bitmap, rect, rect, paint); + + bitmap.recycle(); + + return output; + } + private void setNotificationLargeIcon(Bundle extras, String packageName, Resources resources, NotificationCompat.Builder mBuilder) { String gcmLargeIcon = extras.getString(IMAGE); // from gcm + String imageType = extras.getString(IMAGE_TYPE, IMAGE_TYPE_SQUARE); if (gcmLargeIcon != null && !"".equals(gcmLargeIcon)) { if (gcmLargeIcon.startsWith("http://") || gcmLargeIcon.startsWith("https://")) { - mBuilder.setLargeIcon(getBitmapFromURL(gcmLargeIcon)); + Bitmap bitmap = getBitmapFromURL(gcmLargeIcon); + if (IMAGE_TYPE_SQUARE.equalsIgnoreCase(imageType)) { + mBuilder.setLargeIcon(bitmap); + } else { + Bitmap bm = getCircleBitmap(bitmap); + mBuilder.setLargeIcon(bm); + } Log.d(LOG_TAG, "using remote large-icon from gcm"); } else { AssetManager assetManager = getAssets(); @@ -702,7 +778,12 @@ public class GCMIntentService extends GcmListenerService implements PushConstant try { istr = assetManager.open(gcmLargeIcon); Bitmap bitmap = BitmapFactory.decodeStream(istr); - mBuilder.setLargeIcon(bitmap); + if (IMAGE_TYPE_SQUARE.equalsIgnoreCase(imageType)) { + mBuilder.setLargeIcon(bitmap); + } else { + Bitmap bm = getCircleBitmap(bitmap); + mBuilder.setLargeIcon(bm); + } Log.d(LOG_TAG, "using assets large-icon from gcm"); } catch (IOException e) { int largeIconId = 0; @@ -762,6 +843,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant try { URL url = new URL(strURL); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(15000); connection.setDoInput(true); connection.connect(); InputStream input = connection.getInputStream(); @@ -799,4 +881,11 @@ public class GCMIntentService extends GcmListenerService implements PushConstant else return null; } + + private boolean isAvailableSender(String from) { + SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); + String savedSenderID = sharedPref.getString(SENDER_ID, ""); + + return from.equals(savedSenderID) || from.startsWith("/topics/"); + } } diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PermissionUtils.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PermissionUtils.java index 6aa5c9bf..41bc6a6f 100644 --- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PermissionUtils.java +++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PermissionUtils.java @@ -10,8 +10,12 @@ import java.lang.reflect.Method; public class PermissionUtils { private static final String CHECK_OP_NO_THROW = "checkOpNoThrow"; + private static final int MIN_API_LEVEL = 19; // required by AppOpsManager public static boolean hasPermission(Context appContext, String appOpsServiceId) throws UnknownError { + if (android.os.Build.VERSION.SDK_INT < MIN_API_LEVEL) { + return true; + } ApplicationInfo appInfo = appContext.getApplicationInfo(); diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushConstants.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushConstants.java index 37874e04..e3aa217c 100644 --- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushConstants.java +++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushConstants.java @@ -3,6 +3,7 @@ package com.adobe.phonegap.push; public interface PushConstants { public static final String COM_ADOBE_PHONEGAP_PUSH = "com.adobe.phonegap.push"; public static final String REGISTRATION_ID = "registrationId"; + public static final String REGISTRATION_TYPE = "registrationType"; public static final String FOREGROUND = "foreground"; public static final String TITLE = "title"; public static final String NOT_ID = "notId"; @@ -55,10 +56,11 @@ public interface PushConstants { public static final String FROM = "from"; public static final String COLLAPSE_KEY = "collapse_key"; public static final String FORCE_SHOW = "forceShow"; - public static final String GCM = "GCM"; + public static final String FCM = "FCM"; public static final String CONTENT_AVAILABLE = "content-available"; public static final String TOPICS = "topics"; public static final String SET_APPLICATION_ICON_BADGE_NUMBER = "setApplicationIconBadgeNumber"; + public static final String GET_APPLICATION_ICON_BADGE_NUMBER = "getApplicationIconBadgeNumber"; public static final String CLEAR_ALL_NOTIFICATIONS = "clearAllNotifications"; public static final String VISIBILITY = "visibility"; public static final String INLINE_REPLY = "inlineReply"; @@ -67,6 +69,18 @@ public interface PushConstants { public static final String TWILIO_BODY = "twi_body"; public static final String TWILIO_TITLE = "twi_title"; public static final String TWILIO_SOUND = "twi_sound"; + public static final String MP_MESSAGE = "mp_message"; public static final String START_IN_BACKGROUND = "cdvStartInBackground"; public static final String FORCE_START = "force-start"; + public static final String MESSAGE_KEY = "messageKey"; + public static final String TITLE_KEY = "titleKey"; + public static final String NO_CACHE = "no-cache"; + public static final String DISMISSED = "dismissed"; + public static final String IMAGE_TYPE = "image-type"; + public static final String IMAGE_TYPE_SQUARE = "square"; + public static final String IMAGE_TYPE_CIRCLE = "circle"; + public static final String SUBJECT = "subject"; + public static final String GOOGLE_APP_ID = "google_app_id"; + public static final String GCM_DEFAULT_SENDER_ID = "gcm_defaultSenderId"; + public static final String PUSH_DISMISSED = "push_dismissed"; } diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushDismissedHandler.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushDismissedHandler.java new file mode 100644 index 00000000..a517bc1e --- /dev/null +++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushDismissedHandler.java @@ -0,0 +1,25 @@ +package com.adobe.phonegap.push; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; + +public class PushDismissedHandler extends BroadcastReceiver implements PushConstants { + private static String LOG_TAG = "Push_DismissedHandler"; + + @Override + public void onReceive(Context context, Intent intent) { + Bundle extras = intent.getExtras(); + FCMService fcm = new FCMService(); + String action = intent.getAction(); + int notID = intent.getIntExtra(NOT_ID, 0); + + if (action.equals(PUSH_DISMISSED)) { + Log.d(LOG_TAG, "PushDismissedHandler = " + extras); + Log.d(LOG_TAG, "not id = " + notID); + + fcm.setNotification(notID, ""); + } + } +} diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java index 23682ac8..0d399a61 100644 --- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java +++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushHandlerActivity.java @@ -11,7 +11,7 @@ import android.support.v4.app.RemoteInput; public class PushHandlerActivity extends Activity implements PushConstants { - private static String LOG_TAG = "PushPlugin_PushHandlerActivity"; + private static String LOG_TAG = "Push_HandlerActivity"; /* * this activity will be started if the user touches a notification that we own. @@ -21,7 +21,7 @@ public class PushHandlerActivity extends Activity implements PushConstants { */ @Override public void onCreate(Bundle savedInstanceState) { - GCMIntentService gcm = new GCMIntentService(); + FCMService gcm = new FCMService(); Intent intent = getIntent(); @@ -34,16 +34,18 @@ public class PushHandlerActivity extends Activity implements PushConstants { Log.d(LOG_TAG, "callback = " + callback); boolean foreground = getIntent().getExtras().getBoolean("foreground", true); boolean startOnBackground = getIntent().getExtras().getBoolean(START_IN_BACKGROUND, false); + boolean dismissed = getIntent().getExtras().getBoolean(DISMISSED, false); + Log.d(LOG_TAG, "dismissed = " + dismissed); if(!startOnBackground){ NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.cancel(GCMIntentService.getAppName(this), notId); + notificationManager.cancel(FCMService.getAppName(this), notId); } boolean isPushPluginActive = PushPlugin.isActive(); boolean inline = processPushBundle(isPushPluginActive, intent); - if(inline && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N){ + if(inline && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N && !startOnBackground){ foreground = true; } @@ -51,15 +53,17 @@ public class PushHandlerActivity extends Activity implements PushConstants { finish(); - Log.d(LOG_TAG, "isPushPluginActive = " + isPushPluginActive); - if (!isPushPluginActive && foreground && inline) { - Log.d(LOG_TAG, "forceMainActivityReload"); - forceMainActivityReload(false); - } else if(startOnBackground) { - Log.d(LOG_TAG, "startOnBackgroundTrue"); - forceMainActivityReload(true); - } else { - Log.d(LOG_TAG, "don't want main activity"); + if(!dismissed) { + Log.d(LOG_TAG, "isPushPluginActive = " + isPushPluginActive); + if (!isPushPluginActive && foreground && inline) { + Log.d(LOG_TAG, "forceMainActivityReload"); + forceMainActivityReload(false); + } else if(startOnBackground) { + Log.d(LOG_TAG, "startOnBackgroundTrue"); + forceMainActivityReload(true); + } else { + Log.d(LOG_TAG, "don't want main activity"); + } } } @@ -76,7 +80,9 @@ public class PushHandlerActivity extends Activity implements PushConstants { originalExtras.putBoolean(FOREGROUND, false); originalExtras.putBoolean(COLDSTART, !isPushPluginActive); + originalExtras.putBoolean(DISMISSED, extras.getBoolean(DISMISSED)); originalExtras.putString(ACTION_CALLBACK, extras.getString(CALLBACK)); + originalExtras.remove(NO_CACHE); remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput != null) { diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushInstanceIDListenerService.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushInstanceIDListenerService.java index eaa39a48..176b7419 100644 --- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushInstanceIDListenerService.java +++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushInstanceIDListenerService.java @@ -5,23 +5,22 @@ import android.content.Context; import android.content.SharedPreferences; import android.util.Log; -import com.google.android.gms.iid.InstanceID; -import com.google.android.gms.iid.InstanceIDListenerService; +import com.google.firebase.iid.FirebaseInstanceId; +import com.google.firebase.iid.FirebaseInstanceIdService; import org.json.JSONException; import java.io.IOException; -public class PushInstanceIDListenerService extends InstanceIDListenerService implements PushConstants { - public static final String LOG_TAG = "PushPlugin_PushInstanceIDListenerService"; +public class PushInstanceIDListenerService extends FirebaseInstanceIdService implements PushConstants { + public static final String LOG_TAG = "Push_InsIdService"; @Override public void onTokenRefresh() { - SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); - String senderID = sharedPref.getString(SENDER_ID, ""); - if (!"".equals(senderID)) { - Intent intent = new Intent(this, RegistrationIntentService.class); - startService(intent); - } + // Get updated InstanceID token. + String refreshedToken = FirebaseInstanceId.getInstance().getToken(); + Log.d(LOG_TAG, "Refreshed token: " + refreshedToken); + // TODO: Implement this method to send any registration to your app's servers. + //sendRegistrationToServer(refreshedToken); } } diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushPlugin.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushPlugin.java index f6faaa2b..32f72bf3 100644 --- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushPlugin.java +++ b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/PushPlugin.java @@ -1,13 +1,14 @@ package com.adobe.phonegap.push; +import android.app.Activity; import android.app.NotificationManager; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; -import com.google.android.gms.gcm.GcmPubSub; -import com.google.android.gms.iid.InstanceID; +import com.google.firebase.iid.FirebaseInstanceId; +import com.google.firebase.messaging.FirebaseMessaging; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaInterface; @@ -29,7 +30,7 @@ import me.leolin.shortcutbadger.ShortcutBadger; public class PushPlugin extends CordovaPlugin implements PushConstants { - public static final String LOG_TAG = "PushPlugin"; + public static final String LOG_TAG = "Push_Plugin"; private static CallbackContext pushContext; private static CordovaWebView gWebView; @@ -59,6 +60,7 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { Log.v(LOG_TAG, "execute: data=" + data.toString()); SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); + String token = null; String senderID = null; try { @@ -66,15 +68,19 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { Log.v(LOG_TAG, "execute: jo=" + jo.toString()); - senderID = jo.getString(SENDER_ID); + senderID = getStringResourceByName(GCM_DEFAULT_SENDER_ID); Log.v(LOG_TAG, "execute: senderID=" + senderID); - String savedSenderID = sharedPref.getString(SENDER_ID, ""); - registration_id = InstanceID.getInstance(getApplicationContext()).getToken(senderID, GCM); + token = FirebaseInstanceId.getInstance().getToken(); - if (!"".equals(registration_id)) { - JSONObject json = new JSONObject().put(REGISTRATION_ID, registration_id); + if (token == null) { + token = FirebaseInstanceId.getInstance().getToken(senderID,FCM); + } + + if (!"".equals(token)) { + JSONObject json = new JSONObject().put(REGISTRATION_ID, token); + json.put(REGISTRATION_TYPE, FCM); Log.v(LOG_TAG, "onRegistered: " + json.toString()); @@ -83,14 +89,14 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { PushPlugin.sendEvent( json ); } else { - callbackContext.error("Empty registration ID received from GCM"); + callbackContext.error("Empty registration ID received from FCM"); return; } } catch (JSONException e) { Log.e(LOG_TAG, "execute: Got JSON Exception " + e.getMessage()); callbackContext.error(e.getMessage()); } catch (IOException e) { - Log.e(LOG_TAG, "execute: Got JSON Exception " + e.getMessage()); + Log.e(LOG_TAG, "execute: Got IO Exception " + e.getMessage()); callbackContext.error(e.getMessage()); } @@ -118,6 +124,8 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { editor.putBoolean(CLEAR_NOTIFICATIONS, jo.optBoolean(CLEAR_NOTIFICATIONS, true)); editor.putBoolean(FORCE_SHOW, jo.optBoolean(FORCE_SHOW, false)); editor.putString(SENDER_ID, senderID); + editor.putString(MESSAGE_KEY, jo.optString(MESSAGE_KEY)); + editor.putString(TITLE_KEY, jo.optString(TITLE_KEY)); editor.commit(); } @@ -143,7 +151,7 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { if (topics != null && !"".equals(registration_id)) { unsubscribeFromTopics(topics, registration_id); } else { - InstanceID.getInstance(getApplicationContext()).deleteInstanceID(); + FirebaseInstanceId.getInstance().deleteInstanceId(); Log.v(LOG_TAG, "UNREGISTER"); // Remove shared prefs @@ -194,6 +202,13 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { callbackContext.success(); } }); + } else if (GET_APPLICATION_ICON_BADGE_NUMBER.equals(action)) { + cordova.getThreadPool().execute(new Runnable() { + public void run() { + Log.v(LOG_TAG, "getApplicationIconBadgeNumber"); + callbackContext.success(getApplicationIconBadgeNumber(getApplicationContext())); + } + }); } else if (CLEAR_ALL_NOTIFICATIONS.equals(action)) { cordova.getThreadPool().execute(new Runnable() { public void run() { @@ -212,8 +227,6 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { callbackContext.success(); } catch (JSONException e) { callbackContext.error(e.getMessage()); - } catch (IOException e) { - callbackContext.error(e.getMessage()); } } }); @@ -227,8 +240,6 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { callbackContext.success(); } catch (JSONException e) { callbackContext.error(e.getMessage()); - } catch (IOException e) { - callbackContext.error(e.getMessage()); } } }); @@ -259,25 +270,41 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { /* * Sends the pushbundle extras to the client application. - * If the client application isn't currently active, it is cached for later processing. + * If the client application isn't currently active and the no-cache flag is not set, it is cached for later processing. */ public static void sendExtras(Bundle extras) { if (extras != null) { + String noCache = extras.getString(NO_CACHE); if (gWebView != null) { sendEvent(convertBundleToJson(extras)); - } else { + } else if(!"1".equals(noCache)){ Log.v(LOG_TAG, "sendExtras: caching extras to send at a later time."); gCachedExtras.add(extras); } } } + /* + * Retrives badge count from SharedPreferences + */ + public static int getApplicationIconBadgeNumber(Context context){ + SharedPreferences settings = context.getSharedPreferences(BADGE, Context.MODE_PRIVATE); + return settings.getInt(BADGE, 0); + } + + /* + * Sets badge count on application icon and in SharedPreferences + */ public static void setApplicationIconBadgeNumber(Context context, int badgeCount) { if (badgeCount > 0) { ShortcutBadger.applyCount(context, badgeCount); - } else { + }else{ ShortcutBadger.removeCount(context); } + + SharedPreferences.Editor editor = context.getSharedPreferences(BADGE, Context.MODE_PRIVATE).edit(); + editor.putInt(BADGE, Math.max(badgeCount, 0)); + editor.apply(); } @Override @@ -315,23 +342,7 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { notificationManager.cancelAll(); } - /** - * Transform `topic name` to `topic path` - * Normally, the `topic` inputed from end-user is `topic name` only. - * We should convert them to GCM `topic path` - * Example: - * when topic name = 'my-topic' - * then topic path = '/topics/my-topic' - * - * @param String topic The topic name - * @return The topic path - */ - private String getTopicPath(String topic) - { - return "/topics/" + topic; - } - - private void subscribeToTopics(JSONArray topics, String registrationToken) throws IOException { + private void subscribeToTopics(JSONArray topics, String registrationToken) { if (topics != null) { String topic = null; for (int i=0; i<topics.length(); i++) { @@ -341,16 +352,10 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { } } - private void subscribeToTopic(String topic, String registrationToken) throws IOException - { - try { - if (topic != null) { - Log.d(LOG_TAG, "Subscribing to topic: " + topic); - GcmPubSub.getInstance(getApplicationContext()).subscribe(registrationToken, getTopicPath(topic), null); - } - } catch (IOException e) { - Log.e(LOG_TAG, "Failed to subscribe to topic: " + topic, e); - throw e; + private void subscribeToTopic(String topic, String registrationToken) { + if (topic != null) { + Log.d(LOG_TAG, "Subscribing to topic: " + topic); + FirebaseMessaging.getInstance().subscribeToTopic(topic); } } @@ -358,29 +363,20 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { if (topics != null) { String topic = null; for (int i=0; i<topics.length(); i++) { - try { - topic = topics.optString(i, null); - if (topic != null) { - Log.d(LOG_TAG, "Unsubscribing to topic: " + topic); - GcmPubSub.getInstance(getApplicationContext()).unsubscribe(registrationToken, getTopicPath(topic)); - } - } catch (IOException e) { - Log.e(LOG_TAG, "Failed to unsubscribe to topic: " + topic, e); + topic = topics.optString(i, null); + unsubscribeFromTopic(topic, registrationToken); + if (topic != null) { + Log.d(LOG_TAG, "Unsubscribing to topic: " + topic); + FirebaseMessaging.getInstance().unsubscribeFromTopic(topic); } } } } - private void unsubscribeFromTopic(String topic, String registrationToken) throws IOException - { - try { - if (topic != null) { - Log.d(LOG_TAG, "Unsubscribing to topic: " + topic); - GcmPubSub.getInstance(getApplicationContext()).unsubscribe(registrationToken, getTopicPath(topic)); - } - } catch (IOException e) { - Log.e(LOG_TAG, "Failed to unsubscribe to topic: " + topic, e); - throw e; + private void unsubscribeFromTopic(String topic, String registrationToken) { + if (topic != null) { + Log.d(LOG_TAG, "Unsubscribing to topic: " + topic); + FirebaseMessaging.getInstance().unsubscribeFromTopic(topic); } } @@ -413,6 +409,9 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { else if (key.equals(FOREGROUND)) { additionalData.put(key, extras.getBoolean(FOREGROUND)); } + else if (key.equals(DISMISSED)) { + additionalData.put(key, extras.getBoolean(DISMISSED)); + } else if ( value instanceof String ) { String strValue = (String)value; try { @@ -444,6 +443,13 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { return null; } + private String getStringResourceByName(String aString) { + Activity activity = cordova.getActivity(); + String packageName = activity.getPackageName(); + int resId = activity.getResources().getIdentifier(aString, "string", packageName); + return activity.getString(resId); + } + public static boolean isInForeground() { return gForeground; } diff --git a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/RegistrationIntentService.java b/StoneIsland/platforms/android/src/com/adobe/phonegap/push/RegistrationIntentService.java deleted file mode 100644 index b181e88e..00000000 --- a/StoneIsland/platforms/android/src/com/adobe/phonegap/push/RegistrationIntentService.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.adobe.phonegap.push; - -import android.content.Context; - -import android.app.IntentService; -import android.content.Intent; -import android.content.SharedPreferences; -import android.util.Log; - -import com.google.android.gms.gcm.GoogleCloudMessaging; -import com.google.android.gms.iid.InstanceID; - -import java.io.IOException; - -public class RegistrationIntentService extends IntentService implements PushConstants { - public static final String LOG_TAG = "PushPlugin_RegistrationIntentService"; - - public RegistrationIntentService() { - super(LOG_TAG); - } - - @Override - protected void onHandleIntent(Intent intent) { - SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); - - try { - InstanceID instanceID = InstanceID.getInstance(this); - String senderID = sharedPreferences.getString(SENDER_ID, ""); - String token = instanceID.getToken(senderID, - GoogleCloudMessaging.INSTANCE_ID_SCOPE, null); - PushPlugin.setRegistrationID(token); - Log.i(LOG_TAG, "new GCM Registration Token: " + token); - - } catch (Exception e) { - Log.d(LOG_TAG, "Failed to complete token refresh", e); - } - } -} diff --git a/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePlugin.java b/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePlugin.java deleted file mode 100755 index 7e4431df..00000000 --- a/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePlugin.java +++ /dev/null @@ -1,601 +0,0 @@ -package org.apache.cordova.firebase; - -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.support.v4.app.NotificationManagerCompat; -import android.util.Base64; -import android.util.Log; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.analytics.FirebaseAnalytics; -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.messaging.FirebaseMessaging; -import com.google.firebase.remoteconfig.FirebaseRemoteConfig; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigInfo; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigValue; -import com.google.firebase.crash.FirebaseCrash; -import me.leolin.shortcutbadger.ShortcutBadger; -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.PluginResult; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -public class FirebasePlugin extends CordovaPlugin { - - private FirebaseAnalytics mFirebaseAnalytics; - private final String TAG = "FirebasePlugin"; - protected static final String KEY = "badge"; - - private static boolean inBackground = true; - private static ArrayList<Bundle> notificationStack = null; - private static CallbackContext notificationCallbackContext; - private static CallbackContext tokenRefreshCallbackContext; - - @Override - protected void pluginInitialize() { - final Context context = this.cordova.getActivity().getApplicationContext(); - final Bundle extras = this.cordova.getActivity().getIntent().getExtras(); - this.cordova.getThreadPool().execute(new Runnable() { - public void run() { - Log.d(TAG, "Starting Firebase plugin"); - mFirebaseAnalytics = FirebaseAnalytics.getInstance(context); - mFirebaseAnalytics.setAnalyticsCollectionEnabled(true); - if (extras != null && extras.size() > 1) { - if (FirebasePlugin.notificationStack == null) { - FirebasePlugin.notificationStack = new ArrayList<Bundle>(); - } - if (extras.containsKey("google.message_id")) { - extras.putBoolean("tap", true); - notificationStack.add(extras); - } - } - } - }); - } - - @Override - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - if (action.equals("getInstanceId")) { - this.getInstanceId(callbackContext); - return true; - } else if (action.equals("getToken")) { - this.getToken(callbackContext); - return true; - } else if (action.equals("hasPermission")) { - this.hasPermission(callbackContext); - return true; - } else if (action.equals("setBadgeNumber")) { - this.setBadgeNumber(callbackContext, args.getInt(0)); - return true; - } else if (action.equals("getBadgeNumber")) { - this.getBadgeNumber(callbackContext); - return true; - } else if (action.equals("subscribe")) { - this.subscribe(callbackContext, args.getString(0)); - return true; - } else if (action.equals("unsubscribe")) { - this.unsubscribe(callbackContext, args.getString(0)); - return true; - } else if (action.equals("unregister")) { - this.unregister(callbackContext); - return true; - } else if (action.equals("onNotificationOpen")) { - this.onNotificationOpen(callbackContext); - return true; - } else if (action.equals("onTokenRefresh")) { - this.onTokenRefresh(callbackContext); - return true; - } else if (action.equals("logEvent")) { - this.logEvent(callbackContext, args.getString(0), args.getJSONObject(1)); - return true; - } else if (action.equals("logError")) { - this.logError(callbackContext, args.getString(0)); - return true; - } else if (action.equals("setScreenName")) { - this.setScreenName(callbackContext, args.getString(0)); - return true; - } else if (action.equals("setUserId")) { - this.setUserId(callbackContext, args.getString(0)); - return true; - } else if (action.equals("setUserProperty")) { - this.setUserProperty(callbackContext, args.getString(0), args.getString(1)); - return true; - } else if (action.equals("activateFetched")) { - this.activateFetched(callbackContext); - return true; - } else if (action.equals("fetch")) { - if (args.length() > 0) this.fetch(callbackContext, args.getLong(0)); - else this.fetch(callbackContext); - return true; - } else if (action.equals("getByteArray")) { - if (args.length() > 1) this.getByteArray(callbackContext, args.getString(0), args.getString(1)); - else this.getByteArray(callbackContext, args.getString(0), null); - return true; - } else if (action.equals("getValue")) { - if (args.length() > 1) this.getValue(callbackContext, args.getString(0), args.getString(1)); - else this.getValue(callbackContext, args.getString(0), null); - return true; - } else if (action.equals("getInfo")) { - this.getInfo(callbackContext); - return true; - } else if (action.equals("setConfigSettings")) { - this.setConfigSettings(callbackContext, args.getJSONObject(0)); - return true; - } else if (action.equals("setDefaults")) { - if (args.length() > 1) this.setDefaults(callbackContext, args.getJSONObject(0), args.getString(1)); - else this.setDefaults(callbackContext, args.getJSONObject(0), null); - return true; - } - return false; - } - - @Override - public void onPause(boolean multitasking) { - FirebasePlugin.inBackground = true; - } - - @Override - public void onResume(boolean multitasking) { - FirebasePlugin.inBackground = false; - } - - @Override - public void onReset() { - FirebasePlugin.notificationCallbackContext = null; - FirebasePlugin.tokenRefreshCallbackContext = null; - } - - private void onNotificationOpen(final CallbackContext callbackContext) { - FirebasePlugin.notificationCallbackContext = callbackContext; - if (FirebasePlugin.notificationStack != null) { - for (Bundle bundle : FirebasePlugin.notificationStack) { - FirebasePlugin.sendNotification(bundle); - } - FirebasePlugin.notificationStack.clear(); - } - } - - private void onTokenRefresh(final CallbackContext callbackContext) { - FirebasePlugin.tokenRefreshCallbackContext = callbackContext; - - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - String currentToken = FirebaseInstanceId.getInstance().getToken(); - - if (currentToken != null) { - FirebasePlugin.sendToken(currentToken); - } - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - public static void sendNotification(Bundle bundle) { - if (!FirebasePlugin.hasNotificationsCallback()) { - if (FirebasePlugin.notificationStack == null) { - FirebasePlugin.notificationStack = new ArrayList<Bundle>(); - } - notificationStack.add(bundle); - return; - } - final CallbackContext callbackContext = FirebasePlugin.notificationCallbackContext; - if (callbackContext != null && bundle != null) { - JSONObject json = new JSONObject(); - Set<String> keys = bundle.keySet(); - for (String key : keys) { - try { - json.put(key, bundle.get(key)); - } catch (JSONException e) { - callbackContext.error(e.getMessage()); - return; - } - } - - PluginResult pluginresult = new PluginResult(PluginResult.Status.OK, json); - pluginresult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginresult); - } - } - - public static void sendToken(String token) { - if (FirebasePlugin.tokenRefreshCallbackContext == null) { - return; - } - final CallbackContext callbackContext = FirebasePlugin.tokenRefreshCallbackContext; - if (callbackContext != null && token != null) { - PluginResult pluginresult = new PluginResult(PluginResult.Status.OK, token); - pluginresult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginresult); - } - } - - public static boolean inBackground() { - return FirebasePlugin.inBackground; - } - - public static boolean hasNotificationsCallback() { - return FirebasePlugin.notificationCallbackContext != null; - } - - @Override - public void onNewIntent(Intent intent) { - super.onNewIntent(intent); - final Bundle data = intent.getExtras(); - if (data != null && data.containsKey("google.message_id")) { - data.putBoolean("tap", true); - FirebasePlugin.sendNotification(data); - } - } - - // DEPRECTED - alias of getToken - private void getInstanceId(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - String token = FirebaseInstanceId.getInstance().getToken(); - callbackContext.success(token); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getToken(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - String token = FirebaseInstanceId.getInstance().getToken(); - callbackContext.success(token); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void hasPermission(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - Context context = cordova.getActivity(); - NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context); - boolean areNotificationsEnabled = notificationManagerCompat.areNotificationsEnabled(); - JSONObject object = new JSONObject(); - object.put("isEnabled", areNotificationsEnabled); - callbackContext.success(object); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setBadgeNumber(final CallbackContext callbackContext, final int number) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - Context context = cordova.getActivity(); - SharedPreferences.Editor editor = context.getSharedPreferences(KEY, Context.MODE_PRIVATE).edit(); - editor.putInt(KEY, number); - editor.apply(); - ShortcutBadger.applyCount(context, number); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getBadgeNumber(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - Context context = cordova.getActivity(); - SharedPreferences settings = context.getSharedPreferences(KEY, Context.MODE_PRIVATE); - int number = settings.getInt(KEY, 0); - callbackContext.success(number); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void subscribe(final CallbackContext callbackContext, final String topic) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseMessaging.getInstance().subscribeToTopic(topic); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void unsubscribe(final CallbackContext callbackContext, final String topic) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseMessaging.getInstance().unsubscribeFromTopic(topic); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void unregister(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseInstanceId.getInstance().deleteInstanceId(); - String currentToken = FirebaseInstanceId.getInstance().getToken(); - if (currentToken != null) { - FirebasePlugin.sendToken(currentToken); - } - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void logEvent(final CallbackContext callbackContext, final String name, final JSONObject params) throws JSONException { - final Bundle bundle = new Bundle(); - Iterator iter = params.keys(); - while (iter.hasNext()) { - String key = (String) iter.next(); - Object value = params.get(key); - - if (value instanceof Integer || value instanceof Double) { - bundle.putFloat(key, ((Number) value).floatValue()); - } else { - bundle.putString(key, value.toString()); - } - } - - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - mFirebaseAnalytics.logEvent(name, bundle); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void logError(final CallbackContext callbackContext, final String message) throws JSONException { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseCrash.report(new Exception(message)); - callbackContext.success(1); - } catch (Exception e) { - FirebaseCrash.log(e.getMessage()); - e.printStackTrace(); - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setScreenName(final CallbackContext callbackContext, final String name) { - // This must be called on the main thread - cordova.getActivity().runOnUiThread(new Runnable() { - public void run() { - try { - mFirebaseAnalytics.setCurrentScreen(cordova.getActivity(), name, null); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setUserId(final CallbackContext callbackContext, final String id) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - mFirebaseAnalytics.setUserId(id); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setUserProperty(final CallbackContext callbackContext, final String name, final String value) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - mFirebaseAnalytics.setUserProperty(name, value); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void activateFetched(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - final boolean activated = FirebaseRemoteConfig.getInstance().activateFetched(); - callbackContext.success(String.valueOf(activated)); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void fetch(CallbackContext callbackContext) { - fetch(callbackContext, FirebaseRemoteConfig.getInstance().fetch()); - } - - private void fetch(CallbackContext callbackContext, long cacheExpirationSeconds) { - fetch(callbackContext, FirebaseRemoteConfig.getInstance().fetch(cacheExpirationSeconds)); - } - - private void fetch(final CallbackContext callbackContext, final Task<Void> task) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - task.addOnCompleteListener(new OnCompleteListener<Void>() { - @Override - public void onComplete(Task<Void> task) { - callbackContext.success(); - } - }).addOnFailureListener(new OnFailureListener() { - @Override - public void onFailure(Exception e) { - callbackContext.error(e.getMessage()); - } - }); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getByteArray(final CallbackContext callbackContext, final String key, final String namespace) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - byte[] bytes = namespace == null ? FirebaseRemoteConfig.getInstance().getByteArray(key) - : FirebaseRemoteConfig.getInstance().getByteArray(key, namespace); - JSONObject object = new JSONObject(); - object.put("base64", Base64.encodeToString(bytes, Base64.DEFAULT)); - object.put("array", new JSONArray(bytes)); - callbackContext.success(object); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getValue(final CallbackContext callbackContext, final String key, final String namespace) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseRemoteConfigValue value = namespace == null ? FirebaseRemoteConfig.getInstance().getValue(key) - : FirebaseRemoteConfig.getInstance().getValue(key, namespace); - callbackContext.success(value.asString()); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getInfo(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseRemoteConfigInfo remoteConfigInfo = FirebaseRemoteConfig.getInstance().getInfo(); - JSONObject info = new JSONObject(); - - JSONObject settings = new JSONObject(); - settings.put("developerModeEnabled", remoteConfigInfo.getConfigSettings().isDeveloperModeEnabled()); - info.put("configSettings", settings); - - info.put("fetchTimeMillis", remoteConfigInfo.getFetchTimeMillis()); - info.put("lastFetchStatus", remoteConfigInfo.getLastFetchStatus()); - - callbackContext.success(info); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setConfigSettings(final CallbackContext callbackContext, final JSONObject config) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - boolean devMode = config.getBoolean("developerModeEnabled"); - FirebaseRemoteConfigSettings.Builder settings = new FirebaseRemoteConfigSettings.Builder() - .setDeveloperModeEnabled(devMode); - FirebaseRemoteConfig.getInstance().setConfigSettings(settings.build()); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setDefaults(final CallbackContext callbackContext, final JSONObject defaults, final String namespace) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - if (namespace == null) - FirebaseRemoteConfig.getInstance().setDefaults(defaultsToMap(defaults)); - else - FirebaseRemoteConfig.getInstance().setDefaults(defaultsToMap(defaults), namespace); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private static Map<String, Object> defaultsToMap(JSONObject object) throws JSONException { - final Map<String, Object> map = new HashMap<String, Object>(); - - for (Iterator<String> keys = object.keys(); keys.hasNext(); ) { - String key = keys.next(); - Object value = object.get(key); - - if (value instanceof Integer) { - //setDefaults() should take Longs - value = new Long((Integer) value); - } else if (value instanceof JSONArray) { - JSONArray array = (JSONArray) value; - if (array.length() == 1 && array.get(0) instanceof String) { - //parse byte[] as Base64 String - value = Base64.decode(array.getString(0), Base64.DEFAULT); - } else { - //parse byte[] as numeric array - byte[] bytes = new byte[array.length()]; - for (int i = 0; i < array.length(); i++) - bytes[i] = (byte) array.getInt(i); - value = bytes; - } - } - - map.put(key, value); - } - return map; - } -} diff --git a/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java b/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java deleted file mode 100755 index 96140f02..00000000 --- a/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePluginInstanceIDService.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.apache.cordova.firebase; - -import android.util.Log; - -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.iid.FirebaseInstanceIdService; - - -public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService { - - private static final String TAG = "FirebasePlugin"; - - /** - * Called if InstanceID token is updated. This may occur if the security of - * the previous token had been compromised. Note that this is called when the InstanceID token - * is initially generated so this is where you would retrieve the token. - */ - @Override - public void onTokenRefresh() { - // Get updated InstanceID token. - String refreshedToken = FirebaseInstanceId.getInstance().getToken(); - Log.d(TAG, "Refreshed token: " + refreshedToken); - - FirebasePlugin.sendToken(refreshedToken); - } -} diff --git a/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePluginMessagingService.java b/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePluginMessagingService.java deleted file mode 100755 index a42ce60e..00000000 --- a/StoneIsland/platforms/android/src/org/apache/cordova/firebase/FirebasePluginMessagingService.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.apache.cordova.firebase; - -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.media.RingtoneManager; -import android.net.Uri; -import android.os.Bundle; -import android.support.v4.app.NotificationCompat; -import android.util.Log; -import android.app.Notification; -import android.text.TextUtils; - -import com.google.firebase.messaging.FirebaseMessagingService; -import com.google.firebase.messaging.RemoteMessage; - -import java.util.Map; -import java.util.Random; - -public class FirebasePluginMessagingService extends FirebaseMessagingService { - - private static final String TAG = "FirebasePlugin"; - - /** - * Called when message is received. - * - * @param remoteMessage Object representing the message received from Firebase Cloud Messaging. - */ - @Override - public void onMessageReceived(RemoteMessage remoteMessage) { - // [START_EXCLUDE] - // There are two types of messages data messages and notification messages. Data messages are handled - // here in onMessageReceived whether the app is in the foreground or background. Data messages are the type - // traditionally used with GCM. Notification messages are only received here in onMessageReceived when the app - // is in the foreground. When the app is in the background an automatically generated notification is displayed. - // When the user taps on the notification they are returned to the app. Messages containing both notification - // and data payloads are treated as notification messages. The Firebase console always sends notification - // messages. For more see: https://firebase.google.com/docs/cloud-messaging/concept-options - // [END_EXCLUDE] - - // TODO(developer): Handle FCM messages here. - // Not getting messages here? See why this may be: https://goo.gl/39bRNJ - String title; - String text; - String id; - if (remoteMessage.getNotification() != null) { - title = remoteMessage.getNotification().getTitle(); - text = remoteMessage.getNotification().getBody(); - id = remoteMessage.getMessageId(); - } else { - title = remoteMessage.getData().get("title"); - text = remoteMessage.getData().get("text"); - id = remoteMessage.getData().get("id"); - } - - if(TextUtils.isEmpty(id)){ - Random rand = new Random(); - int n = rand.nextInt(50) + 1; - id = Integer.toString(n); - } - - Log.d(TAG, "From: " + remoteMessage.getFrom()); - Log.d(TAG, "Notification Message id: " + id); - Log.d(TAG, "Notification Message Title: " + title); - Log.d(TAG, "Notification Message Body/Text: " + text); - - // TODO: Add option to developer to configure if show notification when app on foreground - if (!TextUtils.isEmpty(text) || !TextUtils.isEmpty(title) || (!remoteMessage.getData().isEmpty())) { - boolean showNotification = (FirebasePlugin.inBackground() || !FirebasePlugin.hasNotificationsCallback()) && (!TextUtils.isEmpty(text) || !TextUtils.isEmpty(title)); - sendNotification(id, title, text, remoteMessage.getData(), showNotification); - } - } - - private void sendNotification(String id, String title, String messageBody, Map<String, String> data, boolean showNotification) { - Bundle bundle = new Bundle(); - for (String key : data.keySet()) { - bundle.putString(key, data.get(key)); - } - if (showNotification) { - Intent intent = new Intent(this, OnNotificationOpenReceiver.class); - intent.putExtras(bundle); - PendingIntent pendingIntent = PendingIntent.getBroadcast(this, id.hashCode(), intent, - PendingIntent.FLAG_UPDATE_CURRENT); - - Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); - NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) - .setContentTitle(title) - .setContentText(messageBody) - .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) - .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody)) - .setAutoCancel(true) - .setSound(defaultSoundUri) - .setContentIntent(pendingIntent); - - int resID = getResources().getIdentifier("notification_icon", "drawable", getPackageName()); - if (resID != 0) { - notificationBuilder.setSmallIcon(resID); - } else { - notificationBuilder.setSmallIcon(getApplicationInfo().icon); - } - - if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) - { - int accentID = getResources().getIdentifier("accent", "color", getPackageName()); - notificationBuilder.setColor(getResources().getColor(accentID, null)); - } - - Notification notification = notificationBuilder.build(); - if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){ - int iconID = android.R.id.icon; - int notiID = getResources().getIdentifier("notification_big", "drawable", getPackageName()); - if (notification.contentView != null) { - notification.contentView.setImageViewResource(iconID, notiID); - } - } - NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - - notificationManager.notify(id.hashCode(), notification); - } else { - bundle.putBoolean("tap", false); - bundle.putString("title", title); - bundle.putString("body", messageBody); - FirebasePlugin.sendNotification(bundle); - } - } -} diff --git a/StoneIsland/platforms/android/src/org/apache/cordova/firebase/OnNotificationOpenReceiver.java b/StoneIsland/platforms/android/src/org/apache/cordova/firebase/OnNotificationOpenReceiver.java deleted file mode 100644 index a7f63757..00000000 --- a/StoneIsland/platforms/android/src/org/apache/cordova/firebase/OnNotificationOpenReceiver.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.apache.cordova.firebase; - -import android.app.PendingIntent; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.os.Bundle; - -public class OnNotificationOpenReceiver extends BroadcastReceiver { - - @Override - public void onReceive(Context context, Intent intent) { - PackageManager pm = context.getPackageManager(); - Intent launchIntent = pm.getLaunchIntentForPackage(context.getPackageName()); - - launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); - Bundle data = intent.getExtras(); - data.putBoolean("tap", true); - FirebasePlugin.sendNotification(data); - launchIntent.putExtras(data); - context.startActivity(launchIntent); - } -} diff --git a/StoneIsland/platforms/android/wrapper.gradle b/StoneIsland/platforms/android/wrapper.gradle new file mode 100644 index 00000000..d7ebabd7 --- /dev/null +++ b/StoneIsland/platforms/android/wrapper.gradle @@ -0,0 +1 @@ +//This file is intentionally just a comment diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m index bc8f7200..2b13849f 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m @@ -118,7 +118,18 @@ // only allow-intent if it's a UIWebViewNavigationTypeLinkClicked (anchor tag) OR // it's a UIWebViewNavigationTypeOther, and it's an internal link if ([[self class] shouldOpenURLRequest:request navigationType:navigationType]){ +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000 + // CB-11895; openURL with a single parameter is deprecated in iOS 10 + // see https://useyourloaf.com/blog/openurl-deprecated-in-ios10 + if ([[UIApplication sharedApplication] respondsToSelector:@selector(openURL:options:completionHandler:)]) { + [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil]; + } else { + [[UIApplication sharedApplication] openURL:url]; + } +#else + // fall back if on older SDK [[UIApplication sharedApplication] openURL:url]; +#endif } // consume the request (i.e. no error) if it wasn't handled above diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m index 6e316595..348c2845 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m @@ -78,7 +78,7 @@ NSURL* errorUrl = vc.errorURL; if (errorUrl) { - errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl]; + errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [message stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl]; NSLog(@"%@", [errorUrl absoluteString]); [theWebView loadRequest:[NSURLRequest requestWithURL:errorUrl]]; } diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m index 13c2e7bd..821b957e 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAppDelegate.m @@ -85,9 +85,9 @@ return YES; } -#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 +#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window -#else +#else //CB-12098. Defaults to UIInterfaceOrientationMask for iOS 9+ - (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window #endif { diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h index 4e332412..38bdfd73 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVAvailability.h @@ -66,6 +66,7 @@ #define __CORDOVA_4_2_1 40201 #define __CORDOVA_4_3_0 40300 #define __CORDOVA_4_3_1 40301 +#define __CORDOVA_4_4_0 40400 /* coho:next-version,insert-before */ #define __CORDOVA_NA 99999 /* not available */ @@ -78,7 +79,7 @@ */ #ifndef CORDOVA_VERSION_MIN_REQUIRED /* coho:next-version-min-required,replace-after */ - #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_4_3_1 + #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_4_4_0 #endif /* diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h index 7226205a..519dd490 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVScreenOrientationDelegate.h @@ -21,7 +21,12 @@ @protocol CDVScreenOrientationDelegate <NSObject> -- (NSUInteger)supportedInterfaceOrientations; +#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 +- (NSUInteger)supportedInterfaceOrientations; +#else +- (UIInterfaceOrientationMask)supportedInterfaceOrientations; +#endif + - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; - (BOOL)shouldAutorotate; diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m index b589e1f3..b17107e1 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVUserAgentUtil.m @@ -90,7 +90,7 @@ static NSMutableArray* gPendingSetUserAgentBlocks = nil; + (void)releaseLock:(NSInteger*)lockToken { - if (*lockToken == 0) { + if (lockToken == nil || *lockToken == 0) { return; } NSAssert(gCurrentLockToken == *lockToken, @"Got token %ld, expected %ld", (long)*lockToken, (long)gCurrentLockToken); diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h index 90d33d22..605dbbbf 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.h @@ -79,6 +79,7 @@ - (NSString*)appURLScheme; - (NSURL*)errorURL; +- (UIColor*)colorFromColorString:(NSString*)colorString; - (NSArray*)parseInterfaceOrientations:(NSArray*)orientations; - (BOOL)supportsOrientation:(UIInterfaceOrientation)orientation; diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m index 4019c204..d0c05865 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVViewController.m @@ -27,6 +27,7 @@ #import "NSDictionary+CordovaPreferences.h" #import "CDVLocalStorage.h" #import "CDVCommandDelegateImpl.h" +#import <Foundation/NSCharacterSet.h> @interface CDVViewController () { NSInteger _userAgentLockToken; @@ -207,11 +208,11 @@ appURL = [NSURL URLWithString:self.startPage]; } else if ([self.wwwFolderName rangeOfString:@"://"].location != NSNotFound) { appURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.wwwFolderName, self.startPage]]; - } else if([self.wwwFolderName hasSuffix:@".bundle"]){ + } else if([self.wwwFolderName rangeOfString:@".bundle"].location != NSNotFound){ // www folder is actually a bundle NSBundle* bundle = [NSBundle bundleWithPath:self.wwwFolderName]; appURL = [bundle URLForResource:self.startPage withExtension:nil]; - } else if([self.wwwFolderName hasSuffix:@".framework"]){ + } else if([self.wwwFolderName rangeOfString:@".framework"].location != NSNotFound){ // www folder is actually a framework NSBundle* bundle = [NSBundle bundleWithPath:self.wwwFolderName]; appURL = [bundle URLForResource:self.startPage withExtension:nil]; @@ -319,10 +320,11 @@ // ///////////////// NSURL* appURL = [self appUrl]; + __weak __typeof__(self) weakSelf = self; [CDVUserAgentUtil acquireLock:^(NSInteger lockToken) { - _userAgentLockToken = lockToken; - [CDVUserAgentUtil setUserAgent:self.userAgent lockToken:lockToken]; + // Fix the memory leak caused by the strong reference. + [weakSelf setLockToken:lockToken]; if (appURL) { NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0]; [self.webViewEngine loadRequest:appReq]; @@ -332,7 +334,7 @@ NSURL* errorUrl = [self errorURL]; if (errorUrl) { - errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] relativeToURL:errorUrl]; + errorUrl = [NSURL URLWithString:[NSString stringWithFormat:@"?error=%@", [loadErr stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]] relativeToURL:errorUrl]; NSLog(@"%@", [errorUrl absoluteString]); [self.webViewEngine loadRequest:[NSURLRequest requestWithURL:errorUrl]]; } else { @@ -341,6 +343,18 @@ } } }]; + + // ///////////////// + + NSString* bgColorString = [self.settings cordovaSettingForKey:@"BackgroundColor"]; + UIColor* bgColor = [self colorFromColorString:bgColorString]; + [self.webView setBackgroundColor:bgColor]; +} + +- (void)setLockToken:(NSInteger)lockToken +{ + _userAgentLockToken = lockToken; + [CDVUserAgentUtil setUserAgent:self.userAgent lockToken:lockToken]; } -(void)viewWillAppear:(BOOL)animated @@ -385,6 +399,52 @@ [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVViewWillTransitionToSizeNotification object:[NSValue valueWithCGSize:size]]]; } +- (UIColor*)colorFromColorString:(NSString*)colorString +{ + // No value, nothing to do + if (!colorString) { + return nil; + } + + // Validate format + NSError* error = NULL; + NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern:@"^(#[0-9A-F]{3}|(0x|#)([0-9A-F]{2})?[0-9A-F]{6})$" options:NSRegularExpressionCaseInsensitive error:&error]; + NSUInteger countMatches = [regex numberOfMatchesInString:colorString options:0 range:NSMakeRange(0, [colorString length])]; + + if (!countMatches) { + return nil; + } + + // #FAB to #FFAABB + if ([colorString hasPrefix:@"#"] && [colorString length] == 4) { + NSString* r = [colorString substringWithRange:NSMakeRange(1, 1)]; + NSString* g = [colorString substringWithRange:NSMakeRange(2, 1)]; + NSString* b = [colorString substringWithRange:NSMakeRange(3, 1)]; + colorString = [NSString stringWithFormat:@"#%@%@%@%@%@%@", r, r, g, g, b, b]; + } + + // #RRGGBB to 0xRRGGBB + colorString = [colorString stringByReplacingOccurrencesOfString:@"#" withString:@"0x"]; + + // 0xRRGGBB to 0xAARRGGBB + if ([colorString hasPrefix:@"0x"] && [colorString length] == 8) { + colorString = [@"0xFF" stringByAppendingString:[colorString substringFromIndex:2]]; + } + + // 0xAARRGGBB to int + unsigned colorValue = 0; + NSScanner *scanner = [NSScanner scannerWithString:colorString]; + if (![scanner scanHexInt:&colorValue]) { + return nil; + } + + // int to UIColor + return [UIColor colorWithRed:((float)((colorValue & 0x00FF0000) >> 16))/255.0 + green:((float)((colorValue & 0x0000FF00) >> 8))/255.0 + blue:((float)((colorValue & 0x000000FF) >> 0))/255.0 + alpha:((float)((colorValue & 0xFF000000) >> 24))/255.0]; +} + - (NSArray*)parseInterfaceOrientations:(NSArray*)orientations { NSMutableArray* result = [[NSMutableArray alloc] init]; @@ -419,7 +479,12 @@ return YES; } -- (NSUInteger)supportedInterfaceOrientations +// CB-12098 +#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 +- (NSUInteger)supportedInterfaceOrientations +#else +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +#endif { NSUInteger ret = 0; @@ -493,7 +558,7 @@ _userAgent = [NSString stringWithFormat:@"%@ %@", localBaseUserAgent, appendUserAgent]; } else { // Use our address as a unique number to append to the User-Agent. - _userAgent = [NSString stringWithFormat:@"%@ (%lld)", localBaseUserAgent, (long long)self]; + _userAgent = localBaseUserAgent; } return _userAgent; } diff --git a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.m b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.m index 552ea957..758f4d1e 100644 --- a/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.m +++ b/StoneIsland/platforms/ios/CordovaLib/Classes/Public/CDVWhitelist.m @@ -256,7 +256,7 @@ NSString* const kCDVDefaultSchemeName = @"cdv-default-scheme"; // http[s] and ftp[s] should also validate against the common set in the kCDVDefaultSchemeName list if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [scheme isEqualToString:@"ftp"] || [scheme isEqualToString:@"ftps"]) { - NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [[url path] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]; + NSURL* newUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@%@", kCDVDefaultSchemeName, [url host], [[url path] stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet.URLPathAllowedCharacterSet]]]; // If it is allowed, we are done. If not, continue to check for the actual scheme-specific list if ([self URLIsAllowed:newUrl logFailure:NO]) { return YES; diff --git a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj index 4196198b..cee1f0d4 100644 --- a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj +++ b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/project.pbxproj @@ -61,8 +61,42 @@ 7ED95D5A1AB9029B008C4574 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7ED95D341AB9029B008C4574 /* NSMutableArray+QueueAdditions.m */; }; A3B082D41BB15CEA00D8DC35 /* CDVGestureHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */; }; A3B082D51BB15CEA00D8DC35 /* CDVGestureHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */; }; + C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C01EB41E3911D50056E6CB /* Cordova.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EBA1E39120F0056E6CB /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 68A32D7114102E1C006B237C /* libCordova.a */; }; + C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D0F1AB9029B008C4574 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D101AB9029B008C4574 /* CDVAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D121AB9029B008C4574 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D131AB9029B008C4574 /* CDVAvailabilityDeprecated.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D141AB9029B008C4574 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D151AB9029B008C4574 /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D171AB9029B008C4574 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D191AB9029B008C4574 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1B1AB9029B008C4574 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1D1AB9029B008C4574 /* CDVPlugin+Resources.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D1F1AB9029B008C4574 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D211AB9029B008C4574 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D231AB9029B008C4574 /* CDVScreenOrientationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D241AB9029B008C4574 /* CDVTimer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D261AB9029B008C4574 /* CDVURLProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D281AB9029B008C4574 /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2A1AB9029B008C4574 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2C1AB9029B008C4574 /* CDVWebViewEngineProtocol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D2D1AB9029B008C4574 /* CDVWhitelist.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D311AB9029B008C4574 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95D331AB9029B008C4574 /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ED95CFE1AB9028C008C4574 /* CDVUIWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + C0C01ED11E39137C0056E6CB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = CordovaLib; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ 30193A4E1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVUIWebViewNavigationDelegate.m; sourceTree = "<group>"; }; 30193A4F1AE6350A0069A75F /* CDVUIWebViewNavigationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVUIWebViewNavigationDelegate.h; sourceTree = "<group>"; }; @@ -121,9 +155,20 @@ A3B082D21BB15CEA00D8DC35 /* CDVGestureHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVGestureHandler.h; sourceTree = "<group>"; }; A3B082D31BB15CEA00D8DC35 /* CDVGestureHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVGestureHandler.m; sourceTree = "<group>"; }; AA747D9E0F9514B9006C5449 /* CordovaLib_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CordovaLib_Prefix.pch; sourceTree = SOURCE_ROOT; }; + C0C01EB21E3911D50056E6CB /* Cordova.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cordova.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C0C01EB41E3911D50056E6CB /* Cordova.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Cordova.h; sourceTree = "<group>"; }; + C0C01EB51E3911D50056E6CB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + C0C01EAE1E3911D50056E6CB /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C0C01EBA1E39120F0056E6CB /* libCordova.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D2AAC07C0554694100DB518D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -138,6 +183,7 @@ isa = PBXGroup; children = ( 68A32D7114102E1C006B237C /* libCordova.a */, + C0C01EB21E3911D50056E6CB /* Cordova.framework */, ); name = Products; sourceTree = CORDOVALIB; @@ -147,6 +193,7 @@ children = ( 7ED95D0E1AB9029B008C4574 /* Public */, 7ED95CF11AB9028C008C4574 /* Private */, + C0C01EB31E3911D50056E6CB /* Cordova */, 034768DFFF38A50411DB9C8B /* Products */, 30325A0B136B343700982B63 /* VERSION */, ); @@ -272,9 +319,48 @@ path = CDVGestureHandler; sourceTree = "<group>"; }; + C0C01EB31E3911D50056E6CB /* Cordova */ = { + isa = PBXGroup; + children = ( + C0C01EB41E3911D50056E6CB /* Cordova.h */, + C0C01EB51E3911D50056E6CB /* Info.plist */, + ); + path = Cordova; + sourceTree = "<group>"; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ + C0C01EAF1E3911D50056E6CB /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C0C01EC11E39131A0056E6CB /* CDVCommandQueue.h in Headers */, + C0C01EC51E39131A0056E6CB /* CDVPlugin.h in Headers */, + C0C01ECF1E39131A0056E6CB /* NSMutableArray+QueueAdditions.h in Headers */, + C0C01EC21E39131A0056E6CB /* CDVConfigParser.h in Headers */, + C0C01EC81E39131A0056E6CB /* CDVTimer.h in Headers */, + C0C01EBB1E39131A0056E6CB /* CDV.h in Headers */, + C0C01ECE1E39131A0056E6CB /* NSDictionary+CordovaPreferences.h in Headers */, + C0C01EB61E3911D50056E6CB /* Cordova.h in Headers */, + C0C01EC41E39131A0056E6CB /* CDVPlugin+Resources.h in Headers */, + C0C01EBE1E39131A0056E6CB /* CDVAvailabilityDeprecated.h in Headers */, + C0C01EC91E39131A0056E6CB /* CDVURLProtocol.h in Headers */, + C0C01EBF1E39131A0056E6CB /* CDVCommandDelegate.h in Headers */, + C0C01ECD1E39131A0056E6CB /* CDVWhitelist.h in Headers */, + C0C01ED01E3913610056E6CB /* CDVUIWebViewDelegate.h in Headers */, + C0C01ECA1E39131A0056E6CB /* CDVUserAgentUtil.h in Headers */, + C0C01EBC1E39131A0056E6CB /* CDVAppDelegate.h in Headers */, + C0C01EBD1E39131A0056E6CB /* CDVAvailability.h in Headers */, + C0C01ECB1E39131A0056E6CB /* CDVViewController.h in Headers */, + C0C01ECC1E39131A0056E6CB /* CDVWebViewEngineProtocol.h in Headers */, + C0C01EC01E39131A0056E6CB /* CDVCommandDelegateImpl.h in Headers */, + C0C01EC31E39131A0056E6CB /* CDVInvokedUrlCommand.h in Headers */, + C0C01EC71E39131A0056E6CB /* CDVScreenOrientationDelegate.h in Headers */, + C0C01EC61E39131A0056E6CB /* CDVPluginResult.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; D2AAC07A0554694100DB518D /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -316,6 +402,25 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ + C0C01EB11E3911D50056E6CB /* Cordova */ = { + isa = PBXNativeTarget; + buildConfigurationList = C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */; + buildPhases = ( + C0C01EAD1E3911D50056E6CB /* Sources */, + C0C01EAE1E3911D50056E6CB /* Frameworks */, + C0C01EAF1E3911D50056E6CB /* Headers */, + C0C01EB01E3911D50056E6CB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C0C01ED21E39137C0056E6CB /* PBXTargetDependency */, + ); + name = Cordova; + productName = Cordova; + productReference = C0C01EB21E3911D50056E6CB /* Cordova.framework */; + productType = "com.apple.product-type.framework"; + }; D2AAC07D0554694100DB518D /* CordovaLib */ = { isa = PBXNativeTarget; buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "CordovaLib" */; @@ -339,7 +444,13 @@ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0720; + TargetAttributes = { + C0C01EB11E3911D50056E6CB = { + CreatedOnToolsVersion = 8.2; + ProvisioningStyle = Automatic; + }; + }; }; buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "CordovaLib" */; compatibilityVersion = "Xcode 3.2"; @@ -358,11 +469,29 @@ projectRoot = ""; targets = ( D2AAC07D0554694100DB518D /* CordovaLib */, + C0C01EB11E3911D50056E6CB /* Cordova */, ); }; /* End PBXProject section */ +/* Begin PBXResourcesBuildPhase section */ + C0C01EB01E3911D50056E6CB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ + C0C01EAD1E3911D50056E6CB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; D2AAC07B0554694100DB518D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -395,6 +524,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + C0C01ED21E39137C0056E6CB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2AAC07D0554694100DB518D /* CordovaLib */; + targetProxy = C0C01ED11E39137C0056E6CB /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 1DEB921F08733DC00010E9CD /* Debug */ = { isa = XCBuildConfiguration; @@ -413,7 +550,7 @@ GCC_THUMB_SUPPORT = NO; GCC_VERSION = ""; INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; PRODUCT_NAME = Cordova; PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; SKIP_INSTALL = YES; @@ -434,7 +571,7 @@ GCC_THUMB_SUPPORT = NO; GCC_VERSION = ""; INSTALL_PATH = /usr/local/lib; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; PRODUCT_NAME = Cordova; PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; SKIP_INSTALL = YES; @@ -444,37 +581,24 @@ 1DEB922308733DC00010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_THUMB_SUPPORT = NO; GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DDEBUG"; PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; @@ -488,35 +612,22 @@ 1DEB922408733DC00010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_THUMB_SUPPORT = NO; GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; ONLY_ACTIVE_ARCH = NO; PUBLIC_HEADERS_FOLDER_PATH = include/Cordova; SDKROOT = iphoneos; @@ -525,6 +636,105 @@ }; name = Release; }; + C0C01EB71E3911D50056E6CB /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = Cordova/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = "-all_load"; + PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; + SKIP_INSTALL = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + C0C01EB81E3911D50056E6CB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = Cordova/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = "-all_load"; + PRODUCT_BUNDLE_IDENTIFIER = org.apache.cordova.Cordova; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Headers"; + SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -546,6 +756,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C0C01EB91E3911D50056E6CB /* Build configuration list for PBXNativeTarget "Cordova" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C0C01EB71E3911D50056E6CB /* Debug */, + C0C01EB81E3911D50056E6CB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; diff --git a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist index 283503be..4fa01366 100644 --- a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -4,18 +4,15 @@ <dict> <key>SchemeUserState</key> <dict> - <key>CordovaLib.xcscheme</key> + <key>Cordova.xcscheme</key> <dict> <key>orderHint</key> - <integer>1</integer> + <integer>7</integer> </dict> - </dict> - <key>SuppressBuildableAutocreation</key> - <dict> - <key>D2AAC07D0554694100DB518D</key> + <key>CordovaLib.xcscheme</key> <dict> - <key>primary</key> - <true/> + <key>orderHint</key> + <integer>5</integer> </dict> </dict> </dict> diff --git a/StoneIsland/platforms/ios/CordovaLib/VERSION b/StoneIsland/platforms/ios/CordovaLib/VERSION index f77856a6..fdc66988 100644 --- a/StoneIsland/platforms/ios/CordovaLib/VERSION +++ b/StoneIsland/platforms/ios/CordovaLib/VERSION @@ -1 +1 @@ -4.3.1 +4.4.0 diff --git a/StoneIsland/platforms/ios/CordovaLib/cordova.js b/StoneIsland/platforms/ios/CordovaLib/cordova.js index 29be9099..3540a020 100644 --- a/StoneIsland/platforms/ios/CordovaLib/cordova.js +++ b/StoneIsland/platforms/ios/CordovaLib/cordova.js @@ -1,5 +1,5 @@ // Platform: ios -// a3732cb71d9b1dd590338e8cf44196f366d46da3 +// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '4.3.1'; +var PLATFORM_VERSION_BUILD_LABEL = '4.4.0'; // file: src/scripts/require.js /*jshint -W079 */ diff --git a/StoneIsland/platforms/ios/Podfile b/StoneIsland/platforms/ios/Podfile index 65988dd6..f9640186 100644 --- a/StoneIsland/platforms/ios/Podfile +++ b/StoneIsland/platforms/ios/Podfile @@ -1,7 +1,6 @@ # DO NOT MODIFY -- auto-generated by Apache Cordova platform :ios, '8.0' -target 'Stone Island' do - project 'Stone Island.xcodeproj' - pod 'GoogleCloudMessaging', '~> 1.2.0' - pod 'GGLInstanceID', '~> 1.2.1' +target 'StoneIsland' do + project 'StoneIsland.xcodeproj' + pod 'FirebaseMessaging', '~> 2.0.0' end diff --git a/StoneIsland/platforms/ios/Podfile.lock b/StoneIsland/platforms/ios/Podfile.lock index 0fe15b8a..b1a04ec7 100644 --- a/StoneIsland/platforms/ios/Podfile.lock +++ b/StoneIsland/platforms/ios/Podfile.lock @@ -1,30 +1,43 @@ PODS: - - GGLInstanceID (1.2.1) - - GoogleCloudMessaging (1.2.0): - - GoogleInterchangeUtilities (~> 1.0) - - GoogleIPhoneUtilities (~> 1.0) - - GoogleSymbolUtilities (~> 1.0) - - GoogleInterchangeUtilities (1.2.2): - - GoogleSymbolUtilities (~> 1.1) - - GoogleIPhoneUtilities (1.2.1): - - GoogleSymbolUtilities (~> 1.0) - - GoogleUtilities (~> 1.0) - - GoogleSymbolUtilities (1.1.2) - - GoogleUtilities (1.3.2): - - GoogleSymbolUtilities (~> 1.1) + - FirebaseAnalytics (4.0.2): + - FirebaseCore (~> 4.0) + - FirebaseInstanceID (~> 2.0) + - GoogleToolboxForMac/NSData+zlib (~> 2.1) + - FirebaseCore (4.0.4): + - GoogleToolboxForMac/NSData+zlib (~> 2.1) + - nanopb (~> 0.3) + - FirebaseInstanceID (2.0.0): + - FirebaseCore (~> 4.0) + - FirebaseMessaging (2.0.0): + - FirebaseAnalytics (~> 4.0) + - FirebaseCore (~> 4.0) + - FirebaseInstanceID (~> 2.0) + - GoogleToolboxForMac/Logger (~> 2.1) + - Protobuf (~> 3.1) + - GoogleToolboxForMac/Defines (2.1.1) + - GoogleToolboxForMac/Logger (2.1.1): + - GoogleToolboxForMac/Defines (= 2.1.1) + - GoogleToolboxForMac/NSData+zlib (2.1.1): + - GoogleToolboxForMac/Defines (= 2.1.1) + - nanopb (0.3.8): + - nanopb/decode (= 0.3.8) + - nanopb/encode (= 0.3.8) + - nanopb/decode (0.3.8) + - nanopb/encode (0.3.8) + - Protobuf (3.3.0) DEPENDENCIES: - - GGLInstanceID (~> 1.2.1) - - GoogleCloudMessaging (~> 1.2.0) + - FirebaseMessaging (~> 2.0.0) SPEC CHECKSUMS: - GGLInstanceID: 4a317044f744281b82cd03015f379899f277cad3 - GoogleCloudMessaging: f37ea14dd0f41d4d889c10b5559dd35bbfd9ac26 - GoogleInterchangeUtilities: d5bc4d88d5b661ab72f9d70c58d02ca8c27ad1f7 - GoogleIPhoneUtilities: 63f25e93a3ddcb66884d182aab3a660d98f1479b - GoogleSymbolUtilities: 631ee17048aa5e9ab133470d768ea997a5ef9b96 - GoogleUtilities: 8bbc733218aad26306f9d4a253823986110e3358 + FirebaseAnalytics: ad41720e3e67fc63fbe3d2948d3e26932a8de311 + FirebaseCore: cfc042628ef9f20debe09c0eb683135fcd404cb4 + FirebaseInstanceID: 9fbf536668f4d3f0880e7438456dabd1376e294b + FirebaseMessaging: 227406c05b0dc9290702d2e9f18ab5528f0c2cf2 + GoogleToolboxForMac: 8e329f1b599f2512c6b10676d45736bcc2cbbeb0 + nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3 + Protobuf: d582fecf68201eac3d79ed61369ef45734394b9c -PODFILE CHECKSUM: 49a15453d072b09c3f930a9bd96e706663ee516a +PODFILE CHECKSUM: 7da3cdef0167aa1d487941dc339cec90823c1e0a COCOAPODS: 1.2.0 diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/FirebaseAnalytics b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics Binary files differindex 61f61cd1..4a346c5d 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/FirebaseAnalytics +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h index e3ff4c12..d499af66 100755 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h @@ -2,6 +2,8 @@ #import "FIRAnalytics.h" +NS_ASSUME_NONNULL_BEGIN + /** * Provides App Delegate handlers to be used in your App Delegate. * @@ -29,14 +31,14 @@ * updated and a new snapshot can be taken. */ + (void)handleEventsForBackgroundURLSession:(NSString *)identifier - completionHandler:(void (^)(void))completionHandler; + completionHandler:(nullable void (^)(void))completionHandler; /** * Handles the event when the app is launched by a URL. * - * Call this method from [UIApplicationDelegate application:openURL:options:] (on iOS 9.0 and - * above), or [UIApplicationDelegate application:openURL:sourceApplication:annotation:] (on iOS 8.x - * and below) in your app. + * Call this method from [UIApplicationDelegate application:openURL:options:] (on iOS 9.0 and + * above), or [UIApplicationDelegate application:openURL:sourceApplication:annotation:] (on + * iOS 8.x and below) in your app. * * @param url The URL resource to open. This resource can be a network resource or a file. */ @@ -55,3 +57,6 @@ + (void)handleUserActivity:(id)userActivity; @end + +NS_ASSUME_NONNULL_END + diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRAnalytics.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h index f5023f57..b6d22671 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRAnalytics.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h @@ -1,5 +1,6 @@ #import <Foundation/Foundation.h> +#import "FIRAnalyticsSwiftNameSupport.h" #import "FIREventNames.h" #import "FIRParameterNames.h" #import "FIRUserPropertyNames.h" @@ -9,6 +10,7 @@ NS_ASSUME_NONNULL_BEGIN /// The top level Firebase Analytics singleton that provides methods for logging events and setting /// user properties. See <a href="http://goo.gl/gz8SLz">the developer guides</a> for general /// information on using Firebase Analytics in your apps. +FIR_SWIFT_NAME(Analytics) @interface FIRAnalytics : NSObject /// Logs an app event. The event can have up to 25 parameters. Events with the same name must have @@ -17,6 +19,12 @@ NS_ASSUME_NONNULL_BEGIN /// /// The following event names are reserved and cannot be used: /// <ul> +/// <li>ad_activeview</li> +/// <li>ad_click</li> +/// <li>ad_exposure</li> +/// <li>ad_impression</li> +/// <li>ad_query</li> +/// <li>adunit_exposure</li> /// <li>app_clear_data</li> /// <li>app_remove</li> /// <li>app_update</li> @@ -28,23 +36,26 @@ NS_ASSUME_NONNULL_BEGIN /// <li>notification_open</li> /// <li>notification_receive</li> /// <li>os_update</li> +/// <li>screen_view</li> /// <li>session_start</li> /// <li>user_engagement</li> /// </ul> /// /// @param name The name of the event. Should contain 1 to 40 alphanumeric characters or /// underscores. The name must start with an alphabetic character. Some event names are -/// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_" prefix -/// is reserved and should not be used. Note that event names are case-sensitive and that -/// logging two events whose names differ only in case will result in two distinct events. +/// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used. Note that event names are +/// case-sensitive and that logging two events whose names differ only in case will result in +/// two distinct events. /// @param parameters The dictionary of event parameters. Passing nil indicates that the event has /// no parameters. Parameter names can be up to 40 characters long and must start with an /// alphabetic character and contain only alphanumeric characters and underscores. Only NSString /// and NSNumber (signed 64-bit integer and 64-bit floating-point number) parameter types are -/// supported. NSString parameter values can be up to 100 characters long. The "firebase_" -/// prefix is reserved and should not be used for parameter names. +/// supported. NSString parameter values can be up to 100 characters long. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used for parameter names. + (void)logEventWithName:(NSString *)name - parameters:(nullable NSDictionary<NSString *, NSObject *> *)parameters; + parameters:(nullable NSDictionary<NSString *, id> *)parameters + FIR_SWIFT_NAME(logEvent(_:parameters:)); /// Sets a user property to a given value. Up to 25 user property names are supported. Once set, /// user property values persist throughout the app lifecycle and across sessions. @@ -59,9 +70,10 @@ NS_ASSUME_NONNULL_BEGIN /// @param value The value of the user property. Values can be up to 36 characters long. Setting the /// value to nil removes the user property. /// @param name The name of the user property to set. Should contain 1 to 24 alphanumeric characters -/// or underscores and must start with an alphabetic character. The "firebase_" prefix is -/// reserved and should not be used for user property names. -+ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name; +/// or underscores and must start with an alphabetic character. The "firebase_", "google_", and +/// "ga_" prefixes are reserved and should not be used for user property names. ++ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name + FIR_SWIFT_NAME(setUserProperty(_:forName:)); /// Sets the user ID property. This feature must be used in accordance with /// <a href="https://www.google.com/policies/privacy">Google's Privacy Policy</a> diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h index dc227a4c..dc227a4c 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h diff --git a/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h new file mode 100755 index 00000000..50fbf2e2 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h @@ -0,0 +1,13 @@ +#ifndef FIR_SWIFT_NAME + +#import <Foundation/Foundation.h> + +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 + +#endif // FIR_SWIFT_NAME diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRApp.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h index de24da17..de24da17 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRApp.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRConfiguration.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h index be2ff7bf..be2ff7bf 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRConfiguration.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h index 3b40eecf..ac4e0abf 100755 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIREventNames.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h @@ -7,12 +7,15 @@ /// Event type. Some common events are suggested below, but you may also choose to specify custom /// Event types that are associated with your specific app. Each event type is identified by a /// unique name. Event names can be up to 40 characters long, may only contain alphanumeric -/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_" -/// prefix is reserved and should not be used. +/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_", +/// "google_", and "ga_" prefixes are reserved and should not be used. + +#import "FIRAnalyticsSwiftNameSupport.h" /// Add Payment Info event. This event signifies that a user has submitted their payment information /// to your app. -static NSString *const kFIREventAddPaymentInfo = @"add_payment_info"; +static NSString *const kFIREventAddPaymentInfo FIR_SWIFT_NAME(AnalyticsEventAddPaymentInfo) = + @"add_payment_info"; /// E-Commerce Add To Cart event. This event signifies that an item was added to a cart for /// purchase. Add this event to a funnel with kFIREventEcommercePurchase to gauge the effectiveness @@ -34,7 +37,7 @@ static NSString *const kFIREventAddPaymentInfo = @"add_payment_info"; /// <li>@c kFIRParameterStartDate (NSString) (optional)</li> /// <li>@c kFIRParameterEndDate (NSString) (optional)</li> /// </ul> -static NSString *const kFIREventAddToCart = @"add_to_cart"; +static NSString *const kFIREventAddToCart FIR_SWIFT_NAME(AnalyticsEventAddToCart) = @"add_to_cart"; /// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. /// Use this event to identify popular gift items in your app. Note: If you supply the @@ -51,13 +54,14 @@ static NSString *const kFIREventAddToCart = @"add_to_cart"; /// <li>@c kFIRParameterCurrency (NSString) (optional)</li> /// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> /// </ul> -static NSString *const kFIREventAddToWishlist = @"add_to_wishlist"; +static NSString *const kFIREventAddToWishlist FIR_SWIFT_NAME(AnalyticsEventAddToWishlist) = + @"add_to_wishlist"; /// App Open event. By logging this event when an App is moved to the foreground, developers can /// understand how often users leave and return during the course of a Session. Although Sessions /// are automatically reported, this event can provide further clarification around the continuous /// engagement of app-users. -static NSString *const kFIREventAppOpen = @"app_open"; +static NSString *const kFIREventAppOpen FIR_SWIFT_NAME(AnalyticsEventAppOpen) = @"app_open"; /// E-Commerce Begin Checkout event. This event signifies that a user has begun the process of /// checking out. Add this event to a funnel with your kFIREventEcommercePurchase event to gauge the @@ -81,7 +85,8 @@ static NSString *const kFIREventAppOpen = @"app_open"; /// <li>@c kFIRParameterDestination (NSString) (optional)</li> /// <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li> /// </ul> -static NSString *const kFIREventBeginCheckout = @"begin_checkout"; +static NSString *const kFIREventBeginCheckout FIR_SWIFT_NAME(AnalyticsEventBeginCheckout) = + @"begin_checkout"; /// Campaign Detail event. Log this event to supply the referral details of a re-engagement /// campaign. Note: you must supply at least one of the required parameters kFIRParameterSource, @@ -96,7 +101,17 @@ static NSString *const kFIREventBeginCheckout = @"begin_checkout"; /// <li>@c kFIRParameterAdNetworkClickID (NSString) (optional)</li> /// <li>@c kFIRParameterCP1 (NSString) (optional)</li> /// </ul> -static NSString *const kFIREventCampaignDetails = @"campaign_details"; +static NSString *const kFIREventCampaignDetails FIR_SWIFT_NAME(AnalyticsEventCampaignDetails) = + @"campaign_details"; + +/// Checkout progress. Params: +/// +/// <ul> +/// <li>@c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)</li> +/// <li>@c kFIRParameterCheckoutOption (NSString) (optional)</li> +/// </ul> +static NSString *const kFIREventCheckoutProgress FIR_SWIFT_NAME(AnalyticsEventCheckoutProgress) = + @"checkout_progress"; /// Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Log /// this along with @c kFIREventSpendVirtualCurrency to better understand your virtual economy. @@ -106,7 +121,8 @@ static NSString *const kFIREventCampaignDetails = @"campaign_details"; /// <li>@c kFIRParameterVirtualCurrencyName (NSString)</li> /// <li>@c kFIRParameterValue (signed 64-bit integer or double as NSNumber)</li> /// </ul> -static NSString *const kFIREventEarnVirtualCurrency = @"earn_virtual_currency"; +static NSString *const kFIREventEarnVirtualCurrency + FIR_SWIFT_NAME(AnalyticsEventEarnVirtualCurrency) = @"earn_virtual_currency"; /// E-Commerce Purchase event. This event signifies that an item was purchased by a user. Note: /// This is different from the in-app purchase event, which is reported automatically for App @@ -134,7 +150,8 @@ static NSString *const kFIREventEarnVirtualCurrency = @"earn_virtual_currency"; /// <li>@c kFIRParameterDestination (NSString) (optional)</li> /// <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li> /// </ul> -static NSString *const kFIREventEcommercePurchase = @"ecommerce_purchase"; +static NSString *const kFIREventEcommercePurchase FIR_SWIFT_NAME(AnalyticsEventEcommercePurchase) = + @"ecommerce_purchase"; /// Generate Lead event. Log this event when a lead has been generated in the app to understand the /// efficacy of your install and re-engagement campaigns. Note: If you supply the @@ -145,7 +162,8 @@ static NSString *const kFIREventEcommercePurchase = @"ecommerce_purchase"; /// <li>@c kFIRParameterCurrency (NSString) (optional)</li> /// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> /// </ul> -static NSString *const kFIREventGenerateLead = @"generate_lead"; +static NSString *const kFIREventGenerateLead FIR_SWIFT_NAME(AnalyticsEventGenerateLead) = + @"generate_lead"; /// Join Group event. Log this event when a user joins a group such as a guild, team or family. Use /// this event to analyze how popular certain groups or social features are in your app. Params: @@ -153,7 +171,7 @@ static NSString *const kFIREventGenerateLead = @"generate_lead"; /// <ul> /// <li>@c kFIRParameterGroupID (NSString)</li> /// </ul> -static NSString *const kFIREventJoinGroup = @"join_group"; +static NSString *const kFIREventJoinGroup FIR_SWIFT_NAME(AnalyticsEventJoinGroup) = @"join_group"; /// Level Up event. This event signifies that a player has leveled up in your gaming app. It can /// help you gauge the level distribution of your userbase and help you identify certain levels that @@ -163,11 +181,11 @@ static NSString *const kFIREventJoinGroup = @"join_group"; /// <li>@c kFIRParameterLevel (signed 64-bit integer as NSNumber)</li> /// <li>@c kFIRParameterCharacter (NSString) (optional)</li> /// </ul> -static NSString *const kFIREventLevelUp = @"level_up"; +static NSString *const kFIREventLevelUp FIR_SWIFT_NAME(AnalyticsEventLevelUp) = @"level_up"; /// Login event. Apps with a login feature can report this event to signify that a user has logged /// in. -static NSString *const kFIREventLogin = @"login"; +static NSString *const kFIREventLogin FIR_SWIFT_NAME(AnalyticsEventLogin) = @"login"; /// Post Score event. Log this event when the user posts a score in your gaming app. This event can /// help you understand how users are actually performing in your game and it can help you correlate @@ -178,7 +196,7 @@ static NSString *const kFIREventLogin = @"login"; /// <li>@c kFIRParameterLevel (signed 64-bit integer as NSNumber) (optional)</li> /// <li>@c kFIRParameterCharacter (NSString) (optional)</li> /// </ul> -static NSString *const kFIREventPostScore = @"post_score"; +static NSString *const kFIREventPostScore FIR_SWIFT_NAME(AnalyticsEventPostScore) = @"post_score"; /// Present Offer event. This event signifies that the app has presented a purchase offer to a user. /// Add this event to a funnel with the kFIREventAddToCart and kFIREventEcommercePurchase to gauge @@ -196,7 +214,8 @@ static NSString *const kFIREventPostScore = @"post_score"; /// <li>@c kFIRParameterCurrency (NSString) (optional)</li> /// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> /// </ul> -static NSString *const kFIREventPresentOffer = @"present_offer"; +static NSString *const kFIREventPresentOffer FIR_SWIFT_NAME(AnalyticsEventPresentOffer) = + @"present_offer"; /// E-Commerce Purchase Refund event. This event signifies that an item purchase was refunded. /// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the @@ -208,7 +227,27 @@ static NSString *const kFIREventPresentOffer = @"present_offer"; /// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> /// <li>@c kFIRParameterTransactionID (NSString) (optional)</li> /// </ul> -static NSString *const kFIREventPurchaseRefund = @"purchase_refund"; +static NSString *const kFIREventPurchaseRefund FIR_SWIFT_NAME(AnalyticsEventPurchaseRefund) = + @"purchase_refund"; + +/// Remove from cart event. Params: +/// +/// <ul> +/// <li>@c kFIRParameterQuantity (signed 64-bit integer as NSNumber)</li> +/// <li>@c kFIRParameterItemID (NSString)</li> +/// <li>@c kFIRParameterItemName (NSString)</li> +/// <li>@c kFIRParameterItemCategory (NSString)</li> +/// <li>@c kFIRParameterItemLocationID (NSString) (optional)</li> +/// <li>@c kFIRParameterPrice (double as NSNumber) (optional)</li> +/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> +/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> +/// <li>@c kFIRParameterOrigin (NSString) (optional)</li> +/// <li>@c kFIRParameterDestination (NSString) (optional)</li> +/// <li>@c kFIRParameterStartDate (NSString) (optional)</li> +/// <li>@c kFIRParameterEndDate (NSString) (optional)</li> +/// </ul> +static NSString *const kFIREventRemoveFromCart FIR_SWIFT_NAME(AnalyticsEventRemoveFromCart) = + @"remove_from_cart"; /// Search event. Apps that support search features can use this event to contextualize search /// operations by supplying the appropriate, corresponding parameters. This event can help you @@ -228,7 +267,7 @@ static NSString *const kFIREventPurchaseRefund = @"purchase_refund"; /// <li>@c kFIRParameterDestination (NSString) (optional)</li> /// <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li> /// </ul> -static NSString *const kFIREventSearch = @"search"; +static NSString *const kFIREventSearch FIR_SWIFT_NAME(AnalyticsEventSearch) = @"search"; /// Select Content event. This general purpose event signifies that a user has selected some content /// of a certain type in an app. The content can be any object in your app. This event can help you @@ -238,7 +277,17 @@ static NSString *const kFIREventSearch = @"search"; /// <li>@c kFIRParameterContentType (NSString)</li> /// <li>@c kFIRParameterItemID (NSString)</li> /// </ul> -static NSString *const kFIREventSelectContent = @"select_content"; +static NSString *const kFIREventSelectContent FIR_SWIFT_NAME(AnalyticsEventSelectContent) = + @"select_content"; + +/// Set checkout option. Params: +/// +/// <ul> +/// <li>@c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)</li> +/// <li>@c kFIRParameterCheckoutOption (NSString)</li> +/// </ul> +static NSString *const kFIREventSetCheckoutOption FIR_SWIFT_NAME(AnalyticsEventSetCheckoutOption) = + @"set_checkout_option"; /// Share event. Apps with social features can log the Share event to identify the most viral /// content. Params: @@ -247,7 +296,7 @@ static NSString *const kFIREventSelectContent = @"select_content"; /// <li>@c kFIRParameterContentType (NSString)</li> /// <li>@c kFIRParameterItemID (NSString)</li> /// </ul> -static NSString *const kFIREventShare = @"share"; +static NSString *const kFIREventShare FIR_SWIFT_NAME(AnalyticsEventShare) = @"share"; /// Sign Up event. This event indicates that a user has signed up for an account in your app. The /// parameter signifies the method by which the user signed up. Use this event to understand the @@ -256,7 +305,7 @@ static NSString *const kFIREventShare = @"share"; /// <ul> /// <li>@c kFIRParameterSignUpMethod (NSString)</li> /// </ul> -static NSString *const kFIREventSignUp = @"sign_up"; +static NSString *const kFIREventSignUp FIR_SWIFT_NAME(AnalyticsEventSignUp) = @"sign_up"; /// Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and can /// help you identify which virtual goods are the most popular objects of purchase. Params: @@ -266,17 +315,20 @@ static NSString *const kFIREventSignUp = @"sign_up"; /// <li>@c kFIRParameterVirtualCurrencyName (NSString)</li> /// <li>@c kFIRParameterValue (signed 64-bit integer or double as NSNumber)</li> /// </ul> -static NSString *const kFIREventSpendVirtualCurrency = @"spend_virtual_currency"; +static NSString *const kFIREventSpendVirtualCurrency + FIR_SWIFT_NAME(AnalyticsEventSpendVirtualCurrency) = @"spend_virtual_currency"; /// Tutorial Begin event. This event signifies the start of the on-boarding process in your app. Use /// this in a funnel with kFIREventTutorialComplete to understand how many users complete this /// process and move on to the full app experience. -static NSString *const kFIREventTutorialBegin = @"tutorial_begin"; +static NSString *const kFIREventTutorialBegin FIR_SWIFT_NAME(AnalyticsEventTutorialBegin) = + @"tutorial_begin"; /// Tutorial End event. Use this event to signify the user's completion of your app's on-boarding /// process. Add this to a funnel with kFIREventTutorialBegin to gauge the completion rate of your /// on-boarding process. -static NSString *const kFIREventTutorialComplete = @"tutorial_complete"; +static NSString *const kFIREventTutorialComplete FIR_SWIFT_NAME(AnalyticsEventTutorialComplete) = + @"tutorial_complete"; /// Unlock Achievement event. Log this event when the user has unlocked an achievement in your /// game. Since achievements generally represent the breadth of a gaming experience, this event can @@ -285,7 +337,8 @@ static NSString *const kFIREventTutorialComplete = @"tutorial_complete"; /// <ul> /// <li>@c kFIRParameterAchievementID (NSString)</li> /// </ul> -static NSString *const kFIREventUnlockAchievement = @"unlock_achievement"; +static NSString *const kFIREventUnlockAchievement FIR_SWIFT_NAME(AnalyticsEventUnlockAchievement) = + @"unlock_achievement"; /// View Item event. This event signifies that some content was shown to the user. This content may /// be a product, a webpage or just a simple image or text. Use the appropriate parameters to @@ -317,7 +370,7 @@ static NSString *const kFIREventUnlockAchievement = @"unlock_achievement"; /// <li>@c kFIRParameterSearchTerm (NSString) (optional) for travel bookings</li> /// <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li> /// </ul> -static NSString *const kFIREventViewItem = @"view_item"; +static NSString *const kFIREventViewItem FIR_SWIFT_NAME(AnalyticsEventViewItem) = @"view_item"; /// View Item List event. Log this event when the user has been presented with a list of items of a /// certain category. Params: @@ -325,7 +378,8 @@ static NSString *const kFIREventViewItem = @"view_item"; /// <ul> /// <li>@c kFIRParameterItemCategory (NSString)</li> /// </ul> -static NSString *const kFIREventViewItemList = @"view_item_list"; +static NSString *const kFIREventViewItemList FIR_SWIFT_NAME(AnalyticsEventViewItemList) = + @"view_item_list"; /// View Search Results event. Log this event when the user has been presented with the results of a /// search. Params: @@ -333,4 +387,5 @@ static NSString *const kFIREventViewItemList = @"view_item_list"; /// <ul> /// <li>@c kFIRParameterSearchTerm (NSString)</li> /// </ul> -static NSString *const kFIREventViewSearchResults = @"view_search_results"; +static NSString *const kFIREventViewSearchResults FIR_SWIFT_NAME(AnalyticsEventViewSearchResults) = + @"view_search_results"; diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIROptions.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h index 126824b0..126824b0 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIROptions.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRParameterNames.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h index a43e3473..44d60b1c 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRParameterNames.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h @@ -7,7 +7,10 @@ /// not limited to these. You may supply extra Params for suggested Events or custom Params for /// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric /// characters and underscores ("_"), and must start with an alphabetic character. Param values can -/// be up to 100 characters long. The "firebase_" prefix is reserved and should not be used. +/// be up to 100 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and +/// should not be used. + +#import "FIRAnalyticsSwiftNameSupport.h" /// Game achievement ID (NSString). /// <pre> @@ -16,7 +19,8 @@ /// // ... /// }; /// </pre> -static NSString *const kFIRParameterAchievementID = @"achievement_id"; +static NSString *const kFIRParameterAchievementID FIR_SWIFT_NAME(AnalyticsParameterAchievementID) = + @"achievement_id"; /// Ad Network Click ID (NSString). Used for network-specific click IDs which vary in format. /// <pre> @@ -25,7 +29,18 @@ static NSString *const kFIRParameterAchievementID = @"achievement_id"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterAdNetworkClickID = @"aclid"; +static NSString *const kFIRParameterAdNetworkClickID + FIR_SWIFT_NAME(AnalyticsParameterAdNetworkClickID) = @"aclid"; + +/// The store or affiliation from which this transaction occurred (NSString). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterAffiliation : @"Google Store", +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterAffiliation FIR_SWIFT_NAME(AnalyticsParameterAffiliation) = + @"affiliation"; /// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to /// capture campaign information, otherwise can be populated by developer. Highly Recommended @@ -36,7 +51,8 @@ static NSString *const kFIRParameterAdNetworkClickID = @"aclid"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterCampaign = @"campaign"; +static NSString *const kFIRParameterCampaign FIR_SWIFT_NAME(AnalyticsParameterCampaign) = + @"campaign"; /// Character used in game (NSString). /// <pre> @@ -45,10 +61,31 @@ static NSString *const kFIRParameterCampaign = @"campaign"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterCharacter = @"character"; +static NSString *const kFIRParameterCharacter FIR_SWIFT_NAME(AnalyticsParameterCharacter) = + @"character"; + +/// The checkout step (1..N) (unsigned 64-bit integer as NSNumber). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterCheckoutStep : @"1", +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterCheckoutStep FIR_SWIFT_NAME(AnalyticsParameterCheckoutStep) = + @"checkout_step"; + +/// Some option on a step in an ecommerce flow (NSString). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterCheckoutOption : @"Visa", +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterCheckoutOption + FIR_SWIFT_NAME(AnalyticsParameterCheckoutOption) = @"checkout_option"; /// Campaign content (NSString). -static NSString *const kFIRParameterContent = @"content"; +static NSString *const kFIRParameterContent FIR_SWIFT_NAME(AnalyticsParameterContent) = @"content"; /// Type of content selected (NSString). /// <pre> @@ -57,7 +94,8 @@ static NSString *const kFIRParameterContent = @"content"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterContentType = @"content_type"; +static NSString *const kFIRParameterContentType FIR_SWIFT_NAME(AnalyticsParameterContentType) = + @"content_type"; /// Coupon code for a purchasable item (NSString). /// <pre> @@ -66,7 +104,7 @@ static NSString *const kFIRParameterContentType = @"content_type"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterCoupon = @"coupon"; +static NSString *const kFIRParameterCoupon FIR_SWIFT_NAME(AnalyticsParameterCoupon) = @"coupon"; /// Campaign custom parameter (NSString). Used as a method of capturing custom data in a campaign. /// Use varies by network. @@ -76,7 +114,27 @@ static NSString *const kFIRParameterCoupon = @"coupon"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterCP1 = @"cp1"; +static NSString *const kFIRParameterCP1 FIR_SWIFT_NAME(AnalyticsParameterCP1) = @"cp1"; + +/// The name of a creative used in a promotional spot (NSString). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterCreativeName : @"Summer Sale", +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterCreativeName FIR_SWIFT_NAME(AnalyticsParameterCreativeName) = + @"creative_name"; + +/// The name of a creative slot (NSString). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterCreativeSlot : @"summer_banner2", +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterCreativeSlot FIR_SWIFT_NAME(AnalyticsParameterCreativeSlot) = + @"creative_slot"; /// Purchase currency in 3-letter <a href="http://en.wikipedia.org/wiki/ISO_4217#Active_codes"> /// ISO_4217</a> format (NSString). @@ -86,7 +144,8 @@ static NSString *const kFIRParameterCP1 = @"cp1"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterCurrency = @"currency"; +static NSString *const kFIRParameterCurrency FIR_SWIFT_NAME(AnalyticsParameterCurrency) = + @"currency"; /// Flight or Travel destination (NSString). /// <pre> @@ -95,7 +154,8 @@ static NSString *const kFIRParameterCurrency = @"currency"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterDestination = @"destination"; +static NSString *const kFIRParameterDestination FIR_SWIFT_NAME(AnalyticsParameterDestination) = + @"destination"; /// The arrival date, check-out date or rental end date for the item. This should be in /// YYYY-MM-DD format (NSString). @@ -105,7 +165,7 @@ static NSString *const kFIRParameterDestination = @"destination"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterEndDate = @"end_date"; +static NSString *const kFIRParameterEndDate FIR_SWIFT_NAME(AnalyticsParameterEndDate) = @"end_date"; /// Flight number for travel events (NSString). /// <pre> @@ -114,7 +174,8 @@ static NSString *const kFIRParameterEndDate = @"end_date"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterFlightNumber = @"flight_number"; +static NSString *const kFIRParameterFlightNumber FIR_SWIFT_NAME(AnalyticsParameterFlightNumber) = + @"flight_number"; /// Group/clan/guild ID (NSString). /// <pre> @@ -123,7 +184,26 @@ static NSString *const kFIRParameterFlightNumber = @"flight_number"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterGroupID = @"group_id"; +static NSString *const kFIRParameterGroupID FIR_SWIFT_NAME(AnalyticsParameterGroupID) = @"group_id"; + +/// Index of an item in a list (signed 64-bit integer as NSNumber). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterIndex : @(1), +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterIndex FIR_SWIFT_NAME(AnalyticsParameterIndex) = @"index"; + +/// Item brand (NSString). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterItemBrand : @"Google", +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterItemBrand FIR_SWIFT_NAME(AnalyticsParameterItemBrand) = + @"item_brand"; /// Item category (NSString). /// <pre> @@ -132,7 +212,8 @@ static NSString *const kFIRParameterGroupID = @"group_id"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterItemCategory = @"item_category"; +static NSString *const kFIRParameterItemCategory FIR_SWIFT_NAME(AnalyticsParameterItemCategory) = + @"item_category"; /// Item ID (NSString). /// <pre> @@ -141,7 +222,7 @@ static NSString *const kFIRParameterItemCategory = @"item_category"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterItemID = @"item_id"; +static NSString *const kFIRParameterItemID FIR_SWIFT_NAME(AnalyticsParameterItemID) = @"item_id"; /// The Google <a href="https://developers.google.com/places/place-id">Place ID</a> (NSString) that /// corresponds to the associated item. Alternatively, you can supply your own custom Location ID. @@ -151,7 +232,8 @@ static NSString *const kFIRParameterItemID = @"item_id"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterItemLocationID = @"item_location_id"; +static NSString *const kFIRParameterItemLocationID + FIR_SWIFT_NAME(AnalyticsParameterItemLocationID) = @"item_location_id"; /// Item name (NSString). /// <pre> @@ -160,7 +242,28 @@ static NSString *const kFIRParameterItemLocationID = @"item_location_id"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterItemName = @"item_name"; +static NSString *const kFIRParameterItemName FIR_SWIFT_NAME(AnalyticsParameterItemName) = + @"item_name"; + +/// The list in which the item was presented to the user (NSString). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterItemList : @"Search Results", +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterItemList FIR_SWIFT_NAME(AnalyticsParameterItemList) = + @"item_list"; + +/// Item variant (NSString). +/// <pre> +/// NSDictionary *params = @{ +/// kFIRParameterItemVariant : @"Red", +/// // ... +/// }; +/// </pre> +static NSString *const kFIRParameterItemVariant FIR_SWIFT_NAME(AnalyticsParameterItemVariant) = + @"item_variant"; /// Level in game (signed 64-bit integer as NSNumber). /// <pre> @@ -169,7 +272,7 @@ static NSString *const kFIRParameterItemName = @"item_name"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterLevel = @"level"; +static NSString *const kFIRParameterLevel FIR_SWIFT_NAME(AnalyticsParameterLevel) = @"level"; /// Location (NSString). The Google <a href="https://developers.google.com/places/place-id">Place ID /// </a> that corresponds to the associated event. Alternatively, you can supply your own custom @@ -180,7 +283,8 @@ static NSString *const kFIRParameterLevel = @"level"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterLocation = @"location"; +static NSString *const kFIRParameterLocation FIR_SWIFT_NAME(AnalyticsParameterLocation) = + @"location"; /// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended /// (NSString). @@ -190,7 +294,7 @@ static NSString *const kFIRParameterLocation = @"location"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterMedium = @"medium"; +static NSString *const kFIRParameterMedium FIR_SWIFT_NAME(AnalyticsParameterMedium) = @"medium"; /// Number of nights staying at hotel (signed 64-bit integer as NSNumber). /// <pre> @@ -199,7 +303,8 @@ static NSString *const kFIRParameterMedium = @"medium"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterNumberOfNights = @"number_of_nights"; +static NSString *const kFIRParameterNumberOfNights + FIR_SWIFT_NAME(AnalyticsParameterNumberOfNights) = @"number_of_nights"; /// Number of passengers traveling (signed 64-bit integer as NSNumber). /// <pre> @@ -208,7 +313,8 @@ static NSString *const kFIRParameterNumberOfNights = @"number_of_nights"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterNumberOfPassengers = @"number_of_passengers"; +static NSString *const kFIRParameterNumberOfPassengers + FIR_SWIFT_NAME(AnalyticsParameterNumberOfPassengers) = @"number_of_passengers"; /// Number of rooms for travel events (signed 64-bit integer as NSNumber). /// <pre> @@ -217,7 +323,8 @@ static NSString *const kFIRParameterNumberOfPassengers = @"number_of_passengers" /// // ... /// }; /// </pre> -static NSString *const kFIRParameterNumberOfRooms = @"number_of_rooms"; +static NSString *const kFIRParameterNumberOfRooms FIR_SWIFT_NAME(AnalyticsParameterNumberOfRooms) = + @"number_of_rooms"; /// Flight or Travel origin (NSString). /// <pre> @@ -226,7 +333,7 @@ static NSString *const kFIRParameterNumberOfRooms = @"number_of_rooms"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterOrigin = @"origin"; +static NSString *const kFIRParameterOrigin FIR_SWIFT_NAME(AnalyticsParameterOrigin) = @"origin"; /// Purchase price (double as NSNumber). /// <pre> @@ -236,7 +343,7 @@ static NSString *const kFIRParameterOrigin = @"origin"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterPrice = @"price"; +static NSString *const kFIRParameterPrice FIR_SWIFT_NAME(AnalyticsParameterPrice) = @"price"; /// Purchase quantity (signed 64-bit integer as NSNumber). /// <pre> @@ -245,7 +352,8 @@ static NSString *const kFIRParameterPrice = @"price"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterQuantity = @"quantity"; +static NSString *const kFIRParameterQuantity FIR_SWIFT_NAME(AnalyticsParameterQuantity) = + @"quantity"; /// Score in game (signed 64-bit integer as NSNumber). /// <pre> @@ -254,7 +362,7 @@ static NSString *const kFIRParameterQuantity = @"quantity"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterScore = @"score"; +static NSString *const kFIRParameterScore FIR_SWIFT_NAME(AnalyticsParameterScore) = @"score"; /// The search string/keywords used (NSString). /// <pre> @@ -263,7 +371,8 @@ static NSString *const kFIRParameterScore = @"score"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterSearchTerm = @"search_term"; +static NSString *const kFIRParameterSearchTerm FIR_SWIFT_NAME(AnalyticsParameterSearchTerm) = + @"search_term"; /// Shipping cost (double as NSNumber). /// <pre> @@ -273,7 +382,8 @@ static NSString *const kFIRParameterSearchTerm = @"search_term"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterShipping = @"shipping"; +static NSString *const kFIRParameterShipping FIR_SWIFT_NAME(AnalyticsParameterShipping) = + @"shipping"; /// Sign up method (NSString). /// <pre> @@ -282,7 +392,8 @@ static NSString *const kFIRParameterShipping = @"shipping"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterSignUpMethod = @"sign_up_method"; +static NSString *const kFIRParameterSignUpMethod FIR_SWIFT_NAME(AnalyticsParameterSignUpMethod) = + @"sign_up_method"; /// The origin of your traffic, such as an Ad network (for example, google) or partner (urban /// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your @@ -293,7 +404,7 @@ static NSString *const kFIRParameterSignUpMethod = @"sign_up_method"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterSource = @"source"; +static NSString *const kFIRParameterSource FIR_SWIFT_NAME(AnalyticsParameterSource) = @"source"; /// The departure date, check-in date or rental start date for the item. This should be in /// YYYY-MM-DD format (NSString). @@ -303,7 +414,8 @@ static NSString *const kFIRParameterSource = @"source"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterStartDate = @"start_date"; +static NSString *const kFIRParameterStartDate FIR_SWIFT_NAME(AnalyticsParameterStartDate) = + @"start_date"; /// Tax amount (double as NSNumber). /// <pre> @@ -313,7 +425,7 @@ static NSString *const kFIRParameterStartDate = @"start_date"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterTax = @"tax"; +static NSString *const kFIRParameterTax FIR_SWIFT_NAME(AnalyticsParameterTax) = @"tax"; /// If you're manually tagging keyword campaigns, you should use utm_term to specify the keyword /// (NSString). @@ -323,7 +435,7 @@ static NSString *const kFIRParameterTax = @"tax"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterTerm = @"term"; +static NSString *const kFIRParameterTerm FIR_SWIFT_NAME(AnalyticsParameterTerm) = @"term"; /// A single ID for a ecommerce group transaction (NSString). /// <pre> @@ -332,7 +444,8 @@ static NSString *const kFIRParameterTerm = @"term"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterTransactionID = @"transaction_id"; +static NSString *const kFIRParameterTransactionID FIR_SWIFT_NAME(AnalyticsParameterTransactionID) = + @"transaction_id"; /// Travel class (NSString). /// <pre> @@ -341,7 +454,8 @@ static NSString *const kFIRParameterTransactionID = @"transaction_id"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterTravelClass = @"travel_class"; +static NSString *const kFIRParameterTravelClass FIR_SWIFT_NAME(AnalyticsParameterTravelClass) = + @"travel_class"; /// A context-specific numeric value which is accumulated automatically for each event type. This is /// a general purpose parameter that is useful for accumulating a key metric that pertains to an @@ -349,7 +463,10 @@ static NSString *const kFIRParameterTravelClass = @"travel_class"; /// 64-bit integer or double as NSNumber. Notes: Values for pre-defined currency-related events /// (such as @c kFIREventAddToCart) should be supplied using double as NSNumber and must be /// accompanied by a @c kFIRParameterCurrency parameter. The valid range of accumulated values is -/// [-9,223,372,036,854.77, 9,223,372,036,854.77]. +/// [-9,223,372,036,854.77, 9,223,372,036,854.77]. Supplying a non-numeric value, omitting the +/// corresponding @c kFIRParameterCurrency parameter, or supplying an invalid +/// <a href="https://goo.gl/qqX3J2">currency code</a> for conversion events will cause that +/// conversion to be omitted from reporting. /// <pre> /// NSDictionary *params = @{ /// kFIRParameterValue : @(3.99), @@ -357,7 +474,7 @@ static NSString *const kFIRParameterTravelClass = @"travel_class"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterValue = @"value"; +static NSString *const kFIRParameterValue FIR_SWIFT_NAME(AnalyticsParameterValue) = @"value"; /// Name of virtual currency type (NSString). /// <pre> @@ -366,4 +483,5 @@ static NSString *const kFIRParameterValue = @"value"; /// // ... /// }; /// </pre> -static NSString *const kFIRParameterVirtualCurrencyName = @"virtual_currency_name"; +static NSString *const kFIRParameterVirtualCurrencyName + FIR_SWIFT_NAME(AnalyticsParameterVirtualCurrencyName) = @"virtual_currency_name"; diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h index 54cf1c20..a2286354 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h @@ -7,7 +7,11 @@ /// unique UserProperties per app, and you can use the name and value of your choosing for each one. /// UserProperty names can be up to 24 characters long, may only contain alphanumeric characters and /// underscores ("_"), and must start with an alphabetic character. UserProperty values can be up to -/// 36 characters long. The "firebase_" prefix is reserved and should not be used. +/// 36 characters long. The "firebase_", "google_", and "ga_" prefixes are reserved and should not +/// be used. + +#import "FIRAnalyticsSwiftNameSupport.h" /// The method used to sign in. For example, "google", "facebook" or "twitter". -static NSString *const kFIRUserPropertySignUpMethod = @"sign_up_method"; +static NSString *const kFIRUserPropertySignUpMethod + FIR_SWIFT_NAME(AnalyticsUserPropertySignUpMethod) = @"sign_up_method"; diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h index 3142c97b..e1e96f6d 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h @@ -4,6 +4,7 @@ #import "FIROptions.h" #import "FIRAnalytics+AppDelegate.h" #import "FIRAnalytics.h" +#import "FIRAnalyticsSwiftNameSupport.h" #import "FIREventNames.h" #import "FIRParameterNames.h" #import "FIRUserPropertyNames.h" diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap index c9bd66bc..6394d59e 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Modules/module.modulemap +++ b/StoneIsland/platforms/ios/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Modules/module.modulemap @@ -4,7 +4,5 @@ framework module FirebaseAnalytics { module * { export *} link "sqlite3" link "z" - link framework "CoreGraphics" - link framework "Foundation" link framework "UIKit" }
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/FirebaseCore b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/FirebaseCore Binary files differnew file mode 100755 index 00000000..7561ad5a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/FirebaseCore diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h index 667d5a4b..f42eaf54 100755 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h @@ -1,14 +1,35 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import <Foundation/Foundation.h> +#import "FIRCoreSwiftNameSupport.h" + +NS_ASSUME_NONNULL_BEGIN + /** * This class provides configuration fields for Firebase Analytics. */ +FIR_SWIFT_NAME(AnalyticsConfiguration) @interface FIRAnalyticsConfiguration : NSObject /** * Returns the shared instance of FIRAnalyticsConfiguration. */ -+ (FIRAnalyticsConfiguration *)sharedInstance; ++ (FIRAnalyticsConfiguration *)sharedInstance FIR_SWIFT_NAME(shared()); /** * Sets the minimum engagement time in seconds required to start a new session. The default value @@ -28,11 +49,6 @@ */ - (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled; -/** - * Deprecated. Sets whether measurement and reporting are enabled for this app on this device. By - * default they are enabled. - */ -- (void)setIsEnabled:(BOOL)isEnabled - DEPRECATED_MSG_ATTRIBUTE("Use setAnalyticsCollectionEnabled: instead."); - @end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRApp.h b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h index 263c4bef..8f52e1aa 100755 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRApp.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h @@ -1,12 +1,34 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import <Foundation/Foundation.h> + +#if TARGET_OS_IOS +// TODO: Remove UIKit import on next breaking change release #import <UIKit/UIKit.h> +#endif + +#import "FIRCoreSwiftNameSupport.h" @class FIROptions; NS_ASSUME_NONNULL_BEGIN /** A block that takes a BOOL and has no return value. */ -typedef void (^FIRAppVoidBoolCallback)(BOOL success); +typedef void (^FIRAppVoidBoolCallback)(BOOL success) FIR_SWIFT_NAME(FirebaseAppVoidBoolCallback); /** * The entry point of Firebase SDKs. @@ -26,6 +48,7 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success); * It is also possible to change the default logging level in code by calling setLoggerLevel: on * the FIRConfiguration interface. */ +FIR_SWIFT_NAME(FirebaseApp) @interface FIRApp : NSObject /** @@ -42,7 +65,7 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success); * * @param options The Firebase application options used to configure the service. */ -+ (void)configureWithOptions:(FIROptions *)options; ++ (void)configureWithOptions:(FIROptions *)options FIR_SWIFT_NAME(configure(options:)); /** * Configures a Firebase app with the given name and options. Raises an exception if any @@ -52,24 +75,33 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success); Letters, Numbers and Underscore. * @param options The Firebase application options used to configure the services. */ -+ (void)configureWithName:(NSString *)name options:(FIROptions *)options; ++ (void)configureWithName:(NSString *)name options:(FIROptions *)options + FIR_SWIFT_NAME(configure(name:options:)); /** * Returns the default app, or nil if the default app does not exist. */ -+ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(defaultApp()); ++ (nullable FIRApp *)defaultApp FIR_SWIFT_NAME(app()); /** * Returns a previously created FIRApp instance with the given name, or nil if no such app exists. * This method is thread safe. */ -+ (nullable FIRApp *)appNamed:(NSString *)name; ++ (nullable FIRApp *)appNamed:(NSString *)name FIR_SWIFT_NAME(app(name:)); +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This + * method is thread safe. + */ +@property(class, readonly, nullable) NSDictionary <NSString *, FIRApp *> *allApps; +#else /** * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This * method is thread safe. */ -+ (nullable NSDictionary *)allApps; ++ (nullable NSDictionary <NSString *, FIRApp *> *)allApps FIR_SWIFT_NAME(allApps()); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for @@ -89,9 +121,9 @@ typedef void (^FIRAppVoidBoolCallback)(BOOL success); @property(nonatomic, copy, readonly) NSString *name; /** - * Gets the options for this app. + * Gets a copy of the options for this app. These are non-modifiable. */ -@property(nonatomic, readonly) FIROptions *options; +@property(nonatomic, copy, readonly) FIROptions *options; @end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRConfiguration.h b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h index a25647b4..496b2118 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRConfiguration.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h @@ -1,6 +1,23 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import <Foundation/Foundation.h> #import "FIRAnalyticsConfiguration.h" +#import "FIRCoreSwiftNameSupport.h" #import "FIRLoggerLevel.h" /** @@ -22,14 +39,23 @@ typedef NS_ENUM(NSInteger, FIRLogLevel) { } DEPRECATED_MSG_ATTRIBUTE( "Use -FIRDebugEnabled and -FIRDebugDisabled or setLoggerLevel. See FIRApp.h for more details."); +NS_ASSUME_NONNULL_BEGIN + /** * This interface provides global level properties that the developer can tweak, and the singleton * of the Firebase Analytics configuration class. */ +FIR_SWIFT_NAME(FirebaseConfiguration) @interface FIRConfiguration : NSObject + +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** Returns the shared configuration object. */ -+ (FIRConfiguration *)sharedInstance; +@property(class, nonatomic, readonly) FIRConfiguration *sharedInstance FIR_SWIFT_NAME(shared); +#else +/** Returns the shared configuration object. */ ++ (FIRConfiguration *)sharedInstance FIR_SWIFT_NAME(shared()); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** The configuration class for Firebase Analytics. */ @property(nonatomic, readwrite) FIRAnalyticsConfiguration *analyticsConfiguration; @@ -50,3 +76,5 @@ typedef NS_ENUM(NSInteger, FIRLogLevel) { - (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel; @end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h new file mode 100755 index 00000000..55e1bcc8 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h @@ -0,0 +1,29 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIR_SWIFT_NAME + +#import <Foundation/Foundation.h> + +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 + +#endif // FIR_SWIFT_NAME diff --git a/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h new file mode 100755 index 00000000..70e99eea --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h @@ -0,0 +1,37 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FIRCoreSwiftNameSupport.h" + +/** + * The log levels used by internal logging. + */ +typedef NS_ENUM(NSInteger, FIRLoggerLevel) { + /** Error level, matches ASL_LEVEL_ERR. */ + FIRLoggerLevelError = 3, + /** Warning level, matches ASL_LEVEL_WARNING. */ + FIRLoggerLevelWarning = 4, + /** Notice level, matches ASL_LEVEL_NOTICE. */ + FIRLoggerLevelNotice = 5, + /** Info level, matches ASL_LEVEL_NOTICE. */ + FIRLoggerLevelInfo = 6, + /** Debug level, matches ASL_LEVEL_DEBUG. */ + FIRLoggerLevelDebug = 7, + /** Minimum log level. */ + FIRLoggerLevelMin = FIRLoggerLevelError, + /** Maximum log level. */ + FIRLoggerLevelMax = FIRLoggerLevelDebug +} FIR_SWIFT_NAME(FirebaseLoggerLevel); diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIROptions.h b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h index 083082ab..7bc24066 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIROptions.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h @@ -1,69 +1,95 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + #import <Foundation/Foundation.h> +#import "FIRCoreSwiftNameSupport.h" + +NS_ASSUME_NONNULL_BEGIN + /** * This class provides constant fields of Google APIs. */ +FIR_SWIFT_NAME(FirebaseOptions) @interface FIROptions : NSObject<NSCopying> /** * Returns the default options. */ -+ (FIROptions *)defaultOptions; ++ (nullable FIROptions *)defaultOptions FIR_SWIFT_NAME(defaultOptions()); /** * An iOS API key used for authenticating requests from your app, e.g. * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers. */ -@property(nonatomic, readonly, copy) NSString *APIKey; +@property(nonatomic, copy, nullable) NSString *APIKey FIR_SWIFT_NAME(apiKey); + +/** + * The bundle ID for the application. Defaults to `[[NSBundle mainBundle] bundleID]` when not set + * manually or in a plist. + */ +@property(nonatomic, copy) NSString *bundleID; /** * The OAuth2 client ID for iOS application used to authenticate Google users, for example * @"12345.apps.googleusercontent.com", used for signing in with Google. */ -@property(nonatomic, readonly, copy) NSString *clientID; +@property(nonatomic, copy, nullable) NSString *clientID; /** * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics. */ -@property(nonatomic, readonly, copy) NSString *trackingID; +@property(nonatomic, copy, nullable) NSString *trackingID; /** * The Project Number from the Google Developer's console, for example @"012345678901", used to * configure Google Cloud Messaging. */ -@property(nonatomic, readonly, copy) NSString *GCMSenderID; +@property(nonatomic, copy) NSString *GCMSenderID FIR_SWIFT_NAME(gcmSenderID); /** - * The Project ID from the Firebase console, for example @"abc-xyz-123". Currently only populated - * when using [FIROptions defaultOptions]. + * The Project ID from the Firebase console, for example @"abc-xyz-123". */ -@property(nonatomic, readonly, copy) NSString *projectID; +@property(nonatomic, copy, nullable) NSString *projectID; /** * The Android client ID used in Google AppInvite when an iOS app has its Android version, for * example @"12345.apps.googleusercontent.com". */ -@property(nonatomic, readonly, copy) NSString *androidClientID; +@property(nonatomic, copy, nullable) NSString *androidClientID; /** * The Google App ID that is used to uniquely identify an instance of an app. */ -@property(nonatomic, readonly, copy) NSString *googleAppID; +@property(nonatomic, copy) NSString *googleAppID; /** * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com". */ -@property(nonatomic, readonly, copy) NSString *databaseURL; +@property(nonatomic, copy, nullable) NSString *databaseURL; /** * The URL scheme used to set up Durable Deep Link service. */ -@property(nonatomic, readwrite, copy) NSString *deepLinkURLScheme; +@property(nonatomic, copy, nullable) NSString *deepLinkURLScheme; /** * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com". */ -@property(nonatomic, readonly, copy) NSString *storageBucket; +@property(nonatomic, copy, nullable) NSString *storageBucket; /** * Initializes a customized instance of FIROptions with keys. googleAppID, bundleID and GCMSenderID @@ -78,7 +104,10 @@ androidClientID:(NSString *)androidClientID databaseURL:(NSString *)databaseURL storageBucket:(NSString *)storageBucket - deepLinkURLScheme:(NSString *)deepLinkURLScheme; + deepLinkURLScheme:(NSString *)deepLinkURLScheme + DEPRECATED_MSG_ATTRIBUTE("Use `-[[FIROptions alloc] initWithGoogleAppID:GCMSenderID:]` " + "(`FirebaseOptions(googleAppID:gcmSenderID:)` in Swift)` and property " + "setters instead."); /** * Initializes a customized instance of FIROptions from the file at the given plist file path. @@ -88,6 +117,16 @@ * FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; * Returns nil if the plist file does not exist or is invalid. */ -- (instancetype)initWithContentsOfFile:(NSString *)plistPath; +- (nullable instancetype)initWithContentsOfFile:(NSString *)plistPath; + +/** + * Initializes a customized instance of FIROptions with required fields. Use the mutable properties + * to modify fields for configuring specific services. + */ +- (instancetype)initWithGoogleAppID:(NSString *)googleAppID + GCMSenderID:(NSString *)GCMSenderID + FIR_SWIFT_NAME(init(googleAppID:gcmSenderID:)); @end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FirebaseCore.h b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h index 52a222f5..20816292 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FirebaseCore.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h @@ -1,5 +1,6 @@ #import "FIRAnalyticsConfiguration.h" #import "FIRApp.h" #import "FIRConfiguration.h" +#import "FIRCoreSwiftNameSupport.h" #import "FIRLoggerLevel.h" #import "FIROptions.h" diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap index f3db90d8..440f052c 100755 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Modules/module.modulemap +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/Modules/module.modulemap @@ -3,6 +3,4 @@ framework module FirebaseCore { export * module * { export *} link "z" - link framework "Foundation" - link framework "UIKit" }
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics Binary files differnew file mode 100755 index 00000000..f8b09d47 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCoreDiagnostics.framework/FirebaseCoreDiagnostics diff --git a/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCoreDiagnostics.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCoreDiagnostics.framework/Modules/module.modulemap new file mode 100755 index 00000000..5855789c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCoreDiagnostics.framework/Modules/module.modulemap @@ -0,0 +1,5 @@ +framework module FirebaseCoreDiagnostics { + export * + module * { export *} + link "z" +}
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseNanoPB.framework/FirebaseNanoPB b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseNanoPB.framework/FirebaseNanoPB Binary files differnew file mode 100755 index 00000000..13965a90 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseNanoPB.framework/FirebaseNanoPB diff --git a/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/CHANGELOG.md b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/CHANGELOG.md new file mode 100755 index 00000000..ae14de96 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/CHANGELOG.md @@ -0,0 +1,52 @@ +# 2017-05-08 -- v2.0.0 +- Introduced an improved interface for Swift 3 developers +- Deprecated some methods and properties after moving their logic to the + Firebase Cloud Messaging SDK +- Fixed an intermittent stability issue when a debug build of an app was + replaced with a release build of the same version +- Removed swizzling logic that was sometimes resulting in developers receiving + a validation notice about enabling push notification capabilities, even though + they weren't using push notifications +- Fixed a notification that would sometimes fire twice in quick succession + during the first run of an app + +# 2017-03-31 -- v1.0.10 + +- Improvements to token-fetching logic +- Fixed some warnings in Instance ID +- Improved error messages if Instance ID couldn't be initialized properly +- Improvements to console logging + +# 2017-01-31 -- v1.0.9 + +- Removed an error being mistakenly logged to the console. + +# 2016-07-06 -- v1.0.8 + +- Don't store InstanceID plists in Documents folder. + +# 2016-06-19 -- v1.0.7 + +- Fix remote-notifications warning on app submission. + +# 2016-05-16 -- v1.0.6 + +- Fix CocoaPod linter issues for InstanceID pod. + +# 2016-05-13 -- v1.0.5 + +- Fix Authorization errors for InstanceID tokens. + +# 2016-05-11 -- v1.0.4 + +- Reduce wait for InstanceID token during parallel requests. + +# 2016-04-18 -- v1.0.3 + +- Change flag to disable swizzling to *FirebaseAppDelegateProxyEnabled*. +- Fix incessant Keychain errors while accessing InstanceID. +- Fix max retries for fetching IID token. + +# 2016-04-18 -- v1.0.2 + +- Register for remote notifications on iOS8+ in the SDK itself. diff --git a/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID Binary files differnew file mode 100755 index 00000000..8bde6c14 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/Headers/FIRInstanceID.h b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h index 5ff8372e..4b3c546c 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/Headers/FIRInstanceID.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h @@ -1,12 +1,35 @@ #import <Foundation/Foundation.h> +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifndef FIR_SWIFT_NAME +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 +#endif // #ifndef FIR_SWIFT_NAME + /** * @memberof FIRInstanceID * * The scope to be used when fetching/deleting a token for Firebase Messaging. */ -FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessaging; +FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessaging + FIR_SWIFT_NAME(InstanceIDScopeFirebaseMessaging); +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + * Called when the system determines that tokens need to be refreshed. + * This method is also called if Instance ID has been reset in which + * case, tokens and FCM topic subscriptions also need to be refreshed. + * + * Instance ID service will throttle the refresh event across all devices + * to control the rate of token updates on application servers. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull kFIRInstanceIDTokenRefreshNotification + FIR_SWIFT_NAME(InstanceIDTokenRefresh); +#else /** * Called when the system determines that tokens need to be refreshed. * This method is also called if Instance ID has been reset in which @@ -15,7 +38,9 @@ FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessagin * Instance ID service will throttle the refresh event across all devices * to control the rate of token updates on application servers. */ -FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotification; +FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotification + FIR_SWIFT_NAME(InstanceIDTokenRefreshNotification); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 /** * @related FIRInstanceID @@ -29,7 +54,8 @@ FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotificat * failed. See the error codes below for a more detailed * description. */ -typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * __nullable error); +typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * __nullable error) + FIR_SWIFT_NAME(InstanceIDTokenHandler); /** @@ -41,7 +67,8 @@ typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * * @param error The error describing why deleting the token failed. * See the error codes below for a more detailed description. */ -typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error); +typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error) + FIR_SWIFT_NAME(InstanceIDDeleteTokenHandler); /** * @related FIRInstanceID @@ -53,7 +80,8 @@ typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error); * while creating an identity. * @param error The error if fetching the identity fails else nil. */ -typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __nullable error); +typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __nullable error) + FIR_SWIFT_NAME(InstanceIDHandler); /** * @related FIRInstanceID @@ -64,7 +92,8 @@ typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __ * @param error The error if deleting the identity and all the tokens associated with * it fails else nil. */ -typedef void(^FIRInstanceIDDeleteHandler)(NSError * __nullable error); +typedef void(^FIRInstanceIDDeleteHandler)(NSError * __nullable error) + FIR_SWIFT_NAME(InstanceIDDeleteHandler); /** * @enum FIRInstanceIDError @@ -93,7 +122,7 @@ typedef NS_ENUM(NSUInteger, FIRInstanceIDError) { /// InvalidRequest -- Some parameters of the request were invalid. FIRInstanceIDErrorInvalidRequest = 7, -}; +} FIR_SWIFT_NAME(InstanceIDError); /** * The APNS token type for the app. If the token type is set to `UNKNOWN` @@ -107,11 +136,12 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { FIRInstanceIDAPNSTokenTypeSandbox, /// Production token type. FIRInstanceIDAPNSTokenTypeProd, -}; +} FIR_SWIFT_NAME(InstanceIDAPNSTokenType) + __deprecated_enum_msg("Use FIRMessaging's APNSToken property instead."); /** * Instance ID provides a unique identifier for each app instance and a mechanism - * to authenticate and authorize actions (for example, sending a GCM message). + * to authenticate and authorize actions (for example, sending an FCM message). * * Instance ID is long lived but, may be reset if the device is not used for * a long time or the Instance ID service detects a problem. @@ -124,6 +154,7 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { * services associated with the app, call * `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. */ +FIR_SWIFT_NAME(InstanceID) @interface FIRInstanceID : NSObject /** @@ -131,7 +162,7 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { * * @return A shared instance of FIRInstanceID. */ -+ (nonnull instancetype)instanceID NS_SWIFT_NAME(instanceID()); ++ (nonnull instancetype)instanceID FIR_SWIFT_NAME(instanceID()); /** * Unavailable. Use +instanceID instead. @@ -149,7 +180,8 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { * @param type The APNS token type for the above token. */ - (void)setAPNSToken:(nonnull NSData *)token - type:(FIRInstanceIDAPNSTokenType)type; + type:(FIRInstanceIDAPNSTokenType)type + __deprecated_msg("Use FIRMessaging's APNSToken property instead."); #pragma mark - Tokens @@ -235,11 +267,13 @@ typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { * a valid identifier is returned and a valid identifier for the * application instance. */ -- (void)getIDWithHandler:(nonnull FIRInstanceIDHandler)handler; +- (void)getIDWithHandler:(nonnull FIRInstanceIDHandler)handler + FIR_SWIFT_NAME(getID(handler:)); /** * Resets Instance ID and revokes all tokens. */ -- (void)deleteIDWithHandler:(nonnull FIRInstanceIDDeleteHandler)handler; +- (void)deleteIDWithHandler:(nonnull FIRInstanceIDDeleteHandler)handler + FIR_SWIFT_NAME(deleteID(handler:)); @end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h index 053ec2b1..053ec2b1 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap index 267c0356..c10be032 100755 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Modules/module.modulemap +++ b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Modules/module.modulemap @@ -2,6 +2,5 @@ framework module FirebaseInstanceID { umbrella header "FirebaseInstanceID.h" export * module * { export *} - link framework "Foundation" - link framework "UIKit" + link "z" }
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/GGLInstanceID/README.md b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/README.md index e6fb90db..25fe2196 100644..100755 --- a/StoneIsland/platforms/ios/Pods/GGLInstanceID/README.md +++ b/StoneIsland/platforms/ios/Pods/FirebaseInstanceID/README.md @@ -2,7 +2,7 @@ Instance ID provides a unique ID per instance of your apps and also provides a mechanism to authenticate and authorize actions, like sending messages via -Google Cloud Messaging (GCM). +Firebase Cloud Messaging (FCM). Please visit [our developer diff --git a/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/FirebaseMessaging b/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/FirebaseMessaging Binary files differnew file mode 100755 index 00000000..095a9fc4 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/FirebaseMessaging diff --git a/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h b/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h new file mode 100755 index 00000000..84d2526b --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h @@ -0,0 +1,486 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import <Foundation/Foundation.h> + + +// NS_SWIFT_NAME can only translate factory methods before the iOS 9.3 SDK. +// Wrap it in our own macro if it's a non-compatible SDK. +#ifndef FIR_SWIFT_NAME +#ifdef __IPHONE_9_3 +#define FIR_SWIFT_NAME(X) NS_SWIFT_NAME(X) +#else +#define FIR_SWIFT_NAME(X) // Intentionally blank. +#endif // #ifdef __IPHONE_9_3 +#endif // #ifndef FIR_SWIFT_NAME + +/** + * @related FIRMessaging + * + * The completion handler invoked when the registration token returns. + * If the call fails we return the appropriate `error code`, described by + * `FIRMessagingError`. + * + * @param FCMToken The valid registration token returned by FCM. + * @param error The error describing why a token request failed. The error code + * will match a value from the FIRMessagingError enumeration. + */ +typedef void(^FIRMessagingFCMTokenFetchCompletion)(NSString * _Nullable FCMToken, + NSError * _Nullable error) + FIR_SWIFT_NAME(MessagingFCMTokenFetchCompletion); + + +/** + * @related FIRMessaging + * + * The completion handler invoked when the registration token deletion request is + * completed. If the call fails we return the appropriate `error code`, described + * by `FIRMessagingError`. + * + * @param error The error describing why a token deletion failed. The error code + * will match a value from the FIRMessagingError enumeration. + */ +typedef void(^FIRMessagingDeleteFCMTokenCompletion)(NSError * _Nullable error) + FIR_SWIFT_NAME(MessagingDeleteFCMTokenCompletion); + +/** + * The completion handler invoked once the data connection with FIRMessaging is + * established. The data connection is used to send a continous stream of + * data and all the FIRMessaging data notifications arrive through this connection. + * Once the connection is established we invoke the callback with `nil` error. + * Correspondingly if we get an error while trying to establish a connection + * we invoke the handler with an appropriate error object and do an + * exponential backoff to try and connect again unless successful. + * + * @param error The error object if any describing why the data connection + * to FIRMessaging failed. + */ +typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error) + FIR_SWIFT_NAME(MessagingConnectCompletion) + __deprecated_msg("Please listen for the FIRMessagingConnectionStateChangedNotification " + "NSNotification instead."); + +#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +/** + * Notification sent when the upstream message has been delivered + * successfully to the server. The notification object will be the messageID + * of the successfully delivered message. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingSendSuccessNotification + FIR_SWIFT_NAME(MessagingSendSuccess); + +/** + * Notification sent when the upstream message was failed to be sent to the + * server. The notification object will be the messageID of the failed + * message. The userInfo dictionary will contain the relevant error + * information for the failure. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingSendErrorNotification + FIR_SWIFT_NAME(MessagingSendError); + +/** + * Notification sent when the Firebase messaging server deletes pending + * messages due to exceeded storage limits. This may occur, for example, when + * the device cannot be reached for an extended period of time. + * + * It is recommended to retrieve any missing messages directly from the + * server. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingMessagesDeletedNotification + FIR_SWIFT_NAME(MessagingMessagesDeleted); + +/** + * Notification sent when Firebase Messaging establishes or disconnects from + * an FCM socket connection. You can query the connection state in this + * notification by checking the `isDirectChannelEstablished` property of FIRMessaging. + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull FIRMessagingConnectionStateChangedNotification + FIR_SWIFT_NAME(MessagingConnectionStateChanged); + +/** + * Notification sent when the FCM registration token has been refreshed. You can also + * receive the FCM token via the FIRMessagingDelegate method + * `-messaging:didRefreshRegistrationToken:` + */ +FOUNDATION_EXPORT const NSNotificationName __nonnull + FIRMessagingRegistrationTokenRefreshedNotification + FIR_SWIFT_NAME(MessagingRegistrationTokenRefreshed); +#else +/** + * Notification sent when the upstream message has been delivered + * successfully to the server. The notification object will be the messageID + * of the successfully delivered message. + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification + FIR_SWIFT_NAME(MessagingSendSuccessNotification); + +/** + * Notification sent when the upstream message was failed to be sent to the + * server. The notification object will be the messageID of the failed + * message. The userInfo dictionary will contain the relevant error + * information for the failure. + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification + FIR_SWIFT_NAME(MessagingSendErrorNotification); + +/** + * Notification sent when the Firebase messaging server deletes pending + * messages due to exceeded storage limits. This may occur, for example, when + * the device cannot be reached for an extended period of time. + * + * It is recommended to retrieve any missing messages directly from the + * server. + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotification + FIR_SWIFT_NAME(MessagingMessagesDeletedNotification); + +/** + * Notification sent when Firebase Messaging establishes or disconnects from + * an FCM socket connection. You can query the connection state in this + * notification by checking the `isDirectChannelEstablished` property of FIRMessaging. + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingConnectionStateChangedNotification + FIR_SWIFT_NAME(MessagingConnectionStateChangedNotification); + +/** + * Notification sent when the FCM registration token has been refreshed. You can also + * receive the FCM token via the FIRMessagingDelegate method + * `-messaging:didRefreshRegistrationToken:` + */ +FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingRegistrationTokenRefreshedNotification + FIR_SWIFT_NAME(MessagingRegistrationTokenRefreshedNotification); +#endif // defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 + +/** + * @enum FIRMessagingError + */ +typedef NS_ENUM(NSUInteger, FIRMessagingError) { + /// Unknown error. + FIRMessagingErrorUnknown = 0, + + /// FIRMessaging couldn't validate request from this client. + FIRMessagingErrorAuthentication = 1, + + /// InstanceID service cannot be accessed. + FIRMessagingErrorNoAccess = 2, + + /// Request to InstanceID backend timed out. + FIRMessagingErrorTimeout = 3, + + /// No network available to reach the servers. + FIRMessagingErrorNetwork = 4, + + /// Another similar operation in progress, bailing this one. + FIRMessagingErrorOperationInProgress = 5, + + /// Some parameters of the request were invalid. + FIRMessagingErrorInvalidRequest = 7, +} FIR_SWIFT_NAME(MessagingError); + +/// Status for the downstream message received by the app. +typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { + /// Unknown status. + FIRMessagingMessageStatusUnknown, + /// New downstream message received by the app. + FIRMessagingMessageStatusNew, +} FIR_SWIFT_NAME(MessagingMessageStatus); + +/** + * The APNS token type for the app. If the token type is set to `UNKNOWN` + * Firebase Messaging will implicitly try to figure out what the actual token type + * is from the provisioning profile. + * Unless you really need to specify the type, you should use the `APNSToken` + * property instead. + */ +typedef NS_ENUM(NSInteger, FIRMessagingAPNSTokenType) { + /// Unknown token type. + FIRMessagingAPNSTokenTypeUnknown, + /// Sandbox token type. + FIRMessagingAPNSTokenTypeSandbox, + /// Production token type. + FIRMessagingAPNSTokenTypeProd, +} FIR_SWIFT_NAME(MessagingAPNSTokenType); + +/// Information about a downstream message received by the app. +FIR_SWIFT_NAME(MessagingMessageInfo) +@interface FIRMessagingMessageInfo : NSObject + +/// The status of the downstream message +@property(nonatomic, readonly, assign) FIRMessagingMessageStatus status; + +@end + +/** + * A remote data message received by the app via FCM (not just the APNs interface). + * + * This is only for devices running iOS 10 or above. To support devices running iOS 9 or below, use + * the local and remote notifications handlers defined in UIApplicationDelegate protocol. + */ +FIR_SWIFT_NAME(MessagingRemoteMessage) +@interface FIRMessagingRemoteMessage : NSObject + +/// The downstream message received by the application. +@property(nonatomic, readonly, strong, nonnull) NSDictionary *appData; +@end + +@class FIRMessaging; +/** + * A protocol to handle events from FCM for devices running iOS 10 or above. + * + * To support devices running iOS 9 or below, use the local and remote notifications handlers + * defined in UIApplicationDelegate protocol. + */ +FIR_SWIFT_NAME(MessagingDelegate) +@protocol FIRMessagingDelegate <NSObject> + +/// This method will be called whenever FCM receives a new, default FCM token for your +/// Firebase project's Sender ID. +/// You can send this token to your application server to send notifications to this device. +- (void)messaging:(nonnull FIRMessaging *)messaging + didRefreshRegistrationToken:(nonnull NSString *)fcmToken + FIR_SWIFT_NAME(messaging(_:didRefreshRegistrationToken:)); + +@optional +/// This method is called on iOS 10 devices to handle data messages received via FCM through its +/// direct channel (not via APNS). For iOS 9 and below, the FCM data message is delivered via the +/// UIApplicationDelegate's -application:didReceiveRemoteNotification: method. +- (void)messaging:(nonnull FIRMessaging *)messaging + didReceiveMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage + FIR_SWIFT_NAME(messaging(_:didReceive:)) + __IOS_AVAILABLE(10.0); + +/// The callback to handle data message received via FCM for devices running iOS 10 or above. +- (void)applicationReceivedRemoteMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage + FIR_SWIFT_NAME(application(received:)) + __deprecated_msg("Use FIRMessagingDelegate’s -messaging:didReceiveMessage:"); + +@end + +/** + * Firebase Messaging lets you reliably deliver messages at no cost. + * + * To send or receive messages, the app must get a + * registration token from FIRInstanceID. This token authorizes an + * app server to send messages to an app instance. + * + * In order to receive FIRMessaging messages, declare `application:didReceiveRemoteNotification:`. + */ +FIR_SWIFT_NAME(Messaging) +@interface FIRMessaging : NSObject + +/** + * Delegate to handle FCM token refreshes, and remote data messages received via FCM for devices + * running iOS 10 or above. + */ +@property(nonatomic, weak, nullable) id<FIRMessagingDelegate> delegate; + + +/** + * Delegate to handle remote data messages received via FCM for devices running iOS 10 or above. + */ +@property(nonatomic, weak, nullable) id<FIRMessagingDelegate> remoteMessageDelegate + __deprecated_msg("Use 'delegate' property"); + +/** + * When set to YES, Firebase Messaging will automatically establish a socket-based, direct channel + * to the FCM server. You only need to enable this if you are sending upstream messages or + * receiving non-APNS, data-only messages in foregrounded apps. + * Default is NO. + */ +@property(nonatomic) BOOL shouldEstablishDirectChannel; + +/** + * Returns YES if the direct channel to the FCM server is active, NO otherwise. + */ +@property(nonatomic, readonly) BOOL isDirectChannelEstablished; + +/** + * FIRMessaging + * + * @return An instance of FIRMessaging. + */ ++ (nonnull instancetype)messaging FIR_SWIFT_NAME(messaging()); + +/** + * Unavailable. Use +messaging instead. + */ +- (nonnull instancetype)init __attribute__((unavailable("Use +messaging instead."))); + +#pragma mark - APNS + +/** + * This property is used to set the APNS Token received by the application delegate. + * + * FIRMessaging uses method swizzling to ensure the APNS token is set automatically. + * However, if you have disabled swizzling by setting `FirebaseAppDelegateProxyEnabled` + * to `NO` in your app's Info.plist, you should manually set the APNS token in your + * application delegate's -application:didRegisterForRemoteNotificationsWithDeviceToken: + * method. + * + * If you would like to set the type of the APNS token, rather than relying on automatic + * detection, see: -setAPNSToken:type:. + */ +@property(nonatomic, copy, nullable) NSData *APNSToken FIR_SWIFT_NAME(apnsToken); + +/** + * Set APNS token for the application. This APNS token will be used to register + * with Firebase Messaging using `FCMToken` or + * `tokenWithAuthorizedEntity:scope:options:handler`. + * + * @param apnsToken The APNS token for the application. + * @param type The type of APNS token. Debug builds should use + * FIRMessagingAPNSTokenTypeSandbox. Alternatively, you can supply + * FIRMessagingAPNSTokenTypeUnknown to have the type automatically + * detected based on your provisioning profile. + */ +- (void)setAPNSToken:(nonnull NSData *)apnsToken type:(FIRMessagingAPNSTokenType)type; + +#pragma mark - FCM Tokens + +/** + * The FCM token is used to identify this device so that FCM can send notifications to it. + * It is associated with your APNS token when the APNS token is supplied, so that sending + * messages to the FCM token will be delivered over APNS. + * + * The FCM token is sometimes refreshed automatically. You can be notified of these changes + * via the FIRMessagingDelegate method `-message:didRefreshRegistrationToken:`, or by + * listening for the `FIRMessagingRegistrationTokenRefreshedNotification` notification. + * + * Once you have an FCM token, you should send it to your application server, so it can use + * the FCM token to send notifications to your device. + */ +@property(nonatomic, readonly, nullable) NSString *FCMToken FIR_SWIFT_NAME(fcmToken); + + +/** + * Retrieves an FCM registration token for a particular Sender ID. This registration token is + * not cached by FIRMessaging. FIRMessaging should have an APNS token set before calling this + * to ensure that notifications can be delivered via APNS using this FCM token. You may + * re-retrieve the FCM token once you have the APNS token set, to associate it with the FCM + * token. The default FCM token is automatically associated with the APNS token, if the APNS + * token data is available. + * + * @param senderID The Sender ID for a particular Firebase project. + * @param completion The completion handler to handle the token request. + */ +- (void)retrieveFCMTokenForSenderID:(nonnull NSString *)senderID + completion:(nonnull FIRMessagingFCMTokenFetchCompletion)completion + FIR_SWIFT_NAME(retrieveFCMToken(forSenderID:completion:)); + + +/** + * Invalidates an FCM token for a particular Sender ID. That Sender ID cannot no longer send + * notifications to that FCM token. + * + * @param senderID The senderID for a particular Firebase project. + * @param completion The completion handler to handle the token deletion. + */ +- (void)deleteFCMTokenForSenderID:(nonnull NSString *)senderID + completion:(nonnull FIRMessagingDeleteFCMTokenCompletion)completion + FIR_SWIFT_NAME(deleteFCMToken(forSenderID:completion:)); + + +#pragma mark - Connect + +/** + * Create a FIRMessaging data connection which will be used to send the data notifications + * sent by your server. It will also be used to send ACKS and other messages based + * on the FIRMessaging ACKS and other messages based on the FIRMessaging protocol. + * + * + * @param handler The handler to be invoked once the connection is established. + * If the connection fails we invoke the handler with an + * appropriate error code letting you know why it failed. At + * the same time, FIRMessaging performs exponential backoff to retry + * establishing a connection and invoke the handler when successful. + */ +- (void)connectWithCompletion:(nonnull FIRMessagingConnectCompletion)handler + FIR_SWIFT_NAME(connect(handler:)) + __deprecated_msg("Please use the shouldEstablishDirectChannel property instead."); + +/** + * Disconnect the current FIRMessaging data connection. This stops any attempts to + * connect to FIRMessaging. Calling this on an already disconnected client is a no-op. + * + * Call this before `teardown` when your app is going to the background. + * Since the FIRMessaging connection won't be allowed to live when in background it is + * prudent to close the connection. + */ +- (void)disconnect + __deprecated_msg("Please use the shouldEstablishDirectChannel property instead."); + +#pragma mark - Topics + +/** + * Asynchronously subscribes to a topic. + * + * @param topic The name of the topic, for example, @"sports". + */ +- (void)subscribeToTopic:(nonnull NSString *)topic FIR_SWIFT_NAME(subscribe(toTopic:)); + +/** + * Asynchronously unsubscribe from a topic. + * + * @param topic The name of the topic, for example @"sports". + */ +- (void)unsubscribeFromTopic:(nonnull NSString *)topic FIR_SWIFT_NAME(unsubscribe(fromTopic:)); + +#pragma mark - Upstream + +/** + * Sends an upstream ("device to cloud") message. + * + * The message is queued if we don't have an active connection. + * You can only use the upstream feature if your FCM implementation + * uses the XMPP server protocol. + * + * @param message Key/Value pairs to be sent. Values must be String, any + * other type will be ignored. + * @param receiver A string identifying the receiver of the message. For FCM + * project IDs the value is `SENDER_ID@gcm.googleapis.com`. + * @param messageID The ID of the message. This is generated by the application. It + * must be unique for each message generated by this application. + * It allows error callbacks and debugging, to uniquely identify + * each message. + * @param ttl The time to live for the message. In case we aren't able to + * send the message before the TTL expires we will send you a + * callback. If 0, we'll attempt to send immediately and return + * an error if we're not connected. Otherwise, the message will + * be queued. As for server-side messages, we don't return an error + * if the message has been dropped because of TTL; this can happen + * on the server side, and it would require extra communication. + */ +- (void)sendMessage:(nonnull NSDictionary *)message + to:(nonnull NSString *)receiver + withMessageID:(nonnull NSString *)messageID + timeToLive:(int64_t)ttl; + +#pragma mark - Analytics + +/** + * Use this to track message delivery and analytics for messages, typically + * when you receive a notification in `application:didReceiveRemoteNotification:`. + * However, you only need to call this if you set the `FirebaseAppDelegateProxyEnabled` + * flag to NO in your Info.plist. If `FirebaseAppDelegateProxyEnabled` is either missing + * or set to YES in your Info.plist, the library will call this automatically. + * + * @param message The downstream message received by the application. + * + * @return Information about the downstream message. + */ +- (nonnull FIRMessagingMessageInfo *)appDidReceiveMessage:(nonnull NSDictionary *)message; + +@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/Headers/FirebaseMessaging.h b/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h index ef49e7ff..ef49e7ff 100755 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/Headers/FirebaseMessaging.h +++ b/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Modules/module.modulemap index 80bc59c1..45dc7bc0 100755 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Modules/module.modulemap +++ b/StoneIsland/platforms/ios/Pods/FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Modules/module.modulemap @@ -4,8 +4,4 @@ framework module FirebaseMessaging { module * { export *} link "sqlite3" link "z" - link framework "CoreGraphics" - link framework "Foundation" - link framework "SystemConfiguration" - link framework "UIKit" }
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/GGLInstanceID/CHANGELOG.md b/StoneIsland/platforms/ios/Pods/GGLInstanceID/CHANGELOG.md deleted file mode 100644 index 755828e3..00000000 --- a/StoneIsland/platforms/ios/Pods/GGLInstanceID/CHANGELOG.md +++ /dev/null @@ -1,28 +0,0 @@ -# 2016-02-25 -- v1.2.1 -- Fix incorrect caching during library updates. - -# 2016-02-17 -- v1.2.0 -- Add Bitcode markers. - -# 2016-01-25 -- v1.1.7 -- Fix bug in InstanceID generation - -# 2016-01-25 -- v1.1.6 -- Greatly reduce IID library size. -- Bug fixes. - -# 2015-12-08 -- v1.1.4 -- Bug fixes. -- Fix dSYM warnings. - -# 2015-11-09 -- v1.1.3 -- Bug fixes. - -# 2015-10-28 -- v1.1.2 -- Bug fixes. - -# 2015-10-8 -- v1.1.1 - -- Resets InstanceID tokens on app delete and reinstall. -- Adds better error reporting. -- Bug fixes. diff --git a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceID.h b/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceID.h deleted file mode 100644 index e3fd3c64..00000000 --- a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceID.h +++ /dev/null @@ -1,273 +0,0 @@ -#import <Foundation/Foundation.h> - -@class GGLInstanceIDConfig; - -/** - * @memberof GGLInstanceID - * - * The key for APNS token to be included in the options dictionary when - * registering for GCM (Google Cloud Messaging). The value should be a - * NSData object that represents the APNS token for the app. This - * key is required to get a GCM token. - */ -FOUNDATION_EXPORT NSString *const kGGLInstanceIDRegisterAPNSOption; - -/** - * @memberof GGLInstanceID - * - * The key to specify if the APNS token type is sandbox or production. Set - * to YES if the app was built with Sandbox certificate else NO for production. - * At any point of time InstanceID library will support only one type of token. - */ -FOUNDATION_EXPORT NSString *const kGGLInstanceIDAPNSServerTypeSandboxOption; - -/** - * @memberof GGLInstanceID - * - * The scope to be used when fetching/deleting a token for - * GCM (Google Cloud Messaging). - */ -FOUNDATION_EXPORT NSString *const kGGLInstanceIDScopeGCM; - -/** - * @related GGLInstanceID - * - * The completion handler invoked when the InstanceID token returns. If - * the call fails we return the appropriate `error code` as described below. - * - * @param token The valid token as returned by InstanceID backend. - * - * @param error The error describing why generating a new token - * failed. See the error codes below for a more detailed - * description. - */ -typedef void(^GGLInstanceIDTokenHandler)(NSString *token, NSError *error); - - -/** - * @related GGLInstanceID - * - * The completion handler invoked when the InstanceID `deleteToken` returns. If - * the call fails we return the appropriate `error code` as described below - * - * @param error The error describing why deleting the token failed. - * See the error codes below for a more detailed description. - */ -typedef void(^GGLInstanceIDDeleteTokenHandler)(NSError *error); - -/** - * @related GGLInstanceID - * - * The completion handler invoked when the app identity is created. If the - * identity wasn't created for some reason we return the appropriate error code. - * - * @param identity A valid identity for the app instance, nil if there was an error - * while creating an identity. - * @param error The error if fetching the identity fails else nil. - */ -typedef void(^GGLInstanceIDHandler)(NSString *identity, NSError *error); - -/** - * @related GGLInstanceID - * - * The completion handler invoked when the app identity and all the tokens associated - * with it are deleted. Returns a valid error object in case of failure else nil. - * - * @param error The error if deleting the identity and all the tokens associated with - * it fails else nil. - */ -typedef void(^GGLInstanceIDDeleteHandler)(NSError *error); - -/** - * @enum GGLInstanceIDOperationErrorCode - * Description of error codes - */ -typedef NS_ENUM(NSUInteger, GGLInstanceIDOperationErrorCode) { - // Http related errors. - - /// InvalidRequest -- Some parameters of the request were invalid. - kGGLInstanceIDOperationErrorCodeInvalidRequest = 0, - - /// Auth Error -- GCM couldn't validate request from this client. - kGGLInstanceIDOperationErrorCodeAuthentication = 1, - - /// NoAccess -- InstanceID service cannot be accessed. - kGGLInstanceIDOperationErrorCodeNoAccess = 2, - - /// Timeout -- Request to InstanceID backend timed out. - kGGLInstanceIDOperationErrorCodeTimeout = 3, - - - /// Network -- No network available to reach the servers. - kGGLInstanceIDOperationErrorCodeNetwork = 4, - - /// OperationInProgress -- Another similar operation in progress, - /// bailing this one. - kGGLInstanceIDOperationErrorCodeOperationInProgress = 5, - - /// Unknown error. - kGGLInstanceIDOperationErrorCodeUnknown = 7, - - // InstanceID specific errors - - /* - * Generic errors. - */ - - // Device seems to be missing a valid deviceID. Cannot - // authenticate device requests. - kGGLInstanceIDOperationErrorCodeMissingDeviceID = 501, - - /** - * Token specific errors. - */ - - /// GCM token request is missing APNS token. - kGGLInstanceIDOperationErrorCodeMissingAPNSToken = 1001, - - /// GCM token request is missing server type. - kGGLInstanceIDOperationErrorCodeMissingAPNSServerType = 1002, - - /// Token request has invalid authorizedEntity. - kGGLInstanceIDOperationErrorCodeInvalidAuthorizedEntity = 1003, - - /// Token request has invalid scope. - kGGLInstanceIDOperationErrorCodeInvalidScope = 1004, - - /// Should call `startWithConfig:` before requesting token. - kGGLInstanceIDOperationErrorCodeInvalidStart = 1005, - - /// KeyPair access error. - kGGLInstanceIDOperationErrorCodeInvalidKeyPair = 1006, - - /** - * Identity specific errors. - */ - - /// Missing KeyPair. - kGGLInstanceIDOperationErrorCodeMissingKeyPair = 2001, -}; - -/** - * Instance ID provides a unique identifier for each app instance and a mechanism - * to authenticate and authorize actions (for example, sending a GCM message). - * - * Instance ID is long lived but, may be reset if the device is not used for - * a long time or the Instance ID service detects a problem. - * If Instance ID is reset, the app will be notified with a callback to - * [GGLInstanceIDDelegate onTokenRefresh] - * - * If the Instance ID has become invalid, the app can request a new one and - * send it to the app server. - * To prove ownership of Instance ID and to allow servers to access data or - * services associated with the app, call - * `[GGLInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. - */ -@interface GGLInstanceID : NSObject - -/** - * GGLInstanceID. - * - * @return A shared instance of GGLInstanceID. - */ -+ (instancetype)sharedInstance; - -/** - * Start `GGLInstanceID` with the specified config. - * - * @see GGLInstanceIDConfig - * - * @param config The `GGLInstanceIDConfig` used to build the service. - */ -- (void)startWithConfig:(GGLInstanceIDConfig *)config; - -/** - * Stop any network requests started by the client and release any handlers - * associated with it. - */ -- (void)stopAllRequests; - -#pragma mark - Tokens - -/** - * Returns a token that authorizes an Entity (example: cloud service) to perform - * an action on behalf of the application identified by Instance ID. - * - * This is similar to an OAuth2 token except, it applies to the - * application instance instead of a user. - * - * This is an asynchronous call. If the token fetching fails for some reason - * we invoke the completion callback with nil `token` and the appropriate - * error. - * - * Note, you can only have one `token` or `deleteToken` call for a given - * authorizedEntity and scope at any point of time. Making another such call with the - * same authorizedEntity and scope before the last one finishes will result in an - * error with code `OperationInProgress`. - * - * @see GGLInstanceID deleteTokenWithAuthorizedEntity:scope:handler: - * - * @param authorizedEntity Entity authorized by the token. - * @param scope Action authorized for authorizedEntity. - * @param options The extra options to be sent with your token request. The - * value for the `apns_token` should be the NSData object - * passed to UIApplication's - * `didRegisterForRemoteNotificationsWithDeviceToken` method. - * All other keys and values in the options dict need to be - * instances of NSString or else they will be discarded. Bundle - * keys starting with 'GCM.' and 'GOOGLE.' are reserved. - * @param handler The callback handler which is invoked when the token is - * successfully fetched. In case of success a valid `token` and - * `nil` error are returned. In case of any error the `token` - * is nil and a valid `error` is returned. The valid error - * codes have been documented above. - */ -- (void)tokenWithAuthorizedEntity:(NSString *)authorizedEntity - scope:(NSString *)scope - options:(NSDictionary *)options - handler:(GGLInstanceIDTokenHandler)handler; - -/** - * Revokes access to a scope (action) for an entity previously - * authorized by `[GGLInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. - * - * This is an asynchronous call. Call this on the main thread since InstanceID lib - * is not thread safe. In case token deletion fails for some reason we invoke the - * `handler` callback passed in with the appropriate error code. - * - * Note, you can only have one `token` or `deleteToken` call for a given - * authorizedEntity and scope at a point of time. Making another such call with the - * same authorizedEntity and scope before the last one finishes will result in an error - * with code `OperationInProgress`. - * - * @param authorizedEntity Entity that must no longer have access. - * @param scope Action that entity is no longer authorized to perform. - * @param handler The handler that is invoked once the unsubscribe call ends. - * In case of error an appropriate error object is returned - * else error is nil. - */ -- (void)deleteTokenWithAuthorizedEntity:(NSString *)authorizedEntity - scope:(NSString *)scope - handler:(GGLInstanceIDDeleteTokenHandler)handler; - -#pragma mark - Identity - -/** - * Asynchronously fetch a stable identifier that uniquely identifies the app - * instance. If the identifier has been revoked or has expired, this method will - * return a new identifier. - * - * - * @param handler The handler to invoke once the identifier has been fetched. - * In case of error an appropriate error object is returned else - * a valid identifier is returned and a valid identifier for the - * application instance. - */ -- (void)getIDWithHandler:(GGLInstanceIDHandler)handler; - -/** - * Resets Instance ID and revokes all tokens. - */ -- (void)deleteIDWithHandler:(GGLInstanceIDDeleteHandler)handler; - -@end diff --git a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDConfig.h b/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDConfig.h deleted file mode 100644 index da885569..00000000 --- a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDConfig.h +++ /dev/null @@ -1,32 +0,0 @@ -@protocol GGLInstanceIDDelegate; - -typedef NS_ENUM(int8_t, GGLInstanceIDLogLevel) { - kGGLInstanceIDLogLevelDebug, - kGGLInstanceIDLogLevelInfo, - kGGLInstanceIDLogLevelError, - kGGLInstanceIDLogLevelAssert, -}; - -/** - * The config used to configure different options in GGLInstanceID library. - */ -@interface GGLInstanceIDConfig : NSObject <NSCopying, NSMutableCopying> - -/** - * Set the GGLInstanceIDDelegate to receive callbacks. - * - * @see GGLInstanceIDDelegate - */ -@property(nonatomic, readwrite, weak) id<GGLInstanceIDDelegate> delegate; - -// the log level for the GGLInstanceID library. -@property(nonatomic, readwrite, assign) GGLInstanceIDLogLevel logLevel; - -/** - * Initialize a default config with logLevel set to `kGGLInstanceIDLogLevelError`. - * - * @return A default config for GGLInstanceID. - */ -+ (instancetype)defaultConfig; - -@end diff --git a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDDelegate.h b/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDDelegate.h deleted file mode 100644 index dc706a2d..00000000 --- a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDDelegate.h +++ /dev/null @@ -1,13 +0,0 @@ -@protocol GGLInstanceIDDelegate <NSObject> - -/** - * Called when the system determines that tokens need to be refreshed. - * This method is also called if Instance ID has been reset in which - * case, tokens and `GcmPubSub` subscriptions also need to be refreshed. - * - * Instance ID service will throttle the refresh event across all devices - * to control the rate of token updates on application servers. - */ -- (void)onTokenRefresh; - -@end diff --git a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDHeaders.h b/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDHeaders.h deleted file mode 100644 index 2aa4eddd..00000000 --- a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Headers/Public/GGLInstanceIDHeaders.h +++ /dev/null @@ -1,4 +0,0 @@ -#import "GGLInstanceID.h" -#import "GGLInstanceIDConfig.h" -#import "GGLInstanceIDDelegate.h" - diff --git a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Libraries/libGGLInstanceIDLib.a b/StoneIsland/platforms/ios/Pods/GGLInstanceID/Libraries/libGGLInstanceIDLib.a Binary files differdeleted file mode 100755 index d5e6b3a4..00000000 --- a/StoneIsland/platforms/ios/Pods/GGLInstanceID/Libraries/libGGLInstanceIDLib.a +++ /dev/null diff --git a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/CHANGELOG.md b/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/CHANGELOG.md deleted file mode 100644 index 9f24a7a5..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/CHANGELOG.md +++ /dev/null @@ -1,32 +0,0 @@ -# 2016-01-25 -- v1.2.0 - -Add Bitcode markers. - -# 2016-01-25 -- v1.1.3 - -- Bug fixes. - -# 2015-12-08 -- v1.1.2 - -- Bug fixes. -- Fix dSYM warnings. - -# 2015-10-21 -- v1.1.1 - -- Adds analytics support. -- Bug fixes. - -# 2015-10-8 -- v1.1.0 - -- `[GCMService appDidReceiveMessage:]` now returns `BOOL` to signify if the - message has already been received before. -- Fixes deleting old GCM registrations and topic subscriptions on app deletion - and reinstall. -- Removes usage of clang modules for ObjC++ support. -- `GCMReceiverDelegate` protocol methods are now **optional**. -- Add `useNewRemoteNotificationCallback` property in `GCMConfig` to use new - iOS8+ notification callback i.e. - `application:didReceiveRemoteNotification:fetchCompletionHandler:`. -- Add better error reporting. -- Fix some compiler warnings. -- Bug fixes. diff --git a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMConfig.h b/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMConfig.h deleted file mode 100644 index 4e65fb87..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMConfig.h +++ /dev/null @@ -1,49 +0,0 @@ -@protocol GCMReceiverDelegate; - -typedef NS_ENUM(int8_t, GCMLogLevel) { - kGCMLogLevelDebug, - kGCMLogLevelInfo, - kGCMLogLevelError, - kGCMLogLevelAssert, -}; - -/** - * Config used to set different options in Google Cloud Messaging. - */ -@interface GCMConfig : NSObject - -/** - * Set the `GCMReceiverDelegate` to receive callbacks on upstream messages. - * - * @see GCMReceiverDelegate - */ -@property(nonatomic, readwrite, weak) id<GCMReceiverDelegate> receiverDelegate; - -/** - * The log level for the GCM library. Valid values are `kGCMLogLevelDebug`, - * `kGCMLogLevelInfo`, `kGCMLogLevelError`, and `kGCMLogLevelAssert`. - */ -@property(nonatomic, readwrite, assign) GCMLogLevel logLevel; - -/** - * Specify which remote notification callback to invoke when a GCM message is - * received. - * - * If set to "YES" GCM uses the new remote notification callback i.e. - * application:didReceiveRemoteNotification:fetchCompletionHandler:. - * If set to "NO" GCM invokes application:didReceiveRemoteNotification: callback. - * - * Defaults to "NO". - */ -@property(nonatomic, readwrite, assign) BOOL useNewRemoteNotificationCallback; - -/** - * Get default configuration for GCM. The default config has logLevel set to - * `kGCMLogLevelError` and `receiverDelegate` is set to nil. - * - * @return GCMConfig sharedInstance. - */ -+ (instancetype)defaultConfig; - -@end - diff --git a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMPubSub.h b/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMPubSub.h deleted file mode 100644 index 37e0a6b3..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMPubSub.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @related GCMPubSub - * - * The completion handler invoked when the GCM subscribe/unsubscribe returns. - * If the call fails we return the approprirate `error code` as documented in - * `GCMService`. - * - * @param error The error describing subscribe failure else nil. - */ -typedef void(^GCMPubSubCompletion)(NSError *error); - -/** - * GcmPubSub provides a publish-subscribe model for sending GCM topic messages. - * - * An app can subscribe to different topics defined by the - * developer. The app server can then send messages to the subscribed devices - * without having to maintain topic-subscribers mapping. Topics do not - * need to be explicitly created before subscribing or publishing—they - * are automatically created when publishing or subscribing. - * - * Messages published to the topic will be received as regular GCM messages - * with `"from"` set to `"/topics/myTopic"`. - * - * Only topic names that match the pattern `"/topics/[a-zA-Z0-9-_.~%]{1,900}"` - * are allowed for subscribing and publishing. - */ -@interface GCMPubSub : NSObject - -/** - * Returns an instance of GCMPubSub. Note you need to call - * `GCMService startWithConfig` to start using GCM. - * - * @return A shared instance of GCMPubSub. - */ -+ (instancetype)sharedInstance; - -/** - * Subscribes an app instance to a topic, enabling it to receive messages - * sent to that topic. - * - * This is an asynchronous call. If subscription fails, GCM - * invokes the completion callback with the appropriate error. - * - * Call this function from the main thread. GCM is not thread safe. - * - * @see GCMPubSub unsubscribeWithToken:topic:handler: - * - * @param token The registration token as received from the InstanceID - * library for a given `authorizedEntity` and "gcm" scope. - * @param topic The topic to subscribe to. Should be of the form - * `"/topics/<topic-name>"`. - * @param handler The callback handler invoked when the subscribe call - * ends. In case of success, a nil error is returned. Otherwise, - * an appropriate error object is returned. - */ -- (void)subscribeWithToken:(NSString *)token - topic:(NSString *)topic - options:(NSDictionary *)options - handler:(GCMPubSubCompletion)handler; - - -/** - * Unsubscribes an app instance from a topic, stopping it from receiving - * any further messages sent to that topic. - * - * This is an asynchronous call. If the attempt to unsubscribe fails, - * we invoke the `completion` callback passed in with an appropriate error. - * - * Call this function from the main thread. - * - * @param token The token used to subscribe to this topic. - * @param topic The topic to unsubscribe from. - * @param handler The handler that is invoked once the unsubscribe call ends. - * In case of success, nil error is returned. Otherwise, an - * appropriate error object is returned. - */ -- (void)unsubscribeWithToken:(NSString *)token - topic:(NSString *)topic - options:(NSDictionary *)options - handler:(GCMPubSubCompletion)handler; - -@end diff --git a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMReceiverDelegate.h b/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMReceiverDelegate.h deleted file mode 100644 index 45433aed..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMReceiverDelegate.h +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Delegate for receiving status of upstream messages sent via Google Cloud Messaging. - */ -@protocol GCMReceiverDelegate <NSObject> - -@optional -/** - * The callback is invoked once GCM processes the message. If processing fails, the - * callback is invoked with a valid error object representing the error. - * Otherwise, the message is ready to be sent. - * - * @param messageID The messageID for the message that failed to be sent upstream. - * @param error The error describing why the send operation failed. - */ -- (void)willSendDataMessageWithID:(NSString *)messageID error:(NSError *)error; - -/** - * This callback is invoked if GCM successfully sent the message upstream - * and the message was successfully received. - * - * @param messageID The messageID for the message sent. - */ -- (void)didSendDataMessageWithID:(NSString *)messageID; - -/** - * Called when the GCM server deletes pending messages due to exceeded - * storage limits. This may occur, for example, when the device cannot be - * reached for an extended period of time. - * - * It is recommended to retrieve any missing messages directly from the - * app server. - */ -- (void)didDeleteMessagesOnServer; - -@end diff --git a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMService.h b/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMService.h deleted file mode 100644 index d903e5a3..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GCMService.h +++ /dev/null @@ -1,243 +0,0 @@ -@class GCMConfig; - -/** - * The completion handler invoked once the data connection with GCM is - * established. The data connection is used to send a continous stream of - * data and all the GCM data notifications arrive through this connection. - * Once the connection is established we invoke the callback with `nil` error. - * Correspondingly if we get an error while trying to establish a connection - * we invoke the handler with an appropriate error object and do an - * exponential backoff to try and connect again unless successful. - - * - * @param error The error object if any describing why the data connection - * to GCM failed. - */ -typedef void(^GCMServiceConnectCompletion)(NSError *error); - - -/** - * @enum GCMServiceErrorCode - * Description of error codes - */ -typedef NS_ENUM(NSUInteger, GCMServiceErrorCode) { - /** - * HTTP errors. - */ - - // InvalidRequest -- Some parameters of the request were invalid. - kGCMServiceErrorCodeInvalidRequest = 0, - - // Auth Error -- GCM couldn't validate request from this client. - kGCMServiceErrorCodeAuthentication = 1, - - // NoAccess -- InstanceID service cannot be accessed. - kGCMServiceErrorCodeNoAccess = 2, - - // Timeout -- Request to InstanceID backend timed out. - kGCMServiceErrorCodeTimeout = 3, - - // Network -- No network available to reach the servers. - kGCMServiceErrorCodeNetwork = 4, - - // OperationInProgress -- Another similar operation in progress, - // bailing this one. - kGCMServiceErrorCodeOperationInProgress = 5, - - // Unknown error. - kGCMServiceErrorCodeUnknown = 7, - - /** - * Generic errors. - */ - - // Device seems to be missing a valid deviceID. Cannot authenticate - // device requests. - kGCMServiceErrorMissingDeviceID = 501, - - /** - * Upstream Send errors - */ - - // Upstream send not available (e.g. network issues) - kGCMServiceErrorCodeUpstreamServiceNotAvailable = 1001, - - // Invalid send parameters. - kGCMServiceErrorCodeInvalidParameters = 1002, - - // Invalid missing to. - kGCMServiceErrorCodeMissingTo = 1003, - - // GCM could not cache the message for sending. - kGCMServiceErrorSave = 1004, - - // Message size exceeded (size > 4KB). - kGCMServiceErrorSizeExceeded = 1005, - - /** - * GCM Connect errors. - */ - - // GCM already connected with the client. - kGCMServiceErrorCodeAlreadyConnected = 2001, - - /** - * PubSub errors. - */ - - // Topic already subscribed to. - kGCMServiceErrorCodePubSubAlreadySubscribed = 3001, - - // Topic already unsubscribed from. - kGCMServiceErrorCodePubSubAlreadyUnsubscribed = 3002, - - // Invalid topic name, does not match the topic regex "/topics/[a-zA-Z0-9-_.~%]+" - kGCMServiceErrorCodePubSubInvalidTopic = 3003, -}; - -/** - * GoogleCloudMessaging (GCM) enables apps to communicate with their app servers - * using simple messages. - * - * To send or receive messages, the app must get a - * registration token from GGLInstanceID, which authorizes an - * app server to send messages to an app instance. Pass your sender ID and - * `kGGLInstanceIDScopeGCM` as parameters to the method. - * - * A sender ID is a project number created when you configure your API project. - * It is labeled "Project Number" in the Google Developers Console. - * - * In order to receive GCM messages, declare application:didReceiveRemoteNotification: - * - * Client apps can send upstream messages back to the app server using the XMPP-based - * <a href="http://developers.google.com/cloud-messaging/ccs.html">Cloud Connection Server</a>, - * - */ -@interface GCMService : NSObject - -/** - * GCMService - * - * @return A shared instance of GCMService. - */ -+ (instancetype)sharedInstance; - -/** - * Start the `GCMService` with config. This starts the `GCMService` and - * allocates the required resources. - * - * @see GCMConfig - * - * @param config The `GCMConfig` used to build the service. - */ -- (void)startWithConfig:(GCMConfig *)config; - -/** - * Teardown the GCM connection and free all the resources owned by GCM. - * - * Call this when you don't need the GCM connection or to cancel all - * subscribe/unsubscribe requests. If GCM connection is alive before - * calling this, it would implicitly disconnect the connection. - * - * Calling `disconect` before invoking this method is useful but not required. - * Once you call this you won't be able to use `GCMService` for this session - * of your app. Therefore call this only when the app is going to exit. - * In case of background you should rather use `disconnect` and then - * if the app comes to the foreground again you can call `connect` again to - * establish a new connection. - */ -- (void)teardown; - -#pragma mark - Messages - -/** - * Call this to let GCM know that the app received a downstream message. Used - * to detect duplicate messages and to track message delivery for messages - * with different routes. - * - * @param message The downstream message received by the app. - * - * @return For APNs messages this always returns FALSE. For other messages, - * this returns FALSE for new, non-duplicated messages. - */ -- (BOOL)appDidReceiveMessage:(NSDictionary *)message; - - #pragma mark - Connect - -/** - * Create a GCM data connection which will be used to send the data notifications - * send by your server. It will also be used to send ACKS and other messages based - * on the GCM ACKS and other messages based on the GCM protocol. - * - * Use the `disconnect` method to disconnect the connection. - * - * @see GCMService disconnect - * - * @param handler The handler to be invoked once the connection is established. - * If the connection fails we invoke the handler with an - * appropriate error code letting you know why it failed. At - * the same time, GCM performs exponential backoff to retry - * establishing a connection and invoke the handler when successful. - */ -- (void)connectWithHandler:(GCMServiceConnectCompletion)handler; - -/** - * Disconnect the current GCM data connection. This stops any attempts to - * connect to GCM. Calling this on an already disconnected client is a no-op. - * - * Call this before `teardown` when your app is going to the background. - * Since the GCM connection won't be allowed to live when in background it is - * prudent to close the connection. - * - * @see GCMService teardown - */ -- (void)disconnect; - -#pragma mark - Send - -/** - * Send an upstream ("device to cloud") message. - * - * The message will be queued if we don't have an active connection for the max - * interval. - * - * @param message Key/Value pairs to be sent. Values must be String, any other - * type will be ignored. - * @param to String identifying the receiver of the message. For GCM - * project IDs the value is `SENDER_ID@gcm.googleapis.com`. - * @param msgId A unique ID of the message. This is generated by the - * application. It must be unique for each message. This allows - * error callbacks and debugging. - */ -- (void)sendMessage:(NSDictionary *)message - to:(NSString *)to - withId:(NSString *)msgId; - -/** - * Send an upstream ("device to cloud") message. - * - * The message will be queued if we don't have an active connection for the max - * interval. You can only use the upstream feature if your GCM implementation - * uses the XMPP-based Cloud Connection Server. - * - * @param message Key/Value pairs to be sent. Values must be String, any - * other type will be ignored. - * @param to A string identifying the receiver of the message. For GCM - * project IDs the value is `SENDER_ID@gcm.googleapis.com`. - * @param ttl The Time to live for the message. In case we aren't able to - * send the message before the ttl expires we will send you a - * callback. If 0, we'll attempt to send immediately and return - * an error if we're not connected. Otherwise, the message will - * be queued.As for server-side messages, we don't return an error - * if the message has been dropped because of TTL; this can happen - * on the server side, and it would require extra communication. - * @param msgId The ID of the message. This is generated by the application. It - * must be unique for each message. It allows error callbacks and - * debugging, to uniquely identify each message. - */ -- (void)sendMessage:(NSDictionary *)message - to:(NSString *)to - timeToLive:(int64_t)ttl - withId:(NSString *)msgId; - -@end diff --git a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GoogleCloudMessaging.h b/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GoogleCloudMessaging.h deleted file mode 100644 index aab64fbe..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Headers/Public/GoogleCloudMessaging.h +++ /dev/null @@ -1,5 +0,0 @@ -#import "GCMConfig.h" -#import "GCMPubSub.h" -#import "GCMReceiverDelegate.h" -#import "GCMService.h" - diff --git a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Libraries/libGcmLib.a b/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Libraries/libGcmLib.a Binary files differdeleted file mode 100755 index a9356d23..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/Libraries/libGcmLib.a +++ /dev/null diff --git a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/README.md b/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/README.md deleted file mode 100644 index 2c900de2..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleCloudMessaging/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Google Cloud Messaging SDK for iOS - -Google Cloud Messaging (GCM) is a free service that enables developers to send -messages between servers and client apps. This includes downstream messages -from servers to client apps, and upstream messages from client apps to servers. - - -Please visit [our developer -site](https://developers.google.com/cloud-messaging/ios/start) for integration -instructions, documentation, support information, and terms of service. diff --git a/StoneIsland/platforms/ios/Pods/GoogleIPhoneUtilities/Frameworks/GoogleIPhoneUtilities.framework/GoogleIPhoneUtilities b/StoneIsland/platforms/ios/Pods/GoogleIPhoneUtilities/Frameworks/GoogleIPhoneUtilities.framework/GoogleIPhoneUtilities Binary files differdeleted file mode 100644 index 7ab2cf26..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleIPhoneUtilities/Frameworks/GoogleIPhoneUtilities.framework/GoogleIPhoneUtilities +++ /dev/null diff --git a/StoneIsland/platforms/ios/Pods/GoogleInterchangeUtilities/Frameworks/frameworks/GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities b/StoneIsland/platforms/ios/Pods/GoogleInterchangeUtilities/Frameworks/frameworks/GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities Binary files differdeleted file mode 100755 index de404247..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleInterchangeUtilities/Frameworks/frameworks/GoogleInterchangeUtilities.framework/GoogleInterchangeUtilities +++ /dev/null diff --git a/StoneIsland/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities b/StoneIsland/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities Binary files differdeleted file mode 100755 index 408a0026..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleSymbolUtilities/Frameworks/frameworks/GoogleSymbolUtilities.framework/GoogleSymbolUtilities +++ /dev/null diff --git a/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMLogger.h b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMLogger.h new file mode 100644 index 00000000..16f0eafb --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMLogger.h @@ -0,0 +1,508 @@ +// +// GTMLogger.h +// +// Copyright 2007-2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +// Key Abstractions +// ---------------- +// +// This file declares multiple classes and protocols that are used by the +// GTMLogger logging system. The 4 main abstractions used in this file are the +// following: +// +// * logger (GTMLogger) - The main logging class that users interact with. It +// has methods for logging at different levels and uses a log writer, a log +// formatter, and a log filter to get the job done. +// +// * log writer (GTMLogWriter) - Writes a given string to some log file, where +// a "log file" can be a physical file on disk, a POST over HTTP to some URL, +// or even some in-memory structure (e.g., a ring buffer). +// +// * log formatter (GTMLogFormatter) - Given a format string and arguments as +// a va_list, returns a single formatted NSString. A "formatted string" could +// be a string with the date prepended, a string with values in a CSV format, +// or even a string of XML. +// +// * log filter (GTMLogFilter) - Given a formatted log message as an NSString +// and the level at which the message is to be logged, this class will decide +// whether the given message should be logged or not. This is a flexible way +// to filter out messages logged at a certain level, messages that contain +// certain text, or filter nothing out at all. This gives the caller the +// flexibility to dynamically enable debug logging in Release builds. +// +// This file also declares some classes to handle the common log writer, log +// formatter, and log filter cases. Callers can also create their own writers, +// formatters, and filters and they can even build them on top of the ones +// declared here. Keep in mind that your custom writer/formatter/filter may be +// called from multiple threads, so it must be thread-safe. + +#import <Foundation/Foundation.h> +#import "GTMDefines.h" + +// Predeclaration of used protocols that are declared later in this file. +@protocol GTMLogWriter, GTMLogFormatter, GTMLogFilter; + +// GTMLogger +// +// GTMLogger is the primary user-facing class for an object-oriented logging +// system. It is built on the concept of log formatters (GTMLogFormatter), log +// writers (GTMLogWriter), and log filters (GTMLogFilter). When a message is +// sent to a GTMLogger to log a message, the message is formatted using the log +// formatter, then the log filter is consulted to see if the message should be +// logged, and if so, the message is sent to the log writer to be written out. +// +// GTMLogger is intended to be a flexible and thread-safe logging solution. Its +// flexibility comes from the fact that GTMLogger instances can be customized +// with user defined formatters, filters, and writers. And these writers, +// filters, and formatters can be combined, stacked, and customized in arbitrary +// ways to suit the needs at hand. For example, multiple writers can be used at +// the same time, and a GTMLogger instance can even be used as another +// GTMLogger's writer. This allows for arbitrarily deep logging trees. +// +// A standard GTMLogger uses a writer that sends messages to standard out, a +// formatter that smacks a timestamp and a few other bits of interesting +// information on the message, and a filter that filters out debug messages from +// release builds. Using the standard log settings, a log message will look like +// the following: +// +// 2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] foo=<Foo: 0x123> +// +// The output contains the date and time of the log message, the name of the +// process followed by its process ID/thread ID, the log level at which the +// message was logged (in the previous example the level was 1: +// kGTMLoggerLevelDebug), and finally, the user-specified log message itself (in +// this case, the log message was @"foo=%@", foo). +// +// Multiple instances of GTMLogger can be created, each configured their own +// way. Though GTMLogger is not a singleton (in the GoF sense), it does provide +// access to a shared (i.e., globally accessible) GTMLogger instance. This makes +// it convenient for all code in a process to use the same GTMLogger instance. +// The shared GTMLogger instance can also be configured in an arbitrary, and +// these configuration changes will affect all code that logs through the shared +// instance. + +// +// Log Levels +// ---------- +// GTMLogger has 3 different log levels: Debug, Info, and Error. GTMLogger +// doesn't take any special action based on the log level; it simply forwards +// this information on to formatters, filters, and writers, each of which may +// optionally take action based on the level. Since log level filtering is +// performed at runtime, log messages are typically not filtered out at compile +// time. The exception to this rule is that calls to the GTMLoggerDebug() macro +// *ARE* filtered out of non-DEBUG builds. This is to be backwards compatible +// with behavior that many developers are currently used to. Note that this +// means that GTMLoggerDebug(@"hi") will be compiled out of Release builds, but +// [[GTMLogger sharedLogger] logDebug:@"hi"] will NOT be compiled out. +// +// Standard loggers are created with the GTMLogLevelFilter log filter, which +// filters out certain log messages based on log level, and some other settings. +// +// In addition to the -logDebug:, -logInfo:, and -logError: methods defined on +// GTMLogger itself, there are also C macros that make usage of the shared +// GTMLogger instance very convenient. These macros are: +// +// GTMLoggerDebug(...) +// GTMLoggerInfo(...) +// GTMLoggerError(...) +// +// Again, a notable feature of these macros is that GTMLogDebug() calls *will be +// compiled out of non-DEBUG builds*. +// +// Standard Loggers +// ---------------- +// GTMLogger has the concept of "standard loggers". A standard logger is simply +// a logger that is pre-configured with some standard/common writer, formatter, +// and filter combination. Standard loggers are created using the creation +// methods beginning with "standard". The alternative to a standard logger is a +// regular logger, which will send messages to stdout, with no special +// formatting, and no filtering. +// +// How do I use GTMLogger? +// ---------------------- +// The typical way you will want to use GTMLogger is to simply use the +// GTMLogger*() macros for logging from code. That way we can easily make +// changes to the GTMLogger class and simply update the macros accordingly. Only +// your application startup code (perhaps, somewhere in main()) should use the +// GTMLogger class directly in order to configure the shared logger, which all +// of the code using the macros will be using. Again, this is just the typical +// situation. +// +// To be complete, there are cases where you may want to use GTMLogger directly, +// or even create separate GTMLogger instances for some reason. That's fine, +// too. +// +// Examples +// -------- +// The following show some common GTMLogger use cases. +// +// 1. You want to log something as simply as possible. Also, this call will only +// appear in debug builds. In non-DEBUG builds it will be completely removed. +// +// GTMLoggerDebug(@"foo = %@", foo); +// +// 2. The previous example is similar to the following. The major difference is +// that the previous call (example 1) will be compiled out of Release builds +// but this statement will not be compiled out. +// +// [[GTMLogger sharedLogger] logDebug:@"foo = %@", foo]; +// +// 3. Send all logging output from the shared logger to a file. We do this by +// creating an NSFileHandle for writing associated with a file, and setting +// that file handle as the logger's writer. +// +// NSFileHandle *f = [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log" +// create:YES]; +// [[GTMLogger sharedLogger] setWriter:f]; +// GTMLoggerError(@"hi"); // This will be sent to /tmp/f.log +// +// 4. Create a new GTMLogger that will log to a file. This example differs from +// the previous one because here we create a new GTMLogger that is different +// from the shared logger. +// +// GTMLogger *logger = [GTMLogger standardLoggerWithPath:@"/tmp/temp.log"]; +// [logger logInfo:@"hi temp log file"]; +// +// 5. Create a logger that writes to stdout and does NOT do any formatting to +// the log message. This might be useful, for example, when writing a help +// screen for a command-line tool to standard output. +// +// GTMLogger *logger = [GTMLogger logger]; +// [logger logInfo:@"%@ version 0.1 usage", progName]; +// +// 6. Send log output to stdout AND to a log file. The trick here is that +// NSArrays function as composite log writers, which means when an array is +// set as the log writer, it forwards all logging messages to all of its +// contained GTMLogWriters. +// +// // Create array of GTMLogWriters +// NSArray *writers = [NSArray arrayWithObjects: +// [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log" create:YES], +// [NSFileHandle fileHandleWithStandardOutput], nil]; +// +// GTMLogger *logger = [GTMLogger standardLogger]; +// [logger setWriter:writers]; +// [logger logInfo:@"hi"]; // Output goes to stdout and /tmp/f.log +// +// For futher details on log writers, formatters, and filters, see the +// documentation below. +// +// NOTE: GTMLogger is application level logging. By default it does nothing +// with _GTMDevLog/_GTMDevAssert (see GTMDefines.h). An application can choose +// to bridge _GTMDevLog/_GTMDevAssert to GTMLogger by providing macro +// definitions in its prefix header (see GTMDefines.h for how one would do +// that). +// +@interface GTMLogger : NSObject { + @private + id<GTMLogWriter> writer_; + id<GTMLogFormatter> formatter_; + id<GTMLogFilter> filter_; +} + +// +// Accessors for the shared logger instance +// + +// Returns a shared/global standard GTMLogger instance. Callers should typically +// use this method to get a GTMLogger instance, unless they explicitly want +// their own instance to configure for their own needs. This is the only method +// that returns a shared instance; all the rest return new GTMLogger instances. ++ (id)sharedLogger; + +// Sets the shared logger instance to |logger|. Future calls to +sharedLogger +// will return |logger| instead. ++ (void)setSharedLogger:(GTMLogger *)logger; + +// +// Creation methods +// + +// Returns a new autoreleased GTMLogger instance that will log to stdout, using +// the GTMLogStandardFormatter, and the GTMLogLevelFilter filter. ++ (id)standardLogger; + +// Same as +standardLogger, but logs to stderr. ++ (id)standardLoggerWithStderr; + +// Same as +standardLogger but levels >= kGTMLoggerLevelError are routed to +// stderr, everything else goes to stdout. ++ (id)standardLoggerWithStdoutAndStderr; + +// Returns a new standard GTMLogger instance with a log writer that will +// write to the file at |path|, and will use the GTMLogStandardFormatter and +// GTMLogLevelFilter classes. If |path| does not exist, it will be created. ++ (id)standardLoggerWithPath:(NSString *)path; + +// Returns an autoreleased GTMLogger instance that will use the specified +// |writer|, |formatter|, and |filter|. ++ (id)loggerWithWriter:(id<GTMLogWriter>)writer + formatter:(id<GTMLogFormatter>)formatter + filter:(id<GTMLogFilter>)filter; + +// Returns an autoreleased GTMLogger instance that logs to stdout, with the +// basic formatter, and no filter. The returned logger differs from the logger +// returned by +standardLogger because this one does not do any filtering and +// does not do any special log formatting; this is the difference between a +// "regular" logger and a "standard" logger. ++ (id)logger; + +// Designated initializer. This method returns a GTMLogger initialized with the +// specified |writer|, |formatter|, and |filter|. See the setter methods below +// for what values will be used if nil is passed for a parameter. +- (id)initWithWriter:(id<GTMLogWriter>)writer + formatter:(id<GTMLogFormatter>)formatter + filter:(id<GTMLogFilter>)filter; + +// +// Logging methods +// + +// Logs a message at the debug level (kGTMLoggerLevelDebug). +- (void)logDebug:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); +// Logs a message at the info level (kGTMLoggerLevelInfo). +- (void)logInfo:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); +// Logs a message at the error level (kGTMLoggerLevelError). +- (void)logError:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); +// Logs a message at the assert level (kGTMLoggerLevelAssert). +- (void)logAssert:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2); + + +// +// Accessors +// + +// Accessor methods for the log writer. If the log writer is set to nil, +// [NSFileHandle fileHandleWithStandardOutput] is used. +- (id<GTMLogWriter>)writer; +- (void)setWriter:(id<GTMLogWriter>)writer; + +// Accessor methods for the log formatter. If the log formatter is set to nil, +// GTMLogBasicFormatter is used. This formatter will format log messages in a +// plain printf style. +- (id<GTMLogFormatter>)formatter; +- (void)setFormatter:(id<GTMLogFormatter>)formatter; + +// Accessor methods for the log filter. If the log filter is set to nil, +// GTMLogNoFilter is used, which allows all log messages through. +- (id<GTMLogFilter>)filter; +- (void)setFilter:(id<GTMLogFilter>)filter; + +@end // GTMLogger + + +// Helper functions that are used by the convenience GTMLogger*() macros that +// enable the logging of function names. +@interface GTMLogger (GTMLoggerMacroHelpers) +- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ... + NS_FORMAT_FUNCTION(2, 3); +- (void)logFuncInfo:(const char *)func msg:(NSString *)fmt, ... + NS_FORMAT_FUNCTION(2, 3); +- (void)logFuncError:(const char *)func msg:(NSString *)fmt, ... + NS_FORMAT_FUNCTION(2, 3); +- (void)logFuncAssert:(const char *)func msg:(NSString *)fmt, ... + NS_FORMAT_FUNCTION(2, 3); +@end // GTMLoggerMacroHelpers + + +// The convenience macros are only defined if they haven't already been defined. +#ifndef GTMLoggerInfo + +// Convenience macros that log to the shared GTMLogger instance. These macros +// are how users should typically log to GTMLogger. Notice that GTMLoggerDebug() +// calls will be compiled out of non-Debug builds. +#define GTMLoggerDebug(...) \ + [[GTMLogger sharedLogger] logFuncDebug:__func__ msg:__VA_ARGS__] +#define GTMLoggerInfo(...) \ + [[GTMLogger sharedLogger] logFuncInfo:__func__ msg:__VA_ARGS__] +#define GTMLoggerError(...) \ + [[GTMLogger sharedLogger] logFuncError:__func__ msg:__VA_ARGS__] +#define GTMLoggerAssert(...) \ + [[GTMLogger sharedLogger] logFuncAssert:__func__ msg:__VA_ARGS__] + +// If we're not in a debug build, remove the GTMLoggerDebug statements. This +// makes calls to GTMLoggerDebug "compile out" of Release builds +#ifndef DEBUG +#undef GTMLoggerDebug +#define GTMLoggerDebug(...) do {} while(0) +#endif + +#endif // !defined(GTMLoggerInfo) + +// Log levels. +typedef enum { + kGTMLoggerLevelUnknown, + kGTMLoggerLevelDebug, + kGTMLoggerLevelInfo, + kGTMLoggerLevelError, + kGTMLoggerLevelAssert, +} GTMLoggerLevel; + + +// +// Log Writers +// + +// Protocol to be implemented by a GTMLogWriter instance. +@protocol GTMLogWriter <NSObject> +// Writes the given log message to where the log writer is configured to write. +- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level; +@end // GTMLogWriter + + +// Simple category on NSFileHandle that makes NSFileHandles valid log writers. +// This is convenient because something like, say, +fileHandleWithStandardError +// now becomes a valid log writer. Log messages are written to the file handle +// with a newline appended. +@interface NSFileHandle (GTMFileHandleLogWriter) <GTMLogWriter> +// Opens the file at |path| in append mode, and creates the file with |mode| +// if it didn't previously exist. ++ (id)fileHandleForLoggingAtPath:(NSString *)path mode:(mode_t)mode; +@end // NSFileHandle + + +// This category makes NSArray a GTMLogWriter that can be composed of other +// GTMLogWriters. This is the classic Composite GoF design pattern. When the +// GTMLogWriter -logMessage:level: message is sent to the array, the array +// forwards the message to all of its elements that implement the GTMLogWriter +// protocol. +// +// This is useful in situations where you would like to send log output to +// multiple log writers at the same time. Simply create an NSArray of the log +// writers you wish to use, then set the array as the "writer" for your +// GTMLogger instance. +@interface NSArray (GTMArrayCompositeLogWriter) <GTMLogWriter> +@end // GTMArrayCompositeLogWriter + + +// This category adapts the GTMLogger interface so that it can be used as a log +// writer; it's an "adapter" in the GoF Adapter pattern sense. +// +// This is useful when you want to configure a logger to log to a specific +// writer with a specific formatter and/or filter. But you want to also compose +// that with a different log writer that may have its own formatter and/or +// filter. +@interface GTMLogger (GTMLoggerLogWriter) <GTMLogWriter> +@end // GTMLoggerLogWriter + + +// +// Log Formatters +// + +// Protocol to be implemented by a GTMLogFormatter instance. +@protocol GTMLogFormatter <NSObject> +// Returns a formatted string using the format specified in |fmt| and the va +// args specified in |args|. +- (NSString *)stringForFunc:(NSString *)func + withFormat:(NSString *)fmt + valist:(va_list)args + level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0); +@end // GTMLogFormatter + + +// A basic log formatter that formats a string the same way that NSLog (or +// printf) would. It does not do anything fancy, nor does it add any data of its +// own. +@interface GTMLogBasicFormatter : NSObject <GTMLogFormatter> + +// Helper method for prettying C99 __func__ and GCC __PRETTY_FUNCTION__ +- (NSString *)prettyNameForFunc:(NSString *)func; + +@end // GTMLogBasicFormatter + + +// A log formatter that formats the log string like the basic formatter, but +// also prepends a timestamp and some basic process info to the message, as +// shown in the following sample output. +// 2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] log mesage here +@interface GTMLogStandardFormatter : GTMLogBasicFormatter { + @private + NSDateFormatter *dateFormatter_; // yyyy-MM-dd HH:mm:ss.SSS + NSString *pname_; + pid_t pid_; +} +@end // GTMLogStandardFormatter + + +// +// Log Filters +// + +// Protocol to be implemented by a GTMLogFilter instance. +@protocol GTMLogFilter <NSObject> +// Returns YES if |msg| at |level| should be logged; NO otherwise. +- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level; +@end // GTMLogFilter + + +// A log filter that filters messages at the kGTMLoggerLevelDebug level out of +// non-debug builds. Messages at the kGTMLoggerLevelInfo level are also filtered +// out of non-debug builds unless GTMVerboseLogging is set in the environment or +// the processes's defaults. Messages at the kGTMLoggerLevelError level are +// never filtered. +@interface GTMLogLevelFilter : NSObject <GTMLogFilter> { + @private + BOOL verboseLoggingEnabled_; + NSUserDefaults *userDefaults_; +} +@end // GTMLogLevelFilter + +// A simple log filter that does NOT filter anything out; +// -filterAllowsMessage:level will always return YES. This can be a convenient +// way to enable debug-level logging in release builds (if you so desire). +@interface GTMLogNoFilter : NSObject <GTMLogFilter> +@end // GTMLogNoFilter + + +// Base class for custom level filters. Not for direct use, use the minimum +// or maximum level subclasses below. +@interface GTMLogAllowedLevelFilter : NSObject <GTMLogFilter> { + @private + NSIndexSet *allowedLevels_; +} +@end + +// A log filter that allows you to set a minimum log level. Messages below this +// level will be filtered. +@interface GTMLogMininumLevelFilter : GTMLogAllowedLevelFilter + +// Designated initializer, logs at levels < |level| will be filtered. +- (id)initWithMinimumLevel:(GTMLoggerLevel)level; + +@end + +// A log filter that allows you to set a maximum log level. Messages whose level +// exceeds this level will be filtered. This is really only useful if you have +// a composite GTMLogger that is sending the other messages elsewhere. +@interface GTMLogMaximumLevelFilter : GTMLogAllowedLevelFilter + +// Designated initializer, logs at levels > |level| will be filtered. +- (id)initWithMaximumLevel:(GTMLoggerLevel)level; + +@end + + +// For subclasses only +@interface GTMLogger (PrivateMethods) + +- (void)logInternalFunc:(const char *)func + format:(NSString *)fmt + valist:(va_list)args + level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0); + +@end + diff --git a/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMLogger.m b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMLogger.m new file mode 100644 index 00000000..e6b2ba12 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMLogger.m @@ -0,0 +1,648 @@ +// +// GTMLogger.m +// +// Copyright 2007-2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#import "GTMLogger.h" +#import <fcntl.h> +#import <unistd.h> +#import <stdlib.h> +#import <pthread.h> + + +#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) +// Some versions of GCC (4.2 and below AFAIK) aren't great about supporting +// -Wmissing-format-attribute +// when the function is anything more complex than foo(NSString *fmt, ...). +// You see the error inside the function when you turn ... into va_args and +// attempt to call another function (like vsprintf for example). +// So we just shut off the warning for this file. We reenable it at the end. +#pragma GCC diagnostic ignored "-Wmissing-format-attribute" +#endif // !__clang__ + +// Reference to the shared GTMLogger instance. This is not a singleton, it's +// just an easy reference to one shared instance. +static GTMLogger *gSharedLogger = nil; + + +@implementation GTMLogger + +// Returns a pointer to the shared logger instance. If none exists, a standard +// logger is created and returned. ++ (id)sharedLogger { + @synchronized(self) { + if (gSharedLogger == nil) { + gSharedLogger = [[self standardLogger] retain]; + } + } + return [[gSharedLogger retain] autorelease]; +} + ++ (void)setSharedLogger:(GTMLogger *)logger { + @synchronized(self) { + [gSharedLogger autorelease]; + gSharedLogger = [logger retain]; + } +} + ++ (id)standardLogger { + // Don't trust NSFileHandle not to throw + @try { + id<GTMLogWriter> writer = [NSFileHandle fileHandleWithStandardOutput]; + id<GTMLogFormatter> fr = [[[GTMLogStandardFormatter alloc] init] + autorelease]; + id<GTMLogFilter> filter = [[[GTMLogLevelFilter alloc] init] autorelease]; + return [[[self alloc] initWithWriter:writer + formatter:fr + filter:filter] autorelease]; + } + @catch (id e) { + // Ignored + } + return nil; +} + ++ (id)standardLoggerWithStderr { + // Don't trust NSFileHandle not to throw + @try { + id me = [self standardLogger]; + [me setWriter:[NSFileHandle fileHandleWithStandardError]]; + return me; + } + @catch (id e) { + // Ignored + } + return nil; +} + ++ (id)standardLoggerWithStdoutAndStderr { + // We're going to take advantage of the GTMLogger to GTMLogWriter adaptor + // and create a composite logger that an outer "standard" logger can use + // as a writer. Our inner loggers should apply no formatting since the main + // logger does that and we want the caller to be able to change formatters + // or add writers without knowing the inner structure of our composite. + + // Don't trust NSFileHandle not to throw + @try { + GTMLogBasicFormatter *formatter = [[[GTMLogBasicFormatter alloc] init] + autorelease]; + GTMLogger *stdoutLogger = + [self loggerWithWriter:[NSFileHandle fileHandleWithStandardOutput] + formatter:formatter + filter:[[[GTMLogMaximumLevelFilter alloc] + initWithMaximumLevel:kGTMLoggerLevelInfo] + autorelease]]; + GTMLogger *stderrLogger = + [self loggerWithWriter:[NSFileHandle fileHandleWithStandardError] + formatter:formatter + filter:[[[GTMLogMininumLevelFilter alloc] + initWithMinimumLevel:kGTMLoggerLevelError] + autorelease]]; + GTMLogger *compositeWriter = + [self loggerWithWriter:[NSArray arrayWithObjects: + stdoutLogger, stderrLogger, nil] + formatter:formatter + filter:[[[GTMLogNoFilter alloc] init] autorelease]]; + GTMLogger *outerLogger = [self standardLogger]; + [outerLogger setWriter:compositeWriter]; + return outerLogger; + } + @catch (id e) { + // Ignored + } + return nil; +} + ++ (id)standardLoggerWithPath:(NSString *)path { + @try { + NSFileHandle *fh = [NSFileHandle fileHandleForLoggingAtPath:path mode:0644]; + if (fh == nil) return nil; + id me = [self standardLogger]; + [me setWriter:fh]; + return me; + } + @catch (id e) { + // Ignored + } + return nil; +} + ++ (id)loggerWithWriter:(id<GTMLogWriter>)writer + formatter:(id<GTMLogFormatter>)formatter + filter:(id<GTMLogFilter>)filter { + return [[[self alloc] initWithWriter:writer + formatter:formatter + filter:filter] autorelease]; +} + ++ (id)logger { + return [[[self alloc] init] autorelease]; +} + +- (id)init { + return [self initWithWriter:nil formatter:nil filter:nil]; +} + +- (id)initWithWriter:(id<GTMLogWriter>)writer + formatter:(id<GTMLogFormatter>)formatter + filter:(id<GTMLogFilter>)filter { + if ((self = [super init])) { + [self setWriter:writer]; + [self setFormatter:formatter]; + [self setFilter:filter]; + } + return self; +} + +- (void)dealloc { + // Unlikely, but |writer_| may be an NSFileHandle, which can throw + @try { + [formatter_ release]; + [filter_ release]; + [writer_ release]; + } + @catch (id e) { + // Ignored + } + [super dealloc]; +} + +- (id<GTMLogWriter>)writer { + return [[writer_ retain] autorelease]; +} + +- (void)setWriter:(id<GTMLogWriter>)writer { + @synchronized(self) { + [writer_ autorelease]; + writer_ = nil; + if (writer == nil) { + // Try to use stdout, but don't trust NSFileHandle + @try { + writer_ = [[NSFileHandle fileHandleWithStandardOutput] retain]; + } + @catch (id e) { + // Leave |writer_| nil + } + } else { + writer_ = [writer retain]; + } + } +} + +- (id<GTMLogFormatter>)formatter { + return [[formatter_ retain] autorelease]; +} + +- (void)setFormatter:(id<GTMLogFormatter>)formatter { + @synchronized(self) { + [formatter_ autorelease]; + formatter_ = nil; + if (formatter == nil) { + @try { + formatter_ = [[GTMLogBasicFormatter alloc] init]; + } + @catch (id e) { + // Leave |formatter_| nil + } + } else { + formatter_ = [formatter retain]; + } + } +} + +- (id<GTMLogFilter>)filter { + return [[filter_ retain] autorelease]; +} + +- (void)setFilter:(id<GTMLogFilter>)filter { + @synchronized(self) { + [filter_ autorelease]; + filter_ = nil; + if (filter == nil) { + @try { + filter_ = [[GTMLogNoFilter alloc] init]; + } + @catch (id e) { + // Leave |filter_| nil + } + } else { + filter_ = [filter retain]; + } + } +} + +- (void)logDebug:(NSString *)fmt, ... { + va_list args; + va_start(args, fmt); + [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelDebug]; + va_end(args); +} + +- (void)logInfo:(NSString *)fmt, ... { + va_list args; + va_start(args, fmt); + [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelInfo]; + va_end(args); +} + +- (void)logError:(NSString *)fmt, ... { + va_list args; + va_start(args, fmt); + [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelError]; + va_end(args); +} + +- (void)logAssert:(NSString *)fmt, ... { + va_list args; + va_start(args, fmt); + [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelAssert]; + va_end(args); +} + +@end // GTMLogger + +@implementation GTMLogger (GTMLoggerMacroHelpers) + +- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ... { + va_list args; + va_start(args, fmt); + [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelDebug]; + va_end(args); +} + +- (void)logFuncInfo:(const char *)func msg:(NSString *)fmt, ... { + va_list args; + va_start(args, fmt); + [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelInfo]; + va_end(args); +} + +- (void)logFuncError:(const char *)func msg:(NSString *)fmt, ... { + va_list args; + va_start(args, fmt); + [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelError]; + va_end(args); +} + +- (void)logFuncAssert:(const char *)func msg:(NSString *)fmt, ... { + va_list args; + va_start(args, fmt); + [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelAssert]; + va_end(args); +} + +@end // GTMLoggerMacroHelpers + +@implementation GTMLogger (PrivateMethods) + +- (void)logInternalFunc:(const char *)func + format:(NSString *)fmt + valist:(va_list)args + level:(GTMLoggerLevel)level { + // Primary point where logging happens, logging should never throw, catch + // everything. + @try { + NSString *fname = func ? [NSString stringWithUTF8String:func] : nil; + NSString *msg = [formatter_ stringForFunc:fname + withFormat:fmt + valist:args + level:level]; + if (msg && [filter_ filterAllowsMessage:msg level:level]) + [writer_ logMessage:msg level:level]; + } + @catch (id e) { + // Ignored + } +} + +@end // PrivateMethods + + +@implementation NSFileHandle (GTMFileHandleLogWriter) + ++ (id)fileHandleForLoggingAtPath:(NSString *)path mode:(mode_t)mode { + int fd = -1; + if (path) { + int flags = O_WRONLY | O_APPEND | O_CREAT; + fd = open([path fileSystemRepresentation], flags, mode); + } + if (fd == -1) return nil; + return [[[self alloc] initWithFileDescriptor:fd + closeOnDealloc:YES] autorelease]; +} + +- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level { + @synchronized(self) { + // Closed pipes should not generate exceptions in our caller. Catch here + // as well [GTMLogger logInternalFunc:...] so that an exception in this + // writer does not prevent other writers from having a chance. + @try { + NSString *line = [NSString stringWithFormat:@"%@\n", msg]; + [self writeData:[line dataUsingEncoding:NSUTF8StringEncoding]]; + } + @catch (id e) { + // Ignored + } + } +} + +@end // GTMFileHandleLogWriter + + +@implementation NSArray (GTMArrayCompositeLogWriter) + +- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level { + @synchronized(self) { + id<GTMLogWriter> child = nil; + for (child in self) { + if ([child conformsToProtocol:@protocol(GTMLogWriter)]) + [child logMessage:msg level:level]; + } + } +} + +@end // GTMArrayCompositeLogWriter + + +@implementation GTMLogger (GTMLoggerLogWriter) + +- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level { + switch (level) { + case kGTMLoggerLevelDebug: + [self logDebug:@"%@", msg]; + break; + case kGTMLoggerLevelInfo: + [self logInfo:@"%@", msg]; + break; + case kGTMLoggerLevelError: + [self logError:@"%@", msg]; + break; + case kGTMLoggerLevelAssert: + [self logAssert:@"%@", msg]; + break; + default: + // Ignore the message. + break; + } +} + +@end // GTMLoggerLogWriter + + +@implementation GTMLogBasicFormatter + +- (NSString *)prettyNameForFunc:(NSString *)func { + NSString *name = [func stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + NSString *function = @"(unknown)"; + if ([name length]) { + if (// Objective C __func__ and __PRETTY_FUNCTION__ + [name hasPrefix:@"-["] || [name hasPrefix:@"+["] || + // C++ __PRETTY_FUNCTION__ and other preadorned formats + [name hasSuffix:@")"]) { + function = name; + } else { + // Assume C99 __func__ + function = [NSString stringWithFormat:@"%@()", name]; + } + } + return function; +} + +- (NSString *)stringForFunc:(NSString *)func + withFormat:(NSString *)fmt + valist:(va_list)args + level:(GTMLoggerLevel)level { + // Performance note: We may want to do a quick check here to see if |fmt| + // contains a '%', and if not, simply return 'fmt'. + if (!(fmt && args)) return nil; + return [[[NSString alloc] initWithFormat:fmt arguments:args] autorelease]; +} + +@end // GTMLogBasicFormatter + + +@implementation GTMLogStandardFormatter + +- (id)init { + if ((self = [super init])) { + dateFormatter_ = [[NSDateFormatter alloc] init]; + [dateFormatter_ setFormatterBehavior:NSDateFormatterBehavior10_4]; + [dateFormatter_ setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"]; + pname_ = [[[NSProcessInfo processInfo] processName] copy]; + pid_ = [[NSProcessInfo processInfo] processIdentifier]; + if (!(dateFormatter_ && pname_)) { + [self release]; + return nil; + } + } + return self; +} + +- (void)dealloc { + [dateFormatter_ release]; + [pname_ release]; + [super dealloc]; +} + +- (NSString *)stringForFunc:(NSString *)func + withFormat:(NSString *)fmt + valist:(va_list)args + level:(GTMLoggerLevel)level { + NSString *tstamp = nil; + @synchronized (dateFormatter_) { + tstamp = [dateFormatter_ stringFromDate:[NSDate date]]; + } + return [NSString stringWithFormat:@"%@ %@[%d/%p] [lvl=%d] %@ %@", + tstamp, pname_, pid_, pthread_self(), + level, [self prettyNameForFunc:func], + // |super| has guard for nil |fmt| and |args| + [super stringForFunc:func withFormat:fmt valist:args level:level]]; +} + +@end // GTMLogStandardFormatter + +static NSString *const kVerboseLoggingKey = @"GTMVerboseLogging"; + +// Check the environment and the user preferences for the GTMVerboseLogging key +// to see if verbose logging has been enabled. The environment variable will +// override the defaults setting, so check the environment first. +// COV_NF_START +static BOOL IsVerboseLoggingEnabled(NSUserDefaults *userDefaults) { + NSString *value = [[[NSProcessInfo processInfo] environment] + objectForKey:kVerboseLoggingKey]; + if (value) { + // Emulate [NSString boolValue] for pre-10.5 + value = [value stringByTrimmingCharactersInSet: + [NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if ([[value uppercaseString] hasPrefix:@"Y"] || + [[value uppercaseString] hasPrefix:@"T"] || + [value intValue]) { + return YES; + } else { + return NO; + } + } + return [userDefaults boolForKey:kVerboseLoggingKey]; +} +// COV_NF_END + +@implementation GTMLogLevelFilter + +- (id)init { + self = [super init]; + if (self) { + // Keep a reference to standardUserDefaults, avoiding a crash if client code calls + // "NSUserDefaults resetStandardUserDefaults" which releases it from memory. We are still + // notified of changes through our instance. Note: resetStandardUserDefaults does not actually + // clear settings: + // https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/index.html#//apple_ref/occ/clm/NSUserDefaults/resetStandardUserDefaults + // and so should only be called in test code if necessary. + userDefaults_ = [[NSUserDefaults standardUserDefaults] retain]; + [userDefaults_ addObserver:self + forKeyPath:kVerboseLoggingKey + options:NSKeyValueObservingOptionNew + context:nil]; + + verboseLoggingEnabled_ = IsVerboseLoggingEnabled(userDefaults_); + } + + return self; +} + +- (void)dealloc { + [userDefaults_ removeObserver:self forKeyPath:kVerboseLoggingKey]; + [userDefaults_ release]; + + [super dealloc]; +} + +// In DEBUG builds, log everything. If we're not in a debug build we'll assume +// that we're in a Release build. +- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level { +#if defined(DEBUG) && DEBUG + return YES; +#endif + + BOOL allow = YES; + + switch (level) { + case kGTMLoggerLevelDebug: + allow = NO; + break; + case kGTMLoggerLevelInfo: + allow = verboseLoggingEnabled_; + break; + case kGTMLoggerLevelError: + allow = YES; + break; + case kGTMLoggerLevelAssert: + allow = YES; + break; + default: + allow = YES; + break; + } + + return allow; +} + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(NSDictionary *)change + context:(void *)context +{ + if([keyPath isEqual:kVerboseLoggingKey]) { + verboseLoggingEnabled_ = IsVerboseLoggingEnabled(userDefaults_); + } +} + +@end // GTMLogLevelFilter + + +@implementation GTMLogNoFilter + +- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level { + return YES; // Allow everything through +} + +@end // GTMLogNoFilter + + +@implementation GTMLogAllowedLevelFilter + +// Private designated initializer +- (id)initWithAllowedLevels:(NSIndexSet *)levels { + self = [super init]; + if (self != nil) { + allowedLevels_ = [levels retain]; + // Cap min/max level + if (!allowedLevels_ || + // NSIndexSet is unsigned so only check the high bound, but need to + // check both first and last index because NSIndexSet appears to allow + // wraparound. + ([allowedLevels_ firstIndex] > kGTMLoggerLevelAssert) || + ([allowedLevels_ lastIndex] > kGTMLoggerLevelAssert)) { + [self release]; + return nil; + } + } + return self; +} + +- (id)init { + // Allow all levels in default init + return [self initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange: + NSMakeRange(kGTMLoggerLevelUnknown, + (kGTMLoggerLevelAssert - kGTMLoggerLevelUnknown + 1))]]; +} + +- (void)dealloc { + [allowedLevels_ release]; + [super dealloc]; +} + +- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level { + return [allowedLevels_ containsIndex:level]; +} + +@end // GTMLogAllowedLevelFilter + + +@implementation GTMLogMininumLevelFilter + +- (id)initWithMinimumLevel:(GTMLoggerLevel)level { + return [super initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange: + NSMakeRange(level, + (kGTMLoggerLevelAssert - level + 1))]]; +} + +@end // GTMLogMininumLevelFilter + + +@implementation GTMLogMaximumLevelFilter + +- (id)initWithMaximumLevel:(GTMLoggerLevel)level { + return [super initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange: + NSMakeRange(kGTMLoggerLevelUnknown, level + 1)]]; +} + +@end // GTMLogMaximumLevelFilter + +#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42) +// See comment at top of file. +#pragma GCC diagnostic error "-Wmissing-format-attribute" +#endif // !__clang__ diff --git a/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.h b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.h new file mode 100644 index 00000000..dceadc44 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.h @@ -0,0 +1,199 @@ +// +// GTMNSData+zlib.h +// +// Copyright 2007-2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#import <Foundation/Foundation.h> +#import "GTMDefines.h" + +/// Helpers for dealing w/ zlib inflate/deflate calls. +@interface NSData (GTMZLibAdditions) + +// NOTE: For 64bit, none of these apis handle input sizes >32bits, they will +// return nil when given such data. To handle data of that size you really +// should be streaming it rather then doing it all in memory. + +#pragma mark Gzip Compression + +/// Return an autoreleased NSData w/ the result of gzipping the bytes. +// +// Uses the default compression level. ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length; ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of gzipping the payload of |data|. +// +// Uses the default compression level. ++ (NSData *)gtm_dataByGzippingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of gzipping the bytes using |level| compression level. +// +// |level| can be 1-9, any other values will be clipped to that range. ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of gzipping the payload of |data| using |level| compression level. ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error; + +#pragma mark Zlib "Stream" Compression + +// NOTE: deflate is *NOT* gzip. deflate is a "zlib" stream. pick which one +// you really want to create. (the inflate api will handle either) + +/// Return an autoreleased NSData w/ the result of deflating the bytes. +// +// Uses the default compression level. ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of deflating the payload of |data|. +// +// Uses the default compression level. ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of deflating the bytes using |level| compression level. +// +// |level| can be 1-9, any other values will be clipped to that range. ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of deflating the payload of |data| using |level| compression level. ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error; + +#pragma mark Uncompress of Gzip or Zlib + +/// Return an autoreleased NSData w/ the result of decompressing the bytes. +// +// The bytes to decompress can be zlib or gzip payloads. ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of decompressing the payload of |data|. +// +// The data to decompress can be zlib or gzip payloads. ++ (NSData *)gtm_dataByInflatingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByInflatingData:(NSData *)data + error:(NSError **)error; + +#pragma mark "Raw" Compression Support + +// NOTE: raw deflate is *NOT* gzip or deflate. it does not include a header +// of any form and should only be used within streams here an external crc/etc. +// is done to validate the data. The RawInflate apis can be used on data +// processed like this. + +/// Return an autoreleased NSData w/ the result of *raw* deflating the bytes. +// +// Uses the default compression level. +// *No* header is added to the resulting data. ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* deflating the payload of |data|. +// +// Uses the default compression level. +// *No* header is added to the resulting data. ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* deflating the bytes using |level| compression level. +// +// |level| can be 1-9, any other values will be clipped to that range. +// *No* header is added to the resulting data. ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* deflating the payload of |data| using |level| compression level. +// *No* header is added to the resulting data. ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + compressionLevel:(int)level __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* decompressing the bytes. +// +// The data to decompress, it should *not* have any header (zlib nor gzip). ++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes + length:(NSUInteger)length __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error; + +/// Return an autoreleased NSData w/ the result of *raw* decompressing the payload of |data|. +// +// The data to decompress, it should *not* have any header (zlib nor gzip). ++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data __attribute__((deprecated("Use error variant"))); ++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data + error:(NSError **)error; + +@end + +FOUNDATION_EXPORT NSString *const GTMNSDataZlibErrorDomain; +FOUNDATION_EXPORT NSString *const GTMNSDataZlibErrorKey; // NSNumber +FOUNDATION_EXPORT NSString *const GTMNSDataZlibRemainingBytesKey; // NSNumber + +typedef NS_ENUM(NSInteger, GTMNSDataZlibError) { + GTMNSDataZlibErrorGreaterThan32BitsToCompress = 1024, + // An internal zlib error. + // GTMNSDataZlibErrorKey will contain the error value. + // NSLocalizedDescriptionKey may contain an error string from zlib. + // Look in zlib.h for list of errors. + GTMNSDataZlibErrorInternal, + // There was left over data in the buffer that was not used. + // GTMNSDataZlibRemainingBytesKey will contain number of remaining bytes. + GTMNSDataZlibErrorDataRemaining +}; diff --git a/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.m b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.m new file mode 100644 index 00000000..bf74b2d2 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/Foundation/GTMNSData+zlib.m @@ -0,0 +1,531 @@ +// +// GTMNSData+zlib.m +// +// Copyright 2007-2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +#import "GTMNSData+zlib.h" +#import <zlib.h> +#import "GTMDefines.h" + +#define kChunkSize 1024 + +NSString *const GTMNSDataZlibErrorDomain = @"com.google.GTMNSDataZlibErrorDomain"; +NSString *const GTMNSDataZlibErrorKey = @"GTMNSDataZlibErrorKey"; +NSString *const GTMNSDataZlibRemainingBytesKey = @"GTMNSDataZlibRemainingBytesKey"; + +typedef enum { + CompressionModeZlib, + CompressionModeGzip, + CompressionModeRaw, +} CompressionMode; + +@interface NSData (GTMZlibAdditionsPrivate) ++ (NSData *)gtm_dataByCompressingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + mode:(CompressionMode)mode + error:(NSError **)error; ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length + isRawData:(BOOL)isRawData + error:(NSError **)error; +@end + +@implementation NSData (GTMZlibAdditionsPrivate) + ++ (NSData *)gtm_dataByCompressingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + mode:(CompressionMode)mode + error:(NSError **)error { + if (!bytes || !length) { + return nil; + } + +#if defined(__LP64__) && __LP64__ + // Don't support > 32bit length for 64 bit, see note in header. + if (length > UINT_MAX) { + if (error) { + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorGreaterThan32BitsToCompress + userInfo:nil]; + } + return nil; + } +#endif + + if (level == Z_DEFAULT_COMPRESSION) { + // the default value is actually outside the range, so we have to let it + // through specifically. + } else if (level < Z_BEST_SPEED) { + level = Z_BEST_SPEED; + } else if (level > Z_BEST_COMPRESSION) { + level = Z_BEST_COMPRESSION; + } + + z_stream strm; + bzero(&strm, sizeof(z_stream)); + + int memLevel = 8; // the default + int windowBits = 15; // the default + switch (mode) { + case CompressionModeZlib: + // nothing to do + break; + + case CompressionModeGzip: + windowBits += 16; // enable gzip header instead of zlib header + break; + + case CompressionModeRaw: + windowBits *= -1; // Negative to mean no header. + break; + } + int retCode; + if ((retCode = deflateInit2(&strm, level, Z_DEFLATED, windowBits, + memLevel, Z_DEFAULT_STRATEGY)) != Z_OK) { + // COV_NF_START - no real way to force this in a unittest (we guard all args) + if (error) { + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:retCode] + forKey:GTMNSDataZlibErrorKey]; + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorInternal + userInfo:userInfo]; + } + return nil; + // COV_NF_END + } + + // hint the size at 1/4 the input size + NSMutableData *result = [NSMutableData dataWithCapacity:(length/4)]; + unsigned char output[kChunkSize]; + + // setup the input + strm.avail_in = (unsigned int)length; + strm.next_in = (unsigned char*)bytes; + + // loop to collect the data + do { + // update what we're passing in + strm.avail_out = kChunkSize; + strm.next_out = output; + retCode = deflate(&strm, Z_FINISH); + if ((retCode != Z_OK) && (retCode != Z_STREAM_END)) { + // COV_NF_START - no real way to force this in a unittest + // (in inflate, we can feed bogus/truncated data to test, but an error + // here would be some internal issue w/in zlib, and there isn't any real + // way to test it) + if (error) { + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:retCode] + forKey:GTMNSDataZlibErrorKey]; + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorInternal + userInfo:userInfo]; + } + deflateEnd(&strm); + return nil; + // COV_NF_END + } + // collect what we got + unsigned gotBack = kChunkSize - strm.avail_out; + if (gotBack > 0) { + [result appendBytes:output length:gotBack]; + } + + } while (retCode == Z_OK); + + // if the loop exits, we used all input and the stream ended + _GTMDevAssert(strm.avail_in == 0, + @"thought we finished deflate w/o using all input, %u bytes left", + strm.avail_in); + _GTMDevAssert(retCode == Z_STREAM_END, + @"thought we finished deflate w/o getting a result of stream end, code %d", + retCode); + + // clean up + deflateEnd(&strm); + + return result; +} // gtm_dataByCompressingBytes:length:compressionLevel:useGzip: + ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length + isRawData:(BOOL)isRawData + error:(NSError **)error { + if (!bytes || !length) { + return nil; + } + +#if defined(__LP64__) && __LP64__ + // Don't support > 32bit length for 64 bit, see note in header. + if (length > UINT_MAX) { + return nil; + } +#endif + + z_stream strm; + bzero(&strm, sizeof(z_stream)); + + // setup the input + strm.avail_in = (unsigned int)length; + strm.next_in = (unsigned char*)bytes; + + int windowBits = 15; // 15 to enable any window size + if (isRawData) { + windowBits *= -1; // make it negative to signal no header. + } else { + windowBits += 32; // and +32 to enable zlib or gzip header detection. + } + + int retCode; + if ((retCode = inflateInit2(&strm, windowBits)) != Z_OK) { + // COV_NF_START - no real way to force this in a unittest (we guard all args) + if (error) { + NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:retCode] + forKey:GTMNSDataZlibErrorKey]; + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorInternal + userInfo:userInfo]; + } + return nil; + // COV_NF_END + } + + // hint the size at 4x the input size + NSMutableData *result = [NSMutableData dataWithCapacity:(length*4)]; + unsigned char output[kChunkSize]; + + // loop to collect the data + do { + // update what we're passing in + strm.avail_out = kChunkSize; + strm.next_out = output; + retCode = inflate(&strm, Z_NO_FLUSH); + if ((retCode != Z_OK) && (retCode != Z_STREAM_END)) { + if (error) { + NSMutableDictionary *userInfo = + [NSMutableDictionary dictionaryWithObject:[NSNumber numberWithInt:retCode] + forKey:GTMNSDataZlibErrorKey]; + if (strm.msg) { + NSString *message = [NSString stringWithUTF8String:strm.msg]; + if (message) { + [userInfo setObject:message forKey:NSLocalizedDescriptionKey]; + } + } + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorInternal + userInfo:userInfo]; + } + inflateEnd(&strm); + return nil; + } + // collect what we got + unsigned gotBack = kChunkSize - strm.avail_out; + if (gotBack > 0) { + [result appendBytes:output length:gotBack]; + } + + } while (retCode == Z_OK); + + // make sure there wasn't more data tacked onto the end of a valid compressed + // stream. + if (strm.avail_in != 0) { + if (error) { + NSDictionary *userInfo = + [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedInt:strm.avail_in] + forKey:GTMNSDataZlibRemainingBytesKey]; + *error = [NSError errorWithDomain:GTMNSDataZlibErrorDomain + code:GTMNSDataZlibErrorDataRemaining + userInfo:userInfo]; + } + result = nil; + } + // the only way out of the loop was by hitting the end of the stream + _GTMDevAssert(retCode == Z_STREAM_END, + @"thought we finished inflate w/o getting a result of stream end, code %d", + retCode); + + // clean up + inflateEnd(&strm); + + return result; +} // gtm_dataByInflatingBytes:length:windowBits: + +@end + + +@implementation NSData (GTMZLibAdditions) + ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByGzippingBytes:bytes length:length error:NULL]; +} // gtm_dataByGzippingBytes:length: + ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeGzip + error:error]; +} // gtm_dataByGzippingBytes:length:error: + ++ (NSData *)gtm_dataByGzippingData:(NSData *)data { + return [self gtm_dataByGzippingData:data error:NULL]; +} // gtm_dataByGzippingData: + ++ (NSData *)gtm_dataByGzippingData:(NSData *)data error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeGzip + error:error]; +} // gtm_dataByGzippingData:error: + ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level { + return [self gtm_dataByGzippingBytes:bytes + length:length + compressionLevel:level + error:NULL]; +} // gtm_dataByGzippingBytes:length:level: + ++ (NSData *)gtm_dataByGzippingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error{ + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:level + mode:CompressionModeGzip + error:error]; +} // gtm_dataByGzippingBytes:length:level:error + ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + compressionLevel:(int)level { + return [self gtm_dataByGzippingData:data + compressionLevel:level + error:NULL]; +} // gtm_dataByGzippingData:level: + ++ (NSData *)gtm_dataByGzippingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error{ + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:level + mode:CompressionModeGzip + error:error]; +} // gtm_dataByGzippingData:level:error + +#pragma mark - + ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByDeflatingBytes:bytes + length:length + error:NULL]; +} // gtm_dataByDeflatingBytes:length: + ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error{ + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeZlib + error:error]; +} // gtm_dataByDeflatingBytes:length:error + ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data { + return [self gtm_dataByDeflatingData:data error:NULL]; +} // gtm_dataByDeflatingData: + ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeZlib + error:error]; +} // gtm_dataByDeflatingData: + ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level { + return [self gtm_dataByDeflatingBytes:bytes + length:length + compressionLevel:level + error:NULL]; +} // gtm_dataByDeflatingBytes:length:level: + ++ (NSData *)gtm_dataByDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:level + mode:CompressionModeZlib + error:error]; +} // gtm_dataByDeflatingBytes:length:level:error: + ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + compressionLevel:(int)level { + return [self gtm_dataByDeflatingData:data + compressionLevel:level + error:NULL]; +} // gtm_dataByDeflatingData:level: + ++ (NSData *)gtm_dataByDeflatingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:level + mode:CompressionModeZlib + error:error]; +} // gtm_dataByDeflatingData:level:error: + +#pragma mark - + ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByInflatingBytes:bytes + length:length + error:NULL]; +} // gtm_dataByInflatingBytes:length: + ++ (NSData *)gtm_dataByInflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error { + return [self gtm_dataByInflatingBytes:bytes + length:length + isRawData:NO + error:error]; +} // gtm_dataByInflatingBytes:length:error: + ++ (NSData *)gtm_dataByInflatingData:(NSData *)data { + return [self gtm_dataByInflatingData:data error:NULL]; +} // gtm_dataByInflatingData: + ++ (NSData *)gtm_dataByInflatingData:(NSData *)data + error:(NSError **)error { + return [self gtm_dataByInflatingBytes:[data bytes] + length:[data length] + isRawData:NO + error:error]; +} // gtm_dataByInflatingData: + +#pragma mark - + ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:NULL]; +} // gtm_dataByRawDeflatingBytes:length: + ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeRaw + error:error]; +} // gtm_dataByRawDeflatingBytes:length:error: + ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data { + return [self gtm_dataByRawDeflatingData:data error:NULL]; +} // gtm_dataByRawDeflatingData: + ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:Z_DEFAULT_COMPRESSION + mode:CompressionModeRaw + error:error]; +} // gtm_dataByRawDeflatingData:error: + ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level { + return [self gtm_dataByRawDeflatingBytes:bytes + length:length + compressionLevel:level + error:NULL]; +} // gtm_dataByRawDeflatingBytes:length:compressionLevel: + ++ (NSData *)gtm_dataByRawDeflatingBytes:(const void *)bytes + length:(NSUInteger)length + compressionLevel:(int)level + error:(NSError **)error{ + return [self gtm_dataByCompressingBytes:bytes + length:length + compressionLevel:level + mode:CompressionModeRaw + error:error]; +} // gtm_dataByRawDeflatingBytes:length:compressionLevel:error: + ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + compressionLevel:(int)level { + return [self gtm_dataByRawDeflatingData:data + compressionLevel:level + error:NULL]; +} // gtm_dataByRawDeflatingData:compressionLevel: + ++ (NSData *)gtm_dataByRawDeflatingData:(NSData *)data + compressionLevel:(int)level + error:(NSError **)error { + return [self gtm_dataByCompressingBytes:[data bytes] + length:[data length] + compressionLevel:level + mode:CompressionModeRaw + error:error]; +} // gtm_dataByRawDeflatingData:compressionLevel:error: + ++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes + length:(NSUInteger)length { + return [self gtm_dataByInflatingBytes:bytes + length:length + error:NULL]; +} // gtm_dataByRawInflatingBytes:length: + ++ (NSData *)gtm_dataByRawInflatingBytes:(const void *)bytes + length:(NSUInteger)length + error:(NSError **)error{ + return [self gtm_dataByInflatingBytes:bytes + length:length + isRawData:YES + error:error]; +} // gtm_dataByRawInflatingBytes:length:error: + ++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data { + return [self gtm_dataByRawInflatingData:data + error:NULL]; +} // gtm_dataByRawInflatingData: + ++ (NSData *)gtm_dataByRawInflatingData:(NSData *)data + error:(NSError **)error { + return [self gtm_dataByInflatingBytes:[data bytes] + length:[data length] + isRawData:YES + error:error]; +} // gtm_dataByRawInflatingData:error: + +@end diff --git a/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/GTMDefines.h b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/GTMDefines.h new file mode 100644 index 00000000..8ec88cc0 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/GTMDefines.h @@ -0,0 +1,392 @@ +// +// GTMDefines.h +// +// Copyright 2008 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// + +// ============================================================================ + +#include <AvailabilityMacros.h> +#include <TargetConditionals.h> + +#ifdef __OBJC__ +#include <Foundation/NSObjCRuntime.h> +#endif // __OBJC__ + +#if TARGET_OS_IPHONE +#include <Availability.h> +#endif // TARGET_OS_IPHONE + +// ---------------------------------------------------------------------------- +// CPP symbols that can be overridden in a prefix to control how the toolbox +// is compiled. +// ---------------------------------------------------------------------------- + + +// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and +// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens +// when a validation fails. If you implement your own validators, you may want +// to control their internals using the same macros for consistency. +#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT + #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0 +#endif + +// Ensure __has_feature and __has_extension are safe to use. +// See http://clang-analyzer.llvm.org/annotations.html +#ifndef __has_feature // Optional. + #define __has_feature(x) 0 // Compatibility with non-clang compilers. +#endif + +#ifndef __has_extension + #define __has_extension __has_feature // Compatibility with pre-3.0 compilers. +#endif + +// Give ourselves a consistent way to do inlines. Apple's macros even use +// a few different actual definitions, so we're based off of the foundation +// one. +#if !defined(GTM_INLINE) + #if (defined (__GNUC__) && (__GNUC__ == 4)) || defined (__clang__) + #define GTM_INLINE static __inline__ __attribute__((always_inline)) + #else + #define GTM_INLINE static __inline__ + #endif +#endif + +// Give ourselves a consistent way of doing externs that links up nicely +// when mixing objc and objc++ +#if !defined (GTM_EXTERN) + #if defined __cplusplus + #define GTM_EXTERN extern "C" + #define GTM_EXTERN_C_BEGIN extern "C" { + #define GTM_EXTERN_C_END } + #else + #define GTM_EXTERN extern + #define GTM_EXTERN_C_BEGIN + #define GTM_EXTERN_C_END + #endif +#endif + +// Give ourselves a consistent way of exporting things if we have visibility +// set to hidden. +#if !defined (GTM_EXPORT) + #define GTM_EXPORT __attribute__((visibility("default"))) +#endif + +// Give ourselves a consistent way of declaring something as unused. This +// doesn't use __unused because that is only supported in gcc 4.2 and greater. +#if !defined (GTM_UNUSED) +#define GTM_UNUSED(x) ((void)(x)) +#endif + +// _GTMDevLog & _GTMDevAssert +// +// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for +// developer level errors. This implementation simply macros to NSLog/NSAssert. +// It is not intended to be a general logging/reporting system. +// +// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert +// for a little more background on the usage of these macros. +// +// _GTMDevLog log some error/problem in debug builds +// _GTMDevAssert assert if condition isn't met w/in a method/function +// in all builds. +// +// To replace this system, just provide different macro definitions in your +// prefix header. Remember, any implementation you provide *must* be thread +// safe since this could be called by anything in what ever situtation it has +// been placed in. +// + +// We only define the simple macros if nothing else has defined this. +#ifndef _GTMDevLog + +#ifdef DEBUG + #define _GTMDevLog(...) NSLog(__VA_ARGS__) +#else + #define _GTMDevLog(...) do { } while (0) +#endif + +#endif // _GTMDevLog + +#ifndef _GTMDevAssert +// we directly invoke the NSAssert handler so we can pass on the varargs +// (NSAssert doesn't have a macro we can use that takes varargs) +#if !defined(NS_BLOCK_ASSERTIONS) + #define _GTMDevAssert(condition, ...) \ + do { \ + if (!(condition)) { \ + [[NSAssertionHandler currentHandler] \ + handleFailureInFunction:(NSString *) \ + [NSString stringWithUTF8String:__PRETTY_FUNCTION__] \ + file:(NSString *)[NSString stringWithUTF8String:__FILE__] \ + lineNumber:__LINE__ \ + description:__VA_ARGS__]; \ + } \ + } while(0) +#else // !defined(NS_BLOCK_ASSERTIONS) + #define _GTMDevAssert(condition, ...) do { } while (0) +#endif // !defined(NS_BLOCK_ASSERTIONS) + +#endif // _GTMDevAssert + +// _GTMCompileAssert +// +// Note: Software for current compilers should just use _Static_assert directly +// instead of this macro. +// +// _GTMCompileAssert is an assert that is meant to fire at compile time if you +// want to check things at compile instead of runtime. For example if you +// want to check that a wchar is 4 bytes instead of 2 you would use +// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X) +// Note that the second "arg" is not in quotes, and must be a valid processor +// symbol in it's own right (no spaces, punctuation etc). + +// Wrapping this in an #ifndef allows external groups to define their own +// compile time assert scheme. +#ifndef _GTMCompileAssert + #if __has_feature(c_static_assert) || __has_extension(c_static_assert) + #define _GTMCompileAssert(test, msg) _Static_assert((test), #msg) + #else + // Pre-Xcode 7 support. + // + // We got this technique from here: + // http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html + #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg + #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg) + #define _GTMCompileAssert(test, msg) \ + typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] + #endif // __has_feature(c_static_assert) || __has_extension(c_static_assert) +#endif // _GTMCompileAssert + +// ---------------------------------------------------------------------------- +// CPP symbols defined based on the project settings so the GTM code has +// simple things to test against w/o scattering the knowledge of project +// setting through all the code. +// ---------------------------------------------------------------------------- + +// Provide a single constant CPP symbol that all of GTM uses for ifdefing +// iPhone code. +#if TARGET_OS_IPHONE // iPhone SDK + // For iPhone specific stuff + #define GTM_IPHONE_SDK 1 + #if TARGET_IPHONE_SIMULATOR + #define GTM_IPHONE_DEVICE 0 + #define GTM_IPHONE_SIMULATOR 1 + #else + #define GTM_IPHONE_DEVICE 1 + #define GTM_IPHONE_SIMULATOR 0 + #endif // TARGET_IPHONE_SIMULATOR + // By default, GTM has provided it's own unittesting support, define this + // to use the support provided by Xcode, especially for the Xcode4 support + // for unittesting. + #ifndef GTM_USING_XCTEST + #define GTM_USING_XCTEST 0 + #endif + #define GTM_MACOS_SDK 0 +#else + // For MacOS specific stuff + #define GTM_MACOS_SDK 1 + #define GTM_IPHONE_SDK 0 + #define GTM_IPHONE_SIMULATOR 0 + #define GTM_IPHONE_DEVICE 0 + #ifndef GTM_USING_XCTEST + #define GTM_USING_XCTEST 0 + #endif +#endif + +// Some of our own availability macros +#if GTM_MACOS_SDK +#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE +#define GTM_AVAILABLE_ONLY_ON_MACOS +#else +#define GTM_AVAILABLE_ONLY_ON_IPHONE +#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE +#endif + +// GC was dropped by Apple, define the old constant incase anyone still keys +// off of it. +#ifndef GTM_SUPPORT_GC + #define GTM_SUPPORT_GC 0 +#endif + +// Some support for advanced clang static analysis functionality +#ifndef NS_RETURNS_RETAINED + #if __has_feature(attribute_ns_returns_retained) + #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained)) + #else + #define NS_RETURNS_RETAINED + #endif +#endif + +#ifndef NS_RETURNS_NOT_RETAINED + #if __has_feature(attribute_ns_returns_not_retained) + #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) + #else + #define NS_RETURNS_NOT_RETAINED + #endif +#endif + +#ifndef CF_RETURNS_RETAINED + #if __has_feature(attribute_cf_returns_retained) + #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) + #else + #define CF_RETURNS_RETAINED + #endif +#endif + +#ifndef CF_RETURNS_NOT_RETAINED + #if __has_feature(attribute_cf_returns_not_retained) + #define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained)) + #else + #define CF_RETURNS_NOT_RETAINED + #endif +#endif + +#ifndef NS_CONSUMED + #if __has_feature(attribute_ns_consumed) + #define NS_CONSUMED __attribute__((ns_consumed)) + #else + #define NS_CONSUMED + #endif +#endif + +#ifndef CF_CONSUMED + #if __has_feature(attribute_cf_consumed) + #define CF_CONSUMED __attribute__((cf_consumed)) + #else + #define CF_CONSUMED + #endif +#endif + +#ifndef NS_CONSUMES_SELF + #if __has_feature(attribute_ns_consumes_self) + #define NS_CONSUMES_SELF __attribute__((ns_consumes_self)) + #else + #define NS_CONSUMES_SELF + #endif +#endif + +#ifndef GTM_NONNULL + #if defined(__has_attribute) + #if __has_attribute(nonnull) + #define GTM_NONNULL(x) __attribute__((nonnull x)) + #else + #define GTM_NONNULL(x) + #endif + #else + #define GTM_NONNULL(x) + #endif +#endif + +// Invalidates the initializer from which it's called. +#ifndef GTMInvalidateInitializer + #if __has_feature(objc_arc) + #define GTMInvalidateInitializer() \ + do { \ + [self class]; /* Avoid warning of dead store to |self|. */ \ + _GTMDevAssert(NO, @"Invalid initializer."); \ + return nil; \ + } while (0) + #else + #define GTMInvalidateInitializer() \ + do { \ + [self release]; \ + _GTMDevAssert(NO, @"Invalid initializer."); \ + return nil; \ + } while (0) + #endif +#endif + +#ifndef GTMCFAutorelease + // GTMCFAutorelease returns an id. In contrast, Apple's CFAutorelease returns + // a CFTypeRef. + #if __has_feature(objc_arc) + #define GTMCFAutorelease(x) CFBridgingRelease(x) + #else + #define GTMCFAutorelease(x) ([(id)x autorelease]) + #endif +#endif + +#ifdef __OBJC__ + + +// Macro to allow you to create NSStrings out of other macros. +// #define FOO foo +// NSString *fooString = GTM_NSSTRINGIFY(FOO); +#if !defined (GTM_NSSTRINGIFY) + #define GTM_NSSTRINGIFY_INNER(x) @#x + #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x) +#endif + +// Macro to allow fast enumeration when building for 10.5 or later, and +// reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration +// does keys, so pick the right thing, nothing is done on the FastEnumeration +// side to be sure you're getting what you wanted. +#ifndef GTM_FOREACH_OBJECT + #if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5) + #define GTM_FOREACH_ENUMEREE(element, enumeration) \ + for (element in enumeration) + #define GTM_FOREACH_OBJECT(element, collection) \ + for (element in collection) + #define GTM_FOREACH_KEY(element, collection) \ + for (element in collection) + #else + #define GTM_FOREACH_ENUMEREE(element, enumeration) \ + for (NSEnumerator *_ ## element ## _enum = enumeration; \ + (element = [_ ## element ## _enum nextObject]) != nil; ) + #define GTM_FOREACH_OBJECT(element, collection) \ + GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator]) + #define GTM_FOREACH_KEY(element, collection) \ + GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator]) + #endif +#endif + +// ============================================================================ + +// GTM_SEL_STRING is for specifying selector (usually property) names to KVC +// or KVO methods. +// In debug it will generate warnings for undeclared selectors if +// -Wunknown-selector is turned on. +// In release it will have no runtime overhead. +#ifndef GTM_SEL_STRING + #ifdef DEBUG + #define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName)) + #else + #define GTM_SEL_STRING(selName) @#selName + #endif // DEBUG +#endif // GTM_SEL_STRING + +#ifndef GTM_WEAK +#if __has_feature(objc_arc_weak) + // With ARC enabled, __weak means a reference that isn't implicitly + // retained. __weak objects are accessed through runtime functions, so + // they are zeroed out, but this requires OS X 10.7+. + // At clang r251041+, ARC-style zeroing weak references even work in + // non-ARC mode. + #define GTM_WEAK __weak + #elif __has_feature(objc_arc) + // ARC, but targeting 10.6 or older, where zeroing weak references don't + // exist. + #define GTM_WEAK __unsafe_unretained + #else + // With manual reference counting, __weak used to be silently ignored. + // clang r251041 gives it the ARC semantics instead. This means they + // now require a deployment target of 10.7, while some clients of GTM + // still target 10.6. In these cases, expand to __unsafe_unretained instead + #define GTM_WEAK + #endif +#endif + +#endif // __OBJC__ diff --git a/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/LICENSE b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/README.md b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/README.md new file mode 100644 index 00000000..710560a3 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/GoogleToolboxForMac/README.md @@ -0,0 +1,15 @@ +# GTM: Google Toolbox for Mac # + +**Project site** <https://github.com/google/google-toolbox-for-mac><br> +**Discussion group** <http://groups.google.com/group/google-toolbox-for-mac> + +# Google Toolbox for Mac # + +A collection of source from different Google projects that may be of use to +developers working other iOS or OS X projects. + +If you find a problem/bug or want a new feature to be included in the Google +Toolbox for Mac, please join the +[discussion group](http://groups.google.com/group/google-toolbox-for-mac) +or submit an +[issue](https://github.com/google/google-toolbox-for-mac/issues). diff --git a/StoneIsland/platforms/ios/Pods/GoogleUtilities/Frameworks/frameworks/GoogleUtilities.framework/GoogleUtilities b/StoneIsland/platforms/ios/Pods/GoogleUtilities/Frameworks/frameworks/GoogleUtilities.framework/GoogleUtilities Binary files differdeleted file mode 100755 index 0fd17b65..00000000 --- a/StoneIsland/platforms/ios/Pods/GoogleUtilities/Frameworks/frameworks/GoogleUtilities.framework/GoogleUtilities +++ /dev/null diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceID.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceID.h deleted file mode 120000 index 6a5ede6e..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceID.h +++ /dev/null @@ -1 +0,0 @@ -../../../GGLInstanceID/Headers/Public/GGLInstanceID.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDConfig.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDConfig.h deleted file mode 120000 index 95605988..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDConfig.h +++ /dev/null @@ -1 +0,0 @@ -../../../GGLInstanceID/Headers/Public/GGLInstanceIDConfig.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDDelegate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDDelegate.h deleted file mode 120000 index e7d44b8c..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDDelegate.h +++ /dev/null @@ -1 +0,0 @@ -../../../GGLInstanceID/Headers/Public/GGLInstanceIDDelegate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDHeaders.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDHeaders.h deleted file mode 120000 index b1d72b29..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GGLInstanceID/GGLInstanceIDHeaders.h +++ /dev/null @@ -1 +0,0 @@ -../../../GGLInstanceID/Headers/Public/GGLInstanceIDHeaders.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMConfig.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMConfig.h deleted file mode 120000 index b5187f24..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMConfig.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GCMConfig.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMPubSub.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMPubSub.h deleted file mode 120000 index 0072792c..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMPubSub.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GCMPubSub.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMReceiverDelegate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMReceiverDelegate.h deleted file mode 120000 index e6e1be97..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMReceiverDelegate.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GCMReceiverDelegate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMService.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMService.h deleted file mode 120000 index 256f388d..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GCMService.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GCMService.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GoogleCloudMessaging.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GoogleCloudMessaging.h deleted file mode 120000 index 18678070..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleCloudMessaging/GoogleCloudMessaging.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GoogleCloudMessaging.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMDefines.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMDefines.h new file mode 120000 index 00000000..55031108 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMDefines.h @@ -0,0 +1 @@ +../../../GoogleToolboxForMac/GTMDefines.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMLogger.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMLogger.h new file mode 120000 index 00000000..f45a0d7d --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMLogger.h @@ -0,0 +1 @@ +../../../GoogleToolboxForMac/Foundation/GTMLogger.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMNSData+zlib.h b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMNSData+zlib.h new file mode 120000 index 00000000..9e724193 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/GoogleToolboxForMac/GTMNSData+zlib.h @@ -0,0 +1 @@ +../../../GoogleToolboxForMac/Foundation/GTMNSData+zlib.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Any.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Any.pbobjc.h new file mode 120000 index 00000000..a3b2cd7c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Any.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Any.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Api.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Api.pbobjc.h new file mode 120000 index 00000000..aaf80d3f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Api.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Api.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Duration.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Duration.pbobjc.h new file mode 120000 index 00000000..819be985 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Duration.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Duration.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Empty.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Empty.pbobjc.h new file mode 120000 index 00000000..848a3a8f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Empty.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Empty.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/FieldMask.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/FieldMask.pbobjc.h new file mode 120000 index 00000000..094aa0a9 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/FieldMask.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/FieldMask.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBArray.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBArray.h new file mode 120000 index 00000000..f8e77a6c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBArray.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBArray.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBArray_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBArray_PackagePrivate.h new file mode 120000 index 00000000..7114784a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBArray_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBArray_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBBootstrap.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBBootstrap.h new file mode 120000 index 00000000..587e43e9 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBBootstrap.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBBootstrap.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedInputStream.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedInputStream.h new file mode 120000 index 00000000..130ef510 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedInputStream.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBCodedInputStream.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedInputStream_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedInputStream_PackagePrivate.h new file mode 120000 index 00000000..f50b154c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedInputStream_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBCodedInputStream_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedOutputStream.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedOutputStream.h new file mode 120000 index 00000000..56983131 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedOutputStream.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBCodedOutputStream.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedOutputStream_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedOutputStream_PackagePrivate.h new file mode 120000 index 00000000..a0496568 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBCodedOutputStream_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBCodedOutputStream_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDescriptor.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDescriptor.h new file mode 120000 index 00000000..63331674 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDescriptor.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBDescriptor.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDescriptor_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDescriptor_PackagePrivate.h new file mode 120000 index 00000000..78cf94a7 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDescriptor_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBDescriptor_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDictionary.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDictionary.h new file mode 120000 index 00000000..e121884f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDictionary.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBDictionary.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDictionary_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDictionary_PackagePrivate.h new file mode 120000 index 00000000..f4e36365 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBDictionary_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBDictionary_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBExtensionInternals.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBExtensionInternals.h new file mode 120000 index 00000000..524ff703 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBExtensionInternals.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBExtensionInternals.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBExtensionRegistry.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBExtensionRegistry.h new file mode 120000 index 00000000..5235109f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBExtensionRegistry.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBExtensionRegistry.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBMessage.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBMessage.h new file mode 120000 index 00000000..cc221529 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBMessage.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBMessage.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBMessage_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBMessage_PackagePrivate.h new file mode 120000 index 00000000..8a25863d --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBMessage_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBMessage_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBProtocolBuffers.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBProtocolBuffers.h new file mode 120000 index 00000000..9bb666c8 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBProtocolBuffers.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBProtocolBuffers.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBProtocolBuffers_RuntimeSupport.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBProtocolBuffers_RuntimeSupport.h new file mode 120000 index 00000000..33362308 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBProtocolBuffers_RuntimeSupport.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBProtocolBuffers_RuntimeSupport.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRootObject.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRootObject.h new file mode 120000 index 00000000..f793ef7d --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRootObject.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBRootObject.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRootObject_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRootObject_PackagePrivate.h new file mode 120000 index 00000000..6d7e5150 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRootObject_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBRootObject_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRuntimeTypes.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRuntimeTypes.h new file mode 120000 index 00000000..c4d0370a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBRuntimeTypes.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBRuntimeTypes.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownField.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownField.h new file mode 120000 index 00000000..e16bb76b --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownField.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUnknownField.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownFieldSet.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownFieldSet.h new file mode 120000 index 00000000..d89c5eb1 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownFieldSet.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUnknownFieldSet.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownFieldSet_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownFieldSet_PackagePrivate.h new file mode 120000 index 00000000..3493399e --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownFieldSet_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUnknownFieldSet_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownField_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownField_PackagePrivate.h new file mode 120000 index 00000000..1a74032c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUnknownField_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUnknownField_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUtilities.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUtilities.h new file mode 120000 index 00000000..270b85f2 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUtilities.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUtilities.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUtilities_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUtilities_PackagePrivate.h new file mode 120000 index 00000000..507dfa53 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBUtilities_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUtilities_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBWellKnownTypes.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBWellKnownTypes.h new file mode 120000 index 00000000..0d3f3872 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBWellKnownTypes.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBWellKnownTypes.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBWireFormat.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBWireFormat.h new file mode 120000 index 00000000..d1ce7e22 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/GPBWireFormat.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBWireFormat.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/SourceContext.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/SourceContext.pbobjc.h new file mode 120000 index 00000000..2df29f41 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/SourceContext.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/SourceContext.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Struct.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Struct.pbobjc.h new file mode 120000 index 00000000..6cad8000 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Struct.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Struct.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Timestamp.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Timestamp.pbobjc.h new file mode 120000 index 00000000..3d78ef1f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Timestamp.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Timestamp.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Type.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Type.pbobjc.h new file mode 120000 index 00000000..06829fbe --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Type.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Type.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Wrappers.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Wrappers.pbobjc.h new file mode 120000 index 00000000..df905161 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/Protobuf/Wrappers.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Wrappers.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb.h b/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb.h new file mode 120000 index 00000000..549ba434 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb.h @@ -0,0 +1 @@ +../../../nanopb/pb.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_common.h b/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_common.h new file mode 120000 index 00000000..002c466e --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_common.h @@ -0,0 +1 @@ +../../../nanopb/pb_common.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_decode.h b/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_decode.h new file mode 120000 index 00000000..62ed2f10 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_decode.h @@ -0,0 +1 @@ +../../../nanopb/pb_decode.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_encode.h b/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_encode.h new file mode 120000 index 00000000..057760ea --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Private/nanopb/pb_encode.h @@ -0,0 +1 @@ +../../../nanopb/pb_encode.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalytics+AppDelegate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalytics+AppDelegate.h new file mode 120000 index 00000000..1d9bd7ed --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalytics+AppDelegate.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalytics.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalytics.h new file mode 120000 index 00000000..f8fc4fb1 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalytics.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalyticsConfiguration.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalyticsConfiguration.h new file mode 120000 index 00000000..67732719 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalyticsConfiguration.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalyticsSwiftNameSupport.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalyticsSwiftNameSupport.h new file mode 120000 index 00000000..d6071113 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRAnalyticsSwiftNameSupport.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalyticsSwiftNameSupport.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRApp.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRApp.h new file mode 120000 index 00000000..97c9b35a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRApp.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRApp.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRConfiguration.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRConfiguration.h new file mode 120000 index 00000000..c34ddb85 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRConfiguration.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRConfiguration.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIREventNames.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIREventNames.h new file mode 120000 index 00000000..8924cc08 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIREventNames.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIROptions.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIROptions.h new file mode 120000 index 00000000..a40119b4 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIROptions.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIROptions.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRParameterNames.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRParameterNames.h new file mode 120000 index 00000000..6e37a6e0 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRParameterNames.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRUserPropertyNames.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRUserPropertyNames.h new file mode 120000 index 00000000..4459d6bc --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FIRUserPropertyNames.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FirebaseAnalytics.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FirebaseAnalytics.h new file mode 120000 index 00000000..2d48a7db --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseAnalytics/FirebaseAnalytics/FirebaseAnalytics.h @@ -0,0 +1 @@ +../../../../FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRAnalyticsConfiguration.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRAnalyticsConfiguration.h new file mode 120000 index 00000000..31d68c31 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRAnalyticsConfiguration.h @@ -0,0 +1 @@ +../../../../FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRApp.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRApp.h new file mode 120000 index 00000000..90c263ac --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRApp.h @@ -0,0 +1 @@ +../../../../FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRApp.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRConfiguration.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRConfiguration.h new file mode 120000 index 00000000..6a732c03 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRConfiguration.h @@ -0,0 +1 @@ +../../../../FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRConfiguration.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRCoreSwiftNameSupport.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRCoreSwiftNameSupport.h new file mode 120000 index 00000000..8473ede1 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRCoreSwiftNameSupport.h @@ -0,0 +1 @@ +../../../../FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRCoreSwiftNameSupport.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRLoggerLevel.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRLoggerLevel.h new file mode 120000 index 00000000..a2167066 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIRLoggerLevel.h @@ -0,0 +1 @@ +../../../../FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIRLoggerLevel.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIROptions.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIROptions.h new file mode 120000 index 00000000..5bd77eb8 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FIROptions.h @@ -0,0 +1 @@ +../../../../FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FIROptions.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FirebaseCore.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FirebaseCore.h new file mode 120000 index 00000000..96e9330e --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseCore/FirebaseCore/FirebaseCore.h @@ -0,0 +1 @@ +../../../../FirebaseCore/Frameworks/FirebaseCore.framework/Headers/FirebaseCore.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseInstanceID/FirebaseInstanceID/FIRInstanceID.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseInstanceID/FirebaseInstanceID/FIRInstanceID.h new file mode 120000 index 00000000..62c92b0c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseInstanceID/FirebaseInstanceID/FIRInstanceID.h @@ -0,0 +1 @@ +../../../../FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FIRInstanceID.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseInstanceID/FirebaseInstanceID/FirebaseInstanceID.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseInstanceID/FirebaseInstanceID/FirebaseInstanceID.h new file mode 120000 index 00000000..8925bdb8 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseInstanceID/FirebaseInstanceID/FirebaseInstanceID.h @@ -0,0 +1 @@ +../../../../FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseMessaging/FirebaseMessaging/FIRMessaging.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseMessaging/FirebaseMessaging/FIRMessaging.h new file mode 120000 index 00000000..daaf6b08 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseMessaging/FirebaseMessaging/FIRMessaging.h @@ -0,0 +1 @@ +../../../../FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FIRMessaging.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseMessaging/FirebaseMessaging/FirebaseMessaging.h b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseMessaging/FirebaseMessaging/FirebaseMessaging.h new file mode 120000 index 00000000..94e089d7 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/FirebaseMessaging/FirebaseMessaging/FirebaseMessaging.h @@ -0,0 +1 @@ +../../../../FirebaseMessaging/Frameworks/FirebaseMessaging.framework/Headers/FirebaseMessaging.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceID.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceID.h deleted file mode 120000 index 6a5ede6e..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceID.h +++ /dev/null @@ -1 +0,0 @@ -../../../GGLInstanceID/Headers/Public/GGLInstanceID.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDConfig.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDConfig.h deleted file mode 120000 index 95605988..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDConfig.h +++ /dev/null @@ -1 +0,0 @@ -../../../GGLInstanceID/Headers/Public/GGLInstanceIDConfig.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDDelegate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDDelegate.h deleted file mode 120000 index e7d44b8c..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDDelegate.h +++ /dev/null @@ -1 +0,0 @@ -../../../GGLInstanceID/Headers/Public/GGLInstanceIDDelegate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDHeaders.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDHeaders.h deleted file mode 120000 index b1d72b29..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GGLInstanceID/GGLInstanceIDHeaders.h +++ /dev/null @@ -1 +0,0 @@ -../../../GGLInstanceID/Headers/Public/GGLInstanceIDHeaders.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMConfig.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMConfig.h deleted file mode 120000 index b5187f24..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMConfig.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GCMConfig.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMPubSub.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMPubSub.h deleted file mode 120000 index 0072792c..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMPubSub.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GCMPubSub.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMReceiverDelegate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMReceiverDelegate.h deleted file mode 120000 index e6e1be97..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMReceiverDelegate.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GCMReceiverDelegate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMService.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMService.h deleted file mode 120000 index 256f388d..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GCMService.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GCMService.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GoogleCloudMessaging.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GoogleCloudMessaging.h deleted file mode 120000 index 18678070..00000000 --- a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleCloudMessaging/GoogleCloudMessaging.h +++ /dev/null @@ -1 +0,0 @@ -../../../GoogleCloudMessaging/Headers/Public/GoogleCloudMessaging.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMDefines.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMDefines.h new file mode 120000 index 00000000..55031108 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMDefines.h @@ -0,0 +1 @@ +../../../GoogleToolboxForMac/GTMDefines.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMLogger.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMLogger.h new file mode 120000 index 00000000..f45a0d7d --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMLogger.h @@ -0,0 +1 @@ +../../../GoogleToolboxForMac/Foundation/GTMLogger.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMNSData+zlib.h b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMNSData+zlib.h new file mode 120000 index 00000000..9e724193 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/GoogleToolboxForMac/GTMNSData+zlib.h @@ -0,0 +1 @@ +../../../GoogleToolboxForMac/Foundation/GTMNSData+zlib.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Any.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Any.pbobjc.h new file mode 120000 index 00000000..a3b2cd7c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Any.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Any.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Api.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Api.pbobjc.h new file mode 120000 index 00000000..aaf80d3f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Api.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Api.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Duration.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Duration.pbobjc.h new file mode 120000 index 00000000..819be985 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Duration.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Duration.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Empty.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Empty.pbobjc.h new file mode 120000 index 00000000..848a3a8f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Empty.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Empty.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/FieldMask.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/FieldMask.pbobjc.h new file mode 120000 index 00000000..094aa0a9 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/FieldMask.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/FieldMask.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBArray.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBArray.h new file mode 120000 index 00000000..f8e77a6c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBArray.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBArray.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBArray_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBArray_PackagePrivate.h new file mode 120000 index 00000000..7114784a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBArray_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBArray_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBBootstrap.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBBootstrap.h new file mode 120000 index 00000000..587e43e9 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBBootstrap.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBBootstrap.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedInputStream.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedInputStream.h new file mode 120000 index 00000000..130ef510 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedInputStream.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBCodedInputStream.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedInputStream_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedInputStream_PackagePrivate.h new file mode 120000 index 00000000..f50b154c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedInputStream_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBCodedInputStream_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedOutputStream.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedOutputStream.h new file mode 120000 index 00000000..56983131 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedOutputStream.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBCodedOutputStream.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedOutputStream_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedOutputStream_PackagePrivate.h new file mode 120000 index 00000000..a0496568 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBCodedOutputStream_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBCodedOutputStream_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDescriptor.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDescriptor.h new file mode 120000 index 00000000..63331674 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDescriptor.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBDescriptor.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDescriptor_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDescriptor_PackagePrivate.h new file mode 120000 index 00000000..78cf94a7 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDescriptor_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBDescriptor_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDictionary.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDictionary.h new file mode 120000 index 00000000..e121884f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDictionary.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBDictionary.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDictionary_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDictionary_PackagePrivate.h new file mode 120000 index 00000000..f4e36365 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBDictionary_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBDictionary_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBExtensionInternals.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBExtensionInternals.h new file mode 120000 index 00000000..524ff703 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBExtensionInternals.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBExtensionInternals.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBExtensionRegistry.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBExtensionRegistry.h new file mode 120000 index 00000000..5235109f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBExtensionRegistry.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBExtensionRegistry.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBMessage.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBMessage.h new file mode 120000 index 00000000..cc221529 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBMessage.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBMessage.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBMessage_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBMessage_PackagePrivate.h new file mode 120000 index 00000000..8a25863d --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBMessage_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBMessage_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBProtocolBuffers.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBProtocolBuffers.h new file mode 120000 index 00000000..9bb666c8 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBProtocolBuffers.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBProtocolBuffers.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBProtocolBuffers_RuntimeSupport.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBProtocolBuffers_RuntimeSupport.h new file mode 120000 index 00000000..33362308 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBProtocolBuffers_RuntimeSupport.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBProtocolBuffers_RuntimeSupport.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRootObject.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRootObject.h new file mode 120000 index 00000000..f793ef7d --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRootObject.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBRootObject.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRootObject_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRootObject_PackagePrivate.h new file mode 120000 index 00000000..6d7e5150 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRootObject_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBRootObject_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRuntimeTypes.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRuntimeTypes.h new file mode 120000 index 00000000..c4d0370a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBRuntimeTypes.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBRuntimeTypes.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownField.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownField.h new file mode 120000 index 00000000..e16bb76b --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownField.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUnknownField.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownFieldSet.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownFieldSet.h new file mode 120000 index 00000000..d89c5eb1 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownFieldSet.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUnknownFieldSet.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownFieldSet_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownFieldSet_PackagePrivate.h new file mode 120000 index 00000000..3493399e --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownFieldSet_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUnknownFieldSet_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownField_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownField_PackagePrivate.h new file mode 120000 index 00000000..1a74032c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUnknownField_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUnknownField_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUtilities.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUtilities.h new file mode 120000 index 00000000..270b85f2 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUtilities.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUtilities.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUtilities_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUtilities_PackagePrivate.h new file mode 120000 index 00000000..507dfa53 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBUtilities_PackagePrivate.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBUtilities_PackagePrivate.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBWellKnownTypes.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBWellKnownTypes.h new file mode 120000 index 00000000..0d3f3872 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBWellKnownTypes.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBWellKnownTypes.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBWireFormat.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBWireFormat.h new file mode 120000 index 00000000..d1ce7e22 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/GPBWireFormat.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/GPBWireFormat.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/SourceContext.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/SourceContext.pbobjc.h new file mode 120000 index 00000000..2df29f41 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/SourceContext.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/SourceContext.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Struct.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Struct.pbobjc.h new file mode 120000 index 00000000..6cad8000 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Struct.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Struct.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Timestamp.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Timestamp.pbobjc.h new file mode 120000 index 00000000..3d78ef1f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Timestamp.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Timestamp.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Type.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Type.pbobjc.h new file mode 120000 index 00000000..06829fbe --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Type.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Type.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Wrappers.pbobjc.h b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Wrappers.pbobjc.h new file mode 120000 index 00000000..df905161 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/Protobuf/Wrappers.pbobjc.h @@ -0,0 +1 @@ +../../../Protobuf/objectivec/google/protobuf/Wrappers.pbobjc.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb.h b/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb.h new file mode 120000 index 00000000..549ba434 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb.h @@ -0,0 +1 @@ +../../../nanopb/pb.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_common.h b/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_common.h new file mode 120000 index 00000000..002c466e --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_common.h @@ -0,0 +1 @@ +../../../nanopb/pb_common.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_decode.h b/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_decode.h new file mode 120000 index 00000000..62ed2f10 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_decode.h @@ -0,0 +1 @@ +../../../nanopb/pb_decode.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_encode.h b/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_encode.h new file mode 120000 index 00000000..057760ea --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Headers/Public/nanopb/pb_encode.h @@ -0,0 +1 @@ +../../../nanopb/pb_encode.h
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Pods/Manifest.lock b/StoneIsland/platforms/ios/Pods/Manifest.lock index 0fe15b8a..b1a04ec7 100644 --- a/StoneIsland/platforms/ios/Pods/Manifest.lock +++ b/StoneIsland/platforms/ios/Pods/Manifest.lock @@ -1,30 +1,43 @@ PODS: - - GGLInstanceID (1.2.1) - - GoogleCloudMessaging (1.2.0): - - GoogleInterchangeUtilities (~> 1.0) - - GoogleIPhoneUtilities (~> 1.0) - - GoogleSymbolUtilities (~> 1.0) - - GoogleInterchangeUtilities (1.2.2): - - GoogleSymbolUtilities (~> 1.1) - - GoogleIPhoneUtilities (1.2.1): - - GoogleSymbolUtilities (~> 1.0) - - GoogleUtilities (~> 1.0) - - GoogleSymbolUtilities (1.1.2) - - GoogleUtilities (1.3.2): - - GoogleSymbolUtilities (~> 1.1) + - FirebaseAnalytics (4.0.2): + - FirebaseCore (~> 4.0) + - FirebaseInstanceID (~> 2.0) + - GoogleToolboxForMac/NSData+zlib (~> 2.1) + - FirebaseCore (4.0.4): + - GoogleToolboxForMac/NSData+zlib (~> 2.1) + - nanopb (~> 0.3) + - FirebaseInstanceID (2.0.0): + - FirebaseCore (~> 4.0) + - FirebaseMessaging (2.0.0): + - FirebaseAnalytics (~> 4.0) + - FirebaseCore (~> 4.0) + - FirebaseInstanceID (~> 2.0) + - GoogleToolboxForMac/Logger (~> 2.1) + - Protobuf (~> 3.1) + - GoogleToolboxForMac/Defines (2.1.1) + - GoogleToolboxForMac/Logger (2.1.1): + - GoogleToolboxForMac/Defines (= 2.1.1) + - GoogleToolboxForMac/NSData+zlib (2.1.1): + - GoogleToolboxForMac/Defines (= 2.1.1) + - nanopb (0.3.8): + - nanopb/decode (= 0.3.8) + - nanopb/encode (= 0.3.8) + - nanopb/decode (0.3.8) + - nanopb/encode (0.3.8) + - Protobuf (3.3.0) DEPENDENCIES: - - GGLInstanceID (~> 1.2.1) - - GoogleCloudMessaging (~> 1.2.0) + - FirebaseMessaging (~> 2.0.0) SPEC CHECKSUMS: - GGLInstanceID: 4a317044f744281b82cd03015f379899f277cad3 - GoogleCloudMessaging: f37ea14dd0f41d4d889c10b5559dd35bbfd9ac26 - GoogleInterchangeUtilities: d5bc4d88d5b661ab72f9d70c58d02ca8c27ad1f7 - GoogleIPhoneUtilities: 63f25e93a3ddcb66884d182aab3a660d98f1479b - GoogleSymbolUtilities: 631ee17048aa5e9ab133470d768ea997a5ef9b96 - GoogleUtilities: 8bbc733218aad26306f9d4a253823986110e3358 + FirebaseAnalytics: ad41720e3e67fc63fbe3d2948d3e26932a8de311 + FirebaseCore: cfc042628ef9f20debe09c0eb683135fcd404cb4 + FirebaseInstanceID: 9fbf536668f4d3f0880e7438456dabd1376e294b + FirebaseMessaging: 227406c05b0dc9290702d2e9f18ab5528f0c2cf2 + GoogleToolboxForMac: 8e329f1b599f2512c6b10676d45736bcc2cbbeb0 + nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3 + Protobuf: d582fecf68201eac3d79ed61369ef45734394b9c -PODFILE CHECKSUM: 49a15453d072b09c3f930a9bd96e706663ee516a +PODFILE CHECKSUM: 7da3cdef0167aa1d487941dc339cec90823c1e0a COCOAPODS: 1.2.0 diff --git a/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/project.pbxproj b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/project.pbxproj index e5182359..525300e1 100644 --- a/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/project.pbxproj +++ b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/project.pbxproj @@ -7,243 +7,714 @@ objects = { /* Begin PBXBuildFile section */ - 8B931F94A15CEC623D339DA3C38BE3A3 /* Pods-Stone Island-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F1E17C0998C78916667291BC7B0048B0 /* Pods-Stone Island-dummy.m */; }; - A236CF7DD81B48ADA6EC58CCD7C8704E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; + 0647C253E519B23BF00F8760959E8040 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; + 06EA5618BBFA6AF8E4DDB73C7C4BA304 /* GPBDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = ABDBCAF813D5B069AD91028508742BC2 /* GPBDictionary.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 07F4584CDC14D3C0087809A6AF499A8A /* GPBDictionary_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C8C2723080839DDB0C24FEDD0D73096 /* GPBDictionary_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0AED6A8FBEF7F5C59C7082B8E7716BE2 /* pb_decode.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F32BA3D0167408D03707E0C4EDBA4A6 /* pb_decode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0E6C0B324FDC9F887ED6952D78F63832 /* GPBMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 9251C49A032CCBDAE109D0A0CD2DD92E /* GPBMessage.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 0F1B2791257B17A57C2C988DBFDD3479 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; + 0FDCE787F3600CDAD6EFC5739E1AA05B /* Type.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A49C9D5CD03434E366BE7C82C206817 /* Type.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1274C1A10683C1EF753A6F63B88B22A8 /* Empty.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 72A904D3D8B863EED50A4A1E3FFADC0D /* Empty.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 154E5AB0C541CED05D795C6198947D27 /* GTMLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = A9F42493FCDAB7940BB6EEBACF55FD92 /* GTMLogger.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 18DBFCF3E4BF38749859732892001975 /* GPBUnknownField_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F1A5E09DC081BEC3AF27803E648E1367 /* GPBUnknownField_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1A30705C0F6112D32E1BBC55BBE14175 /* GPBCodedOutputStream_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = CBAC1AE6755D17C79F857D660B23B118 /* GPBCodedOutputStream_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1E46EC8AB8830A23FAC91E8547748BF5 /* pb_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6CCDD9C7666644E2535222D173D76CC1 /* pb_common.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1F9475B133DF15EE3A4D2DB9725EB19C /* Any.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = E84A0F52367C4369A4CD78E715FD3316 /* Any.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 235707BF17DFBAF20D3EBA2C9CDE7A5D /* SourceContext.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = A4F87C21CB7A6B68E245AB8373CE92F3 /* SourceContext.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 281A84BF7709A41E42AF0149B7731803 /* GPBUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 14DB8CD0793D1700939269B1162FC634 /* GPBUtilities.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 28B7761E1D77D96D267539A7B67188EA /* nanopb-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 103D9CA08917A78B44AC60345EE69379 /* nanopb-dummy.m */; }; + 2C91E23D3673543CE0B5F361886BE031 /* Any.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B1DD76026CC0D86BA2FD2A023EBF3B1 /* Any.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 2D3370592B46135A72AE93EA362734F0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; + 2E512CF056F21F18437211923BD16212 /* GPBUtilities_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 68E8F056DD0B8CDDCDF684A3A375FCC2 /* GPBUtilities_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2E705544DA43782F2EF8F9B76DC09B23 /* Wrappers.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = FE50E6A13848DC8387C0F2467E5BC858 /* Wrappers.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2F4855A4A74F962812BE2BD8968B98C6 /* GPBRootObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E1DD1E636FBF87375DD28325F85E9F9B /* GPBRootObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3A4DC7BFED8190AB641F8E4CF7FC346E /* Struct.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = D6A504923A8D53592A63719F6FF69A7C /* Struct.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3AFB8BB811B8E80909FAB57769F472CD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */; }; + 3B99FF094E9070F4E32B162FDA1F9E7D /* Type.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 265B5F2D8D23C8DAE5A2EC4C45482BB2 /* Type.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 3C811EF1E9F29B47C51B8623C1D74CDD /* GPBUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F444CCFE63D2832F35B8837ED408165 /* GPBUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 40211E4C8323543FE5EF9CA5AA0DFA82 /* Duration.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 6F2E775643AFE2BFF0D572961BBC381E /* Duration.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 4096BE5D0109CDDCA2E05DD09BDD2CEF /* Api.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C39A2A98031E5843DD0CC795958C690 /* Api.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 433CC4EB532672A6A0C63DA00980FBB9 /* GPBArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C72AF407EBF46522014F5E384F2DF2B /* GPBArray.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 48FD630E470639A90DDA3CE29FF0CBC0 /* SourceContext.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 10F4575D8B6A691A550472225DDF3F0F /* SourceContext.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 4E7D2BC06328DA8BB88DF7C7F340AD60 /* GPBDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = C6CC9FDA24E3A6607E12BFFEE4275B45 /* GPBDescriptor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4EB57F857ABFC21CA70870D06331CF7B /* GPBWellKnownTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = A5428F00BC2E563C54345DD10FBC64B9 /* GPBWellKnownTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4F3B33091D404CA169BC185B9E0D21F1 /* GPBBootstrap.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A608890EC1AF8EC42A14397D3A5894B /* GPBBootstrap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51BB00D08FC2DD9332A008BAC8B32E08 /* FieldMask.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 828B35BEFD155F90F6A506A514E9373D /* FieldMask.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 55EFD5140B18C3CA34208D7AFC9E86FD /* GPBDescriptor.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BF4A1DADA8860F20B2307BA21E0DDA7 /* GPBDescriptor.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 57F720FA78824B1AAC6C69B2945129EB /* Duration.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 115E69164EF7A408741D07C2086D2C25 /* Duration.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5ABA228A6D52AE9D77B0220DA93B0890 /* GPBExtensionRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 6FE2C2FC17101A63229827673FE63277 /* GPBExtensionRegistry.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 5B8F036F7FAAF35FE98CE3FBFF25D72F /* GoogleToolboxForMac-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F905482AB614EB3193EC09019806C5D /* GoogleToolboxForMac-dummy.m */; }; + 5D51F8B1E5E791FAEC0EB27F42B4A185 /* GPBCodedOutputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 58A83A189DC1BFBFAC7F399BB9751F14 /* GPBCodedOutputStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 65AA755CE72E6D6E615D08BD83BD9779 /* GPBUnknownFieldSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 99E63D80EC2BCAC4383FAB765DA50EC0 /* GPBUnknownFieldSet.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 6A5451E67CBAAED4E81995B58427A175 /* GTMNSData+zlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 83147647FF520FEBC086F33609ECA938 /* GTMNSData+zlib.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6DD3F4DC0C4B78F16D8B5483222960C2 /* GPBUnknownField.m in Sources */ = {isa = PBXBuildFile; fileRef = 8EB5760CCB2AC6808AD433F462BA5B40 /* GPBUnknownField.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 70D930DC0E09607E271BC92644FD3148 /* GPBWellKnownTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 7CD04E4A14DCEB9584A09B6CCAF0CCD4 /* GPBWellKnownTypes.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 718975DE6B138B102881C6EA729C528C /* GPBRootObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 4950A34F093D61FB39CE30CCADE17BBE /* GPBRootObject.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 735E8379480FB0A497F20C0DBAB001A8 /* GPBCodedInputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 40D25B6E40FCFF039CD02F31F19588B8 /* GPBCodedInputStream.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 742A96A6FA7E4FBDF6E4E30E35DA5401 /* Empty.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 346156D12F225C5435732E3752CE2FE8 /* Empty.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82210760F8AE48374FF44CD84DDE26B3 /* GPBArray_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4AE7E7D7FC01B98294A0293EF649BD95 /* GPBArray_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 82C84D6FE5FEA850158C62992BB2F04A /* GPBMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9315DD9048DB523B31C2B0B63880F185 /* GPBMessage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8306C748F95D1CB8517DB86AEBC5EDB2 /* Wrappers.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 35A06A6FAC89255798D0D4BD7AE185C5 /* Wrappers.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 8F6AB0DB092366C68D97CB82ADE8C25F /* GPBExtensionInternals.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E49413C1602C72986E35FE55B15AA9D /* GPBExtensionInternals.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + 90906AC58824566DFC6875E1ED25E855 /* GTMDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 8485EE3EE516E1C76E274ED63FD32675 /* GTMDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 91C9C419C2E304B3A68293C22053034E /* pb_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = FBA0788F3CA6A1FC7E1E87517F07ADD1 /* pb_encode.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc"; }; }; + 95A828668D0CA98280B2FE4460C47BCB /* GPBExtensionRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 094F1883B9081EA6E8925E8BB383CAE2 /* GPBExtensionRegistry.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 95EBDB5322C947499AF837A497FBA858 /* GPBUnknownFieldSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D11E9C49AAF09E786C50401B18C3DC4 /* GPBUnknownFieldSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9691896768E205041A357115F73B48F2 /* GPBRootObject_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 85161CE483D0D52918F3658155149F93 /* GPBRootObject_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9CBD14C17446EC9384CFAADBADF12387 /* pb_common.c in Sources */ = {isa = PBXBuildFile; fileRef = FB7C030E89839D647194E5CA2D2DF745 /* pb_common.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc -fno-objc-arc"; }; }; + A39A7F90321353E49D6165BAD53505B2 /* pb.h in Headers */ = {isa = PBXBuildFile; fileRef = C5F5070398EA6EBF049CB8770A127136 /* pb.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A54005EDF9897879D10F17422D728898 /* GPBArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 6500BB56ED633DA52D3173D059F8378D /* GPBArray.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A5E27928137D685764D7F5372A859084 /* Timestamp.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = EB57A28C36332095328E9BCE71ECC618 /* Timestamp.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + AF945DE2DD79B27639AF742A2299413B /* Protobuf-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F4217831202D96492E9AA5A8C1317D16 /* Protobuf-dummy.m */; }; + B1B8ED3C01A6C4547EA89D2F5435EB28 /* Timestamp.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 7180FC87E2294112BACEA059A5831595 /* Timestamp.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B634DF1B61B9160F34DFD78EB40DD338 /* Api.pbobjc.h in Headers */ = {isa = PBXBuildFile; fileRef = 12A858169F9A81AF89F6583B8E966025 /* Api.pbobjc.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B74707B2A658403F88AEAE407966702B /* GPBUnknownField.h in Headers */ = {isa = PBXBuildFile; fileRef = 8E9DF1F8DEF9920EC67FFDBBACE310D6 /* GPBUnknownField.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B7E7B505ADD52654621F00966DCB5648 /* GPBDescriptor_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 4240053415DBD5B52DBD9497BD0984FD /* GPBDescriptor_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B802B2DC2E4419ACE6417F15C34590D3 /* GPBWireFormat.m in Sources */ = {isa = PBXBuildFile; fileRef = 870C6D914891D286B54687025379F80A /* GPBWireFormat.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + C1A4B51D711A870B07AC596CDE259817 /* GPBProtocolBuffers.h in Headers */ = {isa = PBXBuildFile; fileRef = 22BA7C1126445EE94A49FE02FE9FFD6B /* GPBProtocolBuffers.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C2BD9301E51D9AA170B9F06EF9298E57 /* GPBCodedInputStream_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 493A2403E3A377D0C8D3B18E72BD9948 /* GPBCodedInputStream_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C52D8F26DF31AA2C69C446CDD9403FC1 /* FieldMask.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E7C6CABB305C6F18E115008557D510A /* FieldMask.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + C7035ADC5E16FE6C0307A34F25412DCF /* GPBCodedInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D645CF003B6E3608A32FF8B3EC5D589 /* GPBCodedInputStream.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + CAF12B2AD87ADB7A133D2871D176D9BF /* GPBCodedOutputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 3504481E0B537B019882F670155CDDA2 /* GPBCodedOutputStream.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + CC07B89F60EC592EEE1DCA97B8A9CD15 /* Struct.pbobjc.m in Sources */ = {isa = PBXBuildFile; fileRef = B77AE850AC471E6D53586C630AE90ACF /* Struct.pbobjc.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + CE5714147D8743429505895CEBFB3B83 /* GPBRuntimeTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 545A0FB5DF2C8FFCCF42EB58D5A81ED0 /* GPBRuntimeTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CE793643063B71F80F32F0851FDABFA5 /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E6187654126ABEF16075E772E203E1D /* GTMLogger.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + CE91D768A740F7A51FF9BC9AD27F4D89 /* GPBExtensionInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 15595CD747174AB281B75E0EC911F6E2 /* GPBExtensionInternals.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CEBCFD5FC51032FDD7490E4B2B6442B9 /* GPBWireFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 524B0176A9FCF760DD5807E536CD4F89 /* GPBWireFormat.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D02A9BE496DF996BBC92776E586BCAF8 /* pb_encode.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E70F2734E0CCB2FEA59727473D14D4 /* pb_encode.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D90547C165549C74E60CACF7933AA953 /* GPBUnknownFieldSet_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = F6DA253821905085377C5B375CF7B4C3 /* GPBUnknownFieldSet_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DC1EB86506781EA8B6BC2527F92FE208 /* Pods-StoneIsland-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FD21C7F69243BF47B85F20CBE1D04B8 /* Pods-StoneIsland-dummy.m */; }; + F0DBBCEE79434BC2C540DE83632044D3 /* GPBProtocolBuffers_RuntimeSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = BB19157342ADAC984C6ED234681CE8F7 /* GPBProtocolBuffers_RuntimeSupport.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F1B1695A6AB8AFEC306AB371F2DCA21F /* GTMNSData+zlib.m in Sources */ = {isa = PBXBuildFile; fileRef = 8CD49F4DAD4E018B49D62F07A50020C3 /* GTMNSData+zlib.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + F2A7C7D18755231B289C10D16DD6F730 /* pb_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = C1669FD3E74618D9183A1227FBBF4050 /* pb_decode.c */; settings = {COMPILER_FLAGS = "-fno-objc-arc -fno-objc-arc"; }; }; + F41D38A554BFFFF2D2C3AC034C60F36A /* GPBMessage_PackagePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = D7846CA9DBB7357D0A5145648AA01620 /* GPBMessage_PackagePrivate.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FC729CE1F5E9766BFD3C708E59875C20 /* GPBDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = D708F677F238A988C8234E48AC22776D /* GPBDictionary.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 89313E70FCDDFC3D9B5751AA692765F7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = CF4B35B9FC819386EB09219BC91827D7; + remoteInfo = nanopb; + }; + B79280E924D30541F578D522998E7103 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = FA9D13261AF395CF5D54BB3203DF2A6E; + remoteInfo = GoogleToolboxForMac; + }; + FA490077C5EE83FCA3176797D4BC5D71 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = F9A70823884613E915C45CF662FC6743; + remoteInfo = Protobuf; + }; +/* End PBXContainerItemProxy section */ + /* Begin PBXFileReference section */ - 0C86D2D78080EDCEE85A13AA1692ACD6 /* Pods-Stone Island.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Stone Island.release.xcconfig"; sourceTree = "<group>"; }; - 10B3D03939EC1F098DF4D390572E7A70 /* Pods-Stone Island-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-Stone Island-acknowledgements.markdown"; sourceTree = "<group>"; }; - 173B36DA9A5ED406088A50C1589B0B4E /* GGLInstanceID.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GGLInstanceID.h; path = Headers/Public/GGLInstanceID.h; sourceTree = "<group>"; }; - 2313F1DCFFF1A82931A5DF3F158D5DA3 /* Pods-Stone Island.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-Stone Island.debug.xcconfig"; sourceTree = "<group>"; }; - 36F75FFC47B4DBEB5982F58544A7B2FC /* GoogleInterchangeUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleInterchangeUtilities.framework; path = Frameworks/frameworks/GoogleInterchangeUtilities.framework; sourceTree = "<group>"; }; - 474CBC9EAF59DE318EE6611AAE5D0291 /* GoogleIPhoneUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleIPhoneUtilities.framework; path = Frameworks/GoogleIPhoneUtilities.framework; sourceTree = "<group>"; }; - 4A59C4528E6B71DFA7011DF095E0C8B8 /* GCMReceiverDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCMReceiverDelegate.h; path = Headers/Public/GCMReceiverDelegate.h; sourceTree = "<group>"; }; - 5890B2B91852CF430B0772AD7C3B4C2B /* Pods-Stone Island-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Stone Island-frameworks.sh"; sourceTree = "<group>"; }; - 6A055A93C3564E5CDA417C640324E176 /* GoogleUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleUtilities.framework; path = Frameworks/frameworks/GoogleUtilities.framework; sourceTree = "<group>"; }; - 6A52371D28A634057B785F5B581084AF /* GoogleSymbolUtilities.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleSymbolUtilities.framework; path = Frameworks/frameworks/GoogleSymbolUtilities.framework; sourceTree = "<group>"; }; - 8127A92CEFC4B6BC0D037BBDADA1B051 /* GGLInstanceIDConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GGLInstanceIDConfig.h; path = Headers/Public/GGLInstanceIDConfig.h; sourceTree = "<group>"; }; - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - A110B0A704D9AE1951A8F07D446042C1 /* Pods-Stone Island-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-Stone Island-resources.sh"; sourceTree = "<group>"; }; - B47CA48C3A76744553D639170A059DED /* Pods-Stone Island-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-Stone Island-acknowledgements.plist"; sourceTree = "<group>"; }; - BD469413B9D194472712F81C4C19217C /* GGLInstanceIDHeaders.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GGLInstanceIDHeaders.h; path = Headers/Public/GGLInstanceIDHeaders.h; sourceTree = "<group>"; }; - BD5E36BF0B6CBFDEC0927984332B535A /* GCMService.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCMService.h; path = Headers/Public/GCMService.h; sourceTree = "<group>"; }; + 094F1883B9081EA6E8925E8BB383CAE2 /* GPBExtensionRegistry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBExtensionRegistry.h; path = objectivec/GPBExtensionRegistry.h; sourceTree = "<group>"; }; + 0F444CCFE63D2832F35B8837ED408165 /* GPBUtilities.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBUtilities.h; path = objectivec/GPBUtilities.h; sourceTree = "<group>"; }; + 103D9CA08917A78B44AC60345EE69379 /* nanopb-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "nanopb-dummy.m"; sourceTree = "<group>"; }; + 10F4575D8B6A691A550472225DDF3F0F /* SourceContext.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = SourceContext.pbobjc.m; path = objectivec/google/protobuf/SourceContext.pbobjc.m; sourceTree = "<group>"; }; + 115E69164EF7A408741D07C2086D2C25 /* Duration.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Duration.pbobjc.h; path = objectivec/google/protobuf/Duration.pbobjc.h; sourceTree = "<group>"; }; + 12A858169F9A81AF89F6583B8E966025 /* Api.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Api.pbobjc.h; path = objectivec/google/protobuf/Api.pbobjc.h; sourceTree = "<group>"; }; + 14DB8CD0793D1700939269B1162FC634 /* GPBUtilities.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBUtilities.m; path = objectivec/GPBUtilities.m; sourceTree = "<group>"; }; + 15595CD747174AB281B75E0EC911F6E2 /* GPBExtensionInternals.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBExtensionInternals.h; path = objectivec/GPBExtensionInternals.h; sourceTree = "<group>"; }; + 192AB16212B37CEBDD9BD2D13A435C4A /* FirebaseNanoPB.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseNanoPB.framework; path = Frameworks/FirebaseNanoPB.framework; sourceTree = "<group>"; }; + 1F905482AB614EB3193EC09019806C5D /* GoogleToolboxForMac-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "GoogleToolboxForMac-dummy.m"; sourceTree = "<group>"; }; + 22BA7C1126445EE94A49FE02FE9FFD6B /* GPBProtocolBuffers.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBProtocolBuffers.h; path = objectivec/GPBProtocolBuffers.h; sourceTree = "<group>"; }; + 265B5F2D8D23C8DAE5A2EC4C45482BB2 /* Type.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Type.pbobjc.m; path = objectivec/google/protobuf/Type.pbobjc.m; sourceTree = "<group>"; }; + 2C72AF407EBF46522014F5E384F2DF2B /* GPBArray.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBArray.m; path = objectivec/GPBArray.m; sourceTree = "<group>"; }; + 2F32BA3D0167408D03707E0C4EDBA4A6 /* pb_decode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_decode.h; sourceTree = "<group>"; }; + 332F351B06982C59707C55462D6F28FE /* Pods-StoneIsland-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-StoneIsland-frameworks.sh"; sourceTree = "<group>"; }; + 346156D12F225C5435732E3752CE2FE8 /* Empty.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Empty.pbobjc.h; path = objectivec/google/protobuf/Empty.pbobjc.h; sourceTree = "<group>"; }; + 3504481E0B537B019882F670155CDDA2 /* GPBCodedOutputStream.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBCodedOutputStream.m; path = objectivec/GPBCodedOutputStream.m; sourceTree = "<group>"; }; + 35A06A6FAC89255798D0D4BD7AE185C5 /* Wrappers.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Wrappers.pbobjc.m; path = objectivec/google/protobuf/Wrappers.pbobjc.m; sourceTree = "<group>"; }; + 37C3721B617986ED4438605E5315D3F3 /* Pods-StoneIsland-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-StoneIsland-acknowledgements.markdown"; sourceTree = "<group>"; }; + 3BF4A1DADA8860F20B2307BA21E0DDA7 /* GPBDescriptor.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBDescriptor.m; path = objectivec/GPBDescriptor.m; sourceTree = "<group>"; }; + 3E49413C1602C72986E35FE55B15AA9D /* GPBExtensionInternals.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBExtensionInternals.m; path = objectivec/GPBExtensionInternals.m; sourceTree = "<group>"; }; + 40D25B6E40FCFF039CD02F31F19588B8 /* GPBCodedInputStream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBCodedInputStream.h; path = objectivec/GPBCodedInputStream.h; sourceTree = "<group>"; }; + 4240053415DBD5B52DBD9497BD0984FD /* GPBDescriptor_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBDescriptor_PackagePrivate.h; path = objectivec/GPBDescriptor_PackagePrivate.h; sourceTree = "<group>"; }; + 43351FEC3BCA8AB1743C40C96030E1C6 /* FirebaseMessaging.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseMessaging.framework; path = Frameworks/FirebaseMessaging.framework; sourceTree = "<group>"; }; + 45DE04F35C065C20F9213E57D5F936D5 /* GoogleToolboxForMac.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = GoogleToolboxForMac.xcconfig; sourceTree = "<group>"; }; + 493A2403E3A377D0C8D3B18E72BD9948 /* GPBCodedInputStream_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBCodedInputStream_PackagePrivate.h; path = objectivec/GPBCodedInputStream_PackagePrivate.h; sourceTree = "<group>"; }; + 4950A34F093D61FB39CE30CCADE17BBE /* GPBRootObject.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBRootObject.m; path = objectivec/GPBRootObject.m; sourceTree = "<group>"; }; + 4A49C9D5CD03434E366BE7C82C206817 /* Type.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Type.pbobjc.h; path = objectivec/google/protobuf/Type.pbobjc.h; sourceTree = "<group>"; }; + 4AE7E7D7FC01B98294A0293EF649BD95 /* GPBArray_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBArray_PackagePrivate.h; path = objectivec/GPBArray_PackagePrivate.h; sourceTree = "<group>"; }; + 4C8C2723080839DDB0C24FEDD0D73096 /* GPBDictionary_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBDictionary_PackagePrivate.h; path = objectivec/GPBDictionary_PackagePrivate.h; sourceTree = "<group>"; }; + 4E6187654126ABEF16075E772E203E1D /* GTMLogger.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GTMLogger.m; path = Foundation/GTMLogger.m; sourceTree = "<group>"; }; + 50B4982BCC4F07991409560B718F590C /* FirebaseCoreDiagnostics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseCoreDiagnostics.framework; path = Frameworks/FirebaseCoreDiagnostics.framework; sourceTree = "<group>"; }; + 524B0176A9FCF760DD5807E536CD4F89 /* GPBWireFormat.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBWireFormat.h; path = objectivec/GPBWireFormat.h; sourceTree = "<group>"; }; + 545A0FB5DF2C8FFCCF42EB58D5A81ED0 /* GPBRuntimeTypes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBRuntimeTypes.h; path = objectivec/GPBRuntimeTypes.h; sourceTree = "<group>"; }; + 5494FD6852D19AABAEC268A29AFEE091 /* libGoogleToolboxForMac.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libGoogleToolboxForMac.a; path = libGoogleToolboxForMac.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 54AA0B96ACDBAC3DB309CB7E326F5979 /* libPods-StoneIsland.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = "libPods-StoneIsland.a"; path = "libPods-StoneIsland.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 58A83A189DC1BFBFAC7F399BB9751F14 /* GPBCodedOutputStream.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBCodedOutputStream.h; path = objectivec/GPBCodedOutputStream.h; sourceTree = "<group>"; }; + 5B9EF4385DB7EA2E2DEE11B2B6DFE1A0 /* GoogleToolboxForMac-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "GoogleToolboxForMac-prefix.pch"; sourceTree = "<group>"; }; + 5D11E9C49AAF09E786C50401B18C3DC4 /* GPBUnknownFieldSet.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBUnknownFieldSet.h; path = objectivec/GPBUnknownFieldSet.h; sourceTree = "<group>"; }; + 6500BB56ED633DA52D3173D059F8378D /* GPBArray.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBArray.h; path = objectivec/GPBArray.h; sourceTree = "<group>"; }; + 68E8F056DD0B8CDDCDF684A3A375FCC2 /* GPBUtilities_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBUtilities_PackagePrivate.h; path = objectivec/GPBUtilities_PackagePrivate.h; sourceTree = "<group>"; }; + 6B1DD76026CC0D86BA2FD2A023EBF3B1 /* Any.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Any.pbobjc.m; path = objectivec/google/protobuf/Any.pbobjc.m; sourceTree = "<group>"; }; + 6CCDD9C7666644E2535222D173D76CC1 /* pb_common.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_common.h; sourceTree = "<group>"; }; + 6F2E775643AFE2BFF0D572961BBC381E /* Duration.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Duration.pbobjc.m; path = objectivec/google/protobuf/Duration.pbobjc.m; sourceTree = "<group>"; }; + 6FE2C2FC17101A63229827673FE63277 /* GPBExtensionRegistry.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBExtensionRegistry.m; path = objectivec/GPBExtensionRegistry.m; sourceTree = "<group>"; }; + 707C9893806D0AF5C957BC1EA76389CD /* Pods-StoneIsland.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-StoneIsland.debug.xcconfig"; sourceTree = "<group>"; }; + 7180FC87E2294112BACEA059A5831595 /* Timestamp.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Timestamp.pbobjc.h; path = objectivec/google/protobuf/Timestamp.pbobjc.h; sourceTree = "<group>"; }; + 72A904D3D8B863EED50A4A1E3FFADC0D /* Empty.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Empty.pbobjc.m; path = objectivec/google/protobuf/Empty.pbobjc.m; sourceTree = "<group>"; }; + 7CD04E4A14DCEB9584A09B6CCAF0CCD4 /* GPBWellKnownTypes.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBWellKnownTypes.m; path = objectivec/GPBWellKnownTypes.m; sourceTree = "<group>"; }; + 7D645CF003B6E3608A32FF8B3EC5D589 /* GPBCodedInputStream.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBCodedInputStream.m; path = objectivec/GPBCodedInputStream.m; sourceTree = "<group>"; }; + 828B35BEFD155F90F6A506A514E9373D /* FieldMask.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FieldMask.pbobjc.h; path = objectivec/google/protobuf/FieldMask.pbobjc.h; sourceTree = "<group>"; }; + 83147647FF520FEBC086F33609ECA938 /* GTMNSData+zlib.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "GTMNSData+zlib.h"; path = "Foundation/GTMNSData+zlib.h"; sourceTree = "<group>"; }; + 83A0814817308A9E12B255DA6AEFCF48 /* Pods-StoneIsland-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-StoneIsland-resources.sh"; sourceTree = "<group>"; }; + 83FF0A5AF2500AE469AE6047A4A795DD /* FirebaseInstanceID.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseInstanceID.framework; path = Frameworks/FirebaseInstanceID.framework; sourceTree = "<group>"; }; + 8485EE3EE516E1C76E274ED63FD32675 /* GTMDefines.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; }; + 85161CE483D0D52918F3658155149F93 /* GPBRootObject_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBRootObject_PackagePrivate.h; path = objectivec/GPBRootObject_PackagePrivate.h; sourceTree = "<group>"; }; + 870C6D914891D286B54687025379F80A /* GPBWireFormat.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBWireFormat.m; path = objectivec/GPBWireFormat.m; sourceTree = "<group>"; }; + 8A608890EC1AF8EC42A14397D3A5894B /* GPBBootstrap.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBBootstrap.h; path = objectivec/GPBBootstrap.h; sourceTree = "<group>"; }; + 8CD49F4DAD4E018B49D62F07A50020C3 /* GTMNSData+zlib.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "GTMNSData+zlib.m"; path = "Foundation/GTMNSData+zlib.m"; sourceTree = "<group>"; }; + 8E9DF1F8DEF9920EC67FFDBBACE310D6 /* GPBUnknownField.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBUnknownField.h; path = objectivec/GPBUnknownField.h; sourceTree = "<group>"; }; + 8EB5760CCB2AC6808AD433F462BA5B40 /* GPBUnknownField.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBUnknownField.m; path = objectivec/GPBUnknownField.m; sourceTree = "<group>"; }; + 8FD21C7F69243BF47B85F20CBE1D04B8 /* Pods-StoneIsland-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-StoneIsland-dummy.m"; sourceTree = "<group>"; }; + 9251C49A032CCBDAE109D0A0CD2DD92E /* GPBMessage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBMessage.m; path = objectivec/GPBMessage.m; sourceTree = "<group>"; }; + 9315DD9048DB523B31C2B0B63880F185 /* GPBMessage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBMessage.h; path = objectivec/GPBMessage.h; sourceTree = "<group>"; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 9837A32494666A348405234344442538 /* nanopb.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = nanopb.xcconfig; sourceTree = "<group>"; }; + 98A18E81D2E0C6AF12C4E040F92CEEE7 /* nanopb-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "nanopb-prefix.pch"; sourceTree = "<group>"; }; + 99E63D80EC2BCAC4383FAB765DA50EC0 /* GPBUnknownFieldSet.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBUnknownFieldSet.m; path = objectivec/GPBUnknownFieldSet.m; sourceTree = "<group>"; }; + 9C39A2A98031E5843DD0CC795958C690 /* Api.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Api.pbobjc.m; path = objectivec/google/protobuf/Api.pbobjc.m; sourceTree = "<group>"; }; + 9E7C6CABB305C6F18E115008557D510A /* FieldMask.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FieldMask.pbobjc.m; path = objectivec/google/protobuf/FieldMask.pbobjc.m; sourceTree = "<group>"; }; + A4F87C21CB7A6B68E245AB8373CE92F3 /* SourceContext.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = SourceContext.pbobjc.h; path = objectivec/google/protobuf/SourceContext.pbobjc.h; sourceTree = "<group>"; }; + A5428F00BC2E563C54345DD10FBC64B9 /* GPBWellKnownTypes.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBWellKnownTypes.h; path = objectivec/GPBWellKnownTypes.h; sourceTree = "<group>"; }; + A5E70F2734E0CCB2FEA59727473D14D4 /* pb_encode.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb_encode.h; sourceTree = "<group>"; }; + A9F42493FCDAB7940BB6EEBACF55FD92 /* GTMLogger.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GTMLogger.h; path = Foundation/GTMLogger.h; sourceTree = "<group>"; }; + AB849A3B20B1D6F36CB5887317E2E5DC /* Pods-StoneIsland-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-StoneIsland-acknowledgements.plist"; sourceTree = "<group>"; }; + ABDBCAF813D5B069AD91028508742BC2 /* GPBDictionary.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBDictionary.h; path = objectivec/GPBDictionary.h; sourceTree = "<group>"; }; + B77AE850AC471E6D53586C630AE90ACF /* Struct.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Struct.pbobjc.m; path = objectivec/google/protobuf/Struct.pbobjc.m; sourceTree = "<group>"; }; + BB19157342ADAC984C6ED234681CE8F7 /* GPBProtocolBuffers_RuntimeSupport.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBProtocolBuffers_RuntimeSupport.h; path = objectivec/GPBProtocolBuffers_RuntimeSupport.h; sourceTree = "<group>"; }; + C1669FD3E74618D9183A1227FBBF4050 /* pb_decode.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_decode.c; sourceTree = "<group>"; }; + C5F5070398EA6EBF049CB8770A127136 /* pb.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = pb.h; sourceTree = "<group>"; }; + C6CC9FDA24E3A6607E12BFFEE4275B45 /* GPBDescriptor.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBDescriptor.h; path = objectivec/GPBDescriptor.h; sourceTree = "<group>"; }; + C800FF121673E4829ABFA19BE8476A1F /* libProtobuf.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libProtobuf.a; path = libProtobuf.a; sourceTree = BUILT_PRODUCTS_DIR; }; + CBAC1AE6755D17C79F857D660B23B118 /* GPBCodedOutputStream_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBCodedOutputStream_PackagePrivate.h; path = objectivec/GPBCodedOutputStream_PackagePrivate.h; sourceTree = "<group>"; }; CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - D6448B738D0F834A89872ACF4F33A1AA /* libGGLInstanceIDLib.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libGGLInstanceIDLib.a; path = Libraries/libGGLInstanceIDLib.a; sourceTree = "<group>"; }; - E04BE7A3CBD84DBAA76FC51758B7CED6 /* GCMConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCMConfig.h; path = Headers/Public/GCMConfig.h; sourceTree = "<group>"; }; - E7C2BA0DA51EB36ED5DB61FE0CD57F36 /* libPods-Stone Island.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Stone Island.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - EA6ECB7498639194EA9C76AA5A5335AA /* GCMPubSub.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GCMPubSub.h; path = Headers/Public/GCMPubSub.h; sourceTree = "<group>"; }; - EE0A605C9B1A1EA6221D258D4E528AD7 /* GGLInstanceIDDelegate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GGLInstanceIDDelegate.h; path = Headers/Public/GGLInstanceIDDelegate.h; sourceTree = "<group>"; }; - EEFE0B43B6BEB77AB2B72163776B3431 /* libGcmLib.a */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = archive.ar; name = libGcmLib.a; path = Libraries/libGcmLib.a; sourceTree = "<group>"; }; - F1E17C0998C78916667291BC7B0048B0 /* Pods-Stone Island-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-Stone Island-dummy.m"; sourceTree = "<group>"; }; - F3E864806D6F83145EA52D163BA1A423 /* GoogleCloudMessaging.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GoogleCloudMessaging.h; path = Headers/Public/GoogleCloudMessaging.h; sourceTree = "<group>"; }; + D14C72DFF05FD8FE1851FC0A56D82A35 /* Pods-StoneIsland.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-StoneIsland.release.xcconfig"; sourceTree = "<group>"; }; + D6A504923A8D53592A63719F6FF69A7C /* Struct.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Struct.pbobjc.h; path = objectivec/google/protobuf/Struct.pbobjc.h; sourceTree = "<group>"; }; + D708F677F238A988C8234E48AC22776D /* GPBDictionary.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GPBDictionary.m; path = objectivec/GPBDictionary.m; sourceTree = "<group>"; }; + D7846CA9DBB7357D0A5145648AA01620 /* GPBMessage_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBMessage_PackagePrivate.h; path = objectivec/GPBMessage_PackagePrivate.h; sourceTree = "<group>"; }; + E1DD1E636FBF87375DD28325F85E9F9B /* GPBRootObject.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBRootObject.h; path = objectivec/GPBRootObject.h; sourceTree = "<group>"; }; + E4C8A849B8401F02161470ADD18F89E7 /* Protobuf-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Protobuf-prefix.pch"; sourceTree = "<group>"; }; + E84A0F52367C4369A4CD78E715FD3316 /* Any.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Any.pbobjc.h; path = objectivec/google/protobuf/Any.pbobjc.h; sourceTree = "<group>"; }; + EB57A28C36332095328E9BCE71ECC618 /* Timestamp.pbobjc.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = Timestamp.pbobjc.m; path = objectivec/google/protobuf/Timestamp.pbobjc.m; sourceTree = "<group>"; }; + EE724C0FB5B767C81BF0D53C09FEFDBE /* libnanopb.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libnanopb.a; path = libnanopb.a; sourceTree = BUILT_PRODUCTS_DIR; }; + F1A5E09DC081BEC3AF27803E648E1367 /* GPBUnknownField_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBUnknownField_PackagePrivate.h; path = objectivec/GPBUnknownField_PackagePrivate.h; sourceTree = "<group>"; }; + F411F93549CC18B1041B6089FD7D6328 /* FirebaseCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseCore.framework; path = Frameworks/FirebaseCore.framework; sourceTree = "<group>"; }; + F4217831202D96492E9AA5A8C1317D16 /* Protobuf-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Protobuf-dummy.m"; sourceTree = "<group>"; }; + F6DA253821905085377C5B375CF7B4C3 /* GPBUnknownFieldSet_PackagePrivate.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = GPBUnknownFieldSet_PackagePrivate.h; path = objectivec/GPBUnknownFieldSet_PackagePrivate.h; sourceTree = "<group>"; }; + F89A42940C946E790697D23E21C634DA /* Protobuf.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Protobuf.xcconfig; sourceTree = "<group>"; }; + FB1E980B5EEC2800E922D5076A11EFA7 /* FirebaseAnalytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FirebaseAnalytics.framework; path = Frameworks/FirebaseAnalytics.framework; sourceTree = "<group>"; }; + FB7C030E89839D647194E5CA2D2DF745 /* pb_common.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_common.c; sourceTree = "<group>"; }; + FBA0788F3CA6A1FC7E1E87517F07ADD1 /* pb_encode.c */ = {isa = PBXFileReference; includeInIndex = 1; path = pb_encode.c; sourceTree = "<group>"; }; + FE50E6A13848DC8387C0F2467E5BC858 /* Wrappers.pbobjc.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Wrappers.pbobjc.h; path = objectivec/google/protobuf/Wrappers.pbobjc.h; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 4393326EAD1C0D0F9AECF9FC78E6DAD8 /* Frameworks */ = { + 0DF10DEF0FBD645F1DB384329EEC1A7F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0647C253E519B23BF00F8760959E8040 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 423E61FCA73DACBD4EF2A0128489B7A1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0F1B2791257B17A57C2C988DBFDD3479 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6AD215334409363FBBC48E48118C5C62 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 2D3370592B46135A72AE93EA362734F0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 94EB8A8937D61E8CED1F3C819230AE4D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A236CF7DD81B48ADA6EC58CCD7C8704E /* Foundation.framework in Frameworks */, + 3AFB8BB811B8E80909FAB57769F472CD /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 121A86CC4AAF79B70266B959308D3CA7 /* Pods */ = { + 004912157DF4BDCD49123543CE0FF6DD /* Defines */ = { isa = PBXGroup; children = ( - 3758E30E87F41188A58D53252E8DC67F /* GGLInstanceID */, - F52CA7A5CDCB3F8FEAEAD0AD400F9313 /* GoogleCloudMessaging */, - 5E3943FF863A867D4D99F3E17093D9D7 /* GoogleInterchangeUtilities */, - 9DCD9E1660319E9727375653D3EBBA13 /* GoogleIPhoneUtilities */, - BBD88AD6F1DF792566DB101E1D7A50AB /* GoogleSymbolUtilities */, - 736A89F858E6E6D5DDEC5BBDA2E1C51B /* GoogleUtilities */, + 8485EE3EE516E1C76E274ED63FD32675 /* GTMDefines.h */, + ); + name = Defines; + sourceTree = "<group>"; + }; + 02DF76F9E94957693ACE8ABD38E93426 /* nanopb */ = { + isa = PBXGroup; + children = ( + C5F5070398EA6EBF049CB8770A127136 /* pb.h */, + FB7C030E89839D647194E5CA2D2DF745 /* pb_common.c */, + 6CCDD9C7666644E2535222D173D76CC1 /* pb_common.h */, + C1669FD3E74618D9183A1227FBBF4050 /* pb_decode.c */, + 2F32BA3D0167408D03707E0C4EDBA4A6 /* pb_decode.h */, + FBA0788F3CA6A1FC7E1E87517F07ADD1 /* pb_encode.c */, + A5E70F2734E0CCB2FEA59727473D14D4 /* pb_encode.h */, + 58DE47AAAC06564307E7255D1B5E1D62 /* decode */, + 4475247DC75238DBB0E37086D31D3363 /* encode */, + FA0ADBF3B95DD4DD510DA2EF9D9B0B9A /* Support Files */, + ); + name = nanopb; + path = nanopb; + sourceTree = "<group>"; + }; + 11914593C579DC3B903834F9370FDE0C /* Pods */ = { + isa = PBXGroup; + children = ( + 2CCC828646DB6E2832930EA338092B5C /* FirebaseAnalytics */, + D322B836323040BCA8E139D202457EBA /* FirebaseCore */, + 55ACDAF2E6E0245F2ABA46141FF54B0D /* FirebaseInstanceID */, + 5F1C6D3FD3BF644DCE67E28E83281951 /* FirebaseMessaging */, + 543B9265B46C52AA018AC9B5349C1A41 /* GoogleToolboxForMac */, + 02DF76F9E94957693ACE8ABD38E93426 /* nanopb */, + EAC896EC3C2A716D21A44F458CB64190 /* Protobuf */, ); name = Pods; sourceTree = "<group>"; }; - 2FD026630DDFF013082B2945DB20B798 /* Frameworks */ = { + 21FD76479585CF6ADCFBF61ED1315196 /* Logger */ = { isa = PBXGroup; children = ( - 474CBC9EAF59DE318EE6611AAE5D0291 /* GoogleIPhoneUtilities.framework */, + A9F42493FCDAB7940BB6EEBACF55FD92 /* GTMLogger.h */, + 4E6187654126ABEF16075E772E203E1D /* GTMLogger.m */, + ); + name = Logger; + sourceTree = "<group>"; + }; + 2201A4F92BCC4567C0DB2C680592833A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 43351FEC3BCA8AB1743C40C96030E1C6 /* FirebaseMessaging.framework */, ); name = Frameworks; sourceTree = "<group>"; }; - 3758E30E87F41188A58D53252E8DC67F /* GGLInstanceID */ = { + 2CCC828646DB6E2832930EA338092B5C /* FirebaseAnalytics */ = { isa = PBXGroup; children = ( - 173B36DA9A5ED406088A50C1589B0B4E /* GGLInstanceID.h */, - 8127A92CEFC4B6BC0D037BBDADA1B051 /* GGLInstanceIDConfig.h */, - EE0A605C9B1A1EA6221D258D4E528AD7 /* GGLInstanceIDDelegate.h */, - BD469413B9D194472712F81C4C19217C /* GGLInstanceIDHeaders.h */, - FEEE277DB90FD41AA0B77E6258108DFB /* Frameworks */, + AC4F8E9E10982FDB105BC8855C8D52CD /* Frameworks */, ); - path = GGLInstanceID; + name = FirebaseAnalytics; + path = FirebaseAnalytics; sourceTree = "<group>"; }; - 5E3943FF863A867D4D99F3E17093D9D7 /* GoogleInterchangeUtilities */ = { + 4475247DC75238DBB0E37086D31D3363 /* encode */ = { isa = PBXGroup; children = ( - CAFDBEDBC9861619C5BC0B5A525B32E5 /* Frameworks */, ); - path = GoogleInterchangeUtilities; + name = encode; sourceTree = "<group>"; }; - 736A89F858E6E6D5DDEC5BBDA2E1C51B /* GoogleUtilities */ = { + 4628802902B2FF79E0AD76BAEF165D70 /* NSData+zlib */ = { isa = PBXGroup; children = ( - E8A2173F40F6AA192DD2A76C1203C416 /* Frameworks */, + 83147647FF520FEBC086F33609ECA938 /* GTMNSData+zlib.h */, + 8CD49F4DAD4E018B49D62F07A50020C3 /* GTMNSData+zlib.m */, ); - path = GoogleUtilities; + name = "NSData+zlib"; sourceTree = "<group>"; }; - 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */ = { + 4E7C20D5868C2B19766F4704869D5E65 /* Targets Support Files */ = { isa = PBXGroup; children = ( - CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */, + 515275DE96CD1856C5310428721524B6 /* Pods-StoneIsland */, ); - name = iOS; + name = "Targets Support Files"; sourceTree = "<group>"; }; - 7DB346D0F39D3F0E887471402A8071AB = { + 515275DE96CD1856C5310428721524B6 /* Pods-StoneIsland */ = { isa = PBXGroup; children = ( - 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, - 121A86CC4AAF79B70266B959308D3CA7 /* Pods */, - EA7DD587FC2EAD1ECAA75B2850B62903 /* Products */, - 838A3B364ADE24D6443C58DDBACFF0C2 /* Targets Support Files */, + 37C3721B617986ED4438605E5315D3F3 /* Pods-StoneIsland-acknowledgements.markdown */, + AB849A3B20B1D6F36CB5887317E2E5DC /* Pods-StoneIsland-acknowledgements.plist */, + 8FD21C7F69243BF47B85F20CBE1D04B8 /* Pods-StoneIsland-dummy.m */, + 332F351B06982C59707C55462D6F28FE /* Pods-StoneIsland-frameworks.sh */, + 83A0814817308A9E12B255DA6AEFCF48 /* Pods-StoneIsland-resources.sh */, + 707C9893806D0AF5C957BC1EA76389CD /* Pods-StoneIsland.debug.xcconfig */, + D14C72DFF05FD8FE1851FC0A56D82A35 /* Pods-StoneIsland.release.xcconfig */, ); + name = "Pods-StoneIsland"; + path = "Target Support Files/Pods-StoneIsland"; sourceTree = "<group>"; }; - 838A3B364ADE24D6443C58DDBACFF0C2 /* Targets Support Files */ = { + 543B9265B46C52AA018AC9B5349C1A41 /* GoogleToolboxForMac */ = { isa = PBXGroup; children = ( - BA3FA15D22651C0425DF92E8A2A4517F /* Pods-Stone Island */, + 004912157DF4BDCD49123543CE0FF6DD /* Defines */, + 21FD76479585CF6ADCFBF61ED1315196 /* Logger */, + 4628802902B2FF79E0AD76BAEF165D70 /* NSData+zlib */, + B4A3391D3ABAF454717C12C6AFD946A0 /* Support Files */, ); - name = "Targets Support Files"; + name = GoogleToolboxForMac; + path = GoogleToolboxForMac; sourceTree = "<group>"; }; - 9DCD9E1660319E9727375653D3EBBA13 /* GoogleIPhoneUtilities */ = { + 55ACDAF2E6E0245F2ABA46141FF54B0D /* FirebaseInstanceID */ = { isa = PBXGroup; children = ( - 2FD026630DDFF013082B2945DB20B798 /* Frameworks */, + 5EBBA78CDFF493B4DA3AC46DE5C89650 /* Frameworks */, ); - path = GoogleIPhoneUtilities; + name = FirebaseInstanceID; + path = FirebaseInstanceID; sourceTree = "<group>"; }; - A770D2EDC6FA25DCD787792DF757FA50 /* Frameworks */ = { + 58DE47AAAC06564307E7255D1B5E1D62 /* decode */ = { isa = PBXGroup; children = ( - EEFE0B43B6BEB77AB2B72163776B3431 /* libGcmLib.a */, ); - name = Frameworks; + name = decode; sourceTree = "<group>"; }; - B9E958B53590711D484747E648D2BBAF /* Frameworks */ = { + 5EBBA78CDFF493B4DA3AC46DE5C89650 /* Frameworks */ = { isa = PBXGroup; children = ( - 6A52371D28A634057B785F5B581084AF /* GoogleSymbolUtilities.framework */, + 83FF0A5AF2500AE469AE6047A4A795DD /* FirebaseInstanceID.framework */, ); name = Frameworks; sourceTree = "<group>"; }; - BA3FA15D22651C0425DF92E8A2A4517F /* Pods-Stone Island */ = { + 5F1C6D3FD3BF644DCE67E28E83281951 /* FirebaseMessaging */ = { isa = PBXGroup; children = ( - 10B3D03939EC1F098DF4D390572E7A70 /* Pods-Stone Island-acknowledgements.markdown */, - B47CA48C3A76744553D639170A059DED /* Pods-Stone Island-acknowledgements.plist */, - F1E17C0998C78916667291BC7B0048B0 /* Pods-Stone Island-dummy.m */, - 5890B2B91852CF430B0772AD7C3B4C2B /* Pods-Stone Island-frameworks.sh */, - A110B0A704D9AE1951A8F07D446042C1 /* Pods-Stone Island-resources.sh */, - 2313F1DCFFF1A82931A5DF3F158D5DA3 /* Pods-Stone Island.debug.xcconfig */, - 0C86D2D78080EDCEE85A13AA1692ACD6 /* Pods-Stone Island.release.xcconfig */, + 2201A4F92BCC4567C0DB2C680592833A /* Frameworks */, ); - name = "Pods-Stone Island"; - path = "Target Support Files/Pods-Stone Island"; + name = FirebaseMessaging; + path = FirebaseMessaging; sourceTree = "<group>"; }; - BBD88AD6F1DF792566DB101E1D7A50AB /* GoogleSymbolUtilities */ = { + 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */ = { isa = PBXGroup; children = ( - B9E958B53590711D484747E648D2BBAF /* Frameworks */, + CBB3DE36805AF21409EC968A9691732F /* Foundation.framework */, ); - path = GoogleSymbolUtilities; + name = iOS; sourceTree = "<group>"; }; - BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { + 7DB346D0F39D3F0E887471402A8071AB = { isa = PBXGroup; children = ( - 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */, + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, + 11914593C579DC3B903834F9370FDE0C /* Pods */, + DCF83F6BE02C10D712FFB70D4EB58472 /* Products */, + 4E7C20D5868C2B19766F4704869D5E65 /* Targets Support Files */, ); - name = Frameworks; sourceTree = "<group>"; }; - CAFDBEDBC9861619C5BC0B5A525B32E5 /* Frameworks */ = { + 913723635DAAA7A06D7A25B98CE48726 /* Support Files */ = { + isa = PBXGroup; + children = ( + F89A42940C946E790697D23E21C634DA /* Protobuf.xcconfig */, + F4217831202D96492E9AA5A8C1317D16 /* Protobuf-dummy.m */, + E4C8A849B8401F02161470ADD18F89E7 /* Protobuf-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/Protobuf"; + sourceTree = "<group>"; + }; + AC4F8E9E10982FDB105BC8855C8D52CD /* Frameworks */ = { isa = PBXGroup; children = ( - 36F75FFC47B4DBEB5982F58544A7B2FC /* GoogleInterchangeUtilities.framework */, + FB1E980B5EEC2800E922D5076A11EFA7 /* FirebaseAnalytics.framework */, ); name = Frameworks; sourceTree = "<group>"; }; - E8A2173F40F6AA192DD2A76C1203C416 /* Frameworks */ = { + B4A3391D3ABAF454717C12C6AFD946A0 /* Support Files */ = { + isa = PBXGroup; + children = ( + 45DE04F35C065C20F9213E57D5F936D5 /* GoogleToolboxForMac.xcconfig */, + 1F905482AB614EB3193EC09019806C5D /* GoogleToolboxForMac-dummy.m */, + 5B9EF4385DB7EA2E2DEE11B2B6DFE1A0 /* GoogleToolboxForMac-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/GoogleToolboxForMac"; + sourceTree = "<group>"; + }; + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { isa = PBXGroup; children = ( - 6A055A93C3564E5CDA417C640324E176 /* GoogleUtilities.framework */, + 7531C8F8DE19F1AA3C8A7AC97A91DC29 /* iOS */, ); name = Frameworks; sourceTree = "<group>"; }; - EA7DD587FC2EAD1ECAA75B2850B62903 /* Products */ = { + D322B836323040BCA8E139D202457EBA /* FirebaseCore */ = { isa = PBXGroup; children = ( - E7C2BA0DA51EB36ED5DB61FE0CD57F36 /* libPods-Stone Island.a */, + E04C7679B4512CF8CDD79D4392692C6C /* Frameworks */, ); - name = Products; + name = FirebaseCore; + path = FirebaseCore; sourceTree = "<group>"; }; - F52CA7A5CDCB3F8FEAEAD0AD400F9313 /* GoogleCloudMessaging */ = { + DCF83F6BE02C10D712FFB70D4EB58472 /* Products */ = { isa = PBXGroup; children = ( - E04BE7A3CBD84DBAA76FC51758B7CED6 /* GCMConfig.h */, - EA6ECB7498639194EA9C76AA5A5335AA /* GCMPubSub.h */, - 4A59C4528E6B71DFA7011DF095E0C8B8 /* GCMReceiverDelegate.h */, - BD5E36BF0B6CBFDEC0927984332B535A /* GCMService.h */, - F3E864806D6F83145EA52D163BA1A423 /* GoogleCloudMessaging.h */, - A770D2EDC6FA25DCD787792DF757FA50 /* Frameworks */, + 5494FD6852D19AABAEC268A29AFEE091 /* libGoogleToolboxForMac.a */, + EE724C0FB5B767C81BF0D53C09FEFDBE /* libnanopb.a */, + 54AA0B96ACDBAC3DB309CB7E326F5979 /* libPods-StoneIsland.a */, + C800FF121673E4829ABFA19BE8476A1F /* libProtobuf.a */, ); - path = GoogleCloudMessaging; + name = Products; sourceTree = "<group>"; }; - FEEE277DB90FD41AA0B77E6258108DFB /* Frameworks */ = { + E04C7679B4512CF8CDD79D4392692C6C /* Frameworks */ = { isa = PBXGroup; children = ( - D6448B738D0F834A89872ACF4F33A1AA /* libGGLInstanceIDLib.a */, + F411F93549CC18B1041B6089FD7D6328 /* FirebaseCore.framework */, + 50B4982BCC4F07991409560B718F590C /* FirebaseCoreDiagnostics.framework */, + 192AB16212B37CEBDD9BD2D13A435C4A /* FirebaseNanoPB.framework */, ); name = Frameworks; sourceTree = "<group>"; }; + EAC896EC3C2A716D21A44F458CB64190 /* Protobuf */ = { + isa = PBXGroup; + children = ( + E84A0F52367C4369A4CD78E715FD3316 /* Any.pbobjc.h */, + 6B1DD76026CC0D86BA2FD2A023EBF3B1 /* Any.pbobjc.m */, + 12A858169F9A81AF89F6583B8E966025 /* Api.pbobjc.h */, + 9C39A2A98031E5843DD0CC795958C690 /* Api.pbobjc.m */, + 115E69164EF7A408741D07C2086D2C25 /* Duration.pbobjc.h */, + 6F2E775643AFE2BFF0D572961BBC381E /* Duration.pbobjc.m */, + 346156D12F225C5435732E3752CE2FE8 /* Empty.pbobjc.h */, + 72A904D3D8B863EED50A4A1E3FFADC0D /* Empty.pbobjc.m */, + 828B35BEFD155F90F6A506A514E9373D /* FieldMask.pbobjc.h */, + 9E7C6CABB305C6F18E115008557D510A /* FieldMask.pbobjc.m */, + 6500BB56ED633DA52D3173D059F8378D /* GPBArray.h */, + 2C72AF407EBF46522014F5E384F2DF2B /* GPBArray.m */, + 4AE7E7D7FC01B98294A0293EF649BD95 /* GPBArray_PackagePrivate.h */, + 8A608890EC1AF8EC42A14397D3A5894B /* GPBBootstrap.h */, + 40D25B6E40FCFF039CD02F31F19588B8 /* GPBCodedInputStream.h */, + 7D645CF003B6E3608A32FF8B3EC5D589 /* GPBCodedInputStream.m */, + 493A2403E3A377D0C8D3B18E72BD9948 /* GPBCodedInputStream_PackagePrivate.h */, + 58A83A189DC1BFBFAC7F399BB9751F14 /* GPBCodedOutputStream.h */, + 3504481E0B537B019882F670155CDDA2 /* GPBCodedOutputStream.m */, + CBAC1AE6755D17C79F857D660B23B118 /* GPBCodedOutputStream_PackagePrivate.h */, + C6CC9FDA24E3A6607E12BFFEE4275B45 /* GPBDescriptor.h */, + 3BF4A1DADA8860F20B2307BA21E0DDA7 /* GPBDescriptor.m */, + 4240053415DBD5B52DBD9497BD0984FD /* GPBDescriptor_PackagePrivate.h */, + ABDBCAF813D5B069AD91028508742BC2 /* GPBDictionary.h */, + D708F677F238A988C8234E48AC22776D /* GPBDictionary.m */, + 4C8C2723080839DDB0C24FEDD0D73096 /* GPBDictionary_PackagePrivate.h */, + 15595CD747174AB281B75E0EC911F6E2 /* GPBExtensionInternals.h */, + 3E49413C1602C72986E35FE55B15AA9D /* GPBExtensionInternals.m */, + 094F1883B9081EA6E8925E8BB383CAE2 /* GPBExtensionRegistry.h */, + 6FE2C2FC17101A63229827673FE63277 /* GPBExtensionRegistry.m */, + 9315DD9048DB523B31C2B0B63880F185 /* GPBMessage.h */, + 9251C49A032CCBDAE109D0A0CD2DD92E /* GPBMessage.m */, + D7846CA9DBB7357D0A5145648AA01620 /* GPBMessage_PackagePrivate.h */, + 22BA7C1126445EE94A49FE02FE9FFD6B /* GPBProtocolBuffers.h */, + BB19157342ADAC984C6ED234681CE8F7 /* GPBProtocolBuffers_RuntimeSupport.h */, + E1DD1E636FBF87375DD28325F85E9F9B /* GPBRootObject.h */, + 4950A34F093D61FB39CE30CCADE17BBE /* GPBRootObject.m */, + 85161CE483D0D52918F3658155149F93 /* GPBRootObject_PackagePrivate.h */, + 545A0FB5DF2C8FFCCF42EB58D5A81ED0 /* GPBRuntimeTypes.h */, + 8E9DF1F8DEF9920EC67FFDBBACE310D6 /* GPBUnknownField.h */, + 8EB5760CCB2AC6808AD433F462BA5B40 /* GPBUnknownField.m */, + F1A5E09DC081BEC3AF27803E648E1367 /* GPBUnknownField_PackagePrivate.h */, + 5D11E9C49AAF09E786C50401B18C3DC4 /* GPBUnknownFieldSet.h */, + 99E63D80EC2BCAC4383FAB765DA50EC0 /* GPBUnknownFieldSet.m */, + F6DA253821905085377C5B375CF7B4C3 /* GPBUnknownFieldSet_PackagePrivate.h */, + 0F444CCFE63D2832F35B8837ED408165 /* GPBUtilities.h */, + 14DB8CD0793D1700939269B1162FC634 /* GPBUtilities.m */, + 68E8F056DD0B8CDDCDF684A3A375FCC2 /* GPBUtilities_PackagePrivate.h */, + A5428F00BC2E563C54345DD10FBC64B9 /* GPBWellKnownTypes.h */, + 7CD04E4A14DCEB9584A09B6CCAF0CCD4 /* GPBWellKnownTypes.m */, + 524B0176A9FCF760DD5807E536CD4F89 /* GPBWireFormat.h */, + 870C6D914891D286B54687025379F80A /* GPBWireFormat.m */, + A4F87C21CB7A6B68E245AB8373CE92F3 /* SourceContext.pbobjc.h */, + 10F4575D8B6A691A550472225DDF3F0F /* SourceContext.pbobjc.m */, + D6A504923A8D53592A63719F6FF69A7C /* Struct.pbobjc.h */, + B77AE850AC471E6D53586C630AE90ACF /* Struct.pbobjc.m */, + 7180FC87E2294112BACEA059A5831595 /* Timestamp.pbobjc.h */, + EB57A28C36332095328E9BCE71ECC618 /* Timestamp.pbobjc.m */, + 4A49C9D5CD03434E366BE7C82C206817 /* Type.pbobjc.h */, + 265B5F2D8D23C8DAE5A2EC4C45482BB2 /* Type.pbobjc.m */, + FE50E6A13848DC8387C0F2467E5BC858 /* Wrappers.pbobjc.h */, + 35A06A6FAC89255798D0D4BD7AE185C5 /* Wrappers.pbobjc.m */, + 913723635DAAA7A06D7A25B98CE48726 /* Support Files */, + ); + name = Protobuf; + path = Protobuf; + sourceTree = "<group>"; + }; + FA0ADBF3B95DD4DD510DA2EF9D9B0B9A /* Support Files */ = { + isa = PBXGroup; + children = ( + 9837A32494666A348405234344442538 /* nanopb.xcconfig */, + 103D9CA08917A78B44AC60345EE69379 /* nanopb-dummy.m */, + 98A18E81D2E0C6AF12C4E040F92CEEE7 /* nanopb-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/nanopb"; + sourceTree = "<group>"; + }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 415602F8A9DBEBD1D27A9E32DCED6B85 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 1F9475B133DF15EE3A4D2DB9725EB19C /* Any.pbobjc.h in Headers */, + B634DF1B61B9160F34DFD78EB40DD338 /* Api.pbobjc.h in Headers */, + 57F720FA78824B1AAC6C69B2945129EB /* Duration.pbobjc.h in Headers */, + 742A96A6FA7E4FBDF6E4E30E35DA5401 /* Empty.pbobjc.h in Headers */, + 51BB00D08FC2DD9332A008BAC8B32E08 /* FieldMask.pbobjc.h in Headers */, + A54005EDF9897879D10F17422D728898 /* GPBArray.h in Headers */, + 82210760F8AE48374FF44CD84DDE26B3 /* GPBArray_PackagePrivate.h in Headers */, + 4F3B33091D404CA169BC185B9E0D21F1 /* GPBBootstrap.h in Headers */, + 735E8379480FB0A497F20C0DBAB001A8 /* GPBCodedInputStream.h in Headers */, + C2BD9301E51D9AA170B9F06EF9298E57 /* GPBCodedInputStream_PackagePrivate.h in Headers */, + 5D51F8B1E5E791FAEC0EB27F42B4A185 /* GPBCodedOutputStream.h in Headers */, + 1A30705C0F6112D32E1BBC55BBE14175 /* GPBCodedOutputStream_PackagePrivate.h in Headers */, + 4E7D2BC06328DA8BB88DF7C7F340AD60 /* GPBDescriptor.h in Headers */, + B7E7B505ADD52654621F00966DCB5648 /* GPBDescriptor_PackagePrivate.h in Headers */, + 06EA5618BBFA6AF8E4DDB73C7C4BA304 /* GPBDictionary.h in Headers */, + 07F4584CDC14D3C0087809A6AF499A8A /* GPBDictionary_PackagePrivate.h in Headers */, + CE91D768A740F7A51FF9BC9AD27F4D89 /* GPBExtensionInternals.h in Headers */, + 95A828668D0CA98280B2FE4460C47BCB /* GPBExtensionRegistry.h in Headers */, + 82C84D6FE5FEA850158C62992BB2F04A /* GPBMessage.h in Headers */, + F41D38A554BFFFF2D2C3AC034C60F36A /* GPBMessage_PackagePrivate.h in Headers */, + C1A4B51D711A870B07AC596CDE259817 /* GPBProtocolBuffers.h in Headers */, + F0DBBCEE79434BC2C540DE83632044D3 /* GPBProtocolBuffers_RuntimeSupport.h in Headers */, + 2F4855A4A74F962812BE2BD8968B98C6 /* GPBRootObject.h in Headers */, + 9691896768E205041A357115F73B48F2 /* GPBRootObject_PackagePrivate.h in Headers */, + CE5714147D8743429505895CEBFB3B83 /* GPBRuntimeTypes.h in Headers */, + B74707B2A658403F88AEAE407966702B /* GPBUnknownField.h in Headers */, + 18DBFCF3E4BF38749859732892001975 /* GPBUnknownField_PackagePrivate.h in Headers */, + 95EBDB5322C947499AF837A497FBA858 /* GPBUnknownFieldSet.h in Headers */, + D90547C165549C74E60CACF7933AA953 /* GPBUnknownFieldSet_PackagePrivate.h in Headers */, + 3C811EF1E9F29B47C51B8623C1D74CDD /* GPBUtilities.h in Headers */, + 2E512CF056F21F18437211923BD16212 /* GPBUtilities_PackagePrivate.h in Headers */, + 4EB57F857ABFC21CA70870D06331CF7B /* GPBWellKnownTypes.h in Headers */, + CEBCFD5FC51032FDD7490E4B2B6442B9 /* GPBWireFormat.h in Headers */, + 235707BF17DFBAF20D3EBA2C9CDE7A5D /* SourceContext.pbobjc.h in Headers */, + 3A4DC7BFED8190AB641F8E4CF7FC346E /* Struct.pbobjc.h in Headers */, + B1B8ED3C01A6C4547EA89D2F5435EB28 /* Timestamp.pbobjc.h in Headers */, + 0FDCE787F3600CDAD6EFC5739E1AA05B /* Type.pbobjc.h in Headers */, + 2E705544DA43782F2EF8F9B76DC09B23 /* Wrappers.pbobjc.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 49EE04F5125849E644783C89F23AA9F9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A39A7F90321353E49D6165BAD53505B2 /* pb.h in Headers */, + 1E46EC8AB8830A23FAC91E8547748BF5 /* pb_common.h in Headers */, + 0AED6A8FBEF7F5C59C7082B8E7716BE2 /* pb_decode.h in Headers */, + D02A9BE496DF996BBC92776E586BCAF8 /* pb_encode.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 53AC353E7DDDB2167D1AB17676628071 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 90906AC58824566DFC6875E1ED25E855 /* GTMDefines.h in Headers */, + 154E5AB0C541CED05D795C6198947D27 /* GTMLogger.h in Headers */, + 6A5451E67CBAAED4E81995B58427A175 /* GTMNSData+zlib.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ - 270B46424A6E550E1583E7A97AAD265A /* Pods-Stone Island */ = { + C20B93BBE33BE89B57C7F37F2E8AF723 /* Pods-StoneIsland */ = { isa = PBXNativeTarget; - buildConfigurationList = BD1D1A57A9121FF061B86F474E27AA5E /* Build configuration list for PBXNativeTarget "Pods-Stone Island" */; + buildConfigurationList = B85E6CBC67507B91ABD4366801761BC5 /* Build configuration list for PBXNativeTarget "Pods-StoneIsland" */; buildPhases = ( - 04C4D2FB97E65104032C84BA808D29B0 /* Sources */, - 4393326EAD1C0D0F9AECF9FC78E6DAD8 /* Frameworks */, + 2B0F2BBAD9E05BCA14CEA71DE9A2E324 /* Sources */, + 423E61FCA73DACBD4EF2A0128489B7A1 /* Frameworks */, ); buildRules = ( ); dependencies = ( + 6FC761A5597CA44CBE23CCA747737793 /* PBXTargetDependency */, + CA1B348590890ACBA15FE05A64E635EB /* PBXTargetDependency */, + 86DF05762E2C54B4EC0EA8716B18624B /* PBXTargetDependency */, ); - name = "Pods-Stone Island"; - productName = "Pods-Stone Island"; - productReference = E7C2BA0DA51EB36ED5DB61FE0CD57F36 /* libPods-Stone Island.a */; + name = "Pods-StoneIsland"; + productName = "Pods-StoneIsland"; + productReference = 54AA0B96ACDBAC3DB309CB7E326F5979 /* libPods-StoneIsland.a */; + productType = "com.apple.product-type.library.static"; + }; + CF4B35B9FC819386EB09219BC91827D7 /* nanopb */ = { + isa = PBXNativeTarget; + buildConfigurationList = B8307E997A097EB50C00A8C7967B858A /* Build configuration list for PBXNativeTarget "nanopb" */; + buildPhases = ( + 5303D5F0966B6798D7AAA88A9ACCB670 /* Sources */, + 94EB8A8937D61E8CED1F3C819230AE4D /* Frameworks */, + 49EE04F5125849E644783C89F23AA9F9 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = nanopb; + productName = nanopb; + productReference = EE724C0FB5B767C81BF0D53C09FEFDBE /* libnanopb.a */; + productType = "com.apple.product-type.library.static"; + }; + F9A70823884613E915C45CF662FC6743 /* Protobuf */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4A02D863F292513E84DE87A706FBC0BD /* Build configuration list for PBXNativeTarget "Protobuf" */; + buildPhases = ( + 8918B8D5C599091E63DE4915FB13CC61 /* Sources */, + 0DF10DEF0FBD645F1DB384329EEC1A7F /* Frameworks */, + 415602F8A9DBEBD1D27A9E32DCED6B85 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Protobuf; + productName = Protobuf; + productReference = C800FF121673E4829ABFA19BE8476A1F /* libProtobuf.a */; + productType = "com.apple.product-type.library.static"; + }; + FA9D13261AF395CF5D54BB3203DF2A6E /* GoogleToolboxForMac */ = { + isa = PBXNativeTarget; + buildConfigurationList = 94A6FD8AAC113A69F57982237B2DDA0F /* Build configuration list for PBXNativeTarget "GoogleToolboxForMac" */; + buildPhases = ( + B311E4867662945861847843827DB0EB /* Sources */, + 6AD215334409363FBBC48E48118C5C62 /* Frameworks */, + 53AC353E7DDDB2167D1AB17676628071 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GoogleToolboxForMac; + productName = GoogleToolboxForMac; + productReference = 5494FD6852D19AABAEC268A29AFEE091 /* libGoogleToolboxForMac.a */; productType = "com.apple.product-type.library.static"; }; /* End PBXNativeTarget section */ @@ -253,7 +724,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0700; }; buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; @@ -263,26 +734,103 @@ en, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = EA7DD587FC2EAD1ECAA75B2850B62903 /* Products */; + productRefGroup = DCF83F6BE02C10D712FFB70D4EB58472 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 270B46424A6E550E1583E7A97AAD265A /* Pods-Stone Island */, + FA9D13261AF395CF5D54BB3203DF2A6E /* GoogleToolboxForMac */, + CF4B35B9FC819386EB09219BC91827D7 /* nanopb */, + C20B93BBE33BE89B57C7F37F2E8AF723 /* Pods-StoneIsland */, + F9A70823884613E915C45CF662FC6743 /* Protobuf */, ); }; /* End PBXProject section */ /* Begin PBXSourcesBuildPhase section */ - 04C4D2FB97E65104032C84BA808D29B0 /* Sources */ = { + 2B0F2BBAD9E05BCA14CEA71DE9A2E324 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DC1EB86506781EA8B6BC2527F92FE208 /* Pods-StoneIsland-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5303D5F0966B6798D7AAA88A9ACCB670 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28B7761E1D77D96D267539A7B67188EA /* nanopb-dummy.m in Sources */, + 9CBD14C17446EC9384CFAADBADF12387 /* pb_common.c in Sources */, + F2A7C7D18755231B289C10D16DD6F730 /* pb_decode.c in Sources */, + 91C9C419C2E304B3A68293C22053034E /* pb_encode.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8918B8D5C599091E63DE4915FB13CC61 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8B931F94A15CEC623D339DA3C38BE3A3 /* Pods-Stone Island-dummy.m in Sources */, + 2C91E23D3673543CE0B5F361886BE031 /* Any.pbobjc.m in Sources */, + 4096BE5D0109CDDCA2E05DD09BDD2CEF /* Api.pbobjc.m in Sources */, + 40211E4C8323543FE5EF9CA5AA0DFA82 /* Duration.pbobjc.m in Sources */, + 1274C1A10683C1EF753A6F63B88B22A8 /* Empty.pbobjc.m in Sources */, + C52D8F26DF31AA2C69C446CDD9403FC1 /* FieldMask.pbobjc.m in Sources */, + 433CC4EB532672A6A0C63DA00980FBB9 /* GPBArray.m in Sources */, + C7035ADC5E16FE6C0307A34F25412DCF /* GPBCodedInputStream.m in Sources */, + CAF12B2AD87ADB7A133D2871D176D9BF /* GPBCodedOutputStream.m in Sources */, + 55EFD5140B18C3CA34208D7AFC9E86FD /* GPBDescriptor.m in Sources */, + FC729CE1F5E9766BFD3C708E59875C20 /* GPBDictionary.m in Sources */, + 8F6AB0DB092366C68D97CB82ADE8C25F /* GPBExtensionInternals.m in Sources */, + 5ABA228A6D52AE9D77B0220DA93B0890 /* GPBExtensionRegistry.m in Sources */, + 0E6C0B324FDC9F887ED6952D78F63832 /* GPBMessage.m in Sources */, + 718975DE6B138B102881C6EA729C528C /* GPBRootObject.m in Sources */, + 6DD3F4DC0C4B78F16D8B5483222960C2 /* GPBUnknownField.m in Sources */, + 65AA755CE72E6D6E615D08BD83BD9779 /* GPBUnknownFieldSet.m in Sources */, + 281A84BF7709A41E42AF0149B7731803 /* GPBUtilities.m in Sources */, + 70D930DC0E09607E271BC92644FD3148 /* GPBWellKnownTypes.m in Sources */, + B802B2DC2E4419ACE6417F15C34590D3 /* GPBWireFormat.m in Sources */, + AF945DE2DD79B27639AF742A2299413B /* Protobuf-dummy.m in Sources */, + 48FD630E470639A90DDA3CE29FF0CBC0 /* SourceContext.pbobjc.m in Sources */, + CC07B89F60EC592EEE1DCA97B8A9CD15 /* Struct.pbobjc.m in Sources */, + A5E27928137D685764D7F5372A859084 /* Timestamp.pbobjc.m in Sources */, + 3B99FF094E9070F4E32B162FDA1F9E7D /* Type.pbobjc.m in Sources */, + 8306C748F95D1CB8517DB86AEBC5EDB2 /* Wrappers.pbobjc.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B311E4867662945861847843827DB0EB /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5B8F036F7FAAF35FE98CE3FBFF25D72F /* GoogleToolboxForMac-dummy.m in Sources */, + CE793643063B71F80F32F0851FDABFA5 /* GTMLogger.m in Sources */, + F1B1695A6AB8AFEC306AB371F2DCA21F /* GTMNSData+zlib.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 6FC761A5597CA44CBE23CCA747737793 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = GoogleToolboxForMac; + target = FA9D13261AF395CF5D54BB3203DF2A6E /* GoogleToolboxForMac */; + targetProxy = B79280E924D30541F578D522998E7103 /* PBXContainerItemProxy */; + }; + 86DF05762E2C54B4EC0EA8716B18624B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = nanopb; + target = CF4B35B9FC819386EB09219BC91827D7 /* nanopb */; + targetProxy = 89313E70FCDDFC3D9B5751AA692765F7 /* PBXContainerItemProxy */; + }; + CA1B348590890ACBA15FE05A64E635EB /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Protobuf; + target = F9A70823884613E915C45CF662FC6743 /* Protobuf */; + targetProxy = FA490077C5EE83FCA3176797D4BC5D71 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin XCBuildConfiguration section */ 015A368F878AC3E2CEAE21DDE8026304 /* Debug */ = { isa = XCBuildConfiguration; @@ -293,30 +841,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_DEBUG=1", @@ -338,6 +876,29 @@ }; name = Debug; }; + 1C0DED43560AC5E69790FF5BED5899C3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9837A32494666A348405234344442538 /* nanopb.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/nanopb/nanopb-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; 44CDBB6D11DE06DB64D6268622BDC47E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -347,29 +908,19 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGNING_REQUIRED = NO; COPY_PHASE_STRIP = YES; ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "POD_CONFIGURATION_RELEASE=1", "$(inherited)", @@ -388,9 +939,32 @@ }; name = Release; }; - 5B7429374B6EEABBFC1E1EABA7B4556D /* Debug */ = { + 9D5185848EB0524743F60EDF09571F59 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2313F1DCFFF1A82931A5DF3F158D5DA3 /* Pods-Stone Island.debug.xcconfig */; + baseConfigurationReference = 9837A32494666A348405234344442538 /* nanopb.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/nanopb/nanopb-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 4.3; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + BAABE11BE801433DFB7EE52C0B6F15F7 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 707C9893806D0AF5C957BC1EA76389CD /* Pods-StoneIsland.debug.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -411,9 +985,101 @@ }; name = Debug; }; - B2C80873CD55005750F481B734E9380D /* Release */ = { + BE31CE5A4CEE30B7760F0A29A8109B34 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 45DE04F35C065C20F9213E57D5F936D5 /* GoogleToolboxForMac.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + C092DBBB18598FF1BD4BE64AFEB7D78F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 45DE04F35C065C20F9213E57D5F936D5 /* GoogleToolboxForMac.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 5.0; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + C5F5A4163E3B3B48DE22C7FB329E9BD9 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F89A42940C946E790697D23E21C634DA /* Protobuf.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Protobuf/Protobuf-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + D6076FDF5A27B101E0D533C8651C55BF /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0C86D2D78080EDCEE85A13AA1692ACD6 /* Pods-Stone Island.release.xcconfig */; + baseConfigurationReference = F89A42940C946E790697D23E21C634DA /* Protobuf.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/Protobuf/Protobuf-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRIVATE_HEADERS_FOLDER_PATH = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + PUBLIC_HEADERS_FOLDER_PATH = ""; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + F0BCB59EFD77D93A613CB7450005FD40 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D14C72DFF05FD8FE1851FC0A56D82A35 /* Pods-StoneIsland.release.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -446,11 +1112,38 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - BD1D1A57A9121FF061B86F474E27AA5E /* Build configuration list for PBXNativeTarget "Pods-Stone Island" */ = { + 4A02D863F292513E84DE87A706FBC0BD /* Build configuration list for PBXNativeTarget "Protobuf" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C5F5A4163E3B3B48DE22C7FB329E9BD9 /* Debug */, + D6076FDF5A27B101E0D533C8651C55BF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 94A6FD8AAC113A69F57982237B2DDA0F /* Build configuration list for PBXNativeTarget "GoogleToolboxForMac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C092DBBB18598FF1BD4BE64AFEB7D78F /* Debug */, + BE31CE5A4CEE30B7760F0A29A8109B34 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B8307E997A097EB50C00A8C7967B858A /* Build configuration list for PBXNativeTarget "nanopb" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1C0DED43560AC5E69790FF5BED5899C3 /* Debug */, + 9D5185848EB0524743F60EDF09571F59 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + B85E6CBC67507B91ABD4366801761BC5 /* Build configuration list for PBXNativeTarget "Pods-StoneIsland" */ = { isa = XCConfigurationList; buildConfigurations = ( - 5B7429374B6EEABBFC1E1EABA7B4556D /* Debug */, - B2C80873CD55005750F481B734E9380D /* Release */, + BAABE11BE801433DFB7EE52C0B6F15F7 /* Debug */, + F0BCB59EFD77D93A613CB7450005FD40 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Pods-Stone Island.xcscheme b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/GoogleToolboxForMac.xcscheme index 657aefac..6399589c 100644 --- a/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Pods-Stone Island.xcscheme +++ b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/GoogleToolboxForMac.xcscheme @@ -1,67 +1,54 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0900" + LastUpgradeVersion = "0700" version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry + buildForAnalyzing = "YES" buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" - buildForArchiving = "YES" - buildForAnalyzing = "YES"> + buildForArchiving = "YES"> <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "270B46424A6E550E1583E7A97AAD265A" - BuildableName = "libPods-Stone Island.a" - BlueprintName = "Pods-Stone Island" - ReferencedContainer = "container:Pods.xcodeproj"> + BuildableIdentifier = 'primary' + BlueprintIdentifier = 'FA9D13261AF395CF5D54BB3203DF2A6E' + BlueprintName = 'GoogleToolboxForMac' + ReferencedContainer = 'container:Pods.xcodeproj' + BuildableName = 'libGoogleToolboxForMac.a'> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction - buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" - shouldUseLaunchSchemeArgsEnv = "YES"> - <Testables> - </Testables> + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> <AdditionalOptions> </AdditionalOptions> </TestAction> <LaunchAction - buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + buildConfiguration = "Debug" allowLocationSimulation = "YES"> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "270B46424A6E550E1583E7A97AAD265A" - BuildableName = "libPods-Stone Island.a" - BlueprintName = "Pods-Stone Island" - ReferencedContainer = "container:Pods.xcodeproj"> - </BuildableReference> - </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction - buildConfiguration = "Release" - shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" - debugDocumentVersioning = "YES"> + debugDocumentVersioning = "YES" + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES"> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> diff --git a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/CordovaLib.xcscheme b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Pods-StoneIsland.xcscheme index 311aaa19..648a868d 100644 --- a/StoneIsland/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/CordovaLib.xcscheme +++ b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Pods-StoneIsland.xcscheme @@ -1,76 +1,54 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0900" + LastUpgradeVersion = "0700" version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry + buildForAnalyzing = "YES" buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" - buildForArchiving = "YES" - buildForAnalyzing = "YES"> + buildForArchiving = "YES"> <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "D2AAC07D0554694100DB518D" - BuildableName = "libCordova.a" - BlueprintName = "CordovaLib" - ReferencedContainer = "container:CordovaLib.xcodeproj"> + BuildableIdentifier = 'primary' + BlueprintIdentifier = 'C20B93BBE33BE89B57C7F37F2E8AF723' + BlueprintName = 'Pods-StoneIsland' + ReferencedContainer = 'container:Pods.xcodeproj' + BuildableName = 'libPods-StoneIsland.a'> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction - buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" - shouldUseLaunchSchemeArgsEnv = "YES"> - <Testables> - </Testables> + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> <AdditionalOptions> </AdditionalOptions> </TestAction> <LaunchAction - buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + buildConfiguration = "Debug" allowLocationSimulation = "YES"> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "D2AAC07D0554694100DB518D" - BuildableName = "libCordova.a" - BlueprintName = "CordovaLib" - ReferencedContainer = "container:CordovaLib.xcodeproj"> - </BuildableReference> - </MacroExpansion> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction - buildConfiguration = "Release" - shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" - debugDocumentVersioning = "YES"> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "D2AAC07D0554694100DB518D" - BuildableName = "libCordova.a" - BlueprintName = "CordovaLib" - ReferencedContainer = "container:CordovaLib.xcodeproj"> - </BuildableReference> - </MacroExpansion> + debugDocumentVersioning = "YES" + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES"> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> diff --git a/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Protobuf.xcscheme b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Protobuf.xcscheme new file mode 100644 index 00000000..3cce8f22 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Protobuf.xcscheme @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0700" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForAnalyzing = "YES" + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES"> + <BuildableReference + BuildableIdentifier = 'primary' + BlueprintIdentifier = 'F9A70823884613E915C45CF662FC6743' + BlueprintName = 'Protobuf' + ReferencedContainer = 'container:Pods.xcodeproj' + BuildableName = 'libProtobuf.a'> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <AdditionalOptions> + </AdditionalOptions> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + buildConfiguration = "Debug" + allowLocationSimulation = "YES"> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES" + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES"> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/nanopb.xcscheme b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/nanopb.xcscheme new file mode 100644 index 00000000..774ee13f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/nanopb.xcscheme @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0700" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForAnalyzing = "YES" + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES"> + <BuildableReference + BuildableIdentifier = 'primary' + BlueprintIdentifier = 'CF4B35B9FC819386EB09219BC91827D7' + BlueprintName = 'nanopb' + ReferencedContainer = 'container:Pods.xcodeproj' + BuildableName = 'libnanopb.a'> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <AdditionalOptions> + </AdditionalOptions> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + debugServiceExtension = "internal" + buildConfiguration = "Debug" + allowLocationSimulation = "YES"> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + debugDocumentVersioning = "YES" + buildConfiguration = "Release" + shouldUseLaunchSchemeArgsEnv = "YES"> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> diff --git a/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist index 81fa4088..6c1460aa 100644 --- a/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/StoneIsland/platforms/ios/Pods/Pods.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -4,19 +4,36 @@ <dict> <key>SchemeUserState</key> <dict> - <key>Pods-Stone Island.xcscheme</key> + <key>GoogleToolboxForMac.xcscheme</key> <dict> <key>isShown</key> <false/> + <key>orderHint</key> + <integer>1</integer> </dict> - </dict> - <key>SuppressBuildableAutocreation</key> - <dict> - <key>270B46424A6E550E1583E7A97AAD265A</key> + <key>Pods-StoneIsland.xcscheme</key> + <dict> + <key>isShown</key> + <false/> + <key>orderHint</key> + <integer>3</integer> + </dict> + <key>Protobuf.xcscheme</key> <dict> - <key>primary</key> - <true/> + <key>isShown</key> + <false/> + <key>orderHint</key> + <integer>4</integer> + </dict> + <key>nanopb.xcscheme</key> + <dict> + <key>isShown</key> + <false/> + <key>orderHint</key> + <integer>2</integer> </dict> </dict> + <key>SuppressBuildableAutocreation</key> + <dict/> </dict> </plist> diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/LICENSE b/StoneIsland/platforms/ios/Pods/Protobuf/LICENSE new file mode 100644 index 00000000..f028c823 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/LICENSE @@ -0,0 +1,42 @@ +This license applies to all parts of Protocol Buffers except the following: + + - Atomicops support for generic gcc, located in + src/google/protobuf/stubs/atomicops_internals_generic_gcc.h. + This file is copyrighted by Red Hat Inc. + + - Atomicops support for AIX/POWER, located in + src/google/protobuf/stubs/atomicops_internals_power.h. + This file is copyrighted by Bloomberg Finance LP. + +Copyright 2014, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/README.md b/StoneIsland/platforms/ios/Pods/Protobuf/README.md new file mode 100644 index 00000000..b26e5424 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/README.md @@ -0,0 +1,77 @@ +Protocol Buffers - Google's data interchange format +=================================================== + +[](https://travis-ci.org/google/protobuf) [](https://ci.appveyor.com/project/protobuf/protobuf) [](https://grpc-testing.appspot.com/job/protobuf_branch) [](https://grpc-testing.appspot.com/job/protobuf_branch_32) [](http://ci.bazel.io/job/protobuf/) + +Copyright 2008 Google Inc. + +https://developers.google.com/protocol-buffers/ + +Overview +-------- + +Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, +platform-neutral, extensible mechanism for serializing structured data. You +can find [protobuf's documentation on the Google Developers site](https://developers.google.com/protocol-buffers/). + +This README file contains protobuf installation instructions. To install +protobuf, you need to install the protocol compiler (used to compile .proto +files) and the protobuf runtime for your chosen programming language. + +Protocol Compiler Installation +------------------------------ + +The protocol compiler is written in C++. If you are using C++, please follow +the [C++ Installation Instructions](src/README.md) to install protoc along +with the C++ runtime. + +For non-C++ users, the simplest way to install the protocol compiler is to +download a pre-built binary from our release page: + + [https://github.com/google/protobuf/releases](https://github.com/google/protobuf/releases) + +In the downloads section of each release, you can find pre-built binaries in +zip packages: protoc-$VERSION-$PLATFORM.zip. It contains the protoc binary +as well as a set of standard .proto files distributed along with protobuf. + +If you are looking for an old version that is not available in the release +page, check out the maven repo here: + + [http://repo1.maven.org/maven2/com/google/protobuf/protoc/](http://repo1.maven.org/maven2/com/google/protobuf/protoc/) + +These pre-built binaries are only provided for released versions. If you want +to use the github master version at HEAD, or you need to modify protobuf code, +or you are using C++, it's recommended to build your own protoc binary from +source. + +If you would like to build protoc binary from source, see the [C++ Installation +Instructions](src/README.md). + +Protobuf Runtime Installation +----------------------------- + +Protobuf supports several different programming languages. For each programming +language, you can find instructions in the corresponding source directory about +how to install protobuf runtime for that specific language: + +| Language | Source | +|--------------------------------------|-------------------------------------------------------| +| C++ (include C++ runtime and protoc) | [src](src) | +| Java | [java](java) | +| Python | [python](python) | +| Objective-C | [objectivec](objectivec) | +| C# | [csharp](csharp) | +| JavaNano | [javanano](javanano) | +| JavaScript | [js](js) | +| Ruby | [ruby](ruby) | +| Go | [golang/protobuf](https://github.com/golang/protobuf) | +| PHP | [php](php) | + + +Usage +----- + +The complete documentation for Protocol Buffers is available via the +web at: + +https://developers.google.com/protocol-buffers/ diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray.h new file mode 100644 index 00000000..638b2882 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray.h @@ -0,0 +1,1967 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBRuntimeTypes.h" + +NS_ASSUME_NONNULL_BEGIN + +//%PDDM-EXPAND DECLARE_ARRAYS() +// This block of code is generated, do not edit it directly. + +#pragma mark - Int32 + +/** + * Class used for repeated fields of int32_t values. This performs better than + * boxing into NSNumbers in NSArrays. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32Array : NSObject <NSCopying> + +/** The number of elements contained in the array. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty GPBInt32Array. + **/ ++ (instancetype)array; + +/** + * Creates and initializes a GPBInt32Array with the single element given. + * + * @param value The value to be placed in the array. + * + * @return A newly instanced GPBInt32Array with value in it. + **/ ++ (instancetype)arrayWithValue:(int32_t)value; + +/** + * Creates and initializes a GPBInt32Array with the contents of the given + * array. + * + * @param array Array with the contents to be put into the new array. + * + * @return A newly instanced GPBInt32Array with the contents of array. + **/ ++ (instancetype)arrayWithValueArray:(GPBInt32Array *)array; + +/** + * Creates and initializes a GPBInt32Array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly instanced GPBInt32Array with a capacity of count. + **/ ++ (instancetype)arrayWithCapacity:(NSUInteger)count; + +/** + * @return A newly initialized and empty GPBInt32Array. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializes the array, copying the given values. + * + * @param values An array with the values to put inside this array. + * @param count The number of elements to copy into the array. + * + * @return A newly initialized GPBInt32Array with a copy of the values. + **/ +- (instancetype)initWithValues:(const int32_t [__nullable])values + count:(NSUInteger)count; + +/** + * Initializes the array, copying the given values. + * + * @param array An array with the values to put inside this array. + * + * @return A newly initialized GPBInt32Array with a copy of the values. + **/ +- (instancetype)initWithValueArray:(GPBInt32Array *)array; + +/** + * Initializes the array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly initialized GPBInt32Array with a capacity of count. + **/ +- (instancetype)initWithCapacity:(NSUInteger)count; + +/** + * Gets the value at the given index. + * + * @param index The index of the value to get. + * + * @return The value at the given index. + **/ +- (int32_t)valueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Adds a value to this array. + * + * @param value The value to add to this array. + **/ +- (void)addValue:(int32_t)value; + +/** + * Adds values to this array. + * + * @param values The values to add to this array. + * @param count The number of elements to add. + **/ +- (void)addValues:(const int32_t [__nullable])values count:(NSUInteger)count; + +/** + * Adds the values from the given array to this array. + * + * @param array The array containing the elements to add to this array. + **/ +- (void)addValuesFromArray:(GPBInt32Array *)array; + +/** + * Inserts a value into the given position. + * + * @param value The value to add to this array. + * @param index The index into which to insert the value. + **/ +- (void)insertValue:(int32_t)value atIndex:(NSUInteger)index; + +/** + * Replaces the value at the given index with the given value. + * + * @param index The index for which to replace the value. + * @param value The value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int32_t)value; + +/** + * Removes the value at the given index. + * + * @param index The index of the value to remove. + **/ +- (void)removeValueAtIndex:(NSUInteger)index; + +/** + * Removes all the values from this array. + **/ +- (void)removeAll; + +/** + * Exchanges the values between the given indexes. + * + * @param idx1 The index of the first element to exchange. + * @param idx2 The index of the second element to exchange. + **/ +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2; + +@end + +#pragma mark - UInt32 + +/** + * Class used for repeated fields of uint32_t values. This performs better than + * boxing into NSNumbers in NSArrays. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32Array : NSObject <NSCopying> + +/** The number of elements contained in the array. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty GPBUInt32Array. + **/ ++ (instancetype)array; + +/** + * Creates and initializes a GPBUInt32Array with the single element given. + * + * @param value The value to be placed in the array. + * + * @return A newly instanced GPBUInt32Array with value in it. + **/ ++ (instancetype)arrayWithValue:(uint32_t)value; + +/** + * Creates and initializes a GPBUInt32Array with the contents of the given + * array. + * + * @param array Array with the contents to be put into the new array. + * + * @return A newly instanced GPBUInt32Array with the contents of array. + **/ ++ (instancetype)arrayWithValueArray:(GPBUInt32Array *)array; + +/** + * Creates and initializes a GPBUInt32Array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly instanced GPBUInt32Array with a capacity of count. + **/ ++ (instancetype)arrayWithCapacity:(NSUInteger)count; + +/** + * @return A newly initialized and empty GPBUInt32Array. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializes the array, copying the given values. + * + * @param values An array with the values to put inside this array. + * @param count The number of elements to copy into the array. + * + * @return A newly initialized GPBUInt32Array with a copy of the values. + **/ +- (instancetype)initWithValues:(const uint32_t [__nullable])values + count:(NSUInteger)count; + +/** + * Initializes the array, copying the given values. + * + * @param array An array with the values to put inside this array. + * + * @return A newly initialized GPBUInt32Array with a copy of the values. + **/ +- (instancetype)initWithValueArray:(GPBUInt32Array *)array; + +/** + * Initializes the array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly initialized GPBUInt32Array with a capacity of count. + **/ +- (instancetype)initWithCapacity:(NSUInteger)count; + +/** + * Gets the value at the given index. + * + * @param index The index of the value to get. + * + * @return The value at the given index. + **/ +- (uint32_t)valueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithBlock:(void (^)(uint32_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(uint32_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Adds a value to this array. + * + * @param value The value to add to this array. + **/ +- (void)addValue:(uint32_t)value; + +/** + * Adds values to this array. + * + * @param values The values to add to this array. + * @param count The number of elements to add. + **/ +- (void)addValues:(const uint32_t [__nullable])values count:(NSUInteger)count; + +/** + * Adds the values from the given array to this array. + * + * @param array The array containing the elements to add to this array. + **/ +- (void)addValuesFromArray:(GPBUInt32Array *)array; + +/** + * Inserts a value into the given position. + * + * @param value The value to add to this array. + * @param index The index into which to insert the value. + **/ +- (void)insertValue:(uint32_t)value atIndex:(NSUInteger)index; + +/** + * Replaces the value at the given index with the given value. + * + * @param index The index for which to replace the value. + * @param value The value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(uint32_t)value; + +/** + * Removes the value at the given index. + * + * @param index The index of the value to remove. + **/ +- (void)removeValueAtIndex:(NSUInteger)index; + +/** + * Removes all the values from this array. + **/ +- (void)removeAll; + +/** + * Exchanges the values between the given indexes. + * + * @param idx1 The index of the first element to exchange. + * @param idx2 The index of the second element to exchange. + **/ +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2; + +@end + +#pragma mark - Int64 + +/** + * Class used for repeated fields of int64_t values. This performs better than + * boxing into NSNumbers in NSArrays. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64Array : NSObject <NSCopying> + +/** The number of elements contained in the array. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty GPBInt64Array. + **/ ++ (instancetype)array; + +/** + * Creates and initializes a GPBInt64Array with the single element given. + * + * @param value The value to be placed in the array. + * + * @return A newly instanced GPBInt64Array with value in it. + **/ ++ (instancetype)arrayWithValue:(int64_t)value; + +/** + * Creates and initializes a GPBInt64Array with the contents of the given + * array. + * + * @param array Array with the contents to be put into the new array. + * + * @return A newly instanced GPBInt64Array with the contents of array. + **/ ++ (instancetype)arrayWithValueArray:(GPBInt64Array *)array; + +/** + * Creates and initializes a GPBInt64Array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly instanced GPBInt64Array with a capacity of count. + **/ ++ (instancetype)arrayWithCapacity:(NSUInteger)count; + +/** + * @return A newly initialized and empty GPBInt64Array. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializes the array, copying the given values. + * + * @param values An array with the values to put inside this array. + * @param count The number of elements to copy into the array. + * + * @return A newly initialized GPBInt64Array with a copy of the values. + **/ +- (instancetype)initWithValues:(const int64_t [__nullable])values + count:(NSUInteger)count; + +/** + * Initializes the array, copying the given values. + * + * @param array An array with the values to put inside this array. + * + * @return A newly initialized GPBInt64Array with a copy of the values. + **/ +- (instancetype)initWithValueArray:(GPBInt64Array *)array; + +/** + * Initializes the array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly initialized GPBInt64Array with a capacity of count. + **/ +- (instancetype)initWithCapacity:(NSUInteger)count; + +/** + * Gets the value at the given index. + * + * @param index The index of the value to get. + * + * @return The value at the given index. + **/ +- (int64_t)valueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithBlock:(void (^)(int64_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(int64_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Adds a value to this array. + * + * @param value The value to add to this array. + **/ +- (void)addValue:(int64_t)value; + +/** + * Adds values to this array. + * + * @param values The values to add to this array. + * @param count The number of elements to add. + **/ +- (void)addValues:(const int64_t [__nullable])values count:(NSUInteger)count; + +/** + * Adds the values from the given array to this array. + * + * @param array The array containing the elements to add to this array. + **/ +- (void)addValuesFromArray:(GPBInt64Array *)array; + +/** + * Inserts a value into the given position. + * + * @param value The value to add to this array. + * @param index The index into which to insert the value. + **/ +- (void)insertValue:(int64_t)value atIndex:(NSUInteger)index; + +/** + * Replaces the value at the given index with the given value. + * + * @param index The index for which to replace the value. + * @param value The value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int64_t)value; + +/** + * Removes the value at the given index. + * + * @param index The index of the value to remove. + **/ +- (void)removeValueAtIndex:(NSUInteger)index; + +/** + * Removes all the values from this array. + **/ +- (void)removeAll; + +/** + * Exchanges the values between the given indexes. + * + * @param idx1 The index of the first element to exchange. + * @param idx2 The index of the second element to exchange. + **/ +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2; + +@end + +#pragma mark - UInt64 + +/** + * Class used for repeated fields of uint64_t values. This performs better than + * boxing into NSNumbers in NSArrays. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64Array : NSObject <NSCopying> + +/** The number of elements contained in the array. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty GPBUInt64Array. + **/ ++ (instancetype)array; + +/** + * Creates and initializes a GPBUInt64Array with the single element given. + * + * @param value The value to be placed in the array. + * + * @return A newly instanced GPBUInt64Array with value in it. + **/ ++ (instancetype)arrayWithValue:(uint64_t)value; + +/** + * Creates and initializes a GPBUInt64Array with the contents of the given + * array. + * + * @param array Array with the contents to be put into the new array. + * + * @return A newly instanced GPBUInt64Array with the contents of array. + **/ ++ (instancetype)arrayWithValueArray:(GPBUInt64Array *)array; + +/** + * Creates and initializes a GPBUInt64Array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly instanced GPBUInt64Array with a capacity of count. + **/ ++ (instancetype)arrayWithCapacity:(NSUInteger)count; + +/** + * @return A newly initialized and empty GPBUInt64Array. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializes the array, copying the given values. + * + * @param values An array with the values to put inside this array. + * @param count The number of elements to copy into the array. + * + * @return A newly initialized GPBUInt64Array with a copy of the values. + **/ +- (instancetype)initWithValues:(const uint64_t [__nullable])values + count:(NSUInteger)count; + +/** + * Initializes the array, copying the given values. + * + * @param array An array with the values to put inside this array. + * + * @return A newly initialized GPBUInt64Array with a copy of the values. + **/ +- (instancetype)initWithValueArray:(GPBUInt64Array *)array; + +/** + * Initializes the array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly initialized GPBUInt64Array with a capacity of count. + **/ +- (instancetype)initWithCapacity:(NSUInteger)count; + +/** + * Gets the value at the given index. + * + * @param index The index of the value to get. + * + * @return The value at the given index. + **/ +- (uint64_t)valueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithBlock:(void (^)(uint64_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(uint64_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Adds a value to this array. + * + * @param value The value to add to this array. + **/ +- (void)addValue:(uint64_t)value; + +/** + * Adds values to this array. + * + * @param values The values to add to this array. + * @param count The number of elements to add. + **/ +- (void)addValues:(const uint64_t [__nullable])values count:(NSUInteger)count; + +/** + * Adds the values from the given array to this array. + * + * @param array The array containing the elements to add to this array. + **/ +- (void)addValuesFromArray:(GPBUInt64Array *)array; + +/** + * Inserts a value into the given position. + * + * @param value The value to add to this array. + * @param index The index into which to insert the value. + **/ +- (void)insertValue:(uint64_t)value atIndex:(NSUInteger)index; + +/** + * Replaces the value at the given index with the given value. + * + * @param index The index for which to replace the value. + * @param value The value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(uint64_t)value; + +/** + * Removes the value at the given index. + * + * @param index The index of the value to remove. + **/ +- (void)removeValueAtIndex:(NSUInteger)index; + +/** + * Removes all the values from this array. + **/ +- (void)removeAll; + +/** + * Exchanges the values between the given indexes. + * + * @param idx1 The index of the first element to exchange. + * @param idx2 The index of the second element to exchange. + **/ +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2; + +@end + +#pragma mark - Float + +/** + * Class used for repeated fields of float values. This performs better than + * boxing into NSNumbers in NSArrays. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBFloatArray : NSObject <NSCopying> + +/** The number of elements contained in the array. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty GPBFloatArray. + **/ ++ (instancetype)array; + +/** + * Creates and initializes a GPBFloatArray with the single element given. + * + * @param value The value to be placed in the array. + * + * @return A newly instanced GPBFloatArray with value in it. + **/ ++ (instancetype)arrayWithValue:(float)value; + +/** + * Creates and initializes a GPBFloatArray with the contents of the given + * array. + * + * @param array Array with the contents to be put into the new array. + * + * @return A newly instanced GPBFloatArray with the contents of array. + **/ ++ (instancetype)arrayWithValueArray:(GPBFloatArray *)array; + +/** + * Creates and initializes a GPBFloatArray with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly instanced GPBFloatArray with a capacity of count. + **/ ++ (instancetype)arrayWithCapacity:(NSUInteger)count; + +/** + * @return A newly initialized and empty GPBFloatArray. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializes the array, copying the given values. + * + * @param values An array with the values to put inside this array. + * @param count The number of elements to copy into the array. + * + * @return A newly initialized GPBFloatArray with a copy of the values. + **/ +- (instancetype)initWithValues:(const float [__nullable])values + count:(NSUInteger)count; + +/** + * Initializes the array, copying the given values. + * + * @param array An array with the values to put inside this array. + * + * @return A newly initialized GPBFloatArray with a copy of the values. + **/ +- (instancetype)initWithValueArray:(GPBFloatArray *)array; + +/** + * Initializes the array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly initialized GPBFloatArray with a capacity of count. + **/ +- (instancetype)initWithCapacity:(NSUInteger)count; + +/** + * Gets the value at the given index. + * + * @param index The index of the value to get. + * + * @return The value at the given index. + **/ +- (float)valueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithBlock:(void (^)(float value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(float value, NSUInteger idx, BOOL *stop))block; + +/** + * Adds a value to this array. + * + * @param value The value to add to this array. + **/ +- (void)addValue:(float)value; + +/** + * Adds values to this array. + * + * @param values The values to add to this array. + * @param count The number of elements to add. + **/ +- (void)addValues:(const float [__nullable])values count:(NSUInteger)count; + +/** + * Adds the values from the given array to this array. + * + * @param array The array containing the elements to add to this array. + **/ +- (void)addValuesFromArray:(GPBFloatArray *)array; + +/** + * Inserts a value into the given position. + * + * @param value The value to add to this array. + * @param index The index into which to insert the value. + **/ +- (void)insertValue:(float)value atIndex:(NSUInteger)index; + +/** + * Replaces the value at the given index with the given value. + * + * @param index The index for which to replace the value. + * @param value The value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(float)value; + +/** + * Removes the value at the given index. + * + * @param index The index of the value to remove. + **/ +- (void)removeValueAtIndex:(NSUInteger)index; + +/** + * Removes all the values from this array. + **/ +- (void)removeAll; + +/** + * Exchanges the values between the given indexes. + * + * @param idx1 The index of the first element to exchange. + * @param idx2 The index of the second element to exchange. + **/ +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2; + +@end + +#pragma mark - Double + +/** + * Class used for repeated fields of double values. This performs better than + * boxing into NSNumbers in NSArrays. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBDoubleArray : NSObject <NSCopying> + +/** The number of elements contained in the array. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty GPBDoubleArray. + **/ ++ (instancetype)array; + +/** + * Creates and initializes a GPBDoubleArray with the single element given. + * + * @param value The value to be placed in the array. + * + * @return A newly instanced GPBDoubleArray with value in it. + **/ ++ (instancetype)arrayWithValue:(double)value; + +/** + * Creates and initializes a GPBDoubleArray with the contents of the given + * array. + * + * @param array Array with the contents to be put into the new array. + * + * @return A newly instanced GPBDoubleArray with the contents of array. + **/ ++ (instancetype)arrayWithValueArray:(GPBDoubleArray *)array; + +/** + * Creates and initializes a GPBDoubleArray with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly instanced GPBDoubleArray with a capacity of count. + **/ ++ (instancetype)arrayWithCapacity:(NSUInteger)count; + +/** + * @return A newly initialized and empty GPBDoubleArray. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializes the array, copying the given values. + * + * @param values An array with the values to put inside this array. + * @param count The number of elements to copy into the array. + * + * @return A newly initialized GPBDoubleArray with a copy of the values. + **/ +- (instancetype)initWithValues:(const double [__nullable])values + count:(NSUInteger)count; + +/** + * Initializes the array, copying the given values. + * + * @param array An array with the values to put inside this array. + * + * @return A newly initialized GPBDoubleArray with a copy of the values. + **/ +- (instancetype)initWithValueArray:(GPBDoubleArray *)array; + +/** + * Initializes the array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly initialized GPBDoubleArray with a capacity of count. + **/ +- (instancetype)initWithCapacity:(NSUInteger)count; + +/** + * Gets the value at the given index. + * + * @param index The index of the value to get. + * + * @return The value at the given index. + **/ +- (double)valueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithBlock:(void (^)(double value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(double value, NSUInteger idx, BOOL *stop))block; + +/** + * Adds a value to this array. + * + * @param value The value to add to this array. + **/ +- (void)addValue:(double)value; + +/** + * Adds values to this array. + * + * @param values The values to add to this array. + * @param count The number of elements to add. + **/ +- (void)addValues:(const double [__nullable])values count:(NSUInteger)count; + +/** + * Adds the values from the given array to this array. + * + * @param array The array containing the elements to add to this array. + **/ +- (void)addValuesFromArray:(GPBDoubleArray *)array; + +/** + * Inserts a value into the given position. + * + * @param value The value to add to this array. + * @param index The index into which to insert the value. + **/ +- (void)insertValue:(double)value atIndex:(NSUInteger)index; + +/** + * Replaces the value at the given index with the given value. + * + * @param index The index for which to replace the value. + * @param value The value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(double)value; + +/** + * Removes the value at the given index. + * + * @param index The index of the value to remove. + **/ +- (void)removeValueAtIndex:(NSUInteger)index; + +/** + * Removes all the values from this array. + **/ +- (void)removeAll; + +/** + * Exchanges the values between the given indexes. + * + * @param idx1 The index of the first element to exchange. + * @param idx2 The index of the second element to exchange. + **/ +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2; + +@end + +#pragma mark - Bool + +/** + * Class used for repeated fields of BOOL values. This performs better than + * boxing into NSNumbers in NSArrays. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolArray : NSObject <NSCopying> + +/** The number of elements contained in the array. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty GPBBoolArray. + **/ ++ (instancetype)array; + +/** + * Creates and initializes a GPBBoolArray with the single element given. + * + * @param value The value to be placed in the array. + * + * @return A newly instanced GPBBoolArray with value in it. + **/ ++ (instancetype)arrayWithValue:(BOOL)value; + +/** + * Creates and initializes a GPBBoolArray with the contents of the given + * array. + * + * @param array Array with the contents to be put into the new array. + * + * @return A newly instanced GPBBoolArray with the contents of array. + **/ ++ (instancetype)arrayWithValueArray:(GPBBoolArray *)array; + +/** + * Creates and initializes a GPBBoolArray with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly instanced GPBBoolArray with a capacity of count. + **/ ++ (instancetype)arrayWithCapacity:(NSUInteger)count; + +/** + * @return A newly initialized and empty GPBBoolArray. + **/ +- (instancetype)init NS_DESIGNATED_INITIALIZER; + +/** + * Initializes the array, copying the given values. + * + * @param values An array with the values to put inside this array. + * @param count The number of elements to copy into the array. + * + * @return A newly initialized GPBBoolArray with a copy of the values. + **/ +- (instancetype)initWithValues:(const BOOL [__nullable])values + count:(NSUInteger)count; + +/** + * Initializes the array, copying the given values. + * + * @param array An array with the values to put inside this array. + * + * @return A newly initialized GPBBoolArray with a copy of the values. + **/ +- (instancetype)initWithValueArray:(GPBBoolArray *)array; + +/** + * Initializes the array with the given capacity. + * + * @param count The capacity needed for the array. + * + * @return A newly initialized GPBBoolArray with a capacity of count. + **/ +- (instancetype)initWithCapacity:(NSUInteger)count; + +/** + * Gets the value at the given index. + * + * @param index The index of the value to get. + * + * @return The value at the given index. + **/ +- (BOOL)valueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithBlock:(void (^)(BOOL value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(BOOL value, NSUInteger idx, BOOL *stop))block; + +/** + * Adds a value to this array. + * + * @param value The value to add to this array. + **/ +- (void)addValue:(BOOL)value; + +/** + * Adds values to this array. + * + * @param values The values to add to this array. + * @param count The number of elements to add. + **/ +- (void)addValues:(const BOOL [__nullable])values count:(NSUInteger)count; + +/** + * Adds the values from the given array to this array. + * + * @param array The array containing the elements to add to this array. + **/ +- (void)addValuesFromArray:(GPBBoolArray *)array; + +/** + * Inserts a value into the given position. + * + * @param value The value to add to this array. + * @param index The index into which to insert the value. + **/ +- (void)insertValue:(BOOL)value atIndex:(NSUInteger)index; + +/** + * Replaces the value at the given index with the given value. + * + * @param index The index for which to replace the value. + * @param value The value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(BOOL)value; + +/** + * Removes the value at the given index. + * + * @param index The index of the value to remove. + **/ +- (void)removeValueAtIndex:(NSUInteger)index; + +/** + * Removes all the values from this array. + **/ +- (void)removeAll; + +/** + * Exchanges the values between the given indexes. + * + * @param idx1 The index of the first element to exchange. + * @param idx2 The index of the second element to exchange. + **/ +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2; + +@end + +#pragma mark - Enum + +/** + * This class is used for repeated fields of int32_t values. This performs + * better than boxing into NSNumbers in NSArrays. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBEnumArray : NSObject <NSCopying> + +/** The number of elements contained in the array. */ +@property(nonatomic, readonly) NSUInteger count; +/** The validation function to check if the enums are valid. */ +@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; + +/** + * @return A newly instanced and empty GPBEnumArray. + **/ ++ (instancetype)array; + +/** + * Creates and initializes a GPBEnumArray with the enum validation function + * given. + * + * @param func The enum validation function for the array. + * + * @return A newly instanced GPBEnumArray. + **/ ++ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Creates and initializes a GPBEnumArray with the enum validation function + * given and the single raw value given. + * + * @param func The enum validation function for the array. + * @param value The raw value to add to this array. + * + * @return A newly instanced GPBEnumArray. + **/ ++ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValue:(int32_t)value; + +/** + * Creates and initializes a GPBEnumArray that adds the elements from the + * given array. + * + * @param array Array containing the values to add to the new array. + * + * @return A newly instanced GPBEnumArray. + **/ ++ (instancetype)arrayWithValueArray:(GPBEnumArray *)array; + +/** + * Creates and initializes a GPBEnumArray with the given enum validation + * function and with the givencapacity. + * + * @param func The enum validation function for the array. + * @param count The capacity needed for the array. + * + * @return A newly instanced GPBEnumArray with a capacity of count. + **/ ++ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)count; + +/** + * Initializes the array with the given enum validation function. + * + * @param func The enum validation function for the array. + * + * @return A newly initialized GPBEnumArray with a copy of the values. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + NS_DESIGNATED_INITIALIZER; + +/** + * Initializes the array, copying the given values. + * + * @param func The enum validation function for the array. + * @param values An array with the values to put inside this array. + * @param count The number of elements to copy into the array. + * + * @return A newly initialized GPBEnumArray with a copy of the values. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + count:(NSUInteger)count; + +/** + * Initializes the array, copying the given values. + * + * @param array An array with the values to put inside this array. + * + * @return A newly initialized GPBEnumArray with a copy of the values. + **/ +- (instancetype)initWithValueArray:(GPBEnumArray *)array; + +/** + * Initializes the array with the given capacity. + * + * @param func The enum validation function for the array. + * @param count The capacity needed for the array. + * + * @return A newly initialized GPBEnumArray with a capacity of count. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)count; + +// These will return kGPBUnrecognizedEnumeratorValue if the value at index is not a +// valid enumerator as defined by validationFunc. If the actual value is +// desired, use "raw" version of the method. + +/** + * Gets the value at the given index. + * + * @param index The index of the value to get. + * + * @return The value at the given index. + **/ +- (int32_t)valueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block; + +// These methods bypass the validationFunc to provide access to values that were not +// known at the time the binary was compiled. + +/** + * Gets the raw enum value at the given index. + * + * @param index The index of the raw enum value to get. + * + * @return The raw enum value at the given index. + **/ +- (int32_t)rawValueAtIndex:(NSUInteger)index; + +/** + * Enumerates the values on this array with the given block. + * + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateRawValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block; + +/** + * Enumerates the values on this array with the given block. + * + * @param opts Options to control the enumeration. + * @param block The block to enumerate with. + * **value**: The current value being enumerated. + * **idx**: The index of the current value. + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateRawValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block; + +// If value is not a valid enumerator as defined by validationFunc, these +// methods will assert in debug, and will log in release and assign the value +// to the default value. Use the rawValue methods below to assign non enumerator +// values. + +/** + * Adds a value to this array. + * + * @param value The value to add to this array. + **/ +- (void)addValue:(int32_t)value; + +/** + * Adds values to this array. + * + * @param values The values to add to this array. + * @param count The number of elements to add. + **/ +- (void)addValues:(const int32_t [__nullable])values count:(NSUInteger)count; + + +/** + * Inserts a value into the given position. + * + * @param value The value to add to this array. + * @param index The index into which to insert the value. + **/ +- (void)insertValue:(int32_t)value atIndex:(NSUInteger)index; + +/** + * Replaces the value at the given index with the given value. + * + * @param index The index for which to replace the value. + * @param value The value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int32_t)value; + +// These methods bypass the validationFunc to provide setting of values that were not +// known at the time the binary was compiled. + +/** + * Adds a raw enum value to this array. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param value The raw enum value to add to the array. + **/ +- (void)addRawValue:(int32_t)value; + +/** + * Adds raw enum values to this array. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param array Array containing the raw enum values to add to this array. + **/ +- (void)addRawValuesFromArray:(GPBEnumArray *)array; + +/** + * Adds raw enum values to this array. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param values Array containing the raw enum values to add to this array. + * @param count The number of raw values to add. + **/ +- (void)addRawValues:(const int32_t [__nullable])values count:(NSUInteger)count; + +/** + * Inserts a raw enum value at the given index. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param value Raw enum value to add. + * @param index The index into which to insert the value. + **/ +- (void)insertRawValue:(int32_t)value atIndex:(NSUInteger)index; + +/** + * Replaces the raw enum value at the given index with the given value. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param index The index for which to replace the value. + * @param value The raw enum value to replace with. + **/ +- (void)replaceValueAtIndex:(NSUInteger)index withRawValue:(int32_t)value; + +// No validation applies to these methods. + +/** + * Removes the value at the given index. + * + * @param index The index of the value to remove. + **/ +- (void)removeValueAtIndex:(NSUInteger)index; + +/** + * Removes all the values from this array. + **/ +- (void)removeAll; + +/** + * Exchanges the values between the given indexes. + * + * @param idx1 The index of the first element to exchange. + * @param idx2 The index of the second element to exchange. + **/ +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2; + +@end + +//%PDDM-EXPAND-END DECLARE_ARRAYS() + +NS_ASSUME_NONNULL_END + +//%PDDM-DEFINE DECLARE_ARRAYS() +//%ARRAY_INTERFACE_SIMPLE(Int32, int32_t) +//%ARRAY_INTERFACE_SIMPLE(UInt32, uint32_t) +//%ARRAY_INTERFACE_SIMPLE(Int64, int64_t) +//%ARRAY_INTERFACE_SIMPLE(UInt64, uint64_t) +//%ARRAY_INTERFACE_SIMPLE(Float, float) +//%ARRAY_INTERFACE_SIMPLE(Double, double) +//%ARRAY_INTERFACE_SIMPLE(Bool, BOOL) +//%ARRAY_INTERFACE_ENUM(Enum, int32_t) + +// +// The common case (everything but Enum) +// + +//%PDDM-DEFINE ARRAY_INTERFACE_SIMPLE(NAME, TYPE) +//%#pragma mark - NAME +//% +//%/** +//% * Class used for repeated fields of ##TYPE## values. This performs better than +//% * boxing into NSNumbers in NSArrays. +//% * +//% * @note This class is not meant to be subclassed. +//% **/ +//%@interface GPB##NAME##Array : NSObject <NSCopying> +//% +//%/** The number of elements contained in the array. */ +//%@property(nonatomic, readonly) NSUInteger count; +//% +//%/** +//% * @return A newly instanced and empty GPB##NAME##Array. +//% **/ +//%+ (instancetype)array; +//% +//%/** +//% * Creates and initializes a GPB##NAME##Array with the single element given. +//% * +//% * @param value The value to be placed in the array. +//% * +//% * @return A newly instanced GPB##NAME##Array with value in it. +//% **/ +//%+ (instancetype)arrayWithValue:(TYPE)value; +//% +//%/** +//% * Creates and initializes a GPB##NAME##Array with the contents of the given +//% * array. +//% * +//% * @param array Array with the contents to be put into the new array. +//% * +//% * @return A newly instanced GPB##NAME##Array with the contents of array. +//% **/ +//%+ (instancetype)arrayWithValueArray:(GPB##NAME##Array *)array; +//% +//%/** +//% * Creates and initializes a GPB##NAME##Array with the given capacity. +//% * +//% * @param count The capacity needed for the array. +//% * +//% * @return A newly instanced GPB##NAME##Array with a capacity of count. +//% **/ +//%+ (instancetype)arrayWithCapacity:(NSUInteger)count; +//% +//%/** +//% * @return A newly initialized and empty GPB##NAME##Array. +//% **/ +//%- (instancetype)init NS_DESIGNATED_INITIALIZER; +//% +//%/** +//% * Initializes the array, copying the given values. +//% * +//% * @param values An array with the values to put inside this array. +//% * @param count The number of elements to copy into the array. +//% * +//% * @return A newly initialized GPB##NAME##Array with a copy of the values. +//% **/ +//%- (instancetype)initWithValues:(const TYPE [__nullable])values +//% count:(NSUInteger)count; +//% +//%/** +//% * Initializes the array, copying the given values. +//% * +//% * @param array An array with the values to put inside this array. +//% * +//% * @return A newly initialized GPB##NAME##Array with a copy of the values. +//% **/ +//%- (instancetype)initWithValueArray:(GPB##NAME##Array *)array; +//% +//%/** +//% * Initializes the array with the given capacity. +//% * +//% * @param count The capacity needed for the array. +//% * +//% * @return A newly initialized GPB##NAME##Array with a capacity of count. +//% **/ +//%- (instancetype)initWithCapacity:(NSUInteger)count; +//% +//%ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, Basic) +//% +//%ARRAY_MUTABLE_INTERFACE(NAME, TYPE, Basic) +//% +//%@end +//% + +// +// Macros specific to Enums (to tweak their interface). +// + +//%PDDM-DEFINE ARRAY_INTERFACE_ENUM(NAME, TYPE) +//%#pragma mark - NAME +//% +//%/** +//% * This class is used for repeated fields of ##TYPE## values. This performs +//% * better than boxing into NSNumbers in NSArrays. +//% * +//% * @note This class is not meant to be subclassed. +//% **/ +//%@interface GPB##NAME##Array : NSObject <NSCopying> +//% +//%/** The number of elements contained in the array. */ +//%@property(nonatomic, readonly) NSUInteger count; +//%/** The validation function to check if the enums are valid. */ +//%@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; +//% +//%/** +//% * @return A newly instanced and empty GPB##NAME##Array. +//% **/ +//%+ (instancetype)array; +//% +//%/** +//% * Creates and initializes a GPB##NAME##Array with the enum validation function +//% * given. +//% * +//% * @param func The enum validation function for the array. +//% * +//% * @return A newly instanced GPB##NAME##Array. +//% **/ +//%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func; +//% +//%/** +//% * Creates and initializes a GPB##NAME##Array with the enum validation function +//% * given and the single raw value given. +//% * +//% * @param func The enum validation function for the array. +//% * @param value The raw value to add to this array. +//% * +//% * @return A newly instanced GPB##NAME##Array. +//% **/ +//%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% rawValue:(TYPE)value; +//% +//%/** +//% * Creates and initializes a GPB##NAME##Array that adds the elements from the +//% * given array. +//% * +//% * @param array Array containing the values to add to the new array. +//% * +//% * @return A newly instanced GPB##NAME##Array. +//% **/ +//%+ (instancetype)arrayWithValueArray:(GPB##NAME##Array *)array; +//% +//%/** +//% * Creates and initializes a GPB##NAME##Array with the given enum validation +//% * function and with the givencapacity. +//% * +//% * @param func The enum validation function for the array. +//% * @param count The capacity needed for the array. +//% * +//% * @return A newly instanced GPB##NAME##Array with a capacity of count. +//% **/ +//%+ (instancetype)arrayWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% capacity:(NSUInteger)count; +//% +//%/** +//% * Initializes the array with the given enum validation function. +//% * +//% * @param func The enum validation function for the array. +//% * +//% * @return A newly initialized GPB##NAME##Array with a copy of the values. +//% **/ +//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% NS_DESIGNATED_INITIALIZER; +//% +//%/** +//% * Initializes the array, copying the given values. +//% * +//% * @param func The enum validation function for the array. +//% * @param values An array with the values to put inside this array. +//% * @param count The number of elements to copy into the array. +//% * +//% * @return A newly initialized GPB##NAME##Array with a copy of the values. +//% **/ +//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% rawValues:(const TYPE [__nullable])values +//% count:(NSUInteger)count; +//% +//%/** +//% * Initializes the array, copying the given values. +//% * +//% * @param array An array with the values to put inside this array. +//% * +//% * @return A newly initialized GPB##NAME##Array with a copy of the values. +//% **/ +//%- (instancetype)initWithValueArray:(GPB##NAME##Array *)array; +//% +//%/** +//% * Initializes the array with the given capacity. +//% * +//% * @param func The enum validation function for the array. +//% * @param count The capacity needed for the array. +//% * +//% * @return A newly initialized GPB##NAME##Array with a capacity of count. +//% **/ +//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% capacity:(NSUInteger)count; +//% +//%// These will return kGPBUnrecognizedEnumeratorValue if the value at index is not a +//%// valid enumerator as defined by validationFunc. If the actual value is +//%// desired, use "raw" version of the method. +//% +//%ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, NAME) +//% +//%// These methods bypass the validationFunc to provide access to values that were not +//%// known at the time the binary was compiled. +//% +//%/** +//% * Gets the raw enum value at the given index. +//% * +//% * @param index The index of the raw enum value to get. +//% * +//% * @return The raw enum value at the given index. +//% **/ +//%- (TYPE)rawValueAtIndex:(NSUInteger)index; +//% +//%/** +//% * Enumerates the values on this array with the given block. +//% * +//% * @param block The block to enumerate with. +//% * **value**: The current value being enumerated. +//% * **idx**: The index of the current value. +//% * **stop**: A pointer to a boolean that when set stops the enumeration. +//% **/ +//%- (void)enumerateRawValuesWithBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block; +//% +//%/** +//% * Enumerates the values on this array with the given block. +//% * +//% * @param opts Options to control the enumeration. +//% * @param block The block to enumerate with. +//% * **value**: The current value being enumerated. +//% * **idx**: The index of the current value. +//% * **stop**: A pointer to a boolean that when set stops the enumeration. +//% **/ +//%- (void)enumerateRawValuesWithOptions:(NSEnumerationOptions)opts +//% usingBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block; +//% +//%// If value is not a valid enumerator as defined by validationFunc, these +//%// methods will assert in debug, and will log in release and assign the value +//%// to the default value. Use the rawValue methods below to assign non enumerator +//%// values. +//% +//%ARRAY_MUTABLE_INTERFACE(NAME, TYPE, NAME) +//% +//%@end +//% + +//%PDDM-DEFINE ARRAY_IMMUTABLE_INTERFACE(NAME, TYPE, HELPER_NAME) +//%/** +//% * Gets the value at the given index. +//% * +//% * @param index The index of the value to get. +//% * +//% * @return The value at the given index. +//% **/ +//%- (TYPE)valueAtIndex:(NSUInteger)index; +//% +//%/** +//% * Enumerates the values on this array with the given block. +//% * +//% * @param block The block to enumerate with. +//% * **value**: The current value being enumerated. +//% * **idx**: The index of the current value. +//% * **stop**: A pointer to a boolean that when set stops the enumeration. +//% **/ +//%- (void)enumerateValuesWithBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block; +//% +//%/** +//% * Enumerates the values on this array with the given block. +//% * +//% * @param opts Options to control the enumeration. +//% * @param block The block to enumerate with. +//% * **value**: The current value being enumerated. +//% * **idx**: The index of the current value. +//% * **stop**: A pointer to a boolean that when set stops the enumeration. +//% **/ +//%- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts +//% usingBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block; + +//%PDDM-DEFINE ARRAY_MUTABLE_INTERFACE(NAME, TYPE, HELPER_NAME) +//%/** +//% * Adds a value to this array. +//% * +//% * @param value The value to add to this array. +//% **/ +//%- (void)addValue:(TYPE)value; +//% +//%/** +//% * Adds values to this array. +//% * +//% * @param values The values to add to this array. +//% * @param count The number of elements to add. +//% **/ +//%- (void)addValues:(const TYPE [__nullable])values count:(NSUInteger)count; +//% +//%ARRAY_EXTRA_MUTABLE_METHODS1_##HELPER_NAME(NAME, TYPE) +//%/** +//% * Inserts a value into the given position. +//% * +//% * @param value The value to add to this array. +//% * @param index The index into which to insert the value. +//% **/ +//%- (void)insertValue:(TYPE)value atIndex:(NSUInteger)index; +//% +//%/** +//% * Replaces the value at the given index with the given value. +//% * +//% * @param index The index for which to replace the value. +//% * @param value The value to replace with. +//% **/ +//%- (void)replaceValueAtIndex:(NSUInteger)index withValue:(TYPE)value; +//%ARRAY_EXTRA_MUTABLE_METHODS2_##HELPER_NAME(NAME, TYPE) +//%/** +//% * Removes the value at the given index. +//% * +//% * @param index The index of the value to remove. +//% **/ +//%- (void)removeValueAtIndex:(NSUInteger)index; +//% +//%/** +//% * Removes all the values from this array. +//% **/ +//%- (void)removeAll; +//% +//%/** +//% * Exchanges the values between the given indexes. +//% * +//% * @param idx1 The index of the first element to exchange. +//% * @param idx2 The index of the second element to exchange. +//% **/ +//%- (void)exchangeValueAtIndex:(NSUInteger)idx1 +//% withValueAtIndex:(NSUInteger)idx2; + +// +// These are hooks invoked by the above to do insert as needed. +// + +//%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS1_Basic(NAME, TYPE) +//%/** +//% * Adds the values from the given array to this array. +//% * +//% * @param array The array containing the elements to add to this array. +//% **/ +//%- (void)addValuesFromArray:(GPB##NAME##Array *)array; +//% +//%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS2_Basic(NAME, TYPE) +// Empty +//%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS1_Enum(NAME, TYPE) +// Empty +//%PDDM-DEFINE ARRAY_EXTRA_MUTABLE_METHODS2_Enum(NAME, TYPE) +//% +//%// These methods bypass the validationFunc to provide setting of values that were not +//%// known at the time the binary was compiled. +//% +//%/** +//% * Adds a raw enum value to this array. +//% * +//% * @note This method bypass the validationFunc to enable the setting of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param value The raw enum value to add to the array. +//% **/ +//%- (void)addRawValue:(TYPE)value; +//% +//%/** +//% * Adds raw enum values to this array. +//% * +//% * @note This method bypass the validationFunc to enable the setting of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param array Array containing the raw enum values to add to this array. +//% **/ +//%- (void)addRawValuesFromArray:(GPB##NAME##Array *)array; +//% +//%/** +//% * Adds raw enum values to this array. +//% * +//% * @note This method bypass the validationFunc to enable the setting of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param values Array containing the raw enum values to add to this array. +//% * @param count The number of raw values to add. +//% **/ +//%- (void)addRawValues:(const TYPE [__nullable])values count:(NSUInteger)count; +//% +//%/** +//% * Inserts a raw enum value at the given index. +//% * +//% * @note This method bypass the validationFunc to enable the setting of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param value Raw enum value to add. +//% * @param index The index into which to insert the value. +//% **/ +//%- (void)insertRawValue:(TYPE)value atIndex:(NSUInteger)index; +//% +//%/** +//% * Replaces the raw enum value at the given index with the given value. +//% * +//% * @note This method bypass the validationFunc to enable the setting of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param index The index for which to replace the value. +//% * @param value The raw enum value to replace with. +//% **/ +//%- (void)replaceValueAtIndex:(NSUInteger)index withRawValue:(TYPE)value; +//% +//%// No validation applies to these methods. +//% diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray.m new file mode 100644 index 00000000..f401631d --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray.m @@ -0,0 +1,2551 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBArray_PackagePrivate.h" + +#import "GPBMessage_PackagePrivate.h" + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +// Mutable arrays use an internal buffer that can always hold a multiple of this elements. +#define kChunkSize 16 +#define CapacityFromCount(x) (((x / kChunkSize) + 1) * kChunkSize) + +static BOOL ArrayDefault_IsValidValue(int32_t value) { + // Anything but the bad value marker is allowed. + return (value != kGPBUnrecognizedEnumeratorValue); +} + +//%PDDM-DEFINE VALIDATE_RANGE(INDEX, COUNT) +//% if (INDEX >= COUNT) { +//% [NSException raise:NSRangeException +//% format:@"Index (%lu) beyond bounds (%lu)", +//% (unsigned long)INDEX, (unsigned long)COUNT]; +//% } +//%PDDM-DEFINE MAYBE_GROW_TO_SET_COUNT(NEW_COUNT) +//% if (NEW_COUNT > _capacity) { +//% [self internalResizeToCapacity:CapacityFromCount(NEW_COUNT)]; +//% } +//% _count = NEW_COUNT; +//%PDDM-DEFINE SET_COUNT_AND_MAYBE_SHRINK(NEW_COUNT) +//% _count = NEW_COUNT; +//% if ((NEW_COUNT + (2 * kChunkSize)) < _capacity) { +//% [self internalResizeToCapacity:CapacityFromCount(NEW_COUNT)]; +//% } + +// +// Macros for the common basic cases. +// + +//%PDDM-DEFINE ARRAY_INTERFACE_SIMPLE(NAME, TYPE, FORMAT) +//%#pragma mark - NAME +//% +//%@implementation GPB##NAME##Array { +//% @package +//% TYPE *_values; +//% NSUInteger _count; +//% NSUInteger _capacity; +//%} +//% +//%@synthesize count = _count; +//% +//%+ (instancetype)array { +//% return [[[self alloc] init] autorelease]; +//%} +//% +//%+ (instancetype)arrayWithValue:(TYPE)value { +//% // Cast is needed so the compiler knows what class we are invoking initWithValues: on to get +//% // the type correct. +//% return [[(GPB##NAME##Array*)[self alloc] initWithValues:&value count:1] autorelease]; +//%} +//% +//%+ (instancetype)arrayWithValueArray:(GPB##NAME##Array *)array { +//% return [[(GPB##NAME##Array*)[self alloc] initWithValueArray:array] autorelease]; +//%} +//% +//%+ (instancetype)arrayWithCapacity:(NSUInteger)count { +//% return [[[self alloc] initWithCapacity:count] autorelease]; +//%} +//% +//%- (instancetype)init { +//% self = [super init]; +//% // No work needed; +//% return self; +//%} +//% +//%- (instancetype)initWithValueArray:(GPB##NAME##Array *)array { +//% return [self initWithValues:array->_values count:array->_count]; +//%} +//% +//%- (instancetype)initWithValues:(const TYPE [])values count:(NSUInteger)count { +//% self = [self init]; +//% if (self) { +//% if (count && values) { +//% _values = reallocf(_values, count * sizeof(TYPE)); +//% if (_values != NULL) { +//% _capacity = count; +//% memcpy(_values, values, count * sizeof(TYPE)); +//% _count = count; +//% } else { +//% [self release]; +//% [NSException raise:NSMallocException +//% format:@"Failed to allocate %lu bytes", +//% (unsigned long)(count * sizeof(TYPE))]; +//% } +//% } +//% } +//% return self; +//%} +//% +//%- (instancetype)initWithCapacity:(NSUInteger)count { +//% self = [self initWithValues:NULL count:0]; +//% if (self && count) { +//% [self internalResizeToCapacity:count]; +//% } +//% return self; +//%} +//% +//%- (instancetype)copyWithZone:(NSZone *)zone { +//% return [[GPB##NAME##Array allocWithZone:zone] initWithValues:_values count:_count]; +//%} +//% +//%ARRAY_IMMUTABLE_CORE(NAME, TYPE, , FORMAT) +//% +//%- (TYPE)valueAtIndex:(NSUInteger)index { +//%VALIDATE_RANGE(index, _count) +//% return _values[index]; +//%} +//% +//%ARRAY_MUTABLE_CORE(NAME, TYPE, , FORMAT) +//%@end +//% + +// +// Some core macros used for both the simple types and Enums. +// + +//%PDDM-DEFINE ARRAY_IMMUTABLE_CORE(NAME, TYPE, ACCESSOR_NAME, FORMAT) +//%- (void)dealloc { +//% NSAssert(!_autocreator, +//% @"%@: Autocreator must be cleared before release, autocreator: %@", +//% [self class], _autocreator); +//% free(_values); +//% [super dealloc]; +//%} +//% +//%- (BOOL)isEqual:(id)other { +//% if (self == other) { +//% return YES; +//% } +//% if (![other isKindOfClass:[GPB##NAME##Array class]]) { +//% return NO; +//% } +//% GPB##NAME##Array *otherArray = other; +//% return (_count == otherArray->_count +//% && memcmp(_values, otherArray->_values, (_count * sizeof(TYPE))) == 0); +//%} +//% +//%- (NSUInteger)hash { +//% // Follow NSArray's lead, and use the count as the hash. +//% return _count; +//%} +//% +//%- (NSString *)description { +//% NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; +//% for (NSUInteger i = 0, count = _count; i < count; ++i) { +//% if (i == 0) { +//% [result appendFormat:@"##FORMAT##", _values[i]]; +//% } else { +//% [result appendFormat:@", ##FORMAT##", _values[i]]; +//% } +//% } +//% [result appendFormat:@" }"]; +//% return result; +//%} +//% +//%- (void)enumerate##ACCESSOR_NAME##ValuesWithBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block { +//% [self enumerate##ACCESSOR_NAME##ValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +//%} +//% +//%- (void)enumerate##ACCESSOR_NAME##ValuesWithOptions:(NSEnumerationOptions)opts +//% ACCESSOR_NAME$S usingBlock:(void (^)(TYPE value, NSUInteger idx, BOOL *stop))block { +//% // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). +//% BOOL stop = NO; +//% if ((opts & NSEnumerationReverse) == 0) { +//% for (NSUInteger i = 0, count = _count; i < count; ++i) { +//% block(_values[i], i, &stop); +//% if (stop) break; +//% } +//% } else if (_count > 0) { +//% for (NSUInteger i = _count; i > 0; --i) { +//% block(_values[i - 1], (i - 1), &stop); +//% if (stop) break; +//% } +//% } +//%} + +//%PDDM-DEFINE MUTATION_HOOK_None() +//%PDDM-DEFINE MUTATION_METHODS(NAME, TYPE, ACCESSOR_NAME, HOOK_1, HOOK_2) +//%- (void)add##ACCESSOR_NAME##Value:(TYPE)value { +//% [self add##ACCESSOR_NAME##Values:&value count:1]; +//%} +//% +//%- (void)add##ACCESSOR_NAME##Values:(const TYPE [])values count:(NSUInteger)count { +//% if (values == NULL || count == 0) return; +//%MUTATION_HOOK_##HOOK_1() NSUInteger initialCount = _count; +//% NSUInteger newCount = initialCount + count; +//%MAYBE_GROW_TO_SET_COUNT(newCount) +//% memcpy(&_values[initialCount], values, count * sizeof(TYPE)); +//% if (_autocreator) { +//% GPBAutocreatedArrayModified(_autocreator, self); +//% } +//%} +//% +//%- (void)insert##ACCESSOR_NAME##Value:(TYPE)value atIndex:(NSUInteger)index { +//%VALIDATE_RANGE(index, _count + 1) +//%MUTATION_HOOK_##HOOK_2() NSUInteger initialCount = _count; +//% NSUInteger newCount = initialCount + 1; +//%MAYBE_GROW_TO_SET_COUNT(newCount) +//% if (index != initialCount) { +//% memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(TYPE)); +//% } +//% _values[index] = value; +//% if (_autocreator) { +//% GPBAutocreatedArrayModified(_autocreator, self); +//% } +//%} +//% +//%- (void)replaceValueAtIndex:(NSUInteger)index with##ACCESSOR_NAME##Value:(TYPE)value { +//%VALIDATE_RANGE(index, _count) +//%MUTATION_HOOK_##HOOK_2() _values[index] = value; +//%} + +//%PDDM-DEFINE ARRAY_MUTABLE_CORE(NAME, TYPE, ACCESSOR_NAME, FORMAT) +//%- (void)internalResizeToCapacity:(NSUInteger)newCapacity { +//% _values = reallocf(_values, newCapacity * sizeof(TYPE)); +//% if (_values == NULL) { +//% _capacity = 0; +//% _count = 0; +//% [NSException raise:NSMallocException +//% format:@"Failed to allocate %lu bytes", +//% (unsigned long)(newCapacity * sizeof(TYPE))]; +//% } +//% _capacity = newCapacity; +//%} +//% +//%MUTATION_METHODS(NAME, TYPE, ACCESSOR_NAME, None, None) +//% +//%- (void)add##ACCESSOR_NAME##ValuesFromArray:(GPB##NAME##Array *)array { +//% [self add##ACCESSOR_NAME##Values:array->_values count:array->_count]; +//%} +//% +//%- (void)removeValueAtIndex:(NSUInteger)index { +//%VALIDATE_RANGE(index, _count) +//% NSUInteger newCount = _count - 1; +//% if (index != newCount) { +//% memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(TYPE)); +//% } +//%SET_COUNT_AND_MAYBE_SHRINK(newCount) +//%} +//% +//%- (void)removeAll { +//%SET_COUNT_AND_MAYBE_SHRINK(0) +//%} +//% +//%- (void)exchangeValueAtIndex:(NSUInteger)idx1 +//% withValueAtIndex:(NSUInteger)idx2 { +//%VALIDATE_RANGE(idx1, _count) +//%VALIDATE_RANGE(idx2, _count) +//% TYPE temp = _values[idx1]; +//% _values[idx1] = _values[idx2]; +//% _values[idx2] = temp; +//%} +//% + +//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Int32, int32_t, %d) +// This block of code is generated, do not edit it directly. + +#pragma mark - Int32 + +@implementation GPBInt32Array { + @package + int32_t *_values; + NSUInteger _count; + NSUInteger _capacity; +} + +@synthesize count = _count; + ++ (instancetype)array { + return [[[self alloc] init] autorelease]; +} + ++ (instancetype)arrayWithValue:(int32_t)value { + // Cast is needed so the compiler knows what class we are invoking initWithValues: on to get + // the type correct. + return [[(GPBInt32Array*)[self alloc] initWithValues:&value count:1] autorelease]; +} + ++ (instancetype)arrayWithValueArray:(GPBInt32Array *)array { + return [[(GPBInt32Array*)[self alloc] initWithValueArray:array] autorelease]; +} + ++ (instancetype)arrayWithCapacity:(NSUInteger)count { + return [[[self alloc] initWithCapacity:count] autorelease]; +} + +- (instancetype)init { + self = [super init]; + // No work needed; + return self; +} + +- (instancetype)initWithValueArray:(GPBInt32Array *)array { + return [self initWithValues:array->_values count:array->_count]; +} + +- (instancetype)initWithValues:(const int32_t [])values count:(NSUInteger)count { + self = [self init]; + if (self) { + if (count && values) { + _values = reallocf(_values, count * sizeof(int32_t)); + if (_values != NULL) { + _capacity = count; + memcpy(_values, values, count * sizeof(int32_t)); + _count = count; + } else { + [self release]; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(count * sizeof(int32_t))]; + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)count { + self = [self initWithValues:NULL count:0]; + if (self && count) { + [self internalResizeToCapacity:count]; + } + return self; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32Array allocWithZone:zone] initWithValues:_values count:_count]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + free(_values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32Array class]]) { + return NO; + } + GPBInt32Array *otherArray = other; + return (_count == otherArray->_count + && memcmp(_values, otherArray->_values, (_count * sizeof(int32_t))) == 0); +} + +- (NSUInteger)hash { + // Follow NSArray's lead, and use the count as the hash. + return _count; +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; + for (NSUInteger i = 0, count = _count; i < count; ++i) { + if (i == 0) { + [result appendFormat:@"%d", _values[i]]; + } else { + [result appendFormat:@", %d", _values[i]]; + } + } + [result appendFormat:@" }"]; + return result; +} + +- (void)enumerateValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block { + [self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + if ((opts & NSEnumerationReverse) == 0) { + for (NSUInteger i = 0, count = _count; i < count; ++i) { + block(_values[i], i, &stop); + if (stop) break; + } + } else if (_count > 0) { + for (NSUInteger i = _count; i > 0; --i) { + block(_values[i - 1], (i - 1), &stop); + if (stop) break; + } + } +} + +- (int32_t)valueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + return _values[index]; +} + +- (void)internalResizeToCapacity:(NSUInteger)newCapacity { + _values = reallocf(_values, newCapacity * sizeof(int32_t)); + if (_values == NULL) { + _capacity = 0; + _count = 0; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(newCapacity * sizeof(int32_t))]; + } + _capacity = newCapacity; +} + +- (void)addValue:(int32_t)value { + [self addValues:&value count:1]; +} + +- (void)addValues:(const int32_t [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(int32_t)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertValue:(int32_t)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(int32_t)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int32_t)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + _values[index] = value; +} + +- (void)addValuesFromArray:(GPBInt32Array *)array { + [self addValues:array->_values count:array->_count]; +} + +- (void)removeValueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + NSUInteger newCount = _count - 1; + if (index != newCount) { + memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(int32_t)); + } + _count = newCount; + if ((newCount + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } +} + +- (void)removeAll { + _count = 0; + if ((0 + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(0)]; + } +} + +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2 { + if (idx1 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx1, (unsigned long)_count]; + } + if (idx2 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx2, (unsigned long)_count]; + } + int32_t temp = _values[idx1]; + _values[idx1] = _values[idx2]; + _values[idx2] = temp; +} + +@end + +//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(UInt32, uint32_t, %u) +// This block of code is generated, do not edit it directly. + +#pragma mark - UInt32 + +@implementation GPBUInt32Array { + @package + uint32_t *_values; + NSUInteger _count; + NSUInteger _capacity; +} + +@synthesize count = _count; + ++ (instancetype)array { + return [[[self alloc] init] autorelease]; +} + ++ (instancetype)arrayWithValue:(uint32_t)value { + // Cast is needed so the compiler knows what class we are invoking initWithValues: on to get + // the type correct. + return [[(GPBUInt32Array*)[self alloc] initWithValues:&value count:1] autorelease]; +} + ++ (instancetype)arrayWithValueArray:(GPBUInt32Array *)array { + return [[(GPBUInt32Array*)[self alloc] initWithValueArray:array] autorelease]; +} + ++ (instancetype)arrayWithCapacity:(NSUInteger)count { + return [[[self alloc] initWithCapacity:count] autorelease]; +} + +- (instancetype)init { + self = [super init]; + // No work needed; + return self; +} + +- (instancetype)initWithValueArray:(GPBUInt32Array *)array { + return [self initWithValues:array->_values count:array->_count]; +} + +- (instancetype)initWithValues:(const uint32_t [])values count:(NSUInteger)count { + self = [self init]; + if (self) { + if (count && values) { + _values = reallocf(_values, count * sizeof(uint32_t)); + if (_values != NULL) { + _capacity = count; + memcpy(_values, values, count * sizeof(uint32_t)); + _count = count; + } else { + [self release]; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(count * sizeof(uint32_t))]; + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)count { + self = [self initWithValues:NULL count:0]; + if (self && count) { + [self internalResizeToCapacity:count]; + } + return self; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32Array allocWithZone:zone] initWithValues:_values count:_count]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + free(_values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32Array class]]) { + return NO; + } + GPBUInt32Array *otherArray = other; + return (_count == otherArray->_count + && memcmp(_values, otherArray->_values, (_count * sizeof(uint32_t))) == 0); +} + +- (NSUInteger)hash { + // Follow NSArray's lead, and use the count as the hash. + return _count; +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; + for (NSUInteger i = 0, count = _count; i < count; ++i) { + if (i == 0) { + [result appendFormat:@"%u", _values[i]]; + } else { + [result appendFormat:@", %u", _values[i]]; + } + } + [result appendFormat:@" }"]; + return result; +} + +- (void)enumerateValuesWithBlock:(void (^)(uint32_t value, NSUInteger idx, BOOL *stop))block { + [self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(uint32_t value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + if ((opts & NSEnumerationReverse) == 0) { + for (NSUInteger i = 0, count = _count; i < count; ++i) { + block(_values[i], i, &stop); + if (stop) break; + } + } else if (_count > 0) { + for (NSUInteger i = _count; i > 0; --i) { + block(_values[i - 1], (i - 1), &stop); + if (stop) break; + } + } +} + +- (uint32_t)valueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + return _values[index]; +} + +- (void)internalResizeToCapacity:(NSUInteger)newCapacity { + _values = reallocf(_values, newCapacity * sizeof(uint32_t)); + if (_values == NULL) { + _capacity = 0; + _count = 0; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(newCapacity * sizeof(uint32_t))]; + } + _capacity = newCapacity; +} + +- (void)addValue:(uint32_t)value { + [self addValues:&value count:1]; +} + +- (void)addValues:(const uint32_t [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(uint32_t)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertValue:(uint32_t)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(uint32_t)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(uint32_t)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + _values[index] = value; +} + +- (void)addValuesFromArray:(GPBUInt32Array *)array { + [self addValues:array->_values count:array->_count]; +} + +- (void)removeValueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + NSUInteger newCount = _count - 1; + if (index != newCount) { + memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(uint32_t)); + } + _count = newCount; + if ((newCount + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } +} + +- (void)removeAll { + _count = 0; + if ((0 + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(0)]; + } +} + +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2 { + if (idx1 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx1, (unsigned long)_count]; + } + if (idx2 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx2, (unsigned long)_count]; + } + uint32_t temp = _values[idx1]; + _values[idx1] = _values[idx2]; + _values[idx2] = temp; +} + +@end + +//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Int64, int64_t, %lld) +// This block of code is generated, do not edit it directly. + +#pragma mark - Int64 + +@implementation GPBInt64Array { + @package + int64_t *_values; + NSUInteger _count; + NSUInteger _capacity; +} + +@synthesize count = _count; + ++ (instancetype)array { + return [[[self alloc] init] autorelease]; +} + ++ (instancetype)arrayWithValue:(int64_t)value { + // Cast is needed so the compiler knows what class we are invoking initWithValues: on to get + // the type correct. + return [[(GPBInt64Array*)[self alloc] initWithValues:&value count:1] autorelease]; +} + ++ (instancetype)arrayWithValueArray:(GPBInt64Array *)array { + return [[(GPBInt64Array*)[self alloc] initWithValueArray:array] autorelease]; +} + ++ (instancetype)arrayWithCapacity:(NSUInteger)count { + return [[[self alloc] initWithCapacity:count] autorelease]; +} + +- (instancetype)init { + self = [super init]; + // No work needed; + return self; +} + +- (instancetype)initWithValueArray:(GPBInt64Array *)array { + return [self initWithValues:array->_values count:array->_count]; +} + +- (instancetype)initWithValues:(const int64_t [])values count:(NSUInteger)count { + self = [self init]; + if (self) { + if (count && values) { + _values = reallocf(_values, count * sizeof(int64_t)); + if (_values != NULL) { + _capacity = count; + memcpy(_values, values, count * sizeof(int64_t)); + _count = count; + } else { + [self release]; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(count * sizeof(int64_t))]; + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)count { + self = [self initWithValues:NULL count:0]; + if (self && count) { + [self internalResizeToCapacity:count]; + } + return self; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64Array allocWithZone:zone] initWithValues:_values count:_count]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + free(_values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64Array class]]) { + return NO; + } + GPBInt64Array *otherArray = other; + return (_count == otherArray->_count + && memcmp(_values, otherArray->_values, (_count * sizeof(int64_t))) == 0); +} + +- (NSUInteger)hash { + // Follow NSArray's lead, and use the count as the hash. + return _count; +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; + for (NSUInteger i = 0, count = _count; i < count; ++i) { + if (i == 0) { + [result appendFormat:@"%lld", _values[i]]; + } else { + [result appendFormat:@", %lld", _values[i]]; + } + } + [result appendFormat:@" }"]; + return result; +} + +- (void)enumerateValuesWithBlock:(void (^)(int64_t value, NSUInteger idx, BOOL *stop))block { + [self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(int64_t value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + if ((opts & NSEnumerationReverse) == 0) { + for (NSUInteger i = 0, count = _count; i < count; ++i) { + block(_values[i], i, &stop); + if (stop) break; + } + } else if (_count > 0) { + for (NSUInteger i = _count; i > 0; --i) { + block(_values[i - 1], (i - 1), &stop); + if (stop) break; + } + } +} + +- (int64_t)valueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + return _values[index]; +} + +- (void)internalResizeToCapacity:(NSUInteger)newCapacity { + _values = reallocf(_values, newCapacity * sizeof(int64_t)); + if (_values == NULL) { + _capacity = 0; + _count = 0; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(newCapacity * sizeof(int64_t))]; + } + _capacity = newCapacity; +} + +- (void)addValue:(int64_t)value { + [self addValues:&value count:1]; +} + +- (void)addValues:(const int64_t [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(int64_t)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertValue:(int64_t)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(int64_t)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int64_t)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + _values[index] = value; +} + +- (void)addValuesFromArray:(GPBInt64Array *)array { + [self addValues:array->_values count:array->_count]; +} + +- (void)removeValueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + NSUInteger newCount = _count - 1; + if (index != newCount) { + memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(int64_t)); + } + _count = newCount; + if ((newCount + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } +} + +- (void)removeAll { + _count = 0; + if ((0 + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(0)]; + } +} + +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2 { + if (idx1 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx1, (unsigned long)_count]; + } + if (idx2 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx2, (unsigned long)_count]; + } + int64_t temp = _values[idx1]; + _values[idx1] = _values[idx2]; + _values[idx2] = temp; +} + +@end + +//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(UInt64, uint64_t, %llu) +// This block of code is generated, do not edit it directly. + +#pragma mark - UInt64 + +@implementation GPBUInt64Array { + @package + uint64_t *_values; + NSUInteger _count; + NSUInteger _capacity; +} + +@synthesize count = _count; + ++ (instancetype)array { + return [[[self alloc] init] autorelease]; +} + ++ (instancetype)arrayWithValue:(uint64_t)value { + // Cast is needed so the compiler knows what class we are invoking initWithValues: on to get + // the type correct. + return [[(GPBUInt64Array*)[self alloc] initWithValues:&value count:1] autorelease]; +} + ++ (instancetype)arrayWithValueArray:(GPBUInt64Array *)array { + return [[(GPBUInt64Array*)[self alloc] initWithValueArray:array] autorelease]; +} + ++ (instancetype)arrayWithCapacity:(NSUInteger)count { + return [[[self alloc] initWithCapacity:count] autorelease]; +} + +- (instancetype)init { + self = [super init]; + // No work needed; + return self; +} + +- (instancetype)initWithValueArray:(GPBUInt64Array *)array { + return [self initWithValues:array->_values count:array->_count]; +} + +- (instancetype)initWithValues:(const uint64_t [])values count:(NSUInteger)count { + self = [self init]; + if (self) { + if (count && values) { + _values = reallocf(_values, count * sizeof(uint64_t)); + if (_values != NULL) { + _capacity = count; + memcpy(_values, values, count * sizeof(uint64_t)); + _count = count; + } else { + [self release]; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(count * sizeof(uint64_t))]; + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)count { + self = [self initWithValues:NULL count:0]; + if (self && count) { + [self internalResizeToCapacity:count]; + } + return self; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64Array allocWithZone:zone] initWithValues:_values count:_count]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + free(_values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64Array class]]) { + return NO; + } + GPBUInt64Array *otherArray = other; + return (_count == otherArray->_count + && memcmp(_values, otherArray->_values, (_count * sizeof(uint64_t))) == 0); +} + +- (NSUInteger)hash { + // Follow NSArray's lead, and use the count as the hash. + return _count; +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; + for (NSUInteger i = 0, count = _count; i < count; ++i) { + if (i == 0) { + [result appendFormat:@"%llu", _values[i]]; + } else { + [result appendFormat:@", %llu", _values[i]]; + } + } + [result appendFormat:@" }"]; + return result; +} + +- (void)enumerateValuesWithBlock:(void (^)(uint64_t value, NSUInteger idx, BOOL *stop))block { + [self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(uint64_t value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + if ((opts & NSEnumerationReverse) == 0) { + for (NSUInteger i = 0, count = _count; i < count; ++i) { + block(_values[i], i, &stop); + if (stop) break; + } + } else if (_count > 0) { + for (NSUInteger i = _count; i > 0; --i) { + block(_values[i - 1], (i - 1), &stop); + if (stop) break; + } + } +} + +- (uint64_t)valueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + return _values[index]; +} + +- (void)internalResizeToCapacity:(NSUInteger)newCapacity { + _values = reallocf(_values, newCapacity * sizeof(uint64_t)); + if (_values == NULL) { + _capacity = 0; + _count = 0; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(newCapacity * sizeof(uint64_t))]; + } + _capacity = newCapacity; +} + +- (void)addValue:(uint64_t)value { + [self addValues:&value count:1]; +} + +- (void)addValues:(const uint64_t [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(uint64_t)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertValue:(uint64_t)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(uint64_t)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(uint64_t)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + _values[index] = value; +} + +- (void)addValuesFromArray:(GPBUInt64Array *)array { + [self addValues:array->_values count:array->_count]; +} + +- (void)removeValueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + NSUInteger newCount = _count - 1; + if (index != newCount) { + memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(uint64_t)); + } + _count = newCount; + if ((newCount + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } +} + +- (void)removeAll { + _count = 0; + if ((0 + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(0)]; + } +} + +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2 { + if (idx1 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx1, (unsigned long)_count]; + } + if (idx2 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx2, (unsigned long)_count]; + } + uint64_t temp = _values[idx1]; + _values[idx1] = _values[idx2]; + _values[idx2] = temp; +} + +@end + +//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Float, float, %f) +// This block of code is generated, do not edit it directly. + +#pragma mark - Float + +@implementation GPBFloatArray { + @package + float *_values; + NSUInteger _count; + NSUInteger _capacity; +} + +@synthesize count = _count; + ++ (instancetype)array { + return [[[self alloc] init] autorelease]; +} + ++ (instancetype)arrayWithValue:(float)value { + // Cast is needed so the compiler knows what class we are invoking initWithValues: on to get + // the type correct. + return [[(GPBFloatArray*)[self alloc] initWithValues:&value count:1] autorelease]; +} + ++ (instancetype)arrayWithValueArray:(GPBFloatArray *)array { + return [[(GPBFloatArray*)[self alloc] initWithValueArray:array] autorelease]; +} + ++ (instancetype)arrayWithCapacity:(NSUInteger)count { + return [[[self alloc] initWithCapacity:count] autorelease]; +} + +- (instancetype)init { + self = [super init]; + // No work needed; + return self; +} + +- (instancetype)initWithValueArray:(GPBFloatArray *)array { + return [self initWithValues:array->_values count:array->_count]; +} + +- (instancetype)initWithValues:(const float [])values count:(NSUInteger)count { + self = [self init]; + if (self) { + if (count && values) { + _values = reallocf(_values, count * sizeof(float)); + if (_values != NULL) { + _capacity = count; + memcpy(_values, values, count * sizeof(float)); + _count = count; + } else { + [self release]; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(count * sizeof(float))]; + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)count { + self = [self initWithValues:NULL count:0]; + if (self && count) { + [self internalResizeToCapacity:count]; + } + return self; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBFloatArray allocWithZone:zone] initWithValues:_values count:_count]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + free(_values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBFloatArray class]]) { + return NO; + } + GPBFloatArray *otherArray = other; + return (_count == otherArray->_count + && memcmp(_values, otherArray->_values, (_count * sizeof(float))) == 0); +} + +- (NSUInteger)hash { + // Follow NSArray's lead, and use the count as the hash. + return _count; +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; + for (NSUInteger i = 0, count = _count; i < count; ++i) { + if (i == 0) { + [result appendFormat:@"%f", _values[i]]; + } else { + [result appendFormat:@", %f", _values[i]]; + } + } + [result appendFormat:@" }"]; + return result; +} + +- (void)enumerateValuesWithBlock:(void (^)(float value, NSUInteger idx, BOOL *stop))block { + [self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(float value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + if ((opts & NSEnumerationReverse) == 0) { + for (NSUInteger i = 0, count = _count; i < count; ++i) { + block(_values[i], i, &stop); + if (stop) break; + } + } else if (_count > 0) { + for (NSUInteger i = _count; i > 0; --i) { + block(_values[i - 1], (i - 1), &stop); + if (stop) break; + } + } +} + +- (float)valueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + return _values[index]; +} + +- (void)internalResizeToCapacity:(NSUInteger)newCapacity { + _values = reallocf(_values, newCapacity * sizeof(float)); + if (_values == NULL) { + _capacity = 0; + _count = 0; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(newCapacity * sizeof(float))]; + } + _capacity = newCapacity; +} + +- (void)addValue:(float)value { + [self addValues:&value count:1]; +} + +- (void)addValues:(const float [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(float)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertValue:(float)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(float)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(float)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + _values[index] = value; +} + +- (void)addValuesFromArray:(GPBFloatArray *)array { + [self addValues:array->_values count:array->_count]; +} + +- (void)removeValueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + NSUInteger newCount = _count - 1; + if (index != newCount) { + memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(float)); + } + _count = newCount; + if ((newCount + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } +} + +- (void)removeAll { + _count = 0; + if ((0 + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(0)]; + } +} + +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2 { + if (idx1 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx1, (unsigned long)_count]; + } + if (idx2 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx2, (unsigned long)_count]; + } + float temp = _values[idx1]; + _values[idx1] = _values[idx2]; + _values[idx2] = temp; +} + +@end + +//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Double, double, %lf) +// This block of code is generated, do not edit it directly. + +#pragma mark - Double + +@implementation GPBDoubleArray { + @package + double *_values; + NSUInteger _count; + NSUInteger _capacity; +} + +@synthesize count = _count; + ++ (instancetype)array { + return [[[self alloc] init] autorelease]; +} + ++ (instancetype)arrayWithValue:(double)value { + // Cast is needed so the compiler knows what class we are invoking initWithValues: on to get + // the type correct. + return [[(GPBDoubleArray*)[self alloc] initWithValues:&value count:1] autorelease]; +} + ++ (instancetype)arrayWithValueArray:(GPBDoubleArray *)array { + return [[(GPBDoubleArray*)[self alloc] initWithValueArray:array] autorelease]; +} + ++ (instancetype)arrayWithCapacity:(NSUInteger)count { + return [[[self alloc] initWithCapacity:count] autorelease]; +} + +- (instancetype)init { + self = [super init]; + // No work needed; + return self; +} + +- (instancetype)initWithValueArray:(GPBDoubleArray *)array { + return [self initWithValues:array->_values count:array->_count]; +} + +- (instancetype)initWithValues:(const double [])values count:(NSUInteger)count { + self = [self init]; + if (self) { + if (count && values) { + _values = reallocf(_values, count * sizeof(double)); + if (_values != NULL) { + _capacity = count; + memcpy(_values, values, count * sizeof(double)); + _count = count; + } else { + [self release]; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(count * sizeof(double))]; + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)count { + self = [self initWithValues:NULL count:0]; + if (self && count) { + [self internalResizeToCapacity:count]; + } + return self; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBDoubleArray allocWithZone:zone] initWithValues:_values count:_count]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + free(_values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBDoubleArray class]]) { + return NO; + } + GPBDoubleArray *otherArray = other; + return (_count == otherArray->_count + && memcmp(_values, otherArray->_values, (_count * sizeof(double))) == 0); +} + +- (NSUInteger)hash { + // Follow NSArray's lead, and use the count as the hash. + return _count; +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; + for (NSUInteger i = 0, count = _count; i < count; ++i) { + if (i == 0) { + [result appendFormat:@"%lf", _values[i]]; + } else { + [result appendFormat:@", %lf", _values[i]]; + } + } + [result appendFormat:@" }"]; + return result; +} + +- (void)enumerateValuesWithBlock:(void (^)(double value, NSUInteger idx, BOOL *stop))block { + [self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(double value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + if ((opts & NSEnumerationReverse) == 0) { + for (NSUInteger i = 0, count = _count; i < count; ++i) { + block(_values[i], i, &stop); + if (stop) break; + } + } else if (_count > 0) { + for (NSUInteger i = _count; i > 0; --i) { + block(_values[i - 1], (i - 1), &stop); + if (stop) break; + } + } +} + +- (double)valueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + return _values[index]; +} + +- (void)internalResizeToCapacity:(NSUInteger)newCapacity { + _values = reallocf(_values, newCapacity * sizeof(double)); + if (_values == NULL) { + _capacity = 0; + _count = 0; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(newCapacity * sizeof(double))]; + } + _capacity = newCapacity; +} + +- (void)addValue:(double)value { + [self addValues:&value count:1]; +} + +- (void)addValues:(const double [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(double)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertValue:(double)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(double)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(double)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + _values[index] = value; +} + +- (void)addValuesFromArray:(GPBDoubleArray *)array { + [self addValues:array->_values count:array->_count]; +} + +- (void)removeValueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + NSUInteger newCount = _count - 1; + if (index != newCount) { + memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(double)); + } + _count = newCount; + if ((newCount + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } +} + +- (void)removeAll { + _count = 0; + if ((0 + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(0)]; + } +} + +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2 { + if (idx1 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx1, (unsigned long)_count]; + } + if (idx2 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx2, (unsigned long)_count]; + } + double temp = _values[idx1]; + _values[idx1] = _values[idx2]; + _values[idx2] = temp; +} + +@end + +//%PDDM-EXPAND ARRAY_INTERFACE_SIMPLE(Bool, BOOL, %d) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool + +@implementation GPBBoolArray { + @package + BOOL *_values; + NSUInteger _count; + NSUInteger _capacity; +} + +@synthesize count = _count; + ++ (instancetype)array { + return [[[self alloc] init] autorelease]; +} + ++ (instancetype)arrayWithValue:(BOOL)value { + // Cast is needed so the compiler knows what class we are invoking initWithValues: on to get + // the type correct. + return [[(GPBBoolArray*)[self alloc] initWithValues:&value count:1] autorelease]; +} + ++ (instancetype)arrayWithValueArray:(GPBBoolArray *)array { + return [[(GPBBoolArray*)[self alloc] initWithValueArray:array] autorelease]; +} + ++ (instancetype)arrayWithCapacity:(NSUInteger)count { + return [[[self alloc] initWithCapacity:count] autorelease]; +} + +- (instancetype)init { + self = [super init]; + // No work needed; + return self; +} + +- (instancetype)initWithValueArray:(GPBBoolArray *)array { + return [self initWithValues:array->_values count:array->_count]; +} + +- (instancetype)initWithValues:(const BOOL [])values count:(NSUInteger)count { + self = [self init]; + if (self) { + if (count && values) { + _values = reallocf(_values, count * sizeof(BOOL)); + if (_values != NULL) { + _capacity = count; + memcpy(_values, values, count * sizeof(BOOL)); + _count = count; + } else { + [self release]; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(count * sizeof(BOOL))]; + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)count { + self = [self initWithValues:NULL count:0]; + if (self && count) { + [self internalResizeToCapacity:count]; + } + return self; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolArray allocWithZone:zone] initWithValues:_values count:_count]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + free(_values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolArray class]]) { + return NO; + } + GPBBoolArray *otherArray = other; + return (_count == otherArray->_count + && memcmp(_values, otherArray->_values, (_count * sizeof(BOOL))) == 0); +} + +- (NSUInteger)hash { + // Follow NSArray's lead, and use the count as the hash. + return _count; +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; + for (NSUInteger i = 0, count = _count; i < count; ++i) { + if (i == 0) { + [result appendFormat:@"%d", _values[i]]; + } else { + [result appendFormat:@", %d", _values[i]]; + } + } + [result appendFormat:@" }"]; + return result; +} + +- (void)enumerateValuesWithBlock:(void (^)(BOOL value, NSUInteger idx, BOOL *stop))block { + [self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(BOOL value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + if ((opts & NSEnumerationReverse) == 0) { + for (NSUInteger i = 0, count = _count; i < count; ++i) { + block(_values[i], i, &stop); + if (stop) break; + } + } else if (_count > 0) { + for (NSUInteger i = _count; i > 0; --i) { + block(_values[i - 1], (i - 1), &stop); + if (stop) break; + } + } +} + +- (BOOL)valueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + return _values[index]; +} + +- (void)internalResizeToCapacity:(NSUInteger)newCapacity { + _values = reallocf(_values, newCapacity * sizeof(BOOL)); + if (_values == NULL) { + _capacity = 0; + _count = 0; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(newCapacity * sizeof(BOOL))]; + } + _capacity = newCapacity; +} + +- (void)addValue:(BOOL)value { + [self addValues:&value count:1]; +} + +- (void)addValues:(const BOOL [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(BOOL)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertValue:(BOOL)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(BOOL)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(BOOL)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + _values[index] = value; +} + +- (void)addValuesFromArray:(GPBBoolArray *)array { + [self addValues:array->_values count:array->_count]; +} + +- (void)removeValueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + NSUInteger newCount = _count - 1; + if (index != newCount) { + memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(BOOL)); + } + _count = newCount; + if ((newCount + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } +} + +- (void)removeAll { + _count = 0; + if ((0 + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(0)]; + } +} + +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2 { + if (idx1 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx1, (unsigned long)_count]; + } + if (idx2 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx2, (unsigned long)_count]; + } + BOOL temp = _values[idx1]; + _values[idx1] = _values[idx2]; + _values[idx2] = temp; +} + +@end + +//%PDDM-EXPAND-END (7 expansions) + +#pragma mark - Enum + +@implementation GPBEnumArray { + @package + GPBEnumValidationFunc _validationFunc; + int32_t *_values; + NSUInteger _count; + NSUInteger _capacity; +} + +@synthesize count = _count; +@synthesize validationFunc = _validationFunc; + ++ (instancetype)array { + return [[[self alloc] initWithValidationFunction:NULL] autorelease]; +} + ++ (instancetype)arrayWithValidationFunction:(GPBEnumValidationFunc)func { + return [[[self alloc] initWithValidationFunction:func] autorelease]; +} + ++ (instancetype)arrayWithValidationFunction:(GPBEnumValidationFunc)func + rawValue:(int32_t)value { + return [[[self alloc] initWithValidationFunction:func + rawValues:&value + count:1] autorelease]; +} + ++ (instancetype)arrayWithValueArray:(GPBEnumArray *)array { + return [[(GPBEnumArray*)[self alloc] initWithValueArray:array] autorelease]; +} + ++ (instancetype)arrayWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)count { + return [[[self alloc] initWithValidationFunction:func capacity:count] autorelease]; +} + +- (instancetype)init { + return [self initWithValidationFunction:NULL]; +} + +- (instancetype)initWithValueArray:(GPBEnumArray *)array { + return [self initWithValidationFunction:array->_validationFunc + rawValues:array->_values + count:array->_count]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func { + self = [super init]; + if (self) { + _validationFunc = (func != NULL ? func : ArrayDefault_IsValidValue); + } + return self; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])values + count:(NSUInteger)count { + self = [self initWithValidationFunction:func]; + if (self) { + if (count && values) { + _values = reallocf(_values, count * sizeof(int32_t)); + if (_values != NULL) { + _capacity = count; + memcpy(_values, values, count * sizeof(int32_t)); + _count = count; + } else { + [self release]; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(count * sizeof(int32_t))]; + } + } + } + return self; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)count { + self = [self initWithValidationFunction:func]; + if (self && count) { + [self internalResizeToCapacity:count]; + } + return self; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBEnumArray allocWithZone:zone] + initWithValidationFunction:_validationFunc + rawValues:_values + count:_count]; +} + +//%PDDM-EXPAND ARRAY_IMMUTABLE_CORE(Enum, int32_t, Raw, %d) +// This block of code is generated, do not edit it directly. + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + free(_values); + [super dealloc]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBEnumArray class]]) { + return NO; + } + GPBEnumArray *otherArray = other; + return (_count == otherArray->_count + && memcmp(_values, otherArray->_values, (_count * sizeof(int32_t))) == 0); +} + +- (NSUInteger)hash { + // Follow NSArray's lead, and use the count as the hash. + return _count; +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> { ", [self class], self]; + for (NSUInteger i = 0, count = _count; i < count; ++i) { + if (i == 0) { + [result appendFormat:@"%d", _values[i]]; + } else { + [result appendFormat:@", %d", _values[i]]; + } + } + [result appendFormat:@" }"]; + return result; +} + +- (void)enumerateRawValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block { + [self enumerateRawValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateRawValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + if ((opts & NSEnumerationReverse) == 0) { + for (NSUInteger i = 0, count = _count; i < count; ++i) { + block(_values[i], i, &stop); + if (stop) break; + } + } else if (_count > 0) { + for (NSUInteger i = _count; i > 0; --i) { + block(_values[i - 1], (i - 1), &stop); + if (stop) break; + } + } +} +//%PDDM-EXPAND-END ARRAY_IMMUTABLE_CORE(Enum, int32_t, Raw, %d) + +- (int32_t)valueAtIndex:(NSUInteger)index { +//%PDDM-EXPAND VALIDATE_RANGE(index, _count) +// This block of code is generated, do not edit it directly. + + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } +//%PDDM-EXPAND-END VALIDATE_RANGE(index, _count) + int32_t result = _values[index]; + if (!_validationFunc(result)) { + result = kGPBUnrecognizedEnumeratorValue; + } + return result; +} + +- (int32_t)rawValueAtIndex:(NSUInteger)index { +//%PDDM-EXPAND VALIDATE_RANGE(index, _count) +// This block of code is generated, do not edit it directly. + + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } +//%PDDM-EXPAND-END VALIDATE_RANGE(index, _count) + return _values[index]; +} + +- (void)enumerateValuesWithBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block { + [self enumerateValuesWithOptions:(NSEnumerationOptions)0 usingBlock:block]; +} + +- (void)enumerateValuesWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(int32_t value, NSUInteger idx, BOOL *stop))block { + // NSEnumerationConcurrent isn't currently supported (and Apple's docs say that is ok). + BOOL stop = NO; + GPBEnumValidationFunc func = _validationFunc; + if ((opts & NSEnumerationReverse) == 0) { + int32_t *scan = _values; + int32_t *end = scan + _count; + for (NSUInteger i = 0; scan < end; ++i, ++scan) { + int32_t value = *scan; + if (!func(value)) { + value = kGPBUnrecognizedEnumeratorValue; + } + block(value, i, &stop); + if (stop) break; + } + } else if (_count > 0) { + int32_t *end = _values; + int32_t *scan = end + (_count - 1); + for (NSUInteger i = (_count - 1); scan >= end; --i, --scan) { + int32_t value = *scan; + if (!func(value)) { + value = kGPBUnrecognizedEnumeratorValue; + } + block(value, i, &stop); + if (stop) break; + } + } +} + +//%PDDM-EXPAND ARRAY_MUTABLE_CORE(Enum, int32_t, Raw, %d) +// This block of code is generated, do not edit it directly. + +- (void)internalResizeToCapacity:(NSUInteger)newCapacity { + _values = reallocf(_values, newCapacity * sizeof(int32_t)); + if (_values == NULL) { + _capacity = 0; + _count = 0; + [NSException raise:NSMallocException + format:@"Failed to allocate %lu bytes", + (unsigned long)(newCapacity * sizeof(int32_t))]; + } + _capacity = newCapacity; +} + +- (void)addRawValue:(int32_t)value { + [self addRawValues:&value count:1]; +} + +- (void)addRawValues:(const int32_t [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(int32_t)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertRawValue:(int32_t)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(int32_t)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withRawValue:(int32_t)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + _values[index] = value; +} + +- (void)addRawValuesFromArray:(GPBEnumArray *)array { + [self addRawValues:array->_values count:array->_count]; +} + +- (void)removeValueAtIndex:(NSUInteger)index { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + NSUInteger newCount = _count - 1; + if (index != newCount) { + memmove(&_values[index], &_values[index + 1], (newCount - index) * sizeof(int32_t)); + } + _count = newCount; + if ((newCount + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } +} + +- (void)removeAll { + _count = 0; + if ((0 + (2 * kChunkSize)) < _capacity) { + [self internalResizeToCapacity:CapacityFromCount(0)]; + } +} + +- (void)exchangeValueAtIndex:(NSUInteger)idx1 + withValueAtIndex:(NSUInteger)idx2 { + if (idx1 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx1, (unsigned long)_count]; + } + if (idx2 >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)idx2, (unsigned long)_count]; + } + int32_t temp = _values[idx1]; + _values[idx1] = _values[idx2]; + _values[idx2] = temp; +} + +//%PDDM-EXPAND MUTATION_METHODS(Enum, int32_t, , EnumValidationList, EnumValidationOne) +// This block of code is generated, do not edit it directly. + +- (void)addValue:(int32_t)value { + [self addValues:&value count:1]; +} + +- (void)addValues:(const int32_t [])values count:(NSUInteger)count { + if (values == NULL || count == 0) return; + GPBEnumValidationFunc func = _validationFunc; + for (NSUInteger i = 0; i < count; ++i) { + if (!func(values[i])) { + [NSException raise:NSInvalidArgumentException + format:@"%@: Attempt to set an unknown enum value (%d)", + [self class], values[i]]; + } + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + count; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + memcpy(&_values[initialCount], values, count * sizeof(int32_t)); + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)insertValue:(int32_t)value atIndex:(NSUInteger)index { + if (index >= _count + 1) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count + 1]; + } + if (!_validationFunc(value)) { + [NSException raise:NSInvalidArgumentException + format:@"%@: Attempt to set an unknown enum value (%d)", + [self class], value]; + } + NSUInteger initialCount = _count; + NSUInteger newCount = initialCount + 1; + if (newCount > _capacity) { + [self internalResizeToCapacity:CapacityFromCount(newCount)]; + } + _count = newCount; + if (index != initialCount) { + memmove(&_values[index + 1], &_values[index], (initialCount - index) * sizeof(int32_t)); + } + _values[index] = value; + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)replaceValueAtIndex:(NSUInteger)index withValue:(int32_t)value { + if (index >= _count) { + [NSException raise:NSRangeException + format:@"Index (%lu) beyond bounds (%lu)", + (unsigned long)index, (unsigned long)_count]; + } + if (!_validationFunc(value)) { + [NSException raise:NSInvalidArgumentException + format:@"%@: Attempt to set an unknown enum value (%d)", + [self class], value]; + } + _values[index] = value; +} +//%PDDM-EXPAND-END (2 expansions) + +//%PDDM-DEFINE MUTATION_HOOK_EnumValidationList() +//% GPBEnumValidationFunc func = _validationFunc; +//% for (NSUInteger i = 0; i < count; ++i) { +//% if (!func(values[i])) { +//% [NSException raise:NSInvalidArgumentException +//% format:@"%@: Attempt to set an unknown enum value (%d)", +//% [self class], values[i]]; +//% } +//% } +//% +//%PDDM-DEFINE MUTATION_HOOK_EnumValidationOne() +//% if (!_validationFunc(value)) { +//% [NSException raise:NSInvalidArgumentException +//% format:@"%@: Attempt to set an unknown enum value (%d)", +//% [self class], value]; +//% } +//% + +@end + +#pragma mark - NSArray Subclass + +@implementation GPBAutocreatedArray { + NSMutableArray *_array; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_array release]; + [super dealloc]; +} + +#pragma mark Required NSArray overrides + +- (NSUInteger)count { + return [_array count]; +} + +- (id)objectAtIndex:(NSUInteger)idx { + return [_array objectAtIndex:idx]; +} + +#pragma mark Required NSMutableArray overrides + +// Only need to call GPBAutocreatedArrayModified() when adding things since +// we only autocreate empty arrays. + +- (void)insertObject:(id)anObject atIndex:(NSUInteger)idx { + if (_array == nil) { + _array = [[NSMutableArray alloc] init]; + } + [_array insertObject:anObject atIndex:idx]; + + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)removeObject:(id)anObject { + [_array removeObject:anObject]; +} + +- (void)removeObjectAtIndex:(NSUInteger)idx { + [_array removeObjectAtIndex:idx]; +} + +- (void)addObject:(id)anObject { + if (_array == nil) { + _array = [[NSMutableArray alloc] init]; + } + [_array addObject:anObject]; + + if (_autocreator) { + GPBAutocreatedArrayModified(_autocreator, self); + } +} + +- (void)removeLastObject { + [_array removeLastObject]; +} + +- (void)replaceObjectAtIndex:(NSUInteger)idx withObject:(id)anObject { + [_array replaceObjectAtIndex:idx withObject:anObject]; +} + +#pragma mark Extra things hooked + +- (id)copyWithZone:(NSZone *)zone { + if (_array == nil) { + return [[NSMutableArray allocWithZone:zone] init]; + } + return [_array copyWithZone:zone]; +} + +- (id)mutableCopyWithZone:(NSZone *)zone { + if (_array == nil) { + return [[NSMutableArray allocWithZone:zone] init]; + } + return [_array mutableCopyWithZone:zone]; +} + +- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state + objects:(id __unsafe_unretained [])buffer + count:(NSUInteger)len { + return [_array countByEnumeratingWithState:state objects:buffer count:len]; +} + +- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block { + [_array enumerateObjectsUsingBlock:block]; +} + +- (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block { + [_array enumerateObjectsWithOptions:opts usingBlock:block]; +} + +@end + +#pragma clang diagnostic pop diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray_PackagePrivate.h new file mode 100644 index 00000000..35a45381 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBArray_PackagePrivate.h @@ -0,0 +1,130 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBArray.h" + +@class GPBMessage; + +//%PDDM-DEFINE DECLARE_ARRAY_EXTRAS() +//%ARRAY_INTERFACE_EXTRAS(Int32, int32_t) +//%ARRAY_INTERFACE_EXTRAS(UInt32, uint32_t) +//%ARRAY_INTERFACE_EXTRAS(Int64, int64_t) +//%ARRAY_INTERFACE_EXTRAS(UInt64, uint64_t) +//%ARRAY_INTERFACE_EXTRAS(Float, float) +//%ARRAY_INTERFACE_EXTRAS(Double, double) +//%ARRAY_INTERFACE_EXTRAS(Bool, BOOL) +//%ARRAY_INTERFACE_EXTRAS(Enum, int32_t) + +//%PDDM-DEFINE ARRAY_INTERFACE_EXTRAS(NAME, TYPE) +//%#pragma mark - NAME +//% +//%@interface GPB##NAME##Array () { +//% @package +//% GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +//%} +//%@end +//% + +//%PDDM-EXPAND DECLARE_ARRAY_EXTRAS() +// This block of code is generated, do not edit it directly. + +#pragma mark - Int32 + +@interface GPBInt32Array () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - UInt32 + +@interface GPBUInt32Array () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - Int64 + +@interface GPBInt64Array () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - UInt64 + +@interface GPBUInt64Array () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - Float + +@interface GPBFloatArray () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - Double + +@interface GPBDoubleArray () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - Bool + +@interface GPBBoolArray () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - Enum + +@interface GPBEnumArray () { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +//%PDDM-EXPAND-END DECLARE_ARRAY_EXTRAS() + +#pragma mark - NSArray Subclass + +@interface GPBAutocreatedArray : NSMutableArray { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBBootstrap.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBBootstrap.h new file mode 100644 index 00000000..ed53ae7c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBBootstrap.h @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/** + * The Objective C runtime has complete enough info that most protos don’t end + * up using this, so leaving it on is no cost or very little cost. If you + * happen to see it causing bloat, this is the way to disable it. If you do + * need to disable it, try only disabling it for Release builds as having + * full TextFormat can be useful for debugging. + **/ +#ifndef GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS +#define GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS 0 +#endif + +// Used in the generated code to give sizes to enums. int32_t was chosen based +// on the fact that Protocol Buffers enums are limited to this range. +#if !__has_feature(objc_fixed_enum) + #error All supported Xcode versions should support objc_fixed_enum. +#endif + +// If the headers are imported into Objective-C++, we can run into an issue +// where the defintion of NS_ENUM (really CF_ENUM) changes based on the C++ +// standard that is in effect. If it isn't C++11 or higher, the definition +// doesn't allow us to forward declare. We work around this one case by +// providing a local definition. The default case has to use NS_ENUM for the +// magic that is Swift bridging of enums. +#if (defined(__cplusplus) && __cplusplus && __cplusplus < 201103L) + #define GPB_ENUM(X) enum X : int32_t X; enum X : int32_t +#else + #define GPB_ENUM(X) NS_ENUM(int32_t, X) +#endif + +/** + * GPB_ENUM_FWD_DECLARE is used for forward declaring enums, for example: + * + * ``` + * GPB_ENUM_FWD_DECLARE(Foo_Enum) + * + * @interface BarClass : NSObject + * @property (nonatomic) enum Foo_Enum value; + * - (void)bazMethod:(enum Foo_Enum):value; + * @end + * ``` + **/ +#define GPB_ENUM_FWD_DECLARE(X) enum X : int32_t + +/** + * Based upon CF_INLINE. Forces inlining in non DEBUG builds. + **/ +#if !defined(DEBUG) +#define GPB_INLINE static __inline__ __attribute__((always_inline)) +#else +#define GPB_INLINE static __inline__ +#endif + +/** + * For use in public headers that might need to deal with ARC. + **/ +#ifndef GPB_UNSAFE_UNRETAINED +#if __has_feature(objc_arc) +#define GPB_UNSAFE_UNRETAINED __unsafe_unretained +#else +#define GPB_UNSAFE_UNRETAINED +#endif +#endif + +// If property name starts with init we need to annotate it to get past ARC. +// http://stackoverflow.com/questions/18723226/how-do-i-annotate-an-objective-c-property-with-an-objc-method-family/18723227#18723227 +// +// Meant to be used internally by generated code. +#define GPB_METHOD_FAMILY_NONE __attribute__((objc_method_family(none))) + +// ---------------------------------------------------------------------------- +// These version numbers are all internal to the ObjC Protobuf runtime; they +// are used to ensure compatibility between the generated sources and the +// headers being compiled against and/or the version of sources being run +// against. +// +// They are all #defines so the values are captured into every .o file they +// are used in and to allow comparisons in the preprocessor. + +// Current library runtime version. +// - Gets bumped when the runtime makes changes to the interfaces between the +// generated code and runtime (things added/removed, etc). +#define GOOGLE_PROTOBUF_OBJC_VERSION 30002 + +// Minimum runtime version supported for compiling/running against. +// - Gets changed when support for the older generated code is dropped. +#define GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION 30001 + + +// This is a legacy constant now frozen in time for old generated code. If +// GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION ever gets moved above 30001 then +// this should also change to break code compiled with an old runtime that +// can't be supported any more. +#define GOOGLE_PROTOBUF_OBJC_GEN_VERSION 30001 diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream.h new file mode 100644 index 00000000..fbe5009c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream.h @@ -0,0 +1,253 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +@class GPBMessage; +@class GPBExtensionRegistry; + +NS_ASSUME_NONNULL_BEGIN + +CF_EXTERN_C_BEGIN + +/** + * @c GPBCodedInputStream exception name. Exceptions raised from + * @c GPBCodedInputStream contain an underlying error in the userInfo dictionary + * under the GPBCodedInputStreamUnderlyingErrorKey key. + **/ +extern NSString *const GPBCodedInputStreamException; + +/** The key under which the underlying NSError from the exception is stored. */ +extern NSString *const GPBCodedInputStreamUnderlyingErrorKey; + +/** NSError domain used for @c GPBCodedInputStream errors. */ +extern NSString *const GPBCodedInputStreamErrorDomain; + +/** + * Error code for NSError with @c GPBCodedInputStreamErrorDomain. + **/ +typedef NS_ENUM(NSInteger, GPBCodedInputStreamErrorCode) { + /** The size does not fit in the remaining bytes to be read. */ + GPBCodedInputStreamErrorInvalidSize = -100, + /** Attempted to read beyond the subsection limit. */ + GPBCodedInputStreamErrorSubsectionLimitReached = -101, + /** The requested subsection limit is invalid. */ + GPBCodedInputStreamErrorInvalidSubsectionLimit = -102, + /** Invalid tag read. */ + GPBCodedInputStreamErrorInvalidTag = -103, + /** Invalid UTF-8 character in a string. */ + GPBCodedInputStreamErrorInvalidUTF8 = -104, + /** Invalid VarInt read. */ + GPBCodedInputStreamErrorInvalidVarInt = -105, + /** The maximum recursion depth of messages was exceeded. */ + GPBCodedInputStreamErrorRecursionDepthExceeded = -106, +}; + +CF_EXTERN_C_END + +/** + * Reads and decodes protocol message fields. + * + * The common uses of protocol buffers shouldn't need to use this class. + * @c GPBMessage's provide a @c +parseFromData:error: and + * @c +parseFromData:extensionRegistry:error: method that will decode a + * message for you. + * + * @note Subclassing of @c GPBCodedInputStream is NOT supported. + **/ +@interface GPBCodedInputStream : NSObject + +/** + * Creates a new stream wrapping some data. + * + * @param data The data to wrap inside the stream. + * + * @return A newly instanced GPBCodedInputStream. + **/ ++ (instancetype)streamWithData:(NSData *)data; + +/** + * Initializes a stream wrapping some data. + * + * @param data The data to wrap inside the stream. + * + * @return A newly initialized GPBCodedInputStream. + **/ +- (instancetype)initWithData:(NSData *)data; + +/** + * Attempts to read a field tag, returning zero if we have reached EOF. + * Protocol message parsers use this to read tags, since a protocol message + * may legally end wherever a tag occurs, and zero is not a valid tag number. + * + * @return The field tag, or zero if EOF was reached. + **/ +- (int32_t)readTag; + +/** + * @return A double read from the stream. + **/ +- (double)readDouble; +/** + * @return A float read from the stream. + **/ +- (float)readFloat; +/** + * @return A uint64 read from the stream. + **/ +- (uint64_t)readUInt64; +/** + * @return A uint32 read from the stream. + **/ +- (uint32_t)readUInt32; +/** + * @return An int64 read from the stream. + **/ +- (int64_t)readInt64; +/** + * @return An int32 read from the stream. + **/ +- (int32_t)readInt32; +/** + * @return A fixed64 read from the stream. + **/ +- (uint64_t)readFixed64; +/** + * @return A fixed32 read from the stream. + **/ +- (uint32_t)readFixed32; +/** + * @return An enum read from the stream. + **/ +- (int32_t)readEnum; +/** + * @return A sfixed32 read from the stream. + **/ +- (int32_t)readSFixed32; +/** + * @return A fixed64 read from the stream. + **/ +- (int64_t)readSFixed64; +/** + * @return A sint32 read from the stream. + **/ +- (int32_t)readSInt32; +/** + * @return A sint64 read from the stream. + **/ +- (int64_t)readSInt64; +/** + * @return A boolean read from the stream. + **/ +- (BOOL)readBool; +/** + * @return A string read from the stream. + **/ +- (NSString *)readString; +/** + * @return Data read from the stream. + **/ +- (NSData *)readBytes; + +/** + * Read an embedded message field value from the stream. + * + * @param message The message to set fields on as they are read. + * @param extensionRegistry An optional extension registry to use to lookup + * extensions for message. + **/ +- (void)readMessage:(GPBMessage *)message + extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry; + +/** + * Reads and discards a single field, given its tag value. + * + * @param tag The tag number of the field to skip. + * + * @return NO if the tag is an endgroup tag (in which case nothing is skipped), + * YES in all other cases. + **/ +- (BOOL)skipField:(int32_t)tag; + +/** + * Reads and discards an entire message. This will read either until EOF or + * until an endgroup tag, whichever comes first. + **/ +- (void)skipMessage; + +/** + * Check to see if the logical end of the stream has been reached. + * + * @note This can return NO when there is no more data, but the current parsing + * expected more data. + * + * @return YES if the logical end of the stream has been reached, NO otherwise. + **/ +- (BOOL)isAtEnd; + +/** + * @return The offset into the stream. + **/ +- (size_t)position; + +/** + * Moves the limit to the given byte offset starting at the current location. + * + * @exception GPBCodedInputStreamException If the requested bytes exceeed the + * current limit. + * + * @param byteLimit The number of bytes to move the limit, offset to the current + * location. + * + * @return The limit offset before moving the new limit. + */ +- (size_t)pushLimit:(size_t)byteLimit; + +/** + * Moves the limit back to the offset as it was before calling pushLimit:. + * + * @param oldLimit The number of bytes to move the current limit. Usually this + * is the value returned by the pushLimit: method. + */ +- (void)popLimit:(size_t)oldLimit; + +/** + * Verifies that the last call to -readTag returned the given tag value. This + * is used to verify that a nested group ended with the correct end tag. + * + * @exception NSParseErrorException If the value does not match the last tag. + * + * @param expected The tag that was expected. + **/ +- (void)checkLastTagWas:(int32_t)expected; + +@end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream.m new file mode 100644 index 00000000..eef05353 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream.m @@ -0,0 +1,538 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBCodedInputStream_PackagePrivate.h" + +#import "GPBDictionary_PackagePrivate.h" +#import "GPBMessage_PackagePrivate.h" +#import "GPBUnknownFieldSet_PackagePrivate.h" +#import "GPBUtilities_PackagePrivate.h" +#import "GPBWireFormat.h" + +NSString *const GPBCodedInputStreamException = + GPBNSStringifySymbol(GPBCodedInputStreamException); + +NSString *const GPBCodedInputStreamUnderlyingErrorKey = + GPBNSStringifySymbol(GPBCodedInputStreamUnderlyingErrorKey); + +NSString *const GPBCodedInputStreamErrorDomain = + GPBNSStringifySymbol(GPBCodedInputStreamErrorDomain); + +// Matching: +// https://github.com/google/protobuf/blob/master/java/core/src/main/java/com/google/protobuf/CodedInputStream.java#L62 +// private static final int DEFAULT_RECURSION_LIMIT = 100; +// https://github.com/google/protobuf/blob/master/src/google/protobuf/io/coded_stream.cc#L86 +// int CodedInputStream::default_recursion_limit_ = 100; +static const NSUInteger kDefaultRecursionLimit = 100; + +static void RaiseException(NSInteger code, NSString *reason) { + NSDictionary *errorInfo = nil; + if ([reason length]) { + errorInfo = @{ GPBErrorReasonKey: reason }; + } + NSError *error = [NSError errorWithDomain:GPBCodedInputStreamErrorDomain + code:code + userInfo:errorInfo]; + + NSDictionary *exceptionInfo = + @{ GPBCodedInputStreamUnderlyingErrorKey: error }; + [[[NSException alloc] initWithName:GPBCodedInputStreamException + reason:reason + userInfo:exceptionInfo] raise]; +} + +static void CheckSize(GPBCodedInputStreamState *state, size_t size) { + size_t newSize = state->bufferPos + size; + if (newSize > state->bufferSize) { + RaiseException(GPBCodedInputStreamErrorInvalidSize, nil); + } + if (newSize > state->currentLimit) { + // Fast forward to end of currentLimit; + state->bufferPos = state->currentLimit; + RaiseException(GPBCodedInputStreamErrorSubsectionLimitReached, nil); + } +} + +static int8_t ReadRawByte(GPBCodedInputStreamState *state) { + CheckSize(state, sizeof(int8_t)); + return ((int8_t *)state->bytes)[state->bufferPos++]; +} + +static int32_t ReadRawLittleEndian32(GPBCodedInputStreamState *state) { + CheckSize(state, sizeof(int32_t)); + int32_t value = OSReadLittleInt32(state->bytes, state->bufferPos); + state->bufferPos += sizeof(int32_t); + return value; +} + +static int64_t ReadRawLittleEndian64(GPBCodedInputStreamState *state) { + CheckSize(state, sizeof(int64_t)); + int64_t value = OSReadLittleInt64(state->bytes, state->bufferPos); + state->bufferPos += sizeof(int64_t); + return value; +} + +static int32_t ReadRawVarint32(GPBCodedInputStreamState *state) { + int8_t tmp = ReadRawByte(state); + if (tmp >= 0) { + return tmp; + } + int32_t result = tmp & 0x7f; + if ((tmp = ReadRawByte(state)) >= 0) { + result |= tmp << 7; + } else { + result |= (tmp & 0x7f) << 7; + if ((tmp = ReadRawByte(state)) >= 0) { + result |= tmp << 14; + } else { + result |= (tmp & 0x7f) << 14; + if ((tmp = ReadRawByte(state)) >= 0) { + result |= tmp << 21; + } else { + result |= (tmp & 0x7f) << 21; + result |= (tmp = ReadRawByte(state)) << 28; + if (tmp < 0) { + // Discard upper 32 bits. + for (int i = 0; i < 5; i++) { + if (ReadRawByte(state) >= 0) { + return result; + } + } + RaiseException(GPBCodedInputStreamErrorInvalidVarInt, + @"Invalid VarInt32"); + } + } + } + } + return result; +} + +static int64_t ReadRawVarint64(GPBCodedInputStreamState *state) { + int32_t shift = 0; + int64_t result = 0; + while (shift < 64) { + int8_t b = ReadRawByte(state); + result |= (int64_t)(b & 0x7F) << shift; + if ((b & 0x80) == 0) { + return result; + } + shift += 7; + } + RaiseException(GPBCodedInputStreamErrorInvalidVarInt, @"Invalid VarInt64"); + return 0; +} + +static void SkipRawData(GPBCodedInputStreamState *state, size_t size) { + CheckSize(state, size); + state->bufferPos += size; +} + +double GPBCodedInputStreamReadDouble(GPBCodedInputStreamState *state) { + int64_t value = ReadRawLittleEndian64(state); + return GPBConvertInt64ToDouble(value); +} + +float GPBCodedInputStreamReadFloat(GPBCodedInputStreamState *state) { + int32_t value = ReadRawLittleEndian32(state); + return GPBConvertInt32ToFloat(value); +} + +uint64_t GPBCodedInputStreamReadUInt64(GPBCodedInputStreamState *state) { + uint64_t value = ReadRawVarint64(state); + return value; +} + +uint32_t GPBCodedInputStreamReadUInt32(GPBCodedInputStreamState *state) { + uint32_t value = ReadRawVarint32(state); + return value; +} + +int64_t GPBCodedInputStreamReadInt64(GPBCodedInputStreamState *state) { + int64_t value = ReadRawVarint64(state); + return value; +} + +int32_t GPBCodedInputStreamReadInt32(GPBCodedInputStreamState *state) { + int32_t value = ReadRawVarint32(state); + return value; +} + +uint64_t GPBCodedInputStreamReadFixed64(GPBCodedInputStreamState *state) { + uint64_t value = ReadRawLittleEndian64(state); + return value; +} + +uint32_t GPBCodedInputStreamReadFixed32(GPBCodedInputStreamState *state) { + uint32_t value = ReadRawLittleEndian32(state); + return value; +} + +int32_t GPBCodedInputStreamReadEnum(GPBCodedInputStreamState *state) { + int32_t value = ReadRawVarint32(state); + return value; +} + +int32_t GPBCodedInputStreamReadSFixed32(GPBCodedInputStreamState *state) { + int32_t value = ReadRawLittleEndian32(state); + return value; +} + +int64_t GPBCodedInputStreamReadSFixed64(GPBCodedInputStreamState *state) { + int64_t value = ReadRawLittleEndian64(state); + return value; +} + +int32_t GPBCodedInputStreamReadSInt32(GPBCodedInputStreamState *state) { + int32_t value = GPBDecodeZigZag32(ReadRawVarint32(state)); + return value; +} + +int64_t GPBCodedInputStreamReadSInt64(GPBCodedInputStreamState *state) { + int64_t value = GPBDecodeZigZag64(ReadRawVarint64(state)); + return value; +} + +BOOL GPBCodedInputStreamReadBool(GPBCodedInputStreamState *state) { + return ReadRawVarint32(state) != 0; +} + +int32_t GPBCodedInputStreamReadTag(GPBCodedInputStreamState *state) { + if (GPBCodedInputStreamIsAtEnd(state)) { + state->lastTag = 0; + return 0; + } + + state->lastTag = ReadRawVarint32(state); + if (state->lastTag == 0) { + // If we actually read zero, that's not a valid tag. + RaiseException(GPBCodedInputStreamErrorInvalidTag, + @"A zero tag on the wire is invalid."); + } + // Tags have to include a valid wireformat, check that also. + if (!GPBWireFormatIsValidTag(state->lastTag)) { + RaiseException(GPBCodedInputStreamErrorInvalidTag, + @"Invalid wireformat in tag."); + } + return state->lastTag; +} + +NSString *GPBCodedInputStreamReadRetainedString( + GPBCodedInputStreamState *state) { + int32_t size = ReadRawVarint32(state); + NSString *result; + if (size == 0) { + result = @""; + } else { + CheckSize(state, size); + result = [[NSString alloc] initWithBytes:&state->bytes[state->bufferPos] + length:size + encoding:NSUTF8StringEncoding]; + state->bufferPos += size; + if (!result) { +#ifdef DEBUG + // https://developers.google.com/protocol-buffers/docs/proto#scalar + NSLog(@"UTF-8 failure, is some field type 'string' when it should be " + @"'bytes'?"); +#endif + RaiseException(GPBCodedInputStreamErrorInvalidUTF8, nil); + } + } + return result; +} + +NSData *GPBCodedInputStreamReadRetainedBytes(GPBCodedInputStreamState *state) { + int32_t size = ReadRawVarint32(state); + if (size < 0) return nil; + CheckSize(state, size); + NSData *result = [[NSData alloc] initWithBytes:state->bytes + state->bufferPos + length:size]; + state->bufferPos += size; + return result; +} + +NSData *GPBCodedInputStreamReadRetainedBytesNoCopy( + GPBCodedInputStreamState *state) { + int32_t size = ReadRawVarint32(state); + if (size < 0) return nil; + CheckSize(state, size); + // Cast is safe because freeWhenDone is NO. + NSData *result = [[NSData alloc] + initWithBytesNoCopy:(void *)(state->bytes + state->bufferPos) + length:size + freeWhenDone:NO]; + state->bufferPos += size; + return result; +} + +size_t GPBCodedInputStreamPushLimit(GPBCodedInputStreamState *state, + size_t byteLimit) { + byteLimit += state->bufferPos; + size_t oldLimit = state->currentLimit; + if (byteLimit > oldLimit) { + RaiseException(GPBCodedInputStreamErrorInvalidSubsectionLimit, nil); + } + state->currentLimit = byteLimit; + return oldLimit; +} + +void GPBCodedInputStreamPopLimit(GPBCodedInputStreamState *state, + size_t oldLimit) { + state->currentLimit = oldLimit; +} + +size_t GPBCodedInputStreamBytesUntilLimit(GPBCodedInputStreamState *state) { + return state->currentLimit - state->bufferPos; +} + +BOOL GPBCodedInputStreamIsAtEnd(GPBCodedInputStreamState *state) { + return (state->bufferPos == state->bufferSize) || + (state->bufferPos == state->currentLimit); +} + +void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state, + int32_t value) { + if (state->lastTag != value) { + RaiseException(GPBCodedInputStreamErrorInvalidTag, @"Unexpected tag read"); + } +} + +@implementation GPBCodedInputStream + ++ (instancetype)streamWithData:(NSData *)data { + return [[[self alloc] initWithData:data] autorelease]; +} + +- (instancetype)initWithData:(NSData *)data { + if ((self = [super init])) { +#ifdef DEBUG + NSCAssert([self class] == [GPBCodedInputStream class], + @"Subclassing of GPBCodedInputStream is not allowed."); +#endif + buffer_ = [data retain]; + state_.bytes = (const uint8_t *)[data bytes]; + state_.bufferSize = [data length]; + state_.currentLimit = state_.bufferSize; + } + return self; +} + +- (void)dealloc { + [buffer_ release]; + [super dealloc]; +} + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +- (int32_t)readTag { + return GPBCodedInputStreamReadTag(&state_); +} + +- (void)checkLastTagWas:(int32_t)value { + GPBCodedInputStreamCheckLastTagWas(&state_, value); +} + +- (BOOL)skipField:(int32_t)tag { + NSAssert(GPBWireFormatIsValidTag(tag), @"Invalid tag"); + switch (GPBWireFormatGetTagWireType(tag)) { + case GPBWireFormatVarint: + GPBCodedInputStreamReadInt32(&state_); + return YES; + case GPBWireFormatFixed64: + SkipRawData(&state_, sizeof(int64_t)); + return YES; + case GPBWireFormatLengthDelimited: + SkipRawData(&state_, ReadRawVarint32(&state_)); + return YES; + case GPBWireFormatStartGroup: + [self skipMessage]; + GPBCodedInputStreamCheckLastTagWas( + &state_, GPBWireFormatMakeTag(GPBWireFormatGetTagFieldNumber(tag), + GPBWireFormatEndGroup)); + return YES; + case GPBWireFormatEndGroup: + return NO; + case GPBWireFormatFixed32: + SkipRawData(&state_, sizeof(int32_t)); + return YES; + } +} + +- (void)skipMessage { + while (YES) { + int32_t tag = GPBCodedInputStreamReadTag(&state_); + if (tag == 0 || ![self skipField:tag]) { + return; + } + } +} + +- (BOOL)isAtEnd { + return GPBCodedInputStreamIsAtEnd(&state_); +} + +- (size_t)position { + return state_.bufferPos; +} + +- (size_t)pushLimit:(size_t)byteLimit { + return GPBCodedInputStreamPushLimit(&state_, byteLimit); +} + +- (void)popLimit:(size_t)oldLimit { + GPBCodedInputStreamPopLimit(&state_, oldLimit); +} + +- (double)readDouble { + return GPBCodedInputStreamReadDouble(&state_); +} + +- (float)readFloat { + return GPBCodedInputStreamReadFloat(&state_); +} + +- (uint64_t)readUInt64 { + return GPBCodedInputStreamReadUInt64(&state_); +} + +- (int64_t)readInt64 { + return GPBCodedInputStreamReadInt64(&state_); +} + +- (int32_t)readInt32 { + return GPBCodedInputStreamReadInt32(&state_); +} + +- (uint64_t)readFixed64 { + return GPBCodedInputStreamReadFixed64(&state_); +} + +- (uint32_t)readFixed32 { + return GPBCodedInputStreamReadFixed32(&state_); +} + +- (BOOL)readBool { + return GPBCodedInputStreamReadBool(&state_); +} + +- (NSString *)readString { + return [GPBCodedInputStreamReadRetainedString(&state_) autorelease]; +} + +- (void)readGroup:(int32_t)fieldNumber + message:(GPBMessage *)message + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { + if (state_.recursionDepth >= kDefaultRecursionLimit) { + RaiseException(GPBCodedInputStreamErrorRecursionDepthExceeded, nil); + } + ++state_.recursionDepth; + [message mergeFromCodedInputStream:self extensionRegistry:extensionRegistry]; + GPBCodedInputStreamCheckLastTagWas( + &state_, GPBWireFormatMakeTag(fieldNumber, GPBWireFormatEndGroup)); + --state_.recursionDepth; +} + +- (void)readUnknownGroup:(int32_t)fieldNumber + message:(GPBUnknownFieldSet *)message { + if (state_.recursionDepth >= kDefaultRecursionLimit) { + RaiseException(GPBCodedInputStreamErrorRecursionDepthExceeded, nil); + } + ++state_.recursionDepth; + [message mergeFromCodedInputStream:self]; + GPBCodedInputStreamCheckLastTagWas( + &state_, GPBWireFormatMakeTag(fieldNumber, GPBWireFormatEndGroup)); + --state_.recursionDepth; +} + +- (void)readMessage:(GPBMessage *)message + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { + int32_t length = ReadRawVarint32(&state_); + if (state_.recursionDepth >= kDefaultRecursionLimit) { + RaiseException(GPBCodedInputStreamErrorRecursionDepthExceeded, nil); + } + size_t oldLimit = GPBCodedInputStreamPushLimit(&state_, length); + ++state_.recursionDepth; + [message mergeFromCodedInputStream:self extensionRegistry:extensionRegistry]; + GPBCodedInputStreamCheckLastTagWas(&state_, 0); + --state_.recursionDepth; + GPBCodedInputStreamPopLimit(&state_, oldLimit); +} + +- (void)readMapEntry:(id)mapDictionary + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry + field:(GPBFieldDescriptor *)field + parentMessage:(GPBMessage *)parentMessage { + int32_t length = ReadRawVarint32(&state_); + if (state_.recursionDepth >= kDefaultRecursionLimit) { + RaiseException(GPBCodedInputStreamErrorRecursionDepthExceeded, nil); + } + size_t oldLimit = GPBCodedInputStreamPushLimit(&state_, length); + ++state_.recursionDepth; + GPBDictionaryReadEntry(mapDictionary, self, extensionRegistry, field, + parentMessage); + GPBCodedInputStreamCheckLastTagWas(&state_, 0); + --state_.recursionDepth; + GPBCodedInputStreamPopLimit(&state_, oldLimit); +} + +- (NSData *)readBytes { + return [GPBCodedInputStreamReadRetainedBytes(&state_) autorelease]; +} + +- (uint32_t)readUInt32 { + return GPBCodedInputStreamReadUInt32(&state_); +} + +- (int32_t)readEnum { + return GPBCodedInputStreamReadEnum(&state_); +} + +- (int32_t)readSFixed32 { + return GPBCodedInputStreamReadSFixed32(&state_); +} + +- (int64_t)readSFixed64 { + return GPBCodedInputStreamReadSFixed64(&state_); +} + +- (int32_t)readSInt32 { + return GPBCodedInputStreamReadSInt32(&state_); +} + +- (int64_t)readSInt64 { + return GPBCodedInputStreamReadSInt64(&state_); +} + +#pragma clang diagnostic pop + +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream_PackagePrivate.h new file mode 100644 index 00000000..90bd0c92 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedInputStream_PackagePrivate.h @@ -0,0 +1,114 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This header is private to the ProtobolBuffers library and must NOT be +// included by any sources outside this library. The contents of this file are +// subject to change at any time without notice. + +#import "GPBCodedInputStream.h" + +#import <libkern/OSAtomic.h> + +@class GPBUnknownFieldSet; +@class GPBFieldDescriptor; + +typedef struct GPBCodedInputStreamState { + const uint8_t *bytes; + size_t bufferSize; + size_t bufferPos; + + // For parsing subsections of an input stream you can put a hard limit on + // how much should be read. Normally the limit is the end of the stream, + // but you can adjust it to anywhere, and if you hit it you will be at the + // end of the stream, until you adjust the limit. + size_t currentLimit; + int32_t lastTag; + NSUInteger recursionDepth; +} GPBCodedInputStreamState; + +@interface GPBCodedInputStream () { + @package + struct GPBCodedInputStreamState state_; + NSData *buffer_; +} + +// Group support is deprecated, so we hide this interface from users, but +// support for older data. +- (void)readGroup:(int32_t)fieldNumber + message:(GPBMessage *)message + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry; + +// Reads a group field value from the stream and merges it into the given +// UnknownFieldSet. +- (void)readUnknownGroup:(int32_t)fieldNumber + message:(GPBUnknownFieldSet *)message; + +// Reads a map entry. +- (void)readMapEntry:(id)mapDictionary + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry + field:(GPBFieldDescriptor *)field + parentMessage:(GPBMessage *)parentMessage; +@end + +CF_EXTERN_C_BEGIN + +int32_t GPBCodedInputStreamReadTag(GPBCodedInputStreamState *state); + +double GPBCodedInputStreamReadDouble(GPBCodedInputStreamState *state); +float GPBCodedInputStreamReadFloat(GPBCodedInputStreamState *state); +uint64_t GPBCodedInputStreamReadUInt64(GPBCodedInputStreamState *state); +uint32_t GPBCodedInputStreamReadUInt32(GPBCodedInputStreamState *state); +int64_t GPBCodedInputStreamReadInt64(GPBCodedInputStreamState *state); +int32_t GPBCodedInputStreamReadInt32(GPBCodedInputStreamState *state); +uint64_t GPBCodedInputStreamReadFixed64(GPBCodedInputStreamState *state); +uint32_t GPBCodedInputStreamReadFixed32(GPBCodedInputStreamState *state); +int32_t GPBCodedInputStreamReadEnum(GPBCodedInputStreamState *state); +int32_t GPBCodedInputStreamReadSFixed32(GPBCodedInputStreamState *state); +int64_t GPBCodedInputStreamReadSFixed64(GPBCodedInputStreamState *state); +int32_t GPBCodedInputStreamReadSInt32(GPBCodedInputStreamState *state); +int64_t GPBCodedInputStreamReadSInt64(GPBCodedInputStreamState *state); +BOOL GPBCodedInputStreamReadBool(GPBCodedInputStreamState *state); +NSString *GPBCodedInputStreamReadRetainedString(GPBCodedInputStreamState *state) + __attribute((ns_returns_retained)); +NSData *GPBCodedInputStreamReadRetainedBytes(GPBCodedInputStreamState *state) + __attribute((ns_returns_retained)); +NSData *GPBCodedInputStreamReadRetainedBytesNoCopy( + GPBCodedInputStreamState *state) __attribute((ns_returns_retained)); + +size_t GPBCodedInputStreamPushLimit(GPBCodedInputStreamState *state, + size_t byteLimit); +void GPBCodedInputStreamPopLimit(GPBCodedInputStreamState *state, + size_t oldLimit); +size_t GPBCodedInputStreamBytesUntilLimit(GPBCodedInputStreamState *state); +BOOL GPBCodedInputStreamIsAtEnd(GPBCodedInputStreamState *state); +void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state, + int32_t value); + +CF_EXTERN_C_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream.h new file mode 100644 index 00000000..d6fff3db --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream.h @@ -0,0 +1,739 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBRuntimeTypes.h" +#import "GPBWireFormat.h" + +@class GPBBoolArray; +@class GPBDoubleArray; +@class GPBEnumArray; +@class GPBFloatArray; +@class GPBMessage; +@class GPBInt32Array; +@class GPBInt64Array; +@class GPBUInt32Array; +@class GPBUInt64Array; +@class GPBUnknownFieldSet; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Writes out protocol message fields. + * + * The common uses of protocol buffers shouldn't need to use this class. + * GPBMessage's provide a -data method that will serialize the message for you. + * + * @note Subclassing of GPBCodedOutputStream is NOT supported. + **/ +@interface GPBCodedOutputStream : NSObject + +/** + * Creates a stream to fill in the given data. Data must be sized to fit or + * an error will be raised when out of space. + * + * @param data The data where the stream will be written to. + * + * @return A newly instanced GPBCodedOutputStream. + **/ ++ (instancetype)streamWithData:(NSMutableData *)data; + +/** + * Creates a stream to write into the given NSOutputStream. + * + * @param output The output stream where the stream will be written to. + * + * @return A newly instanced GPBCodedOutputStream. + **/ ++ (instancetype)streamWithOutputStream:(NSOutputStream *)output; + +/** + * Initializes a stream to fill in the given data. Data must be sized to fit + * or an error will be raised when out of space. + * + * @param data The data where the stream will be written to. + * + * @return A newly initialized GPBCodedOutputStream. + **/ +- (instancetype)initWithData:(NSMutableData *)data; + +/** + * Initializes a stream to write into the given @c NSOutputStream. + * + * @param output The output stream where the stream will be written to. + * + * @return A newly initialized GPBCodedOutputStream. + **/ +- (instancetype)initWithOutputStream:(NSOutputStream *)output; + +/** + * Flush any buffered data out. + **/ +- (void)flush; + +/** + * Write the raw byte out. + * + * @param value The value to write out. + **/ +- (void)writeRawByte:(uint8_t)value; + +/** + * Write the tag for the given field number and wire format. + * + * @param fieldNumber The field number. + * @param format The wire format the data for the field will be in. + **/ +- (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format; + +/** + * Write a 32bit value out in little endian format. + * + * @param value The value to write out. + **/ +- (void)writeRawLittleEndian32:(int32_t)value; +/** + * Write a 64bit value out in little endian format. + * + * @param value The value to write out. + **/ +- (void)writeRawLittleEndian64:(int64_t)value; + +/** + * Write a 32bit value out in varint format. + * + * @param value The value to write out. + **/ +- (void)writeRawVarint32:(int32_t)value; +/** + * Write a 64bit value out in varint format. + * + * @param value The value to write out. + **/ +- (void)writeRawVarint64:(int64_t)value; + +/** + * Write a size_t out as a 32bit varint value. + * + * @note This will truncate 64 bit values to 32. + * + * @param value The value to write out. + **/ +- (void)writeRawVarintSizeTAs32:(size_t)value; + +/** + * Writes the contents of an NSData out. + * + * @param data The data to write out. + **/ +- (void)writeRawData:(NSData *)data; +/** + * Writes out the given data. + * + * @param data The data blob to write out. + * @param offset The offset into the blob to start writing out. + * @param length The number of bytes from the blob to write out. + **/ +- (void)writeRawPtr:(const void *)data + offset:(size_t)offset + length:(size_t)length; + +//%PDDM-EXPAND _WRITE_DECLS() +// This block of code is generated, do not edit it directly. + +/** + * Write a double for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeDouble:(int32_t)fieldNumber value:(double)value; +/** + * Write a packed array of double for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeDoubleArray:(int32_t)fieldNumber + values:(GPBDoubleArray *)values + tag:(uint32_t)tag; +/** + * Write a double without any tag. + * + * @param value The value to write out. + **/ +- (void)writeDoubleNoTag:(double)value; + +/** + * Write a float for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeFloat:(int32_t)fieldNumber value:(float)value; +/** + * Write a packed array of float for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeFloatArray:(int32_t)fieldNumber + values:(GPBFloatArray *)values + tag:(uint32_t)tag; +/** + * Write a float without any tag. + * + * @param value The value to write out. + **/ +- (void)writeFloatNoTag:(float)value; + +/** + * Write a uint64_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value; +/** + * Write a packed array of uint64_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeUInt64Array:(int32_t)fieldNumber + values:(GPBUInt64Array *)values + tag:(uint32_t)tag; +/** + * Write a uint64_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeUInt64NoTag:(uint64_t)value; + +/** + * Write a int64_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value; +/** + * Write a packed array of int64_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeInt64Array:(int32_t)fieldNumber + values:(GPBInt64Array *)values + tag:(uint32_t)tag; +/** + * Write a int64_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeInt64NoTag:(int64_t)value; + +/** + * Write a int32_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value; +/** + * Write a packed array of int32_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeInt32Array:(int32_t)fieldNumber + values:(GPBInt32Array *)values + tag:(uint32_t)tag; +/** + * Write a int32_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeInt32NoTag:(int32_t)value; + +/** + * Write a uint32_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value; +/** + * Write a packed array of uint32_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeUInt32Array:(int32_t)fieldNumber + values:(GPBUInt32Array *)values + tag:(uint32_t)tag; +/** + * Write a uint32_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeUInt32NoTag:(uint32_t)value; + +/** + * Write a uint64_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value; +/** + * Write a packed array of uint64_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeFixed64Array:(int32_t)fieldNumber + values:(GPBUInt64Array *)values + tag:(uint32_t)tag; +/** + * Write a uint64_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeFixed64NoTag:(uint64_t)value; + +/** + * Write a uint32_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value; +/** + * Write a packed array of uint32_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeFixed32Array:(int32_t)fieldNumber + values:(GPBUInt32Array *)values + tag:(uint32_t)tag; +/** + * Write a uint32_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeFixed32NoTag:(uint32_t)value; + +/** + * Write a int32_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value; +/** + * Write a packed array of int32_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeSInt32Array:(int32_t)fieldNumber + values:(GPBInt32Array *)values + tag:(uint32_t)tag; +/** + * Write a int32_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeSInt32NoTag:(int32_t)value; + +/** + * Write a int64_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value; +/** + * Write a packed array of int64_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeSInt64Array:(int32_t)fieldNumber + values:(GPBInt64Array *)values + tag:(uint32_t)tag; +/** + * Write a int64_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeSInt64NoTag:(int64_t)value; + +/** + * Write a int64_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value; +/** + * Write a packed array of int64_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeSFixed64Array:(int32_t)fieldNumber + values:(GPBInt64Array *)values + tag:(uint32_t)tag; +/** + * Write a int64_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeSFixed64NoTag:(int64_t)value; + +/** + * Write a int32_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value; +/** + * Write a packed array of int32_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeSFixed32Array:(int32_t)fieldNumber + values:(GPBInt32Array *)values + tag:(uint32_t)tag; +/** + * Write a int32_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeSFixed32NoTag:(int32_t)value; + +/** + * Write a BOOL for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeBool:(int32_t)fieldNumber value:(BOOL)value; +/** + * Write a packed array of BOOL for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeBoolArray:(int32_t)fieldNumber + values:(GPBBoolArray *)values + tag:(uint32_t)tag; +/** + * Write a BOOL without any tag. + * + * @param value The value to write out. + **/ +- (void)writeBoolNoTag:(BOOL)value; + +/** + * Write a int32_t for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value; +/** + * Write a packed array of int32_t for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + * @param tag The tag assigned to the values. + **/ +- (void)writeEnumArray:(int32_t)fieldNumber + values:(GPBEnumArray *)values + tag:(uint32_t)tag; +/** + * Write a int32_t without any tag. + * + * @param value The value to write out. + **/ +- (void)writeEnumNoTag:(int32_t)value; + +/** + * Write a NSString for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeString:(int32_t)fieldNumber value:(NSString *)value; +/** + * Write an array of NSString for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + **/ +- (void)writeStringArray:(int32_t)fieldNumber values:(NSArray<NSString*> *)values; +/** + * Write a NSString without any tag. + * + * @param value The value to write out. + **/ +- (void)writeStringNoTag:(NSString *)value; + +/** + * Write a GPBMessage for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value; +/** + * Write an array of GPBMessage for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + **/ +- (void)writeMessageArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)values; +/** + * Write a GPBMessage without any tag. + * + * @param value The value to write out. + **/ +- (void)writeMessageNoTag:(GPBMessage *)value; + +/** + * Write a NSData for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value; +/** + * Write an array of NSData for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + **/ +- (void)writeBytesArray:(int32_t)fieldNumber values:(NSArray<NSData*> *)values; +/** + * Write a NSData without any tag. + * + * @param value The value to write out. + **/ +- (void)writeBytesNoTag:(NSData *)value; + +/** + * Write a GPBMessage for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeGroup:(int32_t)fieldNumber + value:(GPBMessage *)value; +/** + * Write an array of GPBMessage for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + **/ +- (void)writeGroupArray:(int32_t)fieldNumber values:(NSArray<GPBMessage*> *)values; +/** + * Write a GPBMessage without any tag (but does write the endGroup tag). + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeGroupNoTag:(int32_t)fieldNumber + value:(GPBMessage *)value; + +/** + * Write a GPBUnknownFieldSet for the given field number. + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeUnknownGroup:(int32_t)fieldNumber + value:(GPBUnknownFieldSet *)value; +/** + * Write an array of GPBUnknownFieldSet for the given field number. + * + * @param fieldNumber The field number assigned to the values. + * @param values The values to write out. + **/ +- (void)writeUnknownGroupArray:(int32_t)fieldNumber values:(NSArray<GPBUnknownFieldSet*> *)values; +/** + * Write a GPBUnknownFieldSet without any tag (but does write the endGroup tag). + * + * @param fieldNumber The field number assigned to the value. + * @param value The value to write out. + **/ +- (void)writeUnknownGroupNoTag:(int32_t)fieldNumber + value:(GPBUnknownFieldSet *)value; + +//%PDDM-EXPAND-END _WRITE_DECLS() + +/** +Write a MessageSet extension field to the stream. For historical reasons, +the wire format differs from normal fields. + +@param fieldNumber The extension field number to write out. +@param value The message from where to get the extension. +*/ +- (void)writeMessageSetExtension:(int32_t)fieldNumber value:(GPBMessage *)value; + +/** +Write an unparsed MessageSet extension field to the stream. For historical +reasons, the wire format differs from normal fields. + +@param fieldNumber The extension field number to write out. +@param value The raw message from where to get the extension. +*/ +- (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value; + +@end + +NS_ASSUME_NONNULL_END + +// Write methods for types that can be in packed arrays. +//%PDDM-DEFINE _WRITE_PACKABLE_DECLS(NAME, ARRAY_TYPE, TYPE) +//%/** +//% * Write a TYPE for the given field number. +//% * +//% * @param fieldNumber The field number assigned to the value. +//% * @param value The value to write out. +//% **/ +//%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE)value; +//%/** +//% * Write a packed array of TYPE for the given field number. +//% * +//% * @param fieldNumber The field number assigned to the values. +//% * @param values The values to write out. +//% * @param tag The tag assigned to the values. +//% **/ +//%- (void)write##NAME##Array:(int32_t)fieldNumber +//% NAME$S values:(GPB##ARRAY_TYPE##Array *)values +//% NAME$S tag:(uint32_t)tag; +//%/** +//% * Write a TYPE without any tag. +//% * +//% * @param value The value to write out. +//% **/ +//%- (void)write##NAME##NoTag:(TYPE)value; +//% +// Write methods for types that aren't in packed arrays. +//%PDDM-DEFINE _WRITE_UNPACKABLE_DECLS(NAME, TYPE) +//%/** +//% * Write a TYPE for the given field number. +//% * +//% * @param fieldNumber The field number assigned to the value. +//% * @param value The value to write out. +//% **/ +//%- (void)write##NAME:(int32_t)fieldNumber value:(TYPE *)value; +//%/** +//% * Write an array of TYPE for the given field number. +//% * +//% * @param fieldNumber The field number assigned to the values. +//% * @param values The values to write out. +//% **/ +//%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)values; +//%/** +//% * Write a TYPE without any tag. +//% * +//% * @param value The value to write out. +//% **/ +//%- (void)write##NAME##NoTag:(TYPE *)value; +//% +// Special write methods for Groups. +//%PDDM-DEFINE _WRITE_GROUP_DECLS(NAME, TYPE) +//%/** +//% * Write a TYPE for the given field number. +//% * +//% * @param fieldNumber The field number assigned to the value. +//% * @param value The value to write out. +//% **/ +//%- (void)write##NAME:(int32_t)fieldNumber +//% NAME$S value:(TYPE *)value; +//%/** +//% * Write an array of TYPE for the given field number. +//% * +//% * @param fieldNumber The field number assigned to the values. +//% * @param values The values to write out. +//% **/ +//%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray<##TYPE##*> *)values; +//%/** +//% * Write a TYPE without any tag (but does write the endGroup tag). +//% * +//% * @param fieldNumber The field number assigned to the value. +//% * @param value The value to write out. +//% **/ +//%- (void)write##NAME##NoTag:(int32_t)fieldNumber +//% NAME$S value:(TYPE *)value; +//% + +// One macro to hide it all up above. +//%PDDM-DEFINE _WRITE_DECLS() +//%_WRITE_PACKABLE_DECLS(Double, Double, double) +//%_WRITE_PACKABLE_DECLS(Float, Float, float) +//%_WRITE_PACKABLE_DECLS(UInt64, UInt64, uint64_t) +//%_WRITE_PACKABLE_DECLS(Int64, Int64, int64_t) +//%_WRITE_PACKABLE_DECLS(Int32, Int32, int32_t) +//%_WRITE_PACKABLE_DECLS(UInt32, UInt32, uint32_t) +//%_WRITE_PACKABLE_DECLS(Fixed64, UInt64, uint64_t) +//%_WRITE_PACKABLE_DECLS(Fixed32, UInt32, uint32_t) +//%_WRITE_PACKABLE_DECLS(SInt32, Int32, int32_t) +//%_WRITE_PACKABLE_DECLS(SInt64, Int64, int64_t) +//%_WRITE_PACKABLE_DECLS(SFixed64, Int64, int64_t) +//%_WRITE_PACKABLE_DECLS(SFixed32, Int32, int32_t) +//%_WRITE_PACKABLE_DECLS(Bool, Bool, BOOL) +//%_WRITE_PACKABLE_DECLS(Enum, Enum, int32_t) +//%_WRITE_UNPACKABLE_DECLS(String, NSString) +//%_WRITE_UNPACKABLE_DECLS(Message, GPBMessage) +//%_WRITE_UNPACKABLE_DECLS(Bytes, NSData) +//%_WRITE_GROUP_DECLS(Group, GPBMessage) +//%_WRITE_GROUP_DECLS(UnknownGroup, GPBUnknownFieldSet) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream.m new file mode 100644 index 00000000..7c3ab447 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream.m @@ -0,0 +1,1202 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBCodedOutputStream_PackagePrivate.h" + +#import <mach/vm_param.h> + +#import "GPBArray.h" +#import "GPBUnknownFieldSet_PackagePrivate.h" +#import "GPBUtilities_PackagePrivate.h" + +// Structure for containing state of a GPBCodedInputStream. Brought out into +// a struct so that we can inline several common functions instead of dealing +// with overhead of ObjC dispatch. +typedef struct GPBOutputBufferState { + uint8_t *bytes; + size_t size; + size_t position; + NSOutputStream *output; +} GPBOutputBufferState; + +@implementation GPBCodedOutputStream { + GPBOutputBufferState state_; + NSMutableData *buffer_; +} + +static const int32_t LITTLE_ENDIAN_32_SIZE = sizeof(uint32_t); +static const int32_t LITTLE_ENDIAN_64_SIZE = sizeof(uint64_t); + +// Internal helper that writes the current buffer to the output. The +// buffer position is reset to its initial value when this returns. +static void GPBRefreshBuffer(GPBOutputBufferState *state) { + if (state->output == nil) { + // We're writing to a single buffer. + [NSException raise:@"OutOfSpace" format:@""]; + } + if (state->position != 0) { + NSInteger written = + [state->output write:state->bytes maxLength:state->position]; + if (written != (NSInteger)state->position) { + [NSException raise:@"WriteFailed" format:@""]; + } + state->position = 0; + } +} + +static void GPBWriteRawByte(GPBOutputBufferState *state, uint8_t value) { + if (state->position == state->size) { + GPBRefreshBuffer(state); + } + state->bytes[state->position++] = value; +} + +static void GPBWriteRawVarint32(GPBOutputBufferState *state, int32_t value) { + while (YES) { + if ((value & ~0x7F) == 0) { + uint8_t val = (uint8_t)value; + GPBWriteRawByte(state, val); + return; + } else { + GPBWriteRawByte(state, (value & 0x7F) | 0x80); + value = GPBLogicalRightShift32(value, 7); + } + } +} + +static void GPBWriteRawVarint64(GPBOutputBufferState *state, int64_t value) { + while (YES) { + if ((value & ~0x7FL) == 0) { + uint8_t val = (uint8_t)value; + GPBWriteRawByte(state, val); + return; + } else { + GPBWriteRawByte(state, ((int32_t)value & 0x7F) | 0x80); + value = GPBLogicalRightShift64(value, 7); + } + } +} + +static void GPBWriteInt32NoTag(GPBOutputBufferState *state, int32_t value) { + if (value >= 0) { + GPBWriteRawVarint32(state, value); + } else { + // Must sign-extend + GPBWriteRawVarint64(state, value); + } +} + +static void GPBWriteUInt32(GPBOutputBufferState *state, int32_t fieldNumber, + uint32_t value) { + GPBWriteTagWithFormat(state, fieldNumber, GPBWireFormatVarint); + GPBWriteRawVarint32(state, value); +} + +static void GPBWriteTagWithFormat(GPBOutputBufferState *state, + uint32_t fieldNumber, GPBWireFormat format) { + GPBWriteRawVarint32(state, GPBWireFormatMakeTag(fieldNumber, format)); +} + +static void GPBWriteRawLittleEndian32(GPBOutputBufferState *state, + int32_t value) { + GPBWriteRawByte(state, (value)&0xFF); + GPBWriteRawByte(state, (value >> 8) & 0xFF); + GPBWriteRawByte(state, (value >> 16) & 0xFF); + GPBWriteRawByte(state, (value >> 24) & 0xFF); +} + +static void GPBWriteRawLittleEndian64(GPBOutputBufferState *state, + int64_t value) { + GPBWriteRawByte(state, (int32_t)(value)&0xFF); + GPBWriteRawByte(state, (int32_t)(value >> 8) & 0xFF); + GPBWriteRawByte(state, (int32_t)(value >> 16) & 0xFF); + GPBWriteRawByte(state, (int32_t)(value >> 24) & 0xFF); + GPBWriteRawByte(state, (int32_t)(value >> 32) & 0xFF); + GPBWriteRawByte(state, (int32_t)(value >> 40) & 0xFF); + GPBWriteRawByte(state, (int32_t)(value >> 48) & 0xFF); + GPBWriteRawByte(state, (int32_t)(value >> 56) & 0xFF); +} + +- (void)dealloc { + [self flush]; + [state_.output close]; + [state_.output release]; + [buffer_ release]; + + [super dealloc]; +} + +- (instancetype)initWithOutputStream:(NSOutputStream *)output { + NSMutableData *data = [NSMutableData dataWithLength:PAGE_SIZE]; + return [self initWithOutputStream:output data:data]; +} + +- (instancetype)initWithData:(NSMutableData *)data { + return [self initWithOutputStream:nil data:data]; +} + +// This initializer isn't exposed, but it is the designated initializer. +// Setting OutputStream and NSData is to control the buffering behavior/size +// of the work, but that is more obvious via the bufferSize: version. +- (instancetype)initWithOutputStream:(NSOutputStream *)output + data:(NSMutableData *)data { + if ((self = [super init])) { + buffer_ = [data retain]; + [output open]; + state_.bytes = [data mutableBytes]; + state_.size = [data length]; + state_.output = [output retain]; + } + return self; +} + ++ (instancetype)streamWithOutputStream:(NSOutputStream *)output { + NSMutableData *data = [NSMutableData dataWithLength:PAGE_SIZE]; + return [[[self alloc] initWithOutputStream:output + data:data] autorelease]; +} + ++ (instancetype)streamWithData:(NSMutableData *)data { + return [[[self alloc] initWithData:data] autorelease]; +} + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +- (void)writeDoubleNoTag:(double)value { + GPBWriteRawLittleEndian64(&state_, GPBConvertDoubleToInt64(value)); +} + +- (void)writeDouble:(int32_t)fieldNumber value:(double)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatFixed64); + GPBWriteRawLittleEndian64(&state_, GPBConvertDoubleToInt64(value)); +} + +- (void)writeFloatNoTag:(float)value { + GPBWriteRawLittleEndian32(&state_, GPBConvertFloatToInt32(value)); +} + +- (void)writeFloat:(int32_t)fieldNumber value:(float)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatFixed32); + GPBWriteRawLittleEndian32(&state_, GPBConvertFloatToInt32(value)); +} + +- (void)writeUInt64NoTag:(uint64_t)value { + GPBWriteRawVarint64(&state_, value); +} + +- (void)writeUInt64:(int32_t)fieldNumber value:(uint64_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatVarint); + GPBWriteRawVarint64(&state_, value); +} + +- (void)writeInt64NoTag:(int64_t)value { + GPBWriteRawVarint64(&state_, value); +} + +- (void)writeInt64:(int32_t)fieldNumber value:(int64_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatVarint); + GPBWriteRawVarint64(&state_, value); +} + +- (void)writeInt32NoTag:(int32_t)value { + GPBWriteInt32NoTag(&state_, value); +} + +- (void)writeInt32:(int32_t)fieldNumber value:(int32_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatVarint); + GPBWriteInt32NoTag(&state_, value); +} + +- (void)writeFixed64NoTag:(uint64_t)value { + GPBWriteRawLittleEndian64(&state_, value); +} + +- (void)writeFixed64:(int32_t)fieldNumber value:(uint64_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatFixed64); + GPBWriteRawLittleEndian64(&state_, value); +} + +- (void)writeFixed32NoTag:(uint32_t)value { + GPBWriteRawLittleEndian32(&state_, value); +} + +- (void)writeFixed32:(int32_t)fieldNumber value:(uint32_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatFixed32); + GPBWriteRawLittleEndian32(&state_, value); +} + +- (void)writeBoolNoTag:(BOOL)value { + GPBWriteRawByte(&state_, (value ? 1 : 0)); +} + +- (void)writeBool:(int32_t)fieldNumber value:(BOOL)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatVarint); + GPBWriteRawByte(&state_, (value ? 1 : 0)); +} + +- (void)writeStringNoTag:(const NSString *)value { + size_t length = [value lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + GPBWriteRawVarint32(&state_, (int32_t)length); + if (length == 0) { + return; + } + + const char *quickString = + CFStringGetCStringPtr((CFStringRef)value, kCFStringEncodingUTF8); + + // Fast path: Most strings are short, if the buffer already has space, + // add to it directly. + NSUInteger bufferBytesLeft = state_.size - state_.position; + if (bufferBytesLeft >= length) { + NSUInteger usedBufferLength = 0; + BOOL result; + if (quickString != NULL) { + memcpy(state_.bytes + state_.position, quickString, length); + usedBufferLength = length; + result = YES; + } else { + result = [value getBytes:state_.bytes + state_.position + maxLength:bufferBytesLeft + usedLength:&usedBufferLength + encoding:NSUTF8StringEncoding + options:(NSStringEncodingConversionOptions)0 + range:NSMakeRange(0, [value length]) + remainingRange:NULL]; + } + if (result) { + NSAssert2((usedBufferLength == length), + @"Our UTF8 calc was wrong? %tu vs %zd", usedBufferLength, + length); + state_.position += usedBufferLength; + return; + } + } else if (quickString != NULL) { + [self writeRawPtr:quickString offset:0 length:length]; + } else { + // Slow path: just get it as data and write it out. + NSData *utf8Data = [value dataUsingEncoding:NSUTF8StringEncoding]; + NSAssert2(([utf8Data length] == length), + @"Strings UTF8 length was wrong? %tu vs %zd", [utf8Data length], + length); + [self writeRawData:utf8Data]; + } +} + +- (void)writeString:(int32_t)fieldNumber value:(NSString *)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatLengthDelimited); + [self writeStringNoTag:value]; +} + +- (void)writeGroupNoTag:(int32_t)fieldNumber value:(GPBMessage *)value { + [value writeToCodedOutputStream:self]; + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatEndGroup); +} + +- (void)writeGroup:(int32_t)fieldNumber value:(GPBMessage *)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatStartGroup); + [self writeGroupNoTag:fieldNumber value:value]; +} + +- (void)writeUnknownGroupNoTag:(int32_t)fieldNumber + value:(const GPBUnknownFieldSet *)value { + [value writeToCodedOutputStream:self]; + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatEndGroup); +} + +- (void)writeUnknownGroup:(int32_t)fieldNumber + value:(GPBUnknownFieldSet *)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatStartGroup); + [self writeUnknownGroupNoTag:fieldNumber value:value]; +} + +- (void)writeMessageNoTag:(GPBMessage *)value { + GPBWriteRawVarint32(&state_, (int32_t)[value serializedSize]); + [value writeToCodedOutputStream:self]; +} + +- (void)writeMessage:(int32_t)fieldNumber value:(GPBMessage *)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatLengthDelimited); + [self writeMessageNoTag:value]; +} + +- (void)writeBytesNoTag:(NSData *)value { + GPBWriteRawVarint32(&state_, (int32_t)[value length]); + [self writeRawData:value]; +} + +- (void)writeBytes:(int32_t)fieldNumber value:(NSData *)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatLengthDelimited); + [self writeBytesNoTag:value]; +} + +- (void)writeUInt32NoTag:(uint32_t)value { + GPBWriteRawVarint32(&state_, value); +} + +- (void)writeUInt32:(int32_t)fieldNumber value:(uint32_t)value { + GPBWriteUInt32(&state_, fieldNumber, value); +} + +- (void)writeEnumNoTag:(int32_t)value { + GPBWriteRawVarint32(&state_, value); +} + +- (void)writeEnum:(int32_t)fieldNumber value:(int32_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatVarint); + GPBWriteRawVarint32(&state_, value); +} + +- (void)writeSFixed32NoTag:(int32_t)value { + GPBWriteRawLittleEndian32(&state_, value); +} + +- (void)writeSFixed32:(int32_t)fieldNumber value:(int32_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatFixed32); + GPBWriteRawLittleEndian32(&state_, value); +} + +- (void)writeSFixed64NoTag:(int64_t)value { + GPBWriteRawLittleEndian64(&state_, value); +} + +- (void)writeSFixed64:(int32_t)fieldNumber value:(int64_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatFixed64); + GPBWriteRawLittleEndian64(&state_, value); +} + +- (void)writeSInt32NoTag:(int32_t)value { + GPBWriteRawVarint32(&state_, GPBEncodeZigZag32(value)); +} + +- (void)writeSInt32:(int32_t)fieldNumber value:(int32_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatVarint); + GPBWriteRawVarint32(&state_, GPBEncodeZigZag32(value)); +} + +- (void)writeSInt64NoTag:(int64_t)value { + GPBWriteRawVarint64(&state_, GPBEncodeZigZag64(value)); +} + +- (void)writeSInt64:(int32_t)fieldNumber value:(int64_t)value { + GPBWriteTagWithFormat(&state_, fieldNumber, GPBWireFormatVarint); + GPBWriteRawVarint64(&state_, GPBEncodeZigZag64(value)); +} + +//%PDDM-DEFINE WRITE_PACKABLE_DEFNS(NAME, ARRAY_TYPE, TYPE, ACCESSOR_NAME) +//%- (void)write##NAME##Array:(int32_t)fieldNumber +//% NAME$S values:(GPB##ARRAY_TYPE##Array *)values +//% NAME$S tag:(uint32_t)tag { +//% if (tag != 0) { +//% if (values.count == 0) return; +//% __block size_t dataSize = 0; +//% [values enumerate##ACCESSOR_NAME##ValuesWithBlock:^(TYPE value, NSUInteger idx, BOOL *stop) { +//%#pragma unused(idx, stop) +//% dataSize += GPBCompute##NAME##SizeNoTag(value); +//% }]; +//% GPBWriteRawVarint32(&state_, tag); +//% GPBWriteRawVarint32(&state_, (int32_t)dataSize); +//% [values enumerate##ACCESSOR_NAME##ValuesWithBlock:^(TYPE value, NSUInteger idx, BOOL *stop) { +//%#pragma unused(idx, stop) +//% [self write##NAME##NoTag:value]; +//% }]; +//% } else { +//% [values enumerate##ACCESSOR_NAME##ValuesWithBlock:^(TYPE value, NSUInteger idx, BOOL *stop) { +//%#pragma unused(idx, stop) +//% [self write##NAME:fieldNumber value:value]; +//% }]; +//% } +//%} +//% +//%PDDM-DEFINE WRITE_UNPACKABLE_DEFNS(NAME, TYPE) +//%- (void)write##NAME##Array:(int32_t)fieldNumber values:(NSArray *)values { +//% for (TYPE *value in values) { +//% [self write##NAME:fieldNumber value:value]; +//% } +//%} +//% +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(Double, Double, double, ) +// This block of code is generated, do not edit it directly. + +- (void)writeDoubleArray:(int32_t)fieldNumber + values:(GPBDoubleArray *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(double value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeDoubleSizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(double value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeDoubleNoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(double value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeDouble:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(Float, Float, float, ) +// This block of code is generated, do not edit it directly. + +- (void)writeFloatArray:(int32_t)fieldNumber + values:(GPBFloatArray *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(float value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeFloatSizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(float value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeFloatNoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(float value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeFloat:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(UInt64, UInt64, uint64_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeUInt64Array:(int32_t)fieldNumber + values:(GPBUInt64Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeUInt64SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeUInt64NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeUInt64:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(Int64, Int64, int64_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeInt64Array:(int32_t)fieldNumber + values:(GPBInt64Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeInt64SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeInt64NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeInt64:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(Int32, Int32, int32_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeInt32Array:(int32_t)fieldNumber + values:(GPBInt32Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeInt32SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeInt32NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeInt32:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(UInt32, UInt32, uint32_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeUInt32Array:(int32_t)fieldNumber + values:(GPBUInt32Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(uint32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeUInt32SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(uint32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeUInt32NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(uint32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeUInt32:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(Fixed64, UInt64, uint64_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeFixed64Array:(int32_t)fieldNumber + values:(GPBUInt64Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeFixed64SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeFixed64NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeFixed64:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(Fixed32, UInt32, uint32_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeFixed32Array:(int32_t)fieldNumber + values:(GPBUInt32Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(uint32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeFixed32SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(uint32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeFixed32NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(uint32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeFixed32:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(SInt32, Int32, int32_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeSInt32Array:(int32_t)fieldNumber + values:(GPBInt32Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeSInt32SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeSInt32NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeSInt32:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(SInt64, Int64, int64_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeSInt64Array:(int32_t)fieldNumber + values:(GPBInt64Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeSInt64SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeSInt64NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeSInt64:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(SFixed64, Int64, int64_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeSFixed64Array:(int32_t)fieldNumber + values:(GPBInt64Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeSFixed64SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeSFixed64NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(int64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeSFixed64:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(SFixed32, Int32, int32_t, ) +// This block of code is generated, do not edit it directly. + +- (void)writeSFixed32Array:(int32_t)fieldNumber + values:(GPBInt32Array *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeSFixed32SizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeSFixed32NoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeSFixed32:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(Bool, Bool, BOOL, ) +// This block of code is generated, do not edit it directly. + +- (void)writeBoolArray:(int32_t)fieldNumber + values:(GPBBoolArray *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateValuesWithBlock:^(BOOL value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeBoolSizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateValuesWithBlock:^(BOOL value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeBoolNoTag:value]; + }]; + } else { + [values enumerateValuesWithBlock:^(BOOL value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeBool:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_PACKABLE_DEFNS(Enum, Enum, int32_t, Raw) +// This block of code is generated, do not edit it directly. + +- (void)writeEnumArray:(int32_t)fieldNumber + values:(GPBEnumArray *)values + tag:(uint32_t)tag { + if (tag != 0) { + if (values.count == 0) return; + __block size_t dataSize = 0; + [values enumerateRawValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + dataSize += GPBComputeEnumSizeNoTag(value); + }]; + GPBWriteRawVarint32(&state_, tag); + GPBWriteRawVarint32(&state_, (int32_t)dataSize); + [values enumerateRawValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeEnumNoTag:value]; + }]; + } else { + [values enumerateRawValuesWithBlock:^(int32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [self writeEnum:fieldNumber value:value]; + }]; + } +} + +//%PDDM-EXPAND WRITE_UNPACKABLE_DEFNS(String, NSString) +// This block of code is generated, do not edit it directly. + +- (void)writeStringArray:(int32_t)fieldNumber values:(NSArray *)values { + for (NSString *value in values) { + [self writeString:fieldNumber value:value]; + } +} + +//%PDDM-EXPAND WRITE_UNPACKABLE_DEFNS(Message, GPBMessage) +// This block of code is generated, do not edit it directly. + +- (void)writeMessageArray:(int32_t)fieldNumber values:(NSArray *)values { + for (GPBMessage *value in values) { + [self writeMessage:fieldNumber value:value]; + } +} + +//%PDDM-EXPAND WRITE_UNPACKABLE_DEFNS(Bytes, NSData) +// This block of code is generated, do not edit it directly. + +- (void)writeBytesArray:(int32_t)fieldNumber values:(NSArray *)values { + for (NSData *value in values) { + [self writeBytes:fieldNumber value:value]; + } +} + +//%PDDM-EXPAND WRITE_UNPACKABLE_DEFNS(Group, GPBMessage) +// This block of code is generated, do not edit it directly. + +- (void)writeGroupArray:(int32_t)fieldNumber values:(NSArray *)values { + for (GPBMessage *value in values) { + [self writeGroup:fieldNumber value:value]; + } +} + +//%PDDM-EXPAND WRITE_UNPACKABLE_DEFNS(UnknownGroup, GPBUnknownFieldSet) +// This block of code is generated, do not edit it directly. + +- (void)writeUnknownGroupArray:(int32_t)fieldNumber values:(NSArray *)values { + for (GPBUnknownFieldSet *value in values) { + [self writeUnknownGroup:fieldNumber value:value]; + } +} + +//%PDDM-EXPAND-END (19 expansions) + +- (void)writeMessageSetExtension:(int32_t)fieldNumber + value:(GPBMessage *)value { + GPBWriteTagWithFormat(&state_, GPBWireFormatMessageSetItem, + GPBWireFormatStartGroup); + GPBWriteUInt32(&state_, GPBWireFormatMessageSetTypeId, fieldNumber); + [self writeMessage:GPBWireFormatMessageSetMessage value:value]; + GPBWriteTagWithFormat(&state_, GPBWireFormatMessageSetItem, + GPBWireFormatEndGroup); +} + +- (void)writeRawMessageSetExtension:(int32_t)fieldNumber value:(NSData *)value { + GPBWriteTagWithFormat(&state_, GPBWireFormatMessageSetItem, + GPBWireFormatStartGroup); + GPBWriteUInt32(&state_, GPBWireFormatMessageSetTypeId, fieldNumber); + [self writeBytes:GPBWireFormatMessageSetMessage value:value]; + GPBWriteTagWithFormat(&state_, GPBWireFormatMessageSetItem, + GPBWireFormatEndGroup); +} + +- (void)flush { + if (state_.output != nil) { + GPBRefreshBuffer(&state_); + } +} + +- (void)writeRawByte:(uint8_t)value { + GPBWriteRawByte(&state_, value); +} + +- (void)writeRawData:(const NSData *)data { + [self writeRawPtr:[data bytes] offset:0 length:[data length]]; +} + +- (void)writeRawPtr:(const void *)value + offset:(size_t)offset + length:(size_t)length { + if (value == nil || length == 0) { + return; + } + + NSUInteger bufferLength = state_.size; + NSUInteger bufferBytesLeft = bufferLength - state_.position; + if (bufferBytesLeft >= length) { + // We have room in the current buffer. + memcpy(state_.bytes + state_.position, ((uint8_t *)value) + offset, length); + state_.position += length; + } else { + // Write extends past current buffer. Fill the rest of this buffer and + // flush. + size_t bytesWritten = bufferBytesLeft; + memcpy(state_.bytes + state_.position, ((uint8_t *)value) + offset, + bytesWritten); + offset += bytesWritten; + length -= bytesWritten; + state_.position = bufferLength; + GPBRefreshBuffer(&state_); + bufferLength = state_.size; + + // Now deal with the rest. + // Since we have an output stream, this is our buffer + // and buffer offset == 0 + if (length <= bufferLength) { + // Fits in new buffer. + memcpy(state_.bytes, ((uint8_t *)value) + offset, length); + state_.position = length; + } else { + // Write is very big. Let's do it all at once. + [state_.output write:((uint8_t *)value) + offset maxLength:length]; + } + } +} + +- (void)writeTag:(uint32_t)fieldNumber format:(GPBWireFormat)format { + GPBWriteTagWithFormat(&state_, fieldNumber, format); +} + +- (void)writeRawVarint32:(int32_t)value { + GPBWriteRawVarint32(&state_, value); +} + +- (void)writeRawVarintSizeTAs32:(size_t)value { + // Note the truncation. + GPBWriteRawVarint32(&state_, (int32_t)value); +} + +- (void)writeRawVarint64:(int64_t)value { + GPBWriteRawVarint64(&state_, value); +} + +- (void)writeRawLittleEndian32:(int32_t)value { + GPBWriteRawLittleEndian32(&state_, value); +} + +- (void)writeRawLittleEndian64:(int64_t)value { + GPBWriteRawLittleEndian64(&state_, value); +} + +#pragma clang diagnostic pop + +@end + +size_t GPBComputeDoubleSizeNoTag(Float64 value) { +#pragma unused(value) + return LITTLE_ENDIAN_64_SIZE; +} + +size_t GPBComputeFloatSizeNoTag(Float32 value) { +#pragma unused(value) + return LITTLE_ENDIAN_32_SIZE; +} + +size_t GPBComputeUInt64SizeNoTag(uint64_t value) { + return GPBComputeRawVarint64Size(value); +} + +size_t GPBComputeInt64SizeNoTag(int64_t value) { + return GPBComputeRawVarint64Size(value); +} + +size_t GPBComputeInt32SizeNoTag(int32_t value) { + if (value >= 0) { + return GPBComputeRawVarint32Size(value); + } else { + // Must sign-extend. + return 10; + } +} + +size_t GPBComputeSizeTSizeAsInt32NoTag(size_t value) { + return GPBComputeInt32SizeNoTag((int32_t)value); +} + +size_t GPBComputeFixed64SizeNoTag(uint64_t value) { +#pragma unused(value) + return LITTLE_ENDIAN_64_SIZE; +} + +size_t GPBComputeFixed32SizeNoTag(uint32_t value) { +#pragma unused(value) + return LITTLE_ENDIAN_32_SIZE; +} + +size_t GPBComputeBoolSizeNoTag(BOOL value) { +#pragma unused(value) + return 1; +} + +size_t GPBComputeStringSizeNoTag(NSString *value) { + NSUInteger length = [value lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; + return GPBComputeRawVarint32SizeForInteger(length) + length; +} + +size_t GPBComputeGroupSizeNoTag(GPBMessage *value) { + return [value serializedSize]; +} + +size_t GPBComputeUnknownGroupSizeNoTag(GPBUnknownFieldSet *value) { + return value.serializedSize; +} + +size_t GPBComputeMessageSizeNoTag(GPBMessage *value) { + size_t size = [value serializedSize]; + return GPBComputeRawVarint32SizeForInteger(size) + size; +} + +size_t GPBComputeBytesSizeNoTag(NSData *value) { + NSUInteger valueLength = [value length]; + return GPBComputeRawVarint32SizeForInteger(valueLength) + valueLength; +} + +size_t GPBComputeUInt32SizeNoTag(int32_t value) { + return GPBComputeRawVarint32Size(value); +} + +size_t GPBComputeEnumSizeNoTag(int32_t value) { + return GPBComputeRawVarint32Size(value); +} + +size_t GPBComputeSFixed32SizeNoTag(int32_t value) { +#pragma unused(value) + return LITTLE_ENDIAN_32_SIZE; +} + +size_t GPBComputeSFixed64SizeNoTag(int64_t value) { +#pragma unused(value) + return LITTLE_ENDIAN_64_SIZE; +} + +size_t GPBComputeSInt32SizeNoTag(int32_t value) { + return GPBComputeRawVarint32Size(GPBEncodeZigZag32(value)); +} + +size_t GPBComputeSInt64SizeNoTag(int64_t value) { + return GPBComputeRawVarint64Size(GPBEncodeZigZag64(value)); +} + +size_t GPBComputeDoubleSize(int32_t fieldNumber, double value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeDoubleSizeNoTag(value); +} + +size_t GPBComputeFloatSize(int32_t fieldNumber, float value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeFloatSizeNoTag(value); +} + +size_t GPBComputeUInt64Size(int32_t fieldNumber, uint64_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeUInt64SizeNoTag(value); +} + +size_t GPBComputeInt64Size(int32_t fieldNumber, int64_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeInt64SizeNoTag(value); +} + +size_t GPBComputeInt32Size(int32_t fieldNumber, int32_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeInt32SizeNoTag(value); +} + +size_t GPBComputeFixed64Size(int32_t fieldNumber, uint64_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeFixed64SizeNoTag(value); +} + +size_t GPBComputeFixed32Size(int32_t fieldNumber, uint32_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeFixed32SizeNoTag(value); +} + +size_t GPBComputeBoolSize(int32_t fieldNumber, BOOL value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeBoolSizeNoTag(value); +} + +size_t GPBComputeStringSize(int32_t fieldNumber, NSString *value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeStringSizeNoTag(value); +} + +size_t GPBComputeGroupSize(int32_t fieldNumber, GPBMessage *value) { + return GPBComputeTagSize(fieldNumber) * 2 + GPBComputeGroupSizeNoTag(value); +} + +size_t GPBComputeUnknownGroupSize(int32_t fieldNumber, + GPBUnknownFieldSet *value) { + return GPBComputeTagSize(fieldNumber) * 2 + + GPBComputeUnknownGroupSizeNoTag(value); +} + +size_t GPBComputeMessageSize(int32_t fieldNumber, GPBMessage *value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeMessageSizeNoTag(value); +} + +size_t GPBComputeBytesSize(int32_t fieldNumber, NSData *value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeBytesSizeNoTag(value); +} + +size_t GPBComputeUInt32Size(int32_t fieldNumber, uint32_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeUInt32SizeNoTag(value); +} + +size_t GPBComputeEnumSize(int32_t fieldNumber, int32_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeEnumSizeNoTag(value); +} + +size_t GPBComputeSFixed32Size(int32_t fieldNumber, int32_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeSFixed32SizeNoTag(value); +} + +size_t GPBComputeSFixed64Size(int32_t fieldNumber, int64_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeSFixed64SizeNoTag(value); +} + +size_t GPBComputeSInt32Size(int32_t fieldNumber, int32_t value) { + return GPBComputeTagSize(fieldNumber) + GPBComputeSInt32SizeNoTag(value); +} + +size_t GPBComputeSInt64Size(int32_t fieldNumber, int64_t value) { + return GPBComputeTagSize(fieldNumber) + + GPBComputeRawVarint64Size(GPBEncodeZigZag64(value)); +} + +size_t GPBComputeMessageSetExtensionSize(int32_t fieldNumber, + GPBMessage *value) { + return GPBComputeTagSize(GPBWireFormatMessageSetItem) * 2 + + GPBComputeUInt32Size(GPBWireFormatMessageSetTypeId, fieldNumber) + + GPBComputeMessageSize(GPBWireFormatMessageSetMessage, value); +} + +size_t GPBComputeRawMessageSetExtensionSize(int32_t fieldNumber, + NSData *value) { + return GPBComputeTagSize(GPBWireFormatMessageSetItem) * 2 + + GPBComputeUInt32Size(GPBWireFormatMessageSetTypeId, fieldNumber) + + GPBComputeBytesSize(GPBWireFormatMessageSetMessage, value); +} + +size_t GPBComputeTagSize(int32_t fieldNumber) { + return GPBComputeRawVarint32Size( + GPBWireFormatMakeTag(fieldNumber, GPBWireFormatVarint)); +} + +size_t GPBComputeWireFormatTagSize(int field_number, GPBDataType dataType) { + size_t result = GPBComputeTagSize(field_number); + if (dataType == GPBDataTypeGroup) { + // Groups have both a start and an end tag. + return result * 2; + } else { + return result; + } +} + +size_t GPBComputeRawVarint32Size(int32_t value) { + // value is treated as unsigned, so it won't be sign-extended if negative. + if ((value & (0xffffffff << 7)) == 0) return 1; + if ((value & (0xffffffff << 14)) == 0) return 2; + if ((value & (0xffffffff << 21)) == 0) return 3; + if ((value & (0xffffffff << 28)) == 0) return 4; + return 5; +} + +size_t GPBComputeRawVarint32SizeForInteger(NSInteger value) { + // Note the truncation. + return GPBComputeRawVarint32Size((int32_t)value); +} + +size_t GPBComputeRawVarint64Size(int64_t value) { + if ((value & (0xffffffffffffffffL << 7)) == 0) return 1; + if ((value & (0xffffffffffffffffL << 14)) == 0) return 2; + if ((value & (0xffffffffffffffffL << 21)) == 0) return 3; + if ((value & (0xffffffffffffffffL << 28)) == 0) return 4; + if ((value & (0xffffffffffffffffL << 35)) == 0) return 5; + if ((value & (0xffffffffffffffffL << 42)) == 0) return 6; + if ((value & (0xffffffffffffffffL << 49)) == 0) return 7; + if ((value & (0xffffffffffffffffL << 56)) == 0) return 8; + if ((value & (0xffffffffffffffffL << 63)) == 0) return 9; + return 10; +} diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream_PackagePrivate.h new file mode 100644 index 00000000..2e7bb4c4 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBCodedOutputStream_PackagePrivate.h @@ -0,0 +1,126 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2016 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBCodedOutputStream.h" + +NS_ASSUME_NONNULL_BEGIN + +CF_EXTERN_C_BEGIN + +size_t GPBComputeDoubleSize(int32_t fieldNumber, double value) + __attribute__((const)); +size_t GPBComputeFloatSize(int32_t fieldNumber, float value) + __attribute__((const)); +size_t GPBComputeUInt64Size(int32_t fieldNumber, uint64_t value) + __attribute__((const)); +size_t GPBComputeInt64Size(int32_t fieldNumber, int64_t value) + __attribute__((const)); +size_t GPBComputeInt32Size(int32_t fieldNumber, int32_t value) + __attribute__((const)); +size_t GPBComputeFixed64Size(int32_t fieldNumber, uint64_t value) + __attribute__((const)); +size_t GPBComputeFixed32Size(int32_t fieldNumber, uint32_t value) + __attribute__((const)); +size_t GPBComputeBoolSize(int32_t fieldNumber, BOOL value) + __attribute__((const)); +size_t GPBComputeStringSize(int32_t fieldNumber, NSString *value) + __attribute__((const)); +size_t GPBComputeGroupSize(int32_t fieldNumber, GPBMessage *value) + __attribute__((const)); +size_t GPBComputeUnknownGroupSize(int32_t fieldNumber, + GPBUnknownFieldSet *value) + __attribute__((const)); +size_t GPBComputeMessageSize(int32_t fieldNumber, GPBMessage *value) + __attribute__((const)); +size_t GPBComputeBytesSize(int32_t fieldNumber, NSData *value) + __attribute__((const)); +size_t GPBComputeUInt32Size(int32_t fieldNumber, uint32_t value) + __attribute__((const)); +size_t GPBComputeSFixed32Size(int32_t fieldNumber, int32_t value) + __attribute__((const)); +size_t GPBComputeSFixed64Size(int32_t fieldNumber, int64_t value) + __attribute__((const)); +size_t GPBComputeSInt32Size(int32_t fieldNumber, int32_t value) + __attribute__((const)); +size_t GPBComputeSInt64Size(int32_t fieldNumber, int64_t value) + __attribute__((const)); +size_t GPBComputeTagSize(int32_t fieldNumber) __attribute__((const)); +size_t GPBComputeWireFormatTagSize(int field_number, GPBDataType dataType) + __attribute__((const)); + +size_t GPBComputeDoubleSizeNoTag(double value) __attribute__((const)); +size_t GPBComputeFloatSizeNoTag(float value) __attribute__((const)); +size_t GPBComputeUInt64SizeNoTag(uint64_t value) __attribute__((const)); +size_t GPBComputeInt64SizeNoTag(int64_t value) __attribute__((const)); +size_t GPBComputeInt32SizeNoTag(int32_t value) __attribute__((const)); +size_t GPBComputeFixed64SizeNoTag(uint64_t value) __attribute__((const)); +size_t GPBComputeFixed32SizeNoTag(uint32_t value) __attribute__((const)); +size_t GPBComputeBoolSizeNoTag(BOOL value) __attribute__((const)); +size_t GPBComputeStringSizeNoTag(NSString *value) __attribute__((const)); +size_t GPBComputeGroupSizeNoTag(GPBMessage *value) __attribute__((const)); +size_t GPBComputeUnknownGroupSizeNoTag(GPBUnknownFieldSet *value) + __attribute__((const)); +size_t GPBComputeMessageSizeNoTag(GPBMessage *value) __attribute__((const)); +size_t GPBComputeBytesSizeNoTag(NSData *value) __attribute__((const)); +size_t GPBComputeUInt32SizeNoTag(int32_t value) __attribute__((const)); +size_t GPBComputeEnumSizeNoTag(int32_t value) __attribute__((const)); +size_t GPBComputeSFixed32SizeNoTag(int32_t value) __attribute__((const)); +size_t GPBComputeSFixed64SizeNoTag(int64_t value) __attribute__((const)); +size_t GPBComputeSInt32SizeNoTag(int32_t value) __attribute__((const)); +size_t GPBComputeSInt64SizeNoTag(int64_t value) __attribute__((const)); + +// Note that this will calculate the size of 64 bit values truncated to 32. +size_t GPBComputeSizeTSizeAsInt32NoTag(size_t value) __attribute__((const)); + +size_t GPBComputeRawVarint32Size(int32_t value) __attribute__((const)); +size_t GPBComputeRawVarint64Size(int64_t value) __attribute__((const)); + +// Note that this will calculate the size of 64 bit values truncated to 32. +size_t GPBComputeRawVarint32SizeForInteger(NSInteger value) + __attribute__((const)); + +// Compute the number of bytes that would be needed to encode a +// MessageSet extension to the stream. For historical reasons, +// the wire format differs from normal fields. +size_t GPBComputeMessageSetExtensionSize(int32_t fieldNumber, GPBMessage *value) + __attribute__((const)); + +// Compute the number of bytes that would be needed to encode an +// unparsed MessageSet extension field to the stream. For +// historical reasons, the wire format differs from normal fields. +size_t GPBComputeRawMessageSetExtensionSize(int32_t fieldNumber, NSData *value) + __attribute__((const)); + +size_t GPBComputeEnumSize(int32_t fieldNumber, int32_t value) + __attribute__((const)); + +CF_EXTERN_C_END + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor.h new file mode 100644 index 00000000..651f4de0 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor.h @@ -0,0 +1,288 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBRuntimeTypes.h" + +@class GPBEnumDescriptor; +@class GPBFieldDescriptor; +@class GPBFileDescriptor; +@class GPBOneofDescriptor; + +NS_ASSUME_NONNULL_BEGIN + +/** Syntax used in the proto file. */ +typedef NS_ENUM(uint8_t, GPBFileSyntax) { + /** Unknown syntax. */ + GPBFileSyntaxUnknown = 0, + /** Proto2 syntax. */ + GPBFileSyntaxProto2 = 2, + /** Proto3 syntax. */ + GPBFileSyntaxProto3 = 3, +}; + +/** Type of proto field. */ +typedef NS_ENUM(uint8_t, GPBFieldType) { + /** Optional/required field. Only valid for proto2 fields. */ + GPBFieldTypeSingle, + /** Repeated field. */ + GPBFieldTypeRepeated, + /** Map field. */ + GPBFieldTypeMap, +}; + +/** + * Describes a proto message. + **/ +@interface GPBDescriptor : NSObject<NSCopying> + +/** Name of the message. */ +@property(nonatomic, readonly, copy) NSString *name; +/** Fields declared in the message. */ +@property(nonatomic, readonly, strong, nullable) NSArray<GPBFieldDescriptor*> *fields; +/** Oneofs declared in the message. */ +@property(nonatomic, readonly, strong, nullable) NSArray<GPBOneofDescriptor*> *oneofs; +/** Extension range declared for the message. */ +@property(nonatomic, readonly, nullable) const GPBExtensionRange *extensionRanges; +/** Number of extension ranges declared for the message. */ +@property(nonatomic, readonly) uint32_t extensionRangesCount; +/** Descriptor for the file where the message was defined. */ +@property(nonatomic, readonly, assign) GPBFileDescriptor *file; + +/** Whether the message is in wire format or not. */ +@property(nonatomic, readonly, getter=isWireFormat) BOOL wireFormat; +/** The class of this message. */ +@property(nonatomic, readonly) Class messageClass; +/** Containing message descriptor if this message is nested, or nil otherwise. */ +@property(readonly, nullable) GPBDescriptor *containingType; +/** + * Fully qualified name for this message (package.message). Can be nil if the + * value is unable to be computed. + */ +@property(readonly, nullable) NSString *fullName; + +/** + * Gets the field for the given number. + * + * @param fieldNumber The number for the field to get. + * + * @return The field descriptor for the given number, or nil if not found. + **/ +- (nullable GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber; + +/** + * Gets the field for the given name. + * + * @param name The name for the field to get. + * + * @return The field descriptor for the given name, or nil if not found. + **/ +- (nullable GPBFieldDescriptor *)fieldWithName:(NSString *)name; + +/** + * Gets the oneof for the given name. + * + * @param name The name for the oneof to get. + * + * @return The oneof descriptor for the given name, or nil if not found. + **/ +- (nullable GPBOneofDescriptor *)oneofWithName:(NSString *)name; + +@end + +/** + * Describes a proto file. + **/ +@interface GPBFileDescriptor : NSObject + +/** The package declared in the proto file. */ +@property(nonatomic, readonly, copy) NSString *package; +/** The objc prefix declared in the proto file. */ +@property(nonatomic, readonly, copy, nullable) NSString *objcPrefix; +/** The syntax of the proto file. */ +@property(nonatomic, readonly) GPBFileSyntax syntax; + +@end + +/** + * Describes a oneof field. + **/ +@interface GPBOneofDescriptor : NSObject +/** Name of the oneof field. */ +@property(nonatomic, readonly) NSString *name; +/** Fields declared in the oneof. */ +@property(nonatomic, readonly) NSArray<GPBFieldDescriptor*> *fields; + +/** + * Gets the field for the given number. + * + * @param fieldNumber The number for the field to get. + * + * @return The field descriptor for the given number, or nil if not found. + **/ +- (nullable GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber; + +/** + * Gets the field for the given name. + * + * @param name The name for the field to get. + * + * @return The field descriptor for the given name, or nil if not found. + **/ +- (nullable GPBFieldDescriptor *)fieldWithName:(NSString *)name; + +@end + +/** + * Describes a proto field. + **/ +@interface GPBFieldDescriptor : NSObject + +/** Name of the field. */ +@property(nonatomic, readonly, copy) NSString *name; +/** Number associated with the field. */ +@property(nonatomic, readonly) uint32_t number; +/** Data type contained in the field. */ +@property(nonatomic, readonly) GPBDataType dataType; +/** Whether it has a default value or not. */ +@property(nonatomic, readonly) BOOL hasDefaultValue; +/** Default value for the field. */ +@property(nonatomic, readonly) GPBGenericValue defaultValue; +/** Whether this field is required. Only valid for proto2 fields. */ +@property(nonatomic, readonly, getter=isRequired) BOOL required; +/** Whether this field is optional. */ +@property(nonatomic, readonly, getter=isOptional) BOOL optional; +/** Type of field (single, repeated, map). */ +@property(nonatomic, readonly) GPBFieldType fieldType; +/** Type of the key if the field is a map. The value's type is -fieldType. */ +@property(nonatomic, readonly) GPBDataType mapKeyDataType; +/** Whether the field is packable. */ +@property(nonatomic, readonly, getter=isPackable) BOOL packable; + +/** The containing oneof if this field is part of one, nil otherwise. */ +@property(nonatomic, readonly, assign, nullable) GPBOneofDescriptor *containingOneof; + +/** Class of the message if the field is of message type. */ +@property(nonatomic, readonly, assign, nullable) Class msgClass; + +/** Descriptor for the enum if this field is an enum. */ +@property(nonatomic, readonly, strong, nullable) GPBEnumDescriptor *enumDescriptor; + +/** + * Checks whether the given enum raw value is a valid enum value. + * + * @param value The raw enum value to check. + * + * @return YES if value is a valid enum raw value. + **/ +- (BOOL)isValidEnumValue:(int32_t)value; + +/** @return Name for the text format, or nil if not known. */ +- (nullable NSString *)textFormatName; + +@end + +/** + * Describes a proto enum. + **/ +@interface GPBEnumDescriptor : NSObject + +/** Name of the enum. */ +@property(nonatomic, readonly, copy) NSString *name; +/** Function that validates that raw values are valid enum values. */ +@property(nonatomic, readonly) GPBEnumValidationFunc enumVerifier; + +/** + * Returns the enum value name for the given raw enum. + * + * @param number The raw enum value. + * + * @return The name of the enum value passed, or nil if not valid. + **/ +- (nullable NSString *)enumNameForValue:(int32_t)number; + +/** + * Gets the enum raw value for the given enum name. + * + * @param outValue A pointer where the value will be set. + * @param name The enum name for which to get the raw value. + * + * @return YES if a value was copied into the pointer, NO otherwise. + **/ +- (BOOL)getValue:(nullable int32_t *)outValue forEnumName:(NSString *)name; + +/** + * Returns the text format for the given raw enum value. + * + * @param number The raw enum value. + * + * @return The text format name for the raw enum value, or nil if not valid. + **/ +- (nullable NSString *)textFormatNameForValue:(int32_t)number; + +/** + * Gets the enum raw value for the given text format name. + * + * @param outValue A pointer where the value will be set. + * @param textFormatName The text format name for which to get the raw value. + * + * @return YES if a value was copied into the pointer, NO otherwise. + **/ +- (BOOL)getValue:(nullable int32_t *)outValue forEnumTextFormatName:(NSString *)textFormatName; + +@end + +/** + * Describes a proto extension. + **/ +@interface GPBExtensionDescriptor : NSObject<NSCopying> +/** Field number under which the extension is stored. */ +@property(nonatomic, readonly) uint32_t fieldNumber; +/** The containing message class, i.e. the class extended by this extension. */ +@property(nonatomic, readonly) Class containingMessageClass; +/** Data type contained in the extension. */ +@property(nonatomic, readonly) GPBDataType dataType; +/** Whether the extension is repeated. */ +@property(nonatomic, readonly, getter=isRepeated) BOOL repeated; +/** Whether the extension is packable. */ +@property(nonatomic, readonly, getter=isPackable) BOOL packable; +/** The class of the message if the extension is of message type. */ +@property(nonatomic, readonly, assign) Class msgClass; +/** The singleton name for the extension. */ +@property(nonatomic, readonly) NSString *singletonName; +/** The enum descriptor if the extension is of enum type. */ +@property(nonatomic, readonly, strong, nullable) GPBEnumDescriptor *enumDescriptor; +/** The default value for the extension. */ +@property(nonatomic, readonly, nullable) id defaultValue; + +@end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor.m new file mode 100644 index 00000000..0753a948 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor.m @@ -0,0 +1,1104 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBDescriptor_PackagePrivate.h" + +#import <objc/runtime.h> + +#import "GPBUtilities_PackagePrivate.h" +#import "GPBWireFormat.h" +#import "GPBMessage_PackagePrivate.h" + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +// The addresses of these variables are used as keys for objc_getAssociatedObject. +static const char kTextFormatExtraValueKey = 0; +static const char kParentClassNameValueKey = 0; +static const char kClassNameSuffixKey = 0; + +// Utility function to generate selectors on the fly. +static SEL SelFromStrings(const char *prefix, const char *middle, + const char *suffix, BOOL takesArg) { + if (prefix == NULL && suffix == NULL && !takesArg) { + return sel_getUid(middle); + } + const size_t prefixLen = prefix != NULL ? strlen(prefix) : 0; + const size_t middleLen = strlen(middle); + const size_t suffixLen = suffix != NULL ? strlen(suffix) : 0; + size_t totalLen = + prefixLen + middleLen + suffixLen + 1; // include space for null on end. + if (takesArg) { + totalLen += 1; + } + char buffer[totalLen]; + if (prefix != NULL) { + memcpy(buffer, prefix, prefixLen); + memcpy(buffer + prefixLen, middle, middleLen); + buffer[prefixLen] = (char)toupper(buffer[prefixLen]); + } else { + memcpy(buffer, middle, middleLen); + } + if (suffix != NULL) { + memcpy(buffer + prefixLen + middleLen, suffix, suffixLen); + } + if (takesArg) { + buffer[totalLen - 2] = ':'; + } + // Always null terminate it. + buffer[totalLen - 1] = 0; + + SEL result = sel_getUid(buffer); + return result; +} + +static NSArray *NewFieldsArrayForHasIndex(int hasIndex, + NSArray *allMessageFields) + __attribute__((ns_returns_retained)); + +static NSArray *NewFieldsArrayForHasIndex(int hasIndex, + NSArray *allMessageFields) { + NSMutableArray *result = [[NSMutableArray alloc] init]; + for (GPBFieldDescriptor *fieldDesc in allMessageFields) { + if (fieldDesc->description_->hasIndex == hasIndex) { + [result addObject:fieldDesc]; + } + } + return result; +} + +@implementation GPBDescriptor { + Class messageClass_; + GPBFileDescriptor *file_; + BOOL wireFormat_; +} + +@synthesize messageClass = messageClass_; +@synthesize fields = fields_; +@synthesize oneofs = oneofs_; +@synthesize extensionRanges = extensionRanges_; +@synthesize extensionRangesCount = extensionRangesCount_; +@synthesize file = file_; +@synthesize wireFormat = wireFormat_; + ++ (instancetype) + allocDescriptorForClass:(Class)messageClass + rootClass:(Class)rootClass + file:(GPBFileDescriptor *)file + fields:(void *)fieldDescriptions + fieldCount:(uint32_t)fieldCount + storageSize:(uint32_t)storageSize + flags:(GPBDescriptorInitializationFlags)flags { + // The rootClass is no longer used, but it is passed in to ensure it + // was started up during initialization also. + (void)rootClass; + NSMutableArray *fields = nil; + GPBFileSyntax syntax = file.syntax; + BOOL fieldsIncludeDefault = + (flags & GPBDescriptorInitializationFlag_FieldsWithDefault) != 0; + + void *desc; + for (uint32_t i = 0; i < fieldCount; ++i) { + if (fields == nil) { + fields = [[NSMutableArray alloc] initWithCapacity:fieldCount]; + } + // Need correctly typed pointer for array indexing below to work. + if (fieldsIncludeDefault) { + GPBMessageFieldDescriptionWithDefault *fieldDescWithDefault = fieldDescriptions; + desc = &(fieldDescWithDefault[i]); + } else { + GPBMessageFieldDescription *fieldDesc = fieldDescriptions; + desc = &(fieldDesc[i]); + } + GPBFieldDescriptor *fieldDescriptor = + [[GPBFieldDescriptor alloc] initWithFieldDescription:desc + includesDefault:fieldsIncludeDefault + syntax:syntax]; + [fields addObject:fieldDescriptor]; + [fieldDescriptor release]; + } + + BOOL wireFormat = (flags & GPBDescriptorInitializationFlag_WireFormat) != 0; + GPBDescriptor *descriptor = [[self alloc] initWithClass:messageClass + file:file + fields:fields + storageSize:storageSize + wireFormat:wireFormat]; + [fields release]; + return descriptor; +} + +- (instancetype)initWithClass:(Class)messageClass + file:(GPBFileDescriptor *)file + fields:(NSArray *)fields + storageSize:(uint32_t)storageSize + wireFormat:(BOOL)wireFormat { + if ((self = [super init])) { + messageClass_ = messageClass; + file_ = file; + fields_ = [fields retain]; + storageSize_ = storageSize; + wireFormat_ = wireFormat; + } + return self; +} + +- (void)dealloc { + [fields_ release]; + [oneofs_ release]; + [super dealloc]; +} + +- (void)setupOneofs:(const char **)oneofNames + count:(uint32_t)count + firstHasIndex:(int32_t)firstHasIndex { + NSCAssert(firstHasIndex < 0, @"Should always be <0"); + NSMutableArray *oneofs = [[NSMutableArray alloc] initWithCapacity:count]; + for (uint32_t i = 0, hasIndex = firstHasIndex; i < count; ++i, --hasIndex) { + const char *name = oneofNames[i]; + NSArray *fieldsForOneof = NewFieldsArrayForHasIndex(hasIndex, fields_); + NSCAssert(fieldsForOneof.count > 0, + @"No fields for this oneof? (%s:%d)", name, hasIndex); + GPBOneofDescriptor *oneofDescriptor = + [[GPBOneofDescriptor alloc] initWithName:name fields:fieldsForOneof]; + [oneofs addObject:oneofDescriptor]; + [oneofDescriptor release]; + [fieldsForOneof release]; + } + oneofs_ = oneofs; +} + +- (void)setupExtraTextInfo:(const char *)extraTextFormatInfo { + // Extra info is a compile time option, so skip the work if not needed. + if (extraTextFormatInfo) { + NSValue *extraInfoValue = [NSValue valueWithPointer:extraTextFormatInfo]; + for (GPBFieldDescriptor *fieldDescriptor in fields_) { + if (fieldDescriptor->description_->flags & GPBFieldTextFormatNameCustom) { + objc_setAssociatedObject(fieldDescriptor, &kTextFormatExtraValueKey, + extraInfoValue, + OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + } + } +} + +- (void)setupExtensionRanges:(const GPBExtensionRange *)ranges count:(int32_t)count { + extensionRanges_ = ranges; + extensionRangesCount_ = count; +} + +- (void)setupContainingMessageClassName:(const char *)msgClassName { + // Note: Only fetch the class here, can't send messages to it because + // that could cause cycles back to this class within +initialize if + // two messages have each other in fields (i.e. - they build a graph). + NSAssert(objc_getClass(msgClassName), @"Class %s not defined", msgClassName); + NSValue *parentNameValue = [NSValue valueWithPointer:msgClassName]; + objc_setAssociatedObject(self, &kParentClassNameValueKey, + parentNameValue, + OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (void)setupMessageClassNameSuffix:(NSString *)suffix { + if (suffix.length) { + objc_setAssociatedObject(self, &kClassNameSuffixKey, + suffix, + OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } +} + +- (NSString *)name { + return NSStringFromClass(messageClass_); +} + +- (GPBDescriptor *)containingType { + NSValue *parentNameValue = + objc_getAssociatedObject(self, &kParentClassNameValueKey); + if (!parentNameValue) { + return nil; + } + const char *parentName = [parentNameValue pointerValue]; + Class parentClass = objc_getClass(parentName); + NSAssert(parentClass, @"Class %s not defined", parentName); + return [parentClass descriptor]; +} + +- (NSString *)fullName { + NSString *className = NSStringFromClass(self.messageClass); + GPBFileDescriptor *file = self.file; + NSString *objcPrefix = file.objcPrefix; + if (objcPrefix && ![className hasPrefix:objcPrefix]) { + NSAssert(0, + @"Class didn't have correct prefix? (%@ - %@)", + className, objcPrefix); + return nil; + } + GPBDescriptor *parent = self.containingType; + + NSString *name = nil; + if (parent) { + NSString *parentClassName = NSStringFromClass(parent.messageClass); + // The generator will add _Class to avoid reserved words, drop it. + NSString *suffix = objc_getAssociatedObject(parent, &kClassNameSuffixKey); + if (suffix) { + if (![parentClassName hasSuffix:suffix]) { + NSAssert(0, + @"ParentMessage class didn't have correct suffix? (%@ - %@)", + className, suffix); + return nil; + } + parentClassName = + [parentClassName substringToIndex:(parentClassName.length - suffix.length)]; + } + NSString *parentPrefix = [parentClassName stringByAppendingString:@"_"]; + if (![className hasPrefix:parentPrefix]) { + NSAssert(0, + @"Class didn't have the correct parent name prefix? (%@ - %@)", + parentPrefix, className); + return nil; + } + name = [className substringFromIndex:parentPrefix.length]; + } else { + name = [className substringFromIndex:objcPrefix.length]; + } + + // The generator will add _Class to avoid reserved words, drop it. + NSString *suffix = objc_getAssociatedObject(self, &kClassNameSuffixKey); + if (suffix) { + if (![name hasSuffix:suffix]) { + NSAssert(0, + @"Message class didn't have correct suffix? (%@ - %@)", + name, suffix); + return nil; + } + name = [name substringToIndex:(name.length - suffix.length)]; + } + + NSString *prefix = (parent != nil ? parent.fullName : file.package); + NSString *result; + if (prefix.length > 0) { + result = [NSString stringWithFormat:@"%@.%@", prefix, name]; + } else { + result = name; + } + return result; +} + +- (id)copyWithZone:(NSZone *)zone { +#pragma unused(zone) + return [self retain]; +} + +- (GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber { + for (GPBFieldDescriptor *descriptor in fields_) { + if (GPBFieldNumber(descriptor) == fieldNumber) { + return descriptor; + } + } + return nil; +} + +- (GPBFieldDescriptor *)fieldWithName:(NSString *)name { + for (GPBFieldDescriptor *descriptor in fields_) { + if ([descriptor.name isEqual:name]) { + return descriptor; + } + } + return nil; +} + +- (GPBOneofDescriptor *)oneofWithName:(NSString *)name { + for (GPBOneofDescriptor *descriptor in oneofs_) { + if ([descriptor.name isEqual:name]) { + return descriptor; + } + } + return nil; +} + +@end + +@implementation GPBFileDescriptor { + NSString *package_; + NSString *objcPrefix_; + GPBFileSyntax syntax_; +} + +@synthesize package = package_; +@synthesize objcPrefix = objcPrefix_; +@synthesize syntax = syntax_; + +- (instancetype)initWithPackage:(NSString *)package + objcPrefix:(NSString *)objcPrefix + syntax:(GPBFileSyntax)syntax { + self = [super init]; + if (self) { + package_ = [package copy]; + objcPrefix_ = [objcPrefix copy]; + syntax_ = syntax; + } + return self; +} + +- (instancetype)initWithPackage:(NSString *)package + syntax:(GPBFileSyntax)syntax { + self = [super init]; + if (self) { + package_ = [package copy]; + syntax_ = syntax; + } + return self; +} + +- (void)dealloc { + [package_ release]; + [objcPrefix_ release]; + [super dealloc]; +} + +@end + +@implementation GPBOneofDescriptor + +@synthesize fields = fields_; + +- (instancetype)initWithName:(const char *)name fields:(NSArray *)fields { + self = [super init]; + if (self) { + name_ = name; + fields_ = [fields retain]; + for (GPBFieldDescriptor *fieldDesc in fields) { + fieldDesc->containingOneof_ = self; + } + + caseSel_ = SelFromStrings(NULL, name, "OneOfCase", NO); + } + return self; +} + +- (void)dealloc { + [fields_ release]; + [super dealloc]; +} + +- (NSString *)name { + return @(name_); +} + +- (GPBFieldDescriptor *)fieldWithNumber:(uint32_t)fieldNumber { + for (GPBFieldDescriptor *descriptor in fields_) { + if (GPBFieldNumber(descriptor) == fieldNumber) { + return descriptor; + } + } + return nil; +} + +- (GPBFieldDescriptor *)fieldWithName:(NSString *)name { + for (GPBFieldDescriptor *descriptor in fields_) { + if ([descriptor.name isEqual:name]) { + return descriptor; + } + } + return nil; +} + +@end + +uint32_t GPBFieldTag(GPBFieldDescriptor *self) { + GPBMessageFieldDescription *description = self->description_; + GPBWireFormat format; + if ((description->flags & GPBFieldMapKeyMask) != 0) { + // Maps are repeated messages on the wire. + format = GPBWireFormatForType(GPBDataTypeMessage, NO); + } else { + format = GPBWireFormatForType(description->dataType, + ((description->flags & GPBFieldPacked) != 0)); + } + return GPBWireFormatMakeTag(description->number, format); +} + +uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self) { + GPBMessageFieldDescription *description = self->description_; + NSCAssert((description->flags & GPBFieldRepeated) != 0, + @"Only valid on repeated fields"); + GPBWireFormat format = + GPBWireFormatForType(description->dataType, + ((description->flags & GPBFieldPacked) == 0)); + return GPBWireFormatMakeTag(description->number, format); +} + +@implementation GPBFieldDescriptor { + GPBGenericValue defaultValue_; + + // Message ivars + Class msgClass_; + + // Enum ivars. + // If protos are generated with GenerateEnumDescriptors on then it will + // be a enumDescriptor, otherwise it will be a enumVerifier. + union { + GPBEnumDescriptor *enumDescriptor_; + GPBEnumValidationFunc enumVerifier_; + } enumHandling_; +} + +@synthesize msgClass = msgClass_; +@synthesize containingOneof = containingOneof_; + +- (instancetype)init { + // Throw an exception if people attempt to not use the designated initializer. + self = [super init]; + if (self != nil) { + [self doesNotRecognizeSelector:_cmd]; + self = nil; + } + return self; +} + +- (instancetype)initWithFieldDescription:(void *)description + includesDefault:(BOOL)includesDefault + syntax:(GPBFileSyntax)syntax { + if ((self = [super init])) { + GPBMessageFieldDescription *coreDesc; + if (includesDefault) { + coreDesc = &(((GPBMessageFieldDescriptionWithDefault *)description)->core); + } else { + coreDesc = description; + } + description_ = coreDesc; + getSel_ = sel_getUid(coreDesc->name); + setSel_ = SelFromStrings("set", coreDesc->name, NULL, YES); + + GPBDataType dataType = coreDesc->dataType; + BOOL isMessage = GPBDataTypeIsMessage(dataType); + BOOL isMapOrArray = GPBFieldIsMapOrArray(self); + + if (isMapOrArray) { + // map<>/repeated fields get a *Count property (inplace of a has*) to + // support checking if there are any entries without triggering + // autocreation. + hasOrCountSel_ = SelFromStrings(NULL, coreDesc->name, "_Count", NO); + } else { + // If there is a positive hasIndex, then: + // - All fields types for proto2 messages get has* selectors. + // - Only message fields for proto3 messages get has* selectors. + // Note: the positive check is to handle oneOfs, we can't check + // containingOneof_ because it isn't set until after initialization. + if ((coreDesc->hasIndex >= 0) && + (coreDesc->hasIndex != GPBNoHasBit) && + ((syntax != GPBFileSyntaxProto3) || isMessage)) { + hasOrCountSel_ = SelFromStrings("has", coreDesc->name, NULL, NO); + setHasSel_ = SelFromStrings("setHas", coreDesc->name, NULL, YES); + } + } + + // Extra type specific data. + if (isMessage) { + const char *className = coreDesc->dataTypeSpecific.className; + // Note: Only fetch the class here, can't send messages to it because + // that could cause cycles back to this class within +initialize if + // two messages have each other in fields (i.e. - they build a graph). + msgClass_ = objc_getClass(className); + NSAssert(msgClass_, @"Class %s not defined", className); + } else if (dataType == GPBDataTypeEnum) { + if ((coreDesc->flags & GPBFieldHasEnumDescriptor) != 0) { + enumHandling_.enumDescriptor_ = + coreDesc->dataTypeSpecific.enumDescFunc(); + } else { + enumHandling_.enumVerifier_ = + coreDesc->dataTypeSpecific.enumVerifier; + } + } + + // Non map<>/repeated fields can have defaults in proto2 syntax. + if (!isMapOrArray && includesDefault) { + defaultValue_ = ((GPBMessageFieldDescriptionWithDefault *)description)->defaultValue; + if (dataType == GPBDataTypeBytes) { + // Data stored as a length prefixed (network byte order) c-string in + // descriptor structure. + const uint8_t *bytes = (const uint8_t *)defaultValue_.valueData; + if (bytes) { + uint32_t length = *((uint32_t *)bytes); + length = ntohl(length); + bytes += sizeof(length); + defaultValue_.valueData = + [[NSData alloc] initWithBytes:bytes length:length]; + } + } + } + } + return self; +} + +- (void)dealloc { + if (description_->dataType == GPBDataTypeBytes && + !(description_->flags & GPBFieldRepeated)) { + [defaultValue_.valueData release]; + } + [super dealloc]; +} + +- (GPBDataType)dataType { + return description_->dataType; +} + +- (BOOL)hasDefaultValue { + return (description_->flags & GPBFieldHasDefaultValue) != 0; +} + +- (uint32_t)number { + return description_->number; +} + +- (NSString *)name { + return @(description_->name); +} + +- (BOOL)isRequired { + return (description_->flags & GPBFieldRequired) != 0; +} + +- (BOOL)isOptional { + return (description_->flags & GPBFieldOptional) != 0; +} + +- (GPBFieldType)fieldType { + GPBFieldFlags flags = description_->flags; + if ((flags & GPBFieldRepeated) != 0) { + return GPBFieldTypeRepeated; + } else if ((flags & GPBFieldMapKeyMask) != 0) { + return GPBFieldTypeMap; + } else { + return GPBFieldTypeSingle; + } +} + +- (GPBDataType)mapKeyDataType { + switch (description_->flags & GPBFieldMapKeyMask) { + case GPBFieldMapKeyInt32: + return GPBDataTypeInt32; + case GPBFieldMapKeyInt64: + return GPBDataTypeInt64; + case GPBFieldMapKeyUInt32: + return GPBDataTypeUInt32; + case GPBFieldMapKeyUInt64: + return GPBDataTypeUInt64; + case GPBFieldMapKeySInt32: + return GPBDataTypeSInt32; + case GPBFieldMapKeySInt64: + return GPBDataTypeSInt64; + case GPBFieldMapKeyFixed32: + return GPBDataTypeFixed32; + case GPBFieldMapKeyFixed64: + return GPBDataTypeFixed64; + case GPBFieldMapKeySFixed32: + return GPBDataTypeSFixed32; + case GPBFieldMapKeySFixed64: + return GPBDataTypeSFixed64; + case GPBFieldMapKeyBool: + return GPBDataTypeBool; + case GPBFieldMapKeyString: + return GPBDataTypeString; + + default: + NSAssert(0, @"Not a map type"); + return GPBDataTypeInt32; // For lack of anything better. + } +} + +- (BOOL)isPackable { + return (description_->flags & GPBFieldPacked) != 0; +} + +- (BOOL)isValidEnumValue:(int32_t)value { + NSAssert(description_->dataType == GPBDataTypeEnum, + @"Field Must be of type GPBDataTypeEnum"); + if (description_->flags & GPBFieldHasEnumDescriptor) { + return enumHandling_.enumDescriptor_.enumVerifier(value); + } else { + return enumHandling_.enumVerifier_(value); + } +} + +- (GPBEnumDescriptor *)enumDescriptor { + if (description_->flags & GPBFieldHasEnumDescriptor) { + return enumHandling_.enumDescriptor_; + } else { + return nil; + } +} + +- (GPBGenericValue)defaultValue { + // Depends on the fact that defaultValue_ is initialized either to "0/nil" or + // to an actual defaultValue in our initializer. + GPBGenericValue value = defaultValue_; + + if (!(description_->flags & GPBFieldRepeated)) { + // We special handle data and strings. If they are nil, we replace them + // with empty string/empty data. + GPBDataType type = description_->dataType; + if (type == GPBDataTypeBytes && value.valueData == nil) { + value.valueData = GPBEmptyNSData(); + } else if (type == GPBDataTypeString && value.valueString == nil) { + value.valueString = @""; + } + } + return value; +} + +- (NSString *)textFormatName { + if ((description_->flags & GPBFieldTextFormatNameCustom) != 0) { + NSValue *extraInfoValue = + objc_getAssociatedObject(self, &kTextFormatExtraValueKey); + // Support can be left out at generation time. + if (!extraInfoValue) { + return nil; + } + const uint8_t *extraTextFormatInfo = [extraInfoValue pointerValue]; + return GPBDecodeTextFormatName(extraTextFormatInfo, GPBFieldNumber(self), + self.name); + } + + // The logic here has to match SetCommonFieldVariables() from + // objectivec_field.cc in the proto compiler. + NSString *name = self.name; + NSUInteger len = [name length]; + + // Remove the "_p" added to reserved names. + if ([name hasSuffix:@"_p"]) { + name = [name substringToIndex:(len - 2)]; + len = [name length]; + } + + // Remove "Array" from the end for repeated fields. + if (((description_->flags & GPBFieldRepeated) != 0) && + [name hasSuffix:@"Array"]) { + name = [name substringToIndex:(len - 5)]; + len = [name length]; + } + + // Groups vs. other fields. + if (description_->dataType == GPBDataTypeGroup) { + // Just capitalize the first letter. + unichar firstChar = [name characterAtIndex:0]; + if (firstChar >= 'a' && firstChar <= 'z') { + NSString *firstCharString = + [NSString stringWithFormat:@"%C", (unichar)(firstChar - 'a' + 'A')]; + NSString *result = + [name stringByReplacingCharactersInRange:NSMakeRange(0, 1) + withString:firstCharString]; + return result; + } + return name; + + } else { + // Undo the CamelCase. + NSMutableString *result = [NSMutableString stringWithCapacity:len]; + for (uint32_t i = 0; i < len; i++) { + unichar c = [name characterAtIndex:i]; + if (c >= 'A' && c <= 'Z') { + if (i > 0) { + [result appendFormat:@"_%C", (unichar)(c - 'A' + 'a')]; + } else { + [result appendFormat:@"%C", c]; + } + } else { + [result appendFormat:@"%C", c]; + } + } + return result; + } +} + +@end + +@implementation GPBEnumDescriptor { + NSString *name_; + // valueNames_ is a single c string with all of the value names appended + // together, each null terminated. -calcValueNameOffsets fills in + // nameOffsets_ with the offsets to allow quicker access to the individual + // names. + const char *valueNames_; + const int32_t *values_; + GPBEnumValidationFunc enumVerifier_; + const uint8_t *extraTextFormatInfo_; + uint32_t *nameOffsets_; + uint32_t valueCount_; +} + +@synthesize name = name_; +@synthesize enumVerifier = enumVerifier_; + ++ (instancetype) + allocDescriptorForName:(NSString *)name + valueNames:(const char *)valueNames + values:(const int32_t *)values + count:(uint32_t)valueCount + enumVerifier:(GPBEnumValidationFunc)enumVerifier { + GPBEnumDescriptor *descriptor = [[self alloc] initWithName:name + valueNames:valueNames + values:values + count:valueCount + enumVerifier:enumVerifier]; + return descriptor; +} + ++ (instancetype) + allocDescriptorForName:(NSString *)name + valueNames:(const char *)valueNames + values:(const int32_t *)values + count:(uint32_t)valueCount + enumVerifier:(GPBEnumValidationFunc)enumVerifier + extraTextFormatInfo:(const char *)extraTextFormatInfo { + // Call the common case. + GPBEnumDescriptor *descriptor = [self allocDescriptorForName:name + valueNames:valueNames + values:values + count:valueCount + enumVerifier:enumVerifier]; + // Set the extra info. + descriptor->extraTextFormatInfo_ = (const uint8_t *)extraTextFormatInfo; + return descriptor; +} + +- (instancetype)initWithName:(NSString *)name + valueNames:(const char *)valueNames + values:(const int32_t *)values + count:(uint32_t)valueCount + enumVerifier:(GPBEnumValidationFunc)enumVerifier { + if ((self = [super init])) { + name_ = [name copy]; + valueNames_ = valueNames; + values_ = values; + valueCount_ = valueCount; + enumVerifier_ = enumVerifier; + } + return self; +} + +- (void)dealloc { + [name_ release]; + if (nameOffsets_) free(nameOffsets_); + [super dealloc]; +} + +- (void)calcValueNameOffsets { + @synchronized(self) { + if (nameOffsets_ != NULL) { + return; + } + uint32_t *offsets = malloc(valueCount_ * sizeof(uint32_t)); + const char *scan = valueNames_; + for (uint32_t i = 0; i < valueCount_; ++i) { + offsets[i] = (uint32_t)(scan - valueNames_); + while (*scan != '\0') ++scan; + ++scan; // Step over the null. + } + nameOffsets_ = offsets; + } +} + +- (NSString *)enumNameForValue:(int32_t)number { + if (nameOffsets_ == NULL) [self calcValueNameOffsets]; + + for (uint32_t i = 0; i < valueCount_; ++i) { + if (values_[i] == number) { + const char *valueName = valueNames_ + nameOffsets_[i]; + NSString *fullName = [NSString stringWithFormat:@"%@_%s", name_, valueName]; + return fullName; + } + } + return nil; +} + +- (BOOL)getValue:(int32_t *)outValue forEnumName:(NSString *)name { + // Must have the prefix. + NSUInteger prefixLen = name_.length + 1; + if ((name.length <= prefixLen) || ![name hasPrefix:name_] || + ([name characterAtIndex:prefixLen - 1] != '_')) { + return NO; + } + + // Skip over the prefix. + const char *nameAsCStr = [name UTF8String]; + nameAsCStr += prefixLen; + + if (nameOffsets_ == NULL) [self calcValueNameOffsets]; + + // Find it. + for (uint32_t i = 0; i < valueCount_; ++i) { + const char *valueName = valueNames_ + nameOffsets_[i]; + if (strcmp(nameAsCStr, valueName) == 0) { + if (outValue) { + *outValue = values_[i]; + } + return YES; + } + } + return NO; +} + +- (BOOL)getValue:(int32_t *)outValue forEnumTextFormatName:(NSString *)textFormatName { + if (nameOffsets_ == NULL) [self calcValueNameOffsets]; + + for (uint32_t i = 0; i < valueCount_; ++i) { + int32_t value = values_[i]; + NSString *valueTextFormatName = [self textFormatNameForValue:value]; + if ([valueTextFormatName isEqual:textFormatName]) { + if (outValue) { + *outValue = value; + } + return YES; + } + } + return NO; +} + +- (NSString *)textFormatNameForValue:(int32_t)number { + if (nameOffsets_ == NULL) [self calcValueNameOffsets]; + + // Find the EnumValue descriptor and its index. + BOOL foundIt = NO; + uint32_t valueDescriptorIndex; + for (valueDescriptorIndex = 0; valueDescriptorIndex < valueCount_; + ++valueDescriptorIndex) { + if (values_[valueDescriptorIndex] == number) { + foundIt = YES; + break; + } + } + + if (!foundIt) { + return nil; + } + + NSString *result = nil; + // Naming adds an underscore between enum name and value name, skip that also. + const char *valueName = valueNames_ + nameOffsets_[valueDescriptorIndex]; + NSString *shortName = @(valueName); + + // See if it is in the map of special format handling. + if (extraTextFormatInfo_) { + result = GPBDecodeTextFormatName(extraTextFormatInfo_, + (int32_t)valueDescriptorIndex, shortName); + } + // Logic here needs to match what objectivec_enum.cc does in the proto + // compiler. + if (result == nil) { + NSUInteger len = [shortName length]; + NSMutableString *worker = [NSMutableString stringWithCapacity:len]; + for (NSUInteger i = 0; i < len; i++) { + unichar c = [shortName characterAtIndex:i]; + if (i > 0 && c >= 'A' && c <= 'Z') { + [worker appendString:@"_"]; + } + [worker appendFormat:@"%c", toupper((char)c)]; + } + result = worker; + } + return result; +} + +@end + +@implementation GPBExtensionDescriptor { + GPBGenericValue defaultValue_; +} + +@synthesize containingMessageClass = containingMessageClass_; + +- (instancetype)initWithExtensionDescription: + (GPBExtensionDescription *)description { + if ((self = [super init])) { + description_ = description; + +#if defined(DEBUG) && DEBUG + const char *className = description->messageOrGroupClassName; + if (className) { + NSAssert(objc_lookUpClass(className) != Nil, + @"Class %s not defined", className); + } +#endif + + if (description->extendedClass) { + Class containingClass = objc_lookUpClass(description->extendedClass); + NSAssert(containingClass, @"Class %s not defined", + description->extendedClass); + containingMessageClass_ = containingClass; + } + + GPBDataType type = description_->dataType; + if (type == GPBDataTypeBytes) { + // Data stored as a length prefixed c-string in descriptor records. + const uint8_t *bytes = + (const uint8_t *)description->defaultValue.valueData; + if (bytes) { + uint32_t length = *((uint32_t *)bytes); + // The length is stored in network byte order. + length = ntohl(length); + bytes += sizeof(length); + defaultValue_.valueData = + [[NSData alloc] initWithBytes:bytes length:length]; + } + } else if (type == GPBDataTypeMessage || type == GPBDataTypeGroup) { + // The default is looked up in -defaultValue instead since extensions + // aren't common, we avoid the hit startup hit and it avoid initialization + // order issues. + } else { + defaultValue_ = description->defaultValue; + } + } + return self; +} + +- (void)dealloc { + if ((description_->dataType == GPBDataTypeBytes) && + !GPBExtensionIsRepeated(description_)) { + [defaultValue_.valueData release]; + } + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { +#pragma unused(zone) + // Immutable. + return [self retain]; +} + +- (NSString *)singletonName { + return @(description_->singletonName); +} + +- (const char *)singletonNameC { + return description_->singletonName; +} + +- (uint32_t)fieldNumber { + return description_->fieldNumber; +} + +- (GPBDataType)dataType { + return description_->dataType; +} + +- (GPBWireFormat)wireType { + return GPBWireFormatForType(description_->dataType, + GPBExtensionIsPacked(description_)); +} + +- (GPBWireFormat)alternateWireType { + NSAssert(GPBExtensionIsRepeated(description_), + @"Only valid on repeated extensions"); + return GPBWireFormatForType(description_->dataType, + !GPBExtensionIsPacked(description_)); +} + +- (BOOL)isRepeated { + return GPBExtensionIsRepeated(description_); +} + +- (BOOL)isMap { + return (description_->options & GPBFieldMapKeyMask) != 0; +} + +- (BOOL)isPackable { + return GPBExtensionIsPacked(description_); +} + +- (Class)msgClass { + return objc_getClass(description_->messageOrGroupClassName); +} + +- (GPBEnumDescriptor *)enumDescriptor { + if (description_->dataType == GPBDataTypeEnum) { + GPBEnumDescriptor *enumDescriptor = description_->enumDescriptorFunc(); + return enumDescriptor; + } + return nil; +} + +- (id)defaultValue { + if (GPBExtensionIsRepeated(description_)) { + return nil; + } + + switch (description_->dataType) { + case GPBDataTypeBool: + return @(defaultValue_.valueBool); + case GPBDataTypeFloat: + return @(defaultValue_.valueFloat); + case GPBDataTypeDouble: + return @(defaultValue_.valueDouble); + case GPBDataTypeInt32: + case GPBDataTypeSInt32: + case GPBDataTypeEnum: + case GPBDataTypeSFixed32: + return @(defaultValue_.valueInt32); + case GPBDataTypeInt64: + case GPBDataTypeSInt64: + case GPBDataTypeSFixed64: + return @(defaultValue_.valueInt64); + case GPBDataTypeUInt32: + case GPBDataTypeFixed32: + return @(defaultValue_.valueUInt32); + case GPBDataTypeUInt64: + case GPBDataTypeFixed64: + return @(defaultValue_.valueUInt64); + case GPBDataTypeBytes: + // Like message fields, the default is zero length data. + return (defaultValue_.valueData ? defaultValue_.valueData + : GPBEmptyNSData()); + case GPBDataTypeString: + // Like message fields, the default is zero length string. + return (defaultValue_.valueString ? defaultValue_.valueString : @""); + case GPBDataTypeGroup: + case GPBDataTypeMessage: + return nil; + } +} + +- (NSComparisonResult)compareByFieldNumber:(GPBExtensionDescriptor *)other { + int32_t selfNumber = description_->fieldNumber; + int32_t otherNumber = other->description_->fieldNumber; + if (selfNumber < otherNumber) { + return NSOrderedAscending; + } else if (selfNumber == otherNumber) { + return NSOrderedSame; + } else { + return NSOrderedDescending; + } +} + +@end + +#pragma clang diagnostic pop diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor_PackagePrivate.h new file mode 100644 index 00000000..9173e7a2 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDescriptor_PackagePrivate.h @@ -0,0 +1,329 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This header is private to the ProtobolBuffers library and must NOT be +// included by any sources outside this library. The contents of this file are +// subject to change at any time without notice. + +#import "GPBDescriptor.h" +#import "GPBWireFormat.h" + +// Describes attributes of the field. +typedef NS_OPTIONS(uint16_t, GPBFieldFlags) { + GPBFieldNone = 0, + // These map to standard protobuf concepts. + GPBFieldRequired = 1 << 0, + GPBFieldRepeated = 1 << 1, + GPBFieldPacked = 1 << 2, + GPBFieldOptional = 1 << 3, + GPBFieldHasDefaultValue = 1 << 4, + + // Indicates the field needs custom handling for the TextFormat name, if not + // set, the name can be derived from the ObjC name. + GPBFieldTextFormatNameCustom = 1 << 6, + // Indicates the field has an enum descriptor. + GPBFieldHasEnumDescriptor = 1 << 7, + + // These are not standard protobuf concepts, they are specific to the + // Objective C runtime. + + // These bits are used to mark the field as a map and what the key + // type is. + GPBFieldMapKeyMask = 0xF << 8, + GPBFieldMapKeyInt32 = 1 << 8, + GPBFieldMapKeyInt64 = 2 << 8, + GPBFieldMapKeyUInt32 = 3 << 8, + GPBFieldMapKeyUInt64 = 4 << 8, + GPBFieldMapKeySInt32 = 5 << 8, + GPBFieldMapKeySInt64 = 6 << 8, + GPBFieldMapKeyFixed32 = 7 << 8, + GPBFieldMapKeyFixed64 = 8 << 8, + GPBFieldMapKeySFixed32 = 9 << 8, + GPBFieldMapKeySFixed64 = 10 << 8, + GPBFieldMapKeyBool = 11 << 8, + GPBFieldMapKeyString = 12 << 8, +}; + +// NOTE: The structures defined here have their members ordered to minimize +// their size. This directly impacts the size of apps since these exist per +// field/extension. + +// Describes a single field in a protobuf as it is represented as an ivar. +typedef struct GPBMessageFieldDescription { + // Name of ivar. + const char *name; + union { + const char *className; // Name for message class. + // For enums only: If EnumDescriptors are compiled in, it will be that, + // otherwise it will be the verifier. + GPBEnumDescriptorFunc enumDescFunc; + GPBEnumValidationFunc enumVerifier; + } dataTypeSpecific; + // The field number for the ivar. + uint32_t number; + // The index (in bits) into _has_storage_. + // >= 0: the bit to use for a value being set. + // = GPBNoHasBit(INT32_MAX): no storage used. + // < 0: in a oneOf, use a full int32 to record the field active. + int32_t hasIndex; + // Offset of the variable into it's structure struct. + uint32_t offset; + // Field flags. Use accessor functions below. + GPBFieldFlags flags; + // Data type of the ivar. + GPBDataType dataType; +} GPBMessageFieldDescription; + +// Fields in messages defined in a 'proto2' syntax file can provide a default +// value. This struct provides the default along with the field info. +typedef struct GPBMessageFieldDescriptionWithDefault { + // Default value for the ivar. + GPBGenericValue defaultValue; + + GPBMessageFieldDescription core; +} GPBMessageFieldDescriptionWithDefault; + +// Describes attributes of the extension. +typedef NS_OPTIONS(uint8_t, GPBExtensionOptions) { + GPBExtensionNone = 0, + // These map to standard protobuf concepts. + GPBExtensionRepeated = 1 << 0, + GPBExtensionPacked = 1 << 1, + GPBExtensionSetWireFormat = 1 << 2, +}; + +// An extension +typedef struct GPBExtensionDescription { + GPBGenericValue defaultValue; + const char *singletonName; + const char *extendedClass; + const char *messageOrGroupClassName; + GPBEnumDescriptorFunc enumDescriptorFunc; + int32_t fieldNumber; + GPBDataType dataType; + GPBExtensionOptions options; +} GPBExtensionDescription; + +typedef NS_OPTIONS(uint32_t, GPBDescriptorInitializationFlags) { + GPBDescriptorInitializationFlag_None = 0, + GPBDescriptorInitializationFlag_FieldsWithDefault = 1 << 0, + GPBDescriptorInitializationFlag_WireFormat = 1 << 1, +}; + +@interface GPBDescriptor () { + @package + NSArray *fields_; + NSArray *oneofs_; + uint32_t storageSize_; +} + +// fieldDescriptions have to be long lived, they are held as raw pointers. ++ (instancetype) + allocDescriptorForClass:(Class)messageClass + rootClass:(Class)rootClass + file:(GPBFileDescriptor *)file + fields:(void *)fieldDescriptions + fieldCount:(uint32_t)fieldCount + storageSize:(uint32_t)storageSize + flags:(GPBDescriptorInitializationFlags)flags; + +- (instancetype)initWithClass:(Class)messageClass + file:(GPBFileDescriptor *)file + fields:(NSArray *)fields + storageSize:(uint32_t)storage + wireFormat:(BOOL)wireFormat; + +// Called right after init to provide extra information to avoid init having +// an explosion of args. These pointers are recorded, so they are expected +// to live for the lifetime of the app. +- (void)setupOneofs:(const char **)oneofNames + count:(uint32_t)count + firstHasIndex:(int32_t)firstHasIndex; +- (void)setupExtraTextInfo:(const char *)extraTextFormatInfo; +- (void)setupExtensionRanges:(const GPBExtensionRange *)ranges count:(int32_t)count; +- (void)setupContainingMessageClassName:(const char *)msgClassName; +- (void)setupMessageClassNameSuffix:(NSString *)suffix; + +@end + +@interface GPBFileDescriptor () +- (instancetype)initWithPackage:(NSString *)package + objcPrefix:(NSString *)objcPrefix + syntax:(GPBFileSyntax)syntax; +- (instancetype)initWithPackage:(NSString *)package + syntax:(GPBFileSyntax)syntax; +@end + +@interface GPBOneofDescriptor () { + @package + const char *name_; + NSArray *fields_; + SEL caseSel_; +} +// name must be long lived. +- (instancetype)initWithName:(const char *)name fields:(NSArray *)fields; +@end + +@interface GPBFieldDescriptor () { + @package + GPBMessageFieldDescription *description_; + GPB_UNSAFE_UNRETAINED GPBOneofDescriptor *containingOneof_; + + SEL getSel_; + SEL setSel_; + SEL hasOrCountSel_; // *Count for map<>/repeated fields, has* otherwise. + SEL setHasSel_; +} + +// Single initializer +// description has to be long lived, it is held as a raw pointer. +- (instancetype)initWithFieldDescription:(void *)description + includesDefault:(BOOL)includesDefault + syntax:(GPBFileSyntax)syntax; +@end + +@interface GPBEnumDescriptor () +// valueNames, values and extraTextFormatInfo have to be long lived, they are +// held as raw pointers. ++ (instancetype) + allocDescriptorForName:(NSString *)name + valueNames:(const char *)valueNames + values:(const int32_t *)values + count:(uint32_t)valueCount + enumVerifier:(GPBEnumValidationFunc)enumVerifier; ++ (instancetype) + allocDescriptorForName:(NSString *)name + valueNames:(const char *)valueNames + values:(const int32_t *)values + count:(uint32_t)valueCount + enumVerifier:(GPBEnumValidationFunc)enumVerifier + extraTextFormatInfo:(const char *)extraTextFormatInfo; + +- (instancetype)initWithName:(NSString *)name + valueNames:(const char *)valueNames + values:(const int32_t *)values + count:(uint32_t)valueCount + enumVerifier:(GPBEnumValidationFunc)enumVerifier; +@end + +@interface GPBExtensionDescriptor () { + @package + GPBExtensionDescription *description_; +} +@property(nonatomic, readonly) GPBWireFormat wireType; + +// For repeated extensions, alternateWireType is the wireType with the opposite +// value for the packable property. i.e. - if the extension was marked packed +// it would be the wire type for unpacked; if the extension was marked unpacked, +// it would be the wire type for packed. +@property(nonatomic, readonly) GPBWireFormat alternateWireType; + +// description has to be long lived, it is held as a raw pointer. +- (instancetype)initWithExtensionDescription: + (GPBExtensionDescription *)description; +- (NSComparisonResult)compareByFieldNumber:(GPBExtensionDescriptor *)other; +@end + +CF_EXTERN_C_BEGIN + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +GPB_INLINE BOOL GPBFieldIsMapOrArray(GPBFieldDescriptor *field) { + return (field->description_->flags & + (GPBFieldRepeated | GPBFieldMapKeyMask)) != 0; +} + +GPB_INLINE GPBDataType GPBGetFieldDataType(GPBFieldDescriptor *field) { + return field->description_->dataType; +} + +GPB_INLINE int32_t GPBFieldHasIndex(GPBFieldDescriptor *field) { + return field->description_->hasIndex; +} + +GPB_INLINE uint32_t GPBFieldNumber(GPBFieldDescriptor *field) { + return field->description_->number; +} + +#pragma clang diagnostic pop + +uint32_t GPBFieldTag(GPBFieldDescriptor *self); + +// For repeated fields, alternateWireType is the wireType with the opposite +// value for the packable property. i.e. - if the field was marked packed it +// would be the wire type for unpacked; if the field was marked unpacked, it +// would be the wire type for packed. +uint32_t GPBFieldAlternateTag(GPBFieldDescriptor *self); + +GPB_INLINE BOOL GPBPreserveUnknownFields(GPBFileSyntax syntax) { + return syntax != GPBFileSyntaxProto3; +} + +GPB_INLINE BOOL GPBHasPreservingUnknownEnumSemantics(GPBFileSyntax syntax) { + return syntax == GPBFileSyntaxProto3; +} + +GPB_INLINE BOOL GPBExtensionIsRepeated(GPBExtensionDescription *description) { + return (description->options & GPBExtensionRepeated) != 0; +} + +GPB_INLINE BOOL GPBExtensionIsPacked(GPBExtensionDescription *description) { + return (description->options & GPBExtensionPacked) != 0; +} + +GPB_INLINE BOOL GPBExtensionIsWireFormat(GPBExtensionDescription *description) { + return (description->options & GPBExtensionSetWireFormat) != 0; +} + +// Helper for compile time assets. +#ifndef GPBInternalCompileAssert + #if __has_feature(c_static_assert) || __has_extension(c_static_assert) + #define GPBInternalCompileAssert(test, msg) _Static_assert((test), #msg) + #else + // Pre-Xcode 7 support. + #define GPBInternalCompileAssertSymbolInner(line, msg) GPBInternalCompileAssert ## line ## __ ## msg + #define GPBInternalCompileAssertSymbol(line, msg) GPBInternalCompileAssertSymbolInner(line, msg) + #define GPBInternalCompileAssert(test, msg) \ + typedef char GPBInternalCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ] + #endif // __has_feature(c_static_assert) || __has_extension(c_static_assert) +#endif // GPBInternalCompileAssert + +// Sanity check that there isn't padding between the field description +// structures with and without a default. +GPBInternalCompileAssert(sizeof(GPBMessageFieldDescriptionWithDefault) == + (sizeof(GPBGenericValue) + + sizeof(GPBMessageFieldDescription)), + DescriptionsWithDefault_different_size_than_expected); + +CF_EXTERN_C_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary.h new file mode 100644 index 00000000..9d674150 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary.h @@ -0,0 +1,8570 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBRuntimeTypes.h" + +// Note on naming: for the classes holding numeric values, a more natural +// naming of the method might be things like "-valueForKey:", +// "-setValue:forKey:"; etc. But those selectors are also defined by Key Value +// Coding (KVC) as categories on NSObject. So "overloading" the selectors with +// other meanings can cause warnings (based on compiler settings), but more +// importantly, some of those selector get called as KVC breaks up keypaths. +// So if those selectors are used, using KVC will compile cleanly, but could +// crash as it invokes those selectors with the wrong types of arguments. + +NS_ASSUME_NONNULL_BEGIN + +//%PDDM-EXPAND DECLARE_DICTIONARIES() +// This block of code is generated, do not edit it directly. + +#pragma mark - UInt32 -> UInt32 + +/** + * Class used for map fields of <uint32_t, uint32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32UInt32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(uint32_t key, uint32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt32UInt32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt32:(uint32_t)value forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt32ForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt32 -> Int32 + +/** + * Class used for map fields of <uint32_t, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32Int32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32Int32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt32s:(const int32_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt32Int32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt32:(nullable int32_t *)value forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(uint32_t key, int32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt32Int32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt32:(int32_t)value forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt32ForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt32 -> UInt64 + +/** + * Class used for map fields of <uint32_t, uint64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32UInt64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(uint32_t key, uint64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt32UInt64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt64:(uint64_t)value forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt64ForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt32 -> Int64 + +/** + * Class used for map fields of <uint32_t, int64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32Int64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32Int64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt64s:(const int64_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt32Int64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt64:(nullable int64_t *)value forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(uint32_t key, int64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt32Int64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt64:(int64_t)value forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt64ForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt32 -> Bool + +/** + * Class used for map fields of <uint32_t, BOOL> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32BoolDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32BoolDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithBools:(const BOOL [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt32BoolDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getBool:(nullable BOOL *)value forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(uint32_t key, BOOL value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt32BoolDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setBool:(BOOL)value forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeBoolForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt32 -> Float + +/** + * Class used for map fields of <uint32_t, float> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32FloatDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithFloats:(const float [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32FloatDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithFloats:(const float [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt32FloatDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getFloat:(nullable float *)value forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(uint32_t key, float value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt32FloatDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setFloat:(float)value forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeFloatForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt32 -> Double + +/** + * Class used for map fields of <uint32_t, double> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32DoubleDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithDoubles:(const double [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32DoubleDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithDoubles:(const double [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt32DoubleDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getDouble:(nullable double *)value forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(uint32_t key, double value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt32DoubleDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setDouble:(double)value forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeDoubleForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt32 -> Enum + +/** + * Class used for map fields of <uint32_t, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32EnumDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; +/** The validation function to check if the enums are valid. */ +@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly instanced dictionary. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param func The enum validation function for the dictionary. + * @param rawValue The raw enum value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32EnumDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +/** + * Initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly initialized dictionary. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly initialized dictionary with the keys and values in it. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly initialized dictionary with the entries from the given + * dictionary in it. + **/ +- (instancetype)initWithDictionary:(GPBUInt32EnumDictionary *)dictionary; + +/** + * Initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly initialized dictionary with the given capacity. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +// These will return kGPBUnrecognizedEnumeratorValue if the value for the key +// is not a valid enumerator as defined by validationFunc. If the actual value is +// desired, use "raw" version of the method. + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getEnum:(nullable int32_t *)value forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(uint32_t key, int32_t value, BOOL *stop))block; + +/** + * Gets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param rawValue Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **rawValue**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(uint32_t key, int32_t rawValue, BOOL *stop))block; + +/** + * Adds the keys and raw enum values from another dictionary. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addRawEntriesFromDictionary:(GPBUInt32EnumDictionary *)otherDictionary; + +// If value is not a valid enumerator as defined by validationFunc, these +// methods will assert in debug, and will log in release and assign the value +// to the default value. Use the rawValue methods below to assign non enumerator +// values. + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setEnum:(int32_t)value forKey:(uint32_t)key; + +/** + * Sets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param rawValue The raw enum value to set. + * @param key The key under which to store the raw enum value. + **/ +- (void)setRawValue:(int32_t)rawValue forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeEnumForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt32 -> Object + +/** + * Class used for map fields of <uint32_t, ObjectType> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt32ObjectDictionary<__covariant ObjectType> : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param object The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithObject:(ObjectType)object + forKey:(uint32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param objects The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt32ObjectDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param objects The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const uint32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt32ObjectDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Fetches the object stored under the given key. + * + * @param key Key under which the value is stored, if present. + * + * @return The object if found, nil otherwise. + **/ +- (ObjectType)objectForKey:(uint32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **object**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(uint32_t key, ObjectType object, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt32ObjectDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param object The value to set. + * @param key The key under which to store the value. + **/ +- (void)setObject:(ObjectType)object forKey:(uint32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeObjectForKey:(uint32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> UInt32 + +/** + * Class used for map fields of <int32_t, uint32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32UInt32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32UInt32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt32UInt32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(int32_t key, uint32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt32UInt32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt32:(uint32_t)value forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt32ForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> Int32 + +/** + * Class used for map fields of <int32_t, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32Int32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32Int32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt32s:(const int32_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt32Int32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt32:(nullable int32_t *)value forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(int32_t key, int32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt32Int32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt32:(int32_t)value forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt32ForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> UInt64 + +/** + * Class used for map fields of <int32_t, uint64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32UInt64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32UInt64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt32UInt64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(int32_t key, uint64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt32UInt64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt64:(uint64_t)value forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt64ForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> Int64 + +/** + * Class used for map fields of <int32_t, int64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32Int64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32Int64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt64s:(const int64_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt32Int64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt64:(nullable int64_t *)value forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(int32_t key, int64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt32Int64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt64:(int64_t)value forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt64ForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> Bool + +/** + * Class used for map fields of <int32_t, BOOL> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32BoolDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32BoolDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithBools:(const BOOL [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt32BoolDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getBool:(nullable BOOL *)value forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(int32_t key, BOOL value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt32BoolDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setBool:(BOOL)value forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeBoolForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> Float + +/** + * Class used for map fields of <int32_t, float> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32FloatDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithFloats:(const float [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32FloatDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithFloats:(const float [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt32FloatDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getFloat:(nullable float *)value forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(int32_t key, float value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt32FloatDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setFloat:(float)value forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeFloatForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> Double + +/** + * Class used for map fields of <int32_t, double> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32DoubleDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithDoubles:(const double [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32DoubleDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithDoubles:(const double [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt32DoubleDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getDouble:(nullable double *)value forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(int32_t key, double value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt32DoubleDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setDouble:(double)value forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeDoubleForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> Enum + +/** + * Class used for map fields of <int32_t, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32EnumDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; +/** The validation function to check if the enums are valid. */ +@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly instanced dictionary. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param func The enum validation function for the dictionary. + * @param rawValue The raw enum value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32EnumDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +/** + * Initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly initialized dictionary. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly initialized dictionary with the keys and values in it. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly initialized dictionary with the entries from the given + * dictionary in it. + **/ +- (instancetype)initWithDictionary:(GPBInt32EnumDictionary *)dictionary; + +/** + * Initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly initialized dictionary with the given capacity. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +// These will return kGPBUnrecognizedEnumeratorValue if the value for the key +// is not a valid enumerator as defined by validationFunc. If the actual value is +// desired, use "raw" version of the method. + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getEnum:(nullable int32_t *)value forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(int32_t key, int32_t value, BOOL *stop))block; + +/** + * Gets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param rawValue Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **rawValue**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(int32_t key, int32_t rawValue, BOOL *stop))block; + +/** + * Adds the keys and raw enum values from another dictionary. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addRawEntriesFromDictionary:(GPBInt32EnumDictionary *)otherDictionary; + +// If value is not a valid enumerator as defined by validationFunc, these +// methods will assert in debug, and will log in release and assign the value +// to the default value. Use the rawValue methods below to assign non enumerator +// values. + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setEnum:(int32_t)value forKey:(int32_t)key; + +/** + * Sets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param rawValue The raw enum value to set. + * @param key The key under which to store the raw enum value. + **/ +- (void)setRawValue:(int32_t)rawValue forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeEnumForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int32 -> Object + +/** + * Class used for map fields of <int32_t, ObjectType> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt32ObjectDictionary<__covariant ObjectType> : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param object The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithObject:(ObjectType)object + forKey:(int32_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param objects The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt32ObjectDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param objects The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const int32_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt32ObjectDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Fetches the object stored under the given key. + * + * @param key Key under which the value is stored, if present. + * + * @return The object if found, nil otherwise. + **/ +- (ObjectType)objectForKey:(int32_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **object**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(int32_t key, ObjectType object, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt32ObjectDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param object The value to set. + * @param key The key under which to store the value. + **/ +- (void)setObject:(ObjectType)object forKey:(int32_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeObjectForKey:(int32_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> UInt32 + +/** + * Class used for map fields of <uint64_t, uint32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64UInt32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(uint64_t key, uint32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt64UInt32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt32:(uint32_t)value forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt32ForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> Int32 + +/** + * Class used for map fields of <uint64_t, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64Int32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64Int32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt32s:(const int32_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt64Int32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt32:(nullable int32_t *)value forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(uint64_t key, int32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt64Int32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt32:(int32_t)value forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt32ForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> UInt64 + +/** + * Class used for map fields of <uint64_t, uint64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64UInt64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(uint64_t key, uint64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt64UInt64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt64:(uint64_t)value forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt64ForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> Int64 + +/** + * Class used for map fields of <uint64_t, int64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64Int64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64Int64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt64s:(const int64_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt64Int64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt64:(nullable int64_t *)value forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(uint64_t key, int64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt64Int64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt64:(int64_t)value forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt64ForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> Bool + +/** + * Class used for map fields of <uint64_t, BOOL> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64BoolDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64BoolDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithBools:(const BOOL [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt64BoolDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getBool:(nullable BOOL *)value forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(uint64_t key, BOOL value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt64BoolDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setBool:(BOOL)value forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeBoolForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> Float + +/** + * Class used for map fields of <uint64_t, float> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64FloatDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithFloats:(const float [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64FloatDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithFloats:(const float [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt64FloatDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getFloat:(nullable float *)value forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(uint64_t key, float value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt64FloatDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setFloat:(float)value forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeFloatForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> Double + +/** + * Class used for map fields of <uint64_t, double> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64DoubleDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithDoubles:(const double [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64DoubleDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithDoubles:(const double [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt64DoubleDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getDouble:(nullable double *)value forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(uint64_t key, double value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt64DoubleDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setDouble:(double)value forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeDoubleForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> Enum + +/** + * Class used for map fields of <uint64_t, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64EnumDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; +/** The validation function to check if the enums are valid. */ +@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly instanced dictionary. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param func The enum validation function for the dictionary. + * @param rawValue The raw enum value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64EnumDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +/** + * Initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly initialized dictionary. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly initialized dictionary with the keys and values in it. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly initialized dictionary with the entries from the given + * dictionary in it. + **/ +- (instancetype)initWithDictionary:(GPBUInt64EnumDictionary *)dictionary; + +/** + * Initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly initialized dictionary with the given capacity. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +// These will return kGPBUnrecognizedEnumeratorValue if the value for the key +// is not a valid enumerator as defined by validationFunc. If the actual value is +// desired, use "raw" version of the method. + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getEnum:(nullable int32_t *)value forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(uint64_t key, int32_t value, BOOL *stop))block; + +/** + * Gets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param rawValue Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **rawValue**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(uint64_t key, int32_t rawValue, BOOL *stop))block; + +/** + * Adds the keys and raw enum values from another dictionary. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addRawEntriesFromDictionary:(GPBUInt64EnumDictionary *)otherDictionary; + +// If value is not a valid enumerator as defined by validationFunc, these +// methods will assert in debug, and will log in release and assign the value +// to the default value. Use the rawValue methods below to assign non enumerator +// values. + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setEnum:(int32_t)value forKey:(uint64_t)key; + +/** + * Sets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param rawValue The raw enum value to set. + * @param key The key under which to store the raw enum value. + **/ +- (void)setRawValue:(int32_t)rawValue forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeEnumForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - UInt64 -> Object + +/** + * Class used for map fields of <uint64_t, ObjectType> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBUInt64ObjectDictionary<__covariant ObjectType> : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param object The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithObject:(ObjectType)object + forKey:(uint64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param objects The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBUInt64ObjectDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param objects The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const uint64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBUInt64ObjectDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Fetches the object stored under the given key. + * + * @param key Key under which the value is stored, if present. + * + * @return The object if found, nil otherwise. + **/ +- (ObjectType)objectForKey:(uint64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **object**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(uint64_t key, ObjectType object, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBUInt64ObjectDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param object The value to set. + * @param key The key under which to store the value. + **/ +- (void)setObject:(ObjectType)object forKey:(uint64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeObjectForKey:(uint64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> UInt32 + +/** + * Class used for map fields of <int64_t, uint32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64UInt32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64UInt32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt64UInt32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(int64_t key, uint32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt64UInt32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt32:(uint32_t)value forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt32ForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> Int32 + +/** + * Class used for map fields of <int64_t, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64Int32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64Int32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt32s:(const int32_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt64Int32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt32:(nullable int32_t *)value forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(int64_t key, int32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt64Int32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt32:(int32_t)value forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt32ForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> UInt64 + +/** + * Class used for map fields of <int64_t, uint64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64UInt64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64UInt64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt64UInt64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(int64_t key, uint64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt64UInt64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt64:(uint64_t)value forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt64ForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> Int64 + +/** + * Class used for map fields of <int64_t, int64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64Int64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64Int64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt64s:(const int64_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt64Int64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt64:(nullable int64_t *)value forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(int64_t key, int64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt64Int64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt64:(int64_t)value forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt64ForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> Bool + +/** + * Class used for map fields of <int64_t, BOOL> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64BoolDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64BoolDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithBools:(const BOOL [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt64BoolDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getBool:(nullable BOOL *)value forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(int64_t key, BOOL value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt64BoolDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setBool:(BOOL)value forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeBoolForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> Float + +/** + * Class used for map fields of <int64_t, float> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64FloatDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithFloats:(const float [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64FloatDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithFloats:(const float [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt64FloatDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getFloat:(nullable float *)value forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(int64_t key, float value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt64FloatDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setFloat:(float)value forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeFloatForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> Double + +/** + * Class used for map fields of <int64_t, double> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64DoubleDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithDoubles:(const double [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64DoubleDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithDoubles:(const double [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt64DoubleDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getDouble:(nullable double *)value forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(int64_t key, double value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt64DoubleDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setDouble:(double)value forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeDoubleForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> Enum + +/** + * Class used for map fields of <int64_t, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64EnumDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; +/** The validation function to check if the enums are valid. */ +@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly instanced dictionary. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param func The enum validation function for the dictionary. + * @param rawValue The raw enum value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64EnumDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +/** + * Initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly initialized dictionary. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly initialized dictionary with the keys and values in it. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly initialized dictionary with the entries from the given + * dictionary in it. + **/ +- (instancetype)initWithDictionary:(GPBInt64EnumDictionary *)dictionary; + +/** + * Initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly initialized dictionary with the given capacity. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +// These will return kGPBUnrecognizedEnumeratorValue if the value for the key +// is not a valid enumerator as defined by validationFunc. If the actual value is +// desired, use "raw" version of the method. + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getEnum:(nullable int32_t *)value forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(int64_t key, int32_t value, BOOL *stop))block; + +/** + * Gets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param rawValue Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **rawValue**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(int64_t key, int32_t rawValue, BOOL *stop))block; + +/** + * Adds the keys and raw enum values from another dictionary. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addRawEntriesFromDictionary:(GPBInt64EnumDictionary *)otherDictionary; + +// If value is not a valid enumerator as defined by validationFunc, these +// methods will assert in debug, and will log in release and assign the value +// to the default value. Use the rawValue methods below to assign non enumerator +// values. + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setEnum:(int32_t)value forKey:(int64_t)key; + +/** + * Sets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param rawValue The raw enum value to set. + * @param key The key under which to store the raw enum value. + **/ +- (void)setRawValue:(int32_t)rawValue forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeEnumForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Int64 -> Object + +/** + * Class used for map fields of <int64_t, ObjectType> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBInt64ObjectDictionary<__covariant ObjectType> : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param object The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithObject:(ObjectType)object + forKey:(int64_t)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param objects The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBInt64ObjectDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param objects The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const int64_t [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBInt64ObjectDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Fetches the object stored under the given key. + * + * @param key Key under which the value is stored, if present. + * + * @return The object if found, nil otherwise. + **/ +- (ObjectType)objectForKey:(int64_t)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **object**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(int64_t key, ObjectType object, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBInt64ObjectDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param object The value to set. + * @param key The key under which to store the value. + **/ +- (void)setObject:(ObjectType)object forKey:(int64_t)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeObjectForKey:(int64_t)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> UInt32 + +/** + * Class used for map fields of <BOOL, uint32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolUInt32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolUInt32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBBoolUInt32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(BOOL key, uint32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBBoolUInt32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt32:(uint32_t)value forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt32ForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> Int32 + +/** + * Class used for map fields of <BOOL, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolInt32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolInt32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt32s:(const int32_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBBoolInt32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt32:(nullable int32_t *)value forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(BOOL key, int32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBBoolInt32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt32:(int32_t)value forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt32ForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> UInt64 + +/** + * Class used for map fields of <BOOL, uint64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolUInt64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolUInt64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBBoolUInt64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(BOOL key, uint64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBBoolUInt64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt64:(uint64_t)value forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt64ForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> Int64 + +/** + * Class used for map fields of <BOOL, int64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolInt64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolInt64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt64s:(const int64_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBBoolInt64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt64:(nullable int64_t *)value forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(BOOL key, int64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBBoolInt64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt64:(int64_t)value forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt64ForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> Bool + +/** + * Class used for map fields of <BOOL, BOOL> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolBoolDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolBoolDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithBools:(const BOOL [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBBoolBoolDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getBool:(nullable BOOL *)value forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(BOOL key, BOOL value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBBoolBoolDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setBool:(BOOL)value forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeBoolForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> Float + +/** + * Class used for map fields of <BOOL, float> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolFloatDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithFloats:(const float [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolFloatDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithFloats:(const float [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBBoolFloatDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getFloat:(nullable float *)value forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(BOOL key, float value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBBoolFloatDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setFloat:(float)value forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeFloatForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> Double + +/** + * Class used for map fields of <BOOL, double> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolDoubleDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithDoubles:(const double [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolDoubleDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithDoubles:(const double [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBBoolDoubleDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getDouble:(nullable double *)value forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(BOOL key, double value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBBoolDoubleDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setDouble:(double)value forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeDoubleForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> Enum + +/** + * Class used for map fields of <BOOL, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolEnumDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; +/** The validation function to check if the enums are valid. */ +@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly instanced dictionary. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param func The enum validation function for the dictionary. + * @param rawValue The raw enum value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolEnumDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +/** + * Initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly initialized dictionary. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly initialized dictionary with the keys and values in it. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly initialized dictionary with the entries from the given + * dictionary in it. + **/ +- (instancetype)initWithDictionary:(GPBBoolEnumDictionary *)dictionary; + +/** + * Initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly initialized dictionary with the given capacity. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +// These will return kGPBUnrecognizedEnumeratorValue if the value for the key +// is not a valid enumerator as defined by validationFunc. If the actual value is +// desired, use "raw" version of the method. + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getEnum:(nullable int32_t *)value forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(BOOL key, int32_t value, BOOL *stop))block; + +/** + * Gets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param rawValue Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **rawValue**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(BOOL key, int32_t rawValue, BOOL *stop))block; + +/** + * Adds the keys and raw enum values from another dictionary. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addRawEntriesFromDictionary:(GPBBoolEnumDictionary *)otherDictionary; + +// If value is not a valid enumerator as defined by validationFunc, these +// methods will assert in debug, and will log in release and assign the value +// to the default value. Use the rawValue methods below to assign non enumerator +// values. + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setEnum:(int32_t)value forKey:(BOOL)key; + +/** + * Sets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param rawValue The raw enum value to set. + * @param key The key under which to store the raw enum value. + **/ +- (void)setRawValue:(int32_t)rawValue forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeEnumForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - Bool -> Object + +/** + * Class used for map fields of <BOOL, ObjectType> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBBoolObjectDictionary<__covariant ObjectType> : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param object The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithObject:(ObjectType)object + forKey:(BOOL)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param objects The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBBoolObjectDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param objects The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithObjects:(const ObjectType __nonnull GPB_UNSAFE_UNRETAINED [__nullable])objects + forKeys:(const BOOL [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBBoolObjectDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Fetches the object stored under the given key. + * + * @param key Key under which the value is stored, if present. + * + * @return The object if found, nil otherwise. + **/ +- (ObjectType)objectForKey:(BOOL)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **object**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(BOOL key, ObjectType object, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBBoolObjectDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param object The value to set. + * @param key The key under which to store the value. + **/ +- (void)setObject:(ObjectType)object forKey:(BOOL)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeObjectForKey:(BOOL)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - String -> UInt32 + +/** + * Class used for map fields of <NSString, uint32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBStringUInt32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(NSString *)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBStringUInt32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt32s:(const uint32_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBStringUInt32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(NSString *key, uint32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBStringUInt32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt32:(uint32_t)value forKey:(NSString *)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt32ForKey:(NSString *)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - String -> Int32 + +/** + * Class used for map fields of <NSString, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBStringInt32Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(NSString *)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt32s:(const int32_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBStringInt32Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt32s:(const int32_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBStringInt32Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt32:(nullable int32_t *)value forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(NSString *key, int32_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBStringInt32Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt32:(int32_t)value forKey:(NSString *)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt32ForKey:(NSString *)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - String -> UInt64 + +/** + * Class used for map fields of <NSString, uint64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBStringUInt64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(NSString *)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBStringUInt64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithUInt64s:(const uint64_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBStringUInt64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(NSString *key, uint64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBStringUInt64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setUInt64:(uint64_t)value forKey:(NSString *)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeUInt64ForKey:(NSString *)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - String -> Int64 + +/** + * Class used for map fields of <NSString, int64_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBStringInt64Dictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(NSString *)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithInt64s:(const int64_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBStringInt64Dictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithInt64s:(const int64_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBStringInt64Dictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getInt64:(nullable int64_t *)value forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(NSString *key, int64_t value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBStringInt64Dictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setInt64:(int64_t)value forKey:(NSString *)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeInt64ForKey:(NSString *)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - String -> Bool + +/** + * Class used for map fields of <NSString, BOOL> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBStringBoolDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(NSString *)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithBools:(const BOOL [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBStringBoolDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithBools:(const BOOL [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBStringBoolDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getBool:(nullable BOOL *)value forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(NSString *key, BOOL value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBStringBoolDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setBool:(BOOL)value forKey:(NSString *)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeBoolForKey:(NSString *)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - String -> Float + +/** + * Class used for map fields of <NSString, float> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBStringFloatDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(NSString *)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithFloats:(const float [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBStringFloatDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithFloats:(const float [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBStringFloatDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getFloat:(nullable float *)value forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(NSString *key, float value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBStringFloatDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setFloat:(float)value forKey:(NSString *)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeFloatForKey:(NSString *)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - String -> Double + +/** + * Class used for map fields of <NSString, double> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBStringDoubleDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param value The value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(NSString *)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param values The values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithDoubles:(const double [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBStringDoubleDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; + +/** + * Initializes this dictionary, copying the given values and keys. + * + * @param values The values to be placed in this dictionary. + * @param keys The keys under which to store the values. + * @param count The number of elements to copy into the dictionary. + * + * @return A newly initialized dictionary with a copy of the values and keys. + **/ +- (instancetype)initWithDoubles:(const double [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes this dictionary, copying the entries from the given dictionary. + * + * @param dictionary Dictionary containing the entries to add to this dictionary. + * + * @return A newly initialized dictionary with the entries of the given dictionary. + **/ +- (instancetype)initWithDictionary:(GPBStringDoubleDictionary *)dictionary; + +/** + * Initializes this dictionary with the requested capacity. + * + * @param numItems Number of items needed for this dictionary. + * + * @return A newly initialized dictionary with the requested capacity. + **/ +- (instancetype)initWithCapacity:(NSUInteger)numItems; + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getDouble:(nullable double *)value forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(NSString *key, double value, BOOL *stop))block; + +/** + * Adds the keys and values from another dictionary. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addEntriesFromDictionary:(GPBStringDoubleDictionary *)otherDictionary; + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setDouble:(double)value forKey:(NSString *)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeDoubleForKey:(NSString *)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +#pragma mark - String -> Enum + +/** + * Class used for map fields of <NSString, int32_t> + * values. This performs better than boxing into NSNumbers in NSDictionaries. + * + * @note This class is not meant to be subclassed. + **/ +@interface GPBStringEnumDictionary : NSObject <NSCopying> + +/** Number of entries stored in this dictionary. */ +@property(nonatomic, readonly) NSUInteger count; +/** The validation function to check if the enums are valid. */ +@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; + +/** + * @return A newly instanced and empty dictionary. + **/ ++ (instancetype)dictionary; + +/** + * Creates and initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly instanced dictionary. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Creates and initializes a dictionary with the single entry given. + * + * @param func The enum validation function for the dictionary. + * @param rawValue The raw enum value to be placed in the dictionary. + * @param key The key under which to store the value. + * + * @return A newly instanced dictionary with the key and value in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(NSString *)key; + +/** + * Creates and initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly instanced dictionary with the keys and values in it. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count; + +/** + * Creates and initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly instanced dictionary with the entries from the given + * dictionary in it. + **/ ++ (instancetype)dictionaryWithDictionary:(GPBStringEnumDictionary *)dictionary; + +/** + * Creates and initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly instanced dictionary with the given capacity. + **/ ++ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +/** + * Initializes a dictionary with the given validation function. + * + * @param func The enum validation function for the dictionary. + * + * @return A newly initialized dictionary. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func; + +/** + * Initializes a dictionary with the entries given. + * + * @param func The enum validation function for the dictionary. + * @param values The raw enum values values to be placed in the dictionary. + * @param keys The keys under which to store the values. + * @param count The number of entries to store in the dictionary. + * + * @return A newly initialized dictionary with the keys and values in it. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + rawValues:(const int32_t [__nullable])values + forKeys:(const NSString * __nonnull GPB_UNSAFE_UNRETAINED [__nullable])keys + count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; + +/** + * Initializes a dictionary with the entries from the given. + * dictionary. + * + * @param dictionary Dictionary containing the entries to add to the dictionary. + * + * @return A newly initialized dictionary with the entries from the given + * dictionary in it. + **/ +- (instancetype)initWithDictionary:(GPBStringEnumDictionary *)dictionary; + +/** + * Initializes a dictionary with the given capacity. + * + * @param func The enum validation function for the dictionary. + * @param numItems Capacity needed for the dictionary. + * + * @return A newly initialized dictionary with the given capacity. + **/ +- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems; + +// These will return kGPBUnrecognizedEnumeratorValue if the value for the key +// is not a valid enumerator as defined by validationFunc. If the actual value is +// desired, use "raw" version of the method. + +/** + * Gets the value for the given key. + * + * @param value Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getEnum:(nullable int32_t *)value forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **value**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(NSString *key, int32_t value, BOOL *stop))block; + +/** + * Gets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param rawValue Pointer into which the value will be set, if found. + * @param key Key under which the value is stored, if present. + * + * @return YES if the key was found and the value was copied, NO otherwise. + **/ +- (BOOL)getRawValue:(nullable int32_t *)rawValue forKey:(NSString *)key; + +/** + * Enumerates the keys and values on this dictionary with the given block. + * + * @note This method bypass the validationFunc to enable the access of values that + * were not known at the time the binary was compiled. + * + * @param block The block to enumerate with. + * **key**: The key for the current entry. + * **rawValue**: The value for the current entry + * **stop**: A pointer to a boolean that when set stops the enumeration. + **/ +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(NSString *key, int32_t rawValue, BOOL *stop))block; + +/** + * Adds the keys and raw enum values from another dictionary. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param otherDictionary Dictionary containing entries to be added to this + * dictionary. + **/ +- (void)addRawEntriesFromDictionary:(GPBStringEnumDictionary *)otherDictionary; + +// If value is not a valid enumerator as defined by validationFunc, these +// methods will assert in debug, and will log in release and assign the value +// to the default value. Use the rawValue methods below to assign non enumerator +// values. + +/** + * Sets the value for the given key. + * + * @param value The value to set. + * @param key The key under which to store the value. + **/ +- (void)setEnum:(int32_t)value forKey:(NSString *)key; + +/** + * Sets the raw enum value for the given key. + * + * @note This method bypass the validationFunc to enable the setting of values that + * were not known at the time the binary was compiled. + * + * @param rawValue The raw enum value to set. + * @param key The key under which to store the raw enum value. + **/ +- (void)setRawValue:(int32_t)rawValue forKey:(NSString *)key; + +/** + * Removes the entry for the given key. + * + * @param aKey Key to be removed from this dictionary. + **/ +- (void)removeEnumForKey:(NSString *)aKey; + +/** + * Removes all entries in this dictionary. + **/ +- (void)removeAll; + +@end + +//%PDDM-EXPAND-END DECLARE_DICTIONARIES() + +NS_ASSUME_NONNULL_END + +//%PDDM-DEFINE DECLARE_DICTIONARIES() +//%DICTIONARY_INTERFACES_FOR_POD_KEY(UInt32, uint32_t) +//%DICTIONARY_INTERFACES_FOR_POD_KEY(Int32, int32_t) +//%DICTIONARY_INTERFACES_FOR_POD_KEY(UInt64, uint64_t) +//%DICTIONARY_INTERFACES_FOR_POD_KEY(Int64, int64_t) +//%DICTIONARY_INTERFACES_FOR_POD_KEY(Bool, BOOL) +//%DICTIONARY_POD_INTERFACES_FOR_KEY(String, NSString, *, OBJECT) +//%PDDM-DEFINE DICTIONARY_INTERFACES_FOR_POD_KEY(KEY_NAME, KEY_TYPE) +//%DICTIONARY_POD_INTERFACES_FOR_KEY(KEY_NAME, KEY_TYPE, , POD) +//%DICTIONARY_POD_KEY_TO_OBJECT_INTERFACE(KEY_NAME, KEY_TYPE, Object, ObjectType) +//%PDDM-DEFINE DICTIONARY_POD_INTERFACES_FOR_KEY(KEY_NAME, KEY_TYPE, KisP, KHELPER) +//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, UInt32, uint32_t) +//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Int32, int32_t) +//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, UInt64, uint64_t) +//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Int64, int64_t) +//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Bool, BOOL) +//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Float, float) +//%DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Double, double) +//%DICTIONARY_KEY_TO_ENUM_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, Enum, int32_t) +//%PDDM-DEFINE DICTIONARY_KEY_TO_POD_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE) +//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, POD, VALUE_NAME, value) +//%PDDM-DEFINE DICTIONARY_POD_KEY_TO_OBJECT_INTERFACE(KEY_NAME, KEY_TYPE, VALUE_NAME, VALUE_TYPE) +//%DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, , POD, VALUE_NAME, VALUE_TYPE, OBJECT, Object, object) +//%PDDM-DEFINE VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE, VNAME) +//%/** +//% * Gets the value for the given key. +//% * +//% * @param value Pointer into which the value will be set, if found. +//% * @param key Key under which the value is stored, if present. +//% * +//% * @return YES if the key was found and the value was copied, NO otherwise. +//% **/ +//%- (BOOL)get##VNAME##:(nullable VALUE_TYPE *)value forKey:(KEY_TYPE)key; +//%PDDM-DEFINE VALUE_FOR_KEY_OBJECT(KEY_TYPE, VALUE_TYPE, VNAME) +//%/** +//% * Fetches the object stored under the given key. +//% * +//% * @param key Key under which the value is stored, if present. +//% * +//% * @return The object if found, nil otherwise. +//% **/ +//%- (VALUE_TYPE)objectForKey:(KEY_TYPE)key; +//%PDDM-DEFINE VALUE_FOR_KEY_Enum(KEY_TYPE, VALUE_TYPE, VNAME) +//%VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_TYPE, VNAME) +//%PDDM-DEFINE ARRAY_ARG_MODIFIERPOD() +// Nothing +//%PDDM-DEFINE ARRAY_ARG_MODIFIEREnum() +// Nothing +//%PDDM-DEFINE ARRAY_ARG_MODIFIEROBJECT() +//%__nonnull GPB_UNSAFE_UNRETAINED ## +//%PDDM-DEFINE DICTIONARY_CLASS_DECLPOD(KEY_NAME, VALUE_NAME, VALUE_TYPE) +//%GPB##KEY_NAME##VALUE_NAME##Dictionary +//%PDDM-DEFINE DICTIONARY_CLASS_DECLEnum(KEY_NAME, VALUE_NAME, VALUE_TYPE) +//%GPB##KEY_NAME##VALUE_NAME##Dictionary +//%PDDM-DEFINE DICTIONARY_CLASS_DECLOBJECT(KEY_NAME, VALUE_NAME, VALUE_TYPE) +//%GPB##KEY_NAME##VALUE_NAME##Dictionary<__covariant VALUE_TYPE> +//%PDDM-DEFINE DICTIONARY_COMMON_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR) +//%#pragma mark - KEY_NAME -> VALUE_NAME +//% +//%/** +//% * Class used for map fields of <##KEY_TYPE##, ##VALUE_TYPE##> +//% * values. This performs better than boxing into NSNumbers in NSDictionaries. +//% * +//% * @note This class is not meant to be subclassed. +//% **/ +//%@interface DICTIONARY_CLASS_DECL##VHELPER(KEY_NAME, VALUE_NAME, VALUE_TYPE) : NSObject <NSCopying> +//% +//%/** Number of entries stored in this dictionary. */ +//%@property(nonatomic, readonly) NSUInteger count; +//% +//%/** +//% * @return A newly instanced and empty dictionary. +//% **/ +//%+ (instancetype)dictionary; +//% +//%/** +//% * Creates and initializes a dictionary with the single entry given. +//% * +//% * @param ##VNAME_VAR The value to be placed in the dictionary. +//% * @param key ##VNAME_VAR$S## The key under which to store the value. +//% * +//% * @return A newly instanced dictionary with the key and value in it. +//% **/ +//%+ (instancetype)dictionaryWith##VNAME##:(VALUE_TYPE)##VNAME_VAR +//% ##VNAME$S## forKey:(KEY_TYPE##KisP$S##KisP)key; +//% +//%/** +//% * Creates and initializes a dictionary with the entries given. +//% * +//% * @param ##VNAME_VAR##s The values to be placed in the dictionary. +//% * @param keys ##VNAME_VAR$S## The keys under which to store the values. +//% * @param count ##VNAME_VAR$S## The number of entries to store in the dictionary. +//% * +//% * @return A newly instanced dictionary with the keys and values in it. +//% **/ +//%+ (instancetype)dictionaryWith##VNAME##s:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[__nullable])##VNAME_VAR##s +//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[__nullable])keys +//% ##VNAME$S## count:(NSUInteger)count; +//% +//%/** +//% * Creates and initializes a dictionary with the entries from the given. +//% * dictionary. +//% * +//% * @param dictionary Dictionary containing the entries to add to the dictionary. +//% * +//% * @return A newly instanced dictionary with the entries from the given +//% * dictionary in it. +//% **/ +//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary; +//% +//%/** +//% * Creates and initializes a dictionary with the given capacity. +//% * +//% * @param numItems Capacity needed for the dictionary. +//% * +//% * @return A newly instanced dictionary with the given capacity. +//% **/ +//%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems; +//% +//%/** +//% * Initializes this dictionary, copying the given values and keys. +//% * +//% * @param ##VNAME_VAR##s The values to be placed in this dictionary. +//% * @param keys ##VNAME_VAR$S## The keys under which to store the values. +//% * @param count ##VNAME_VAR$S## The number of elements to copy into the dictionary. +//% * +//% * @return A newly initialized dictionary with a copy of the values and keys. +//% **/ +//%- (instancetype)initWith##VNAME##s:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[__nullable])##VNAME_VAR##s +//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[__nullable])keys +//% ##VNAME$S## count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; +//% +//%/** +//% * Initializes this dictionary, copying the entries from the given dictionary. +//% * +//% * @param dictionary Dictionary containing the entries to add to this dictionary. +//% * +//% * @return A newly initialized dictionary with the entries of the given dictionary. +//% **/ +//%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary; +//% +//%/** +//% * Initializes this dictionary with the requested capacity. +//% * +//% * @param numItems Number of items needed for this dictionary. +//% * +//% * @return A newly initialized dictionary with the requested capacity. +//% **/ +//%- (instancetype)initWithCapacity:(NSUInteger)numItems; +//% +//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR) +//% +//%/** +//% * Adds the keys and values from another dictionary. +//% * +//% * @param otherDictionary Dictionary containing entries to be added to this +//% * dictionary. +//% **/ +//%- (void)addEntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary; +//% +//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR) +//% +//%@end +//% + +//%PDDM-DEFINE DICTIONARY_KEY_TO_ENUM_INTERFACE(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE) +//%DICTIONARY_KEY_TO_ENUM_INTERFACE2(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, Enum) +//%PDDM-DEFINE DICTIONARY_KEY_TO_ENUM_INTERFACE2(KEY_NAME, KEY_TYPE, KisP, KHELPER, VALUE_NAME, VALUE_TYPE, VHELPER) +//%#pragma mark - KEY_NAME -> VALUE_NAME +//% +//%/** +//% * Class used for map fields of <##KEY_TYPE##, ##VALUE_TYPE##> +//% * values. This performs better than boxing into NSNumbers in NSDictionaries. +//% * +//% * @note This class is not meant to be subclassed. +//% **/ +//%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary : NSObject <NSCopying> +//% +//%/** Number of entries stored in this dictionary. */ +//%@property(nonatomic, readonly) NSUInteger count; +//%/** The validation function to check if the enums are valid. */ +//%@property(nonatomic, readonly) GPBEnumValidationFunc validationFunc; +//% +//%/** +//% * @return A newly instanced and empty dictionary. +//% **/ +//%+ (instancetype)dictionary; +//% +//%/** +//% * Creates and initializes a dictionary with the given validation function. +//% * +//% * @param func The enum validation function for the dictionary. +//% * +//% * @return A newly instanced dictionary. +//% **/ +//%+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func; +//% +//%/** +//% * Creates and initializes a dictionary with the single entry given. +//% * +//% * @param func The enum validation function for the dictionary. +//% * @param rawValue The raw enum value to be placed in the dictionary. +//% * @param key The key under which to store the value. +//% * +//% * @return A newly instanced dictionary with the key and value in it. +//% **/ +//%+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% rawValue:(VALUE_TYPE)rawValue +//% forKey:(KEY_TYPE##KisP$S##KisP)key; +//% +//%/** +//% * Creates and initializes a dictionary with the entries given. +//% * +//% * @param func The enum validation function for the dictionary. +//% * @param values The raw enum values values to be placed in the dictionary. +//% * @param keys The keys under which to store the values. +//% * @param count The number of entries to store in the dictionary. +//% * +//% * @return A newly instanced dictionary with the keys and values in it. +//% **/ +//%+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% rawValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[__nullable])values +//% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[__nullable])keys +//% count:(NSUInteger)count; +//% +//%/** +//% * Creates and initializes a dictionary with the entries from the given. +//% * dictionary. +//% * +//% * @param dictionary Dictionary containing the entries to add to the dictionary. +//% * +//% * @return A newly instanced dictionary with the entries from the given +//% * dictionary in it. +//% **/ +//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary; +//% +//%/** +//% * Creates and initializes a dictionary with the given capacity. +//% * +//% * @param func The enum validation function for the dictionary. +//% * @param numItems Capacity needed for the dictionary. +//% * +//% * @return A newly instanced dictionary with the given capacity. +//% **/ +//%+ (instancetype)dictionaryWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% capacity:(NSUInteger)numItems; +//% +//%/** +//% * Initializes a dictionary with the given validation function. +//% * +//% * @param func The enum validation function for the dictionary. +//% * +//% * @return A newly initialized dictionary. +//% **/ +//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func; +//% +//%/** +//% * Initializes a dictionary with the entries given. +//% * +//% * @param func The enum validation function for the dictionary. +//% * @param values The raw enum values values to be placed in the dictionary. +//% * @param keys The keys under which to store the values. +//% * @param count The number of entries to store in the dictionary. +//% * +//% * @return A newly initialized dictionary with the keys and values in it. +//% **/ +//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% rawValues:(const VALUE_TYPE ARRAY_ARG_MODIFIER##VHELPER()[__nullable])values +//% forKeys:(const KEY_TYPE##KisP$S##KisP ARRAY_ARG_MODIFIER##KHELPER()[__nullable])keys +//% count:(NSUInteger)count NS_DESIGNATED_INITIALIZER; +//% +//%/** +//% * Initializes a dictionary with the entries from the given. +//% * dictionary. +//% * +//% * @param dictionary Dictionary containing the entries to add to the dictionary. +//% * +//% * @return A newly initialized dictionary with the entries from the given +//% * dictionary in it. +//% **/ +//%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary; +//% +//%/** +//% * Initializes a dictionary with the given capacity. +//% * +//% * @param func The enum validation function for the dictionary. +//% * @param numItems Capacity needed for the dictionary. +//% * +//% * @return A newly initialized dictionary with the given capacity. +//% **/ +//%- (instancetype)initWithValidationFunction:(nullable GPBEnumValidationFunc)func +//% capacity:(NSUInteger)numItems; +//% +//%// These will return kGPBUnrecognizedEnumeratorValue if the value for the key +//%// is not a valid enumerator as defined by validationFunc. If the actual value is +//%// desired, use "raw" version of the method. +//% +//%DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, Enum, value) +//% +//%/** +//% * Gets the raw enum value for the given key. +//% * +//% * @note This method bypass the validationFunc to enable the access of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param rawValue Pointer into which the value will be set, if found. +//% * @param key Key under which the value is stored, if present. +//% * +//% * @return YES if the key was found and the value was copied, NO otherwise. +//% **/ +//%- (BOOL)getRawValue:(nullable VALUE_TYPE *)rawValue forKey:(KEY_TYPE##KisP$S##KisP)key; +//% +//%/** +//% * Enumerates the keys and values on this dictionary with the given block. +//% * +//% * @note This method bypass the validationFunc to enable the access of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param block The block to enumerate with. +//% * **key**: The key for the current entry. +//% * **rawValue**: The value for the current entry +//% * **stop**: A pointer to a boolean that when set stops the enumeration. +//% **/ +//%- (void)enumerateKeysAndRawValuesUsingBlock: +//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE rawValue, BOOL *stop))block; +//% +//%/** +//% * Adds the keys and raw enum values from another dictionary. +//% * +//% * @note This method bypass the validationFunc to enable the setting of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param otherDictionary Dictionary containing entries to be added to this +//% * dictionary. +//% **/ +//%- (void)addRawEntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary; +//% +//%// If value is not a valid enumerator as defined by validationFunc, these +//%// methods will assert in debug, and will log in release and assign the value +//%// to the default value. Use the rawValue methods below to assign non enumerator +//%// values. +//% +//%DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, Enum, value) +//% +//%@end +//% + +//%PDDM-DEFINE DICTIONARY_IMMUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR) +//%VALUE_FOR_KEY_##VHELPER(KEY_TYPE##KisP$S##KisP, VALUE_TYPE, VNAME) +//% +//%/** +//% * Enumerates the keys and values on this dictionary with the given block. +//% * +//% * @param block The block to enumerate with. +//% * **key**: ##VNAME_VAR$S## The key for the current entry. +//% * **VNAME_VAR**: The value for the current entry +//% * **stop**: ##VNAME_VAR$S## A pointer to a boolean that when set stops the enumeration. +//% **/ +//%- (void)enumerateKeysAnd##VNAME##sUsingBlock: +//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE VNAME_VAR, BOOL *stop))block; + +//%PDDM-DEFINE DICTIONARY_MUTABLE_INTERFACE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, VHELPER, VNAME, VNAME_VAR) +//%/** +//% * Sets the value for the given key. +//% * +//% * @param ##VNAME_VAR The value to set. +//% * @param key ##VNAME_VAR$S## The key under which to store the value. +//% **/ +//%- (void)set##VNAME##:(VALUE_TYPE)##VNAME_VAR forKey:(KEY_TYPE##KisP$S##KisP)key; +//%DICTIONARY_EXTRA_MUTABLE_METHODS_##VHELPER(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE) +//%/** +//% * Removes the entry for the given key. +//% * +//% * @param aKey Key to be removed from this dictionary. +//% **/ +//%- (void)remove##VNAME##ForKey:(KEY_TYPE##KisP$S##KisP)aKey; +//% +//%/** +//% * Removes all entries in this dictionary. +//% **/ +//%- (void)removeAll; + +//%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_POD(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE) +// Empty +//%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_OBJECT(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE) +// Empty +//%PDDM-DEFINE DICTIONARY_EXTRA_MUTABLE_METHODS_Enum(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE) +//% +//%/** +//% * Sets the raw enum value for the given key. +//% * +//% * @note This method bypass the validationFunc to enable the setting of values that +//% * were not known at the time the binary was compiled. +//% * +//% * @param rawValue The raw enum value to set. +//% * @param key The key under which to store the raw enum value. +//% **/ +//%- (void)setRawValue:(VALUE_TYPE)rawValue forKey:(KEY_TYPE##KisP$S##KisP)key; +//% diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary.m new file mode 100644 index 00000000..1c67c680 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary.m @@ -0,0 +1,13627 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBDictionary_PackagePrivate.h" + +#import "GPBCodedInputStream_PackagePrivate.h" +#import "GPBCodedOutputStream_PackagePrivate.h" +#import "GPBDescriptor_PackagePrivate.h" +#import "GPBMessage_PackagePrivate.h" +#import "GPBUtilities_PackagePrivate.h" + +// ------------------------------ NOTE ------------------------------ +// At the moment, this is all using NSNumbers in NSDictionaries under +// the hood, but it is all hidden so we can come back and optimize +// with direct CFDictionary usage later. The reason that wasn't +// done yet is needing to support 32bit iOS builds. Otherwise +// it would be pretty simple to store all this data in CFDictionaries +// directly. +// ------------------------------------------------------------------ + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +// Used to include code only visible to specific versions of the static +// analyzer. Useful for wrapping code that only exists to silence the analyzer. +// Determine the values you want to use for BEGIN_APPLE_BUILD_VERSION, +// END_APPLE_BUILD_VERSION using: +// xcrun clang -dM -E -x c /dev/null | grep __apple_build_version__ +// Example usage: +// #if GPB_STATIC_ANALYZER_ONLY(5621, 5623) ... #endif +#define GPB_STATIC_ANALYZER_ONLY(BEGIN_APPLE_BUILD_VERSION, END_APPLE_BUILD_VERSION) \ + (defined(__clang_analyzer__) && \ + (__apple_build_version__ >= BEGIN_APPLE_BUILD_VERSION && \ + __apple_build_version__ <= END_APPLE_BUILD_VERSION)) + +enum { + kMapKeyFieldNumber = 1, + kMapValueFieldNumber = 2, +}; + +static BOOL DictDefault_IsValidValue(int32_t value) { + // Anything but the bad value marker is allowed. + return (value != kGPBUnrecognizedEnumeratorValue); +} + +//%PDDM-DEFINE SERIALIZE_SUPPORT_2_TYPE(VALUE_NAME, VALUE_TYPE, GPBDATATYPE_NAME1, GPBDATATYPE_NAME2) +//%static size_t ComputeDict##VALUE_NAME##FieldSize(VALUE_TYPE value, uint32_t fieldNum, GPBDataType dataType) { +//% if (dataType == GPBDataType##GPBDATATYPE_NAME1) { +//% return GPBCompute##GPBDATATYPE_NAME1##Size(fieldNum, value); +//% } else if (dataType == GPBDataType##GPBDATATYPE_NAME2) { +//% return GPBCompute##GPBDATATYPE_NAME2##Size(fieldNum, value); +//% } else { +//% NSCAssert(NO, @"Unexpected type %d", dataType); +//% return 0; +//% } +//%} +//% +//%static void WriteDict##VALUE_NAME##Field(GPBCodedOutputStream *stream, VALUE_TYPE value, uint32_t fieldNum, GPBDataType dataType) { +//% if (dataType == GPBDataType##GPBDATATYPE_NAME1) { +//% [stream write##GPBDATATYPE_NAME1##:fieldNum value:value]; +//% } else if (dataType == GPBDataType##GPBDATATYPE_NAME2) { +//% [stream write##GPBDATATYPE_NAME2##:fieldNum value:value]; +//% } else { +//% NSCAssert(NO, @"Unexpected type %d", dataType); +//% } +//%} +//% +//%PDDM-DEFINE SERIALIZE_SUPPORT_3_TYPE(VALUE_NAME, VALUE_TYPE, GPBDATATYPE_NAME1, GPBDATATYPE_NAME2, GPBDATATYPE_NAME3) +//%static size_t ComputeDict##VALUE_NAME##FieldSize(VALUE_TYPE value, uint32_t fieldNum, GPBDataType dataType) { +//% if (dataType == GPBDataType##GPBDATATYPE_NAME1) { +//% return GPBCompute##GPBDATATYPE_NAME1##Size(fieldNum, value); +//% } else if (dataType == GPBDataType##GPBDATATYPE_NAME2) { +//% return GPBCompute##GPBDATATYPE_NAME2##Size(fieldNum, value); +//% } else if (dataType == GPBDataType##GPBDATATYPE_NAME3) { +//% return GPBCompute##GPBDATATYPE_NAME3##Size(fieldNum, value); +//% } else { +//% NSCAssert(NO, @"Unexpected type %d", dataType); +//% return 0; +//% } +//%} +//% +//%static void WriteDict##VALUE_NAME##Field(GPBCodedOutputStream *stream, VALUE_TYPE value, uint32_t fieldNum, GPBDataType dataType) { +//% if (dataType == GPBDataType##GPBDATATYPE_NAME1) { +//% [stream write##GPBDATATYPE_NAME1##:fieldNum value:value]; +//% } else if (dataType == GPBDataType##GPBDATATYPE_NAME2) { +//% [stream write##GPBDATATYPE_NAME2##:fieldNum value:value]; +//% } else if (dataType == GPBDataType##GPBDATATYPE_NAME3) { +//% [stream write##GPBDATATYPE_NAME3##:fieldNum value:value]; +//% } else { +//% NSCAssert(NO, @"Unexpected type %d", dataType); +//% } +//%} +//% +//%PDDM-DEFINE SIMPLE_SERIALIZE_SUPPORT(VALUE_NAME, VALUE_TYPE, VisP) +//%static size_t ComputeDict##VALUE_NAME##FieldSize(VALUE_TYPE VisP##value, uint32_t fieldNum, GPBDataType dataType) { +//% NSCAssert(dataType == GPBDataType##VALUE_NAME, @"bad type: %d", dataType); +//% #pragma unused(dataType) // For when asserts are off in release. +//% return GPBCompute##VALUE_NAME##Size(fieldNum, value); +//%} +//% +//%static void WriteDict##VALUE_NAME##Field(GPBCodedOutputStream *stream, VALUE_TYPE VisP##value, uint32_t fieldNum, GPBDataType dataType) { +//% NSCAssert(dataType == GPBDataType##VALUE_NAME, @"bad type: %d", dataType); +//% #pragma unused(dataType) // For when asserts are off in release. +//% [stream write##VALUE_NAME##:fieldNum value:value]; +//%} +//% +//%PDDM-DEFINE SERIALIZE_SUPPORT_HELPERS() +//%SERIALIZE_SUPPORT_3_TYPE(Int32, int32_t, Int32, SInt32, SFixed32) +//%SERIALIZE_SUPPORT_2_TYPE(UInt32, uint32_t, UInt32, Fixed32) +//%SERIALIZE_SUPPORT_3_TYPE(Int64, int64_t, Int64, SInt64, SFixed64) +//%SERIALIZE_SUPPORT_2_TYPE(UInt64, uint64_t, UInt64, Fixed64) +//%SIMPLE_SERIALIZE_SUPPORT(Bool, BOOL, ) +//%SIMPLE_SERIALIZE_SUPPORT(Enum, int32_t, ) +//%SIMPLE_SERIALIZE_SUPPORT(Float, float, ) +//%SIMPLE_SERIALIZE_SUPPORT(Double, double, ) +//%SIMPLE_SERIALIZE_SUPPORT(String, NSString, *) +//%SERIALIZE_SUPPORT_3_TYPE(Object, id, Message, String, Bytes) +//%PDDM-EXPAND SERIALIZE_SUPPORT_HELPERS() +// This block of code is generated, do not edit it directly. + +static size_t ComputeDictInt32FieldSize(int32_t value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeInt32) { + return GPBComputeInt32Size(fieldNum, value); + } else if (dataType == GPBDataTypeSInt32) { + return GPBComputeSInt32Size(fieldNum, value); + } else if (dataType == GPBDataTypeSFixed32) { + return GPBComputeSFixed32Size(fieldNum, value); + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + return 0; + } +} + +static void WriteDictInt32Field(GPBCodedOutputStream *stream, int32_t value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeInt32) { + [stream writeInt32:fieldNum value:value]; + } else if (dataType == GPBDataTypeSInt32) { + [stream writeSInt32:fieldNum value:value]; + } else if (dataType == GPBDataTypeSFixed32) { + [stream writeSFixed32:fieldNum value:value]; + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + } +} + +static size_t ComputeDictUInt32FieldSize(uint32_t value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeUInt32) { + return GPBComputeUInt32Size(fieldNum, value); + } else if (dataType == GPBDataTypeFixed32) { + return GPBComputeFixed32Size(fieldNum, value); + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + return 0; + } +} + +static void WriteDictUInt32Field(GPBCodedOutputStream *stream, uint32_t value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeUInt32) { + [stream writeUInt32:fieldNum value:value]; + } else if (dataType == GPBDataTypeFixed32) { + [stream writeFixed32:fieldNum value:value]; + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + } +} + +static size_t ComputeDictInt64FieldSize(int64_t value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeInt64) { + return GPBComputeInt64Size(fieldNum, value); + } else if (dataType == GPBDataTypeSInt64) { + return GPBComputeSInt64Size(fieldNum, value); + } else if (dataType == GPBDataTypeSFixed64) { + return GPBComputeSFixed64Size(fieldNum, value); + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + return 0; + } +} + +static void WriteDictInt64Field(GPBCodedOutputStream *stream, int64_t value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeInt64) { + [stream writeInt64:fieldNum value:value]; + } else if (dataType == GPBDataTypeSInt64) { + [stream writeSInt64:fieldNum value:value]; + } else if (dataType == GPBDataTypeSFixed64) { + [stream writeSFixed64:fieldNum value:value]; + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + } +} + +static size_t ComputeDictUInt64FieldSize(uint64_t value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeUInt64) { + return GPBComputeUInt64Size(fieldNum, value); + } else if (dataType == GPBDataTypeFixed64) { + return GPBComputeFixed64Size(fieldNum, value); + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + return 0; + } +} + +static void WriteDictUInt64Field(GPBCodedOutputStream *stream, uint64_t value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeUInt64) { + [stream writeUInt64:fieldNum value:value]; + } else if (dataType == GPBDataTypeFixed64) { + [stream writeFixed64:fieldNum value:value]; + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + } +} + +static size_t ComputeDictBoolFieldSize(BOOL value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeBool, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + return GPBComputeBoolSize(fieldNum, value); +} + +static void WriteDictBoolField(GPBCodedOutputStream *stream, BOOL value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeBool, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + [stream writeBool:fieldNum value:value]; +} + +static size_t ComputeDictEnumFieldSize(int32_t value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeEnum, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + return GPBComputeEnumSize(fieldNum, value); +} + +static void WriteDictEnumField(GPBCodedOutputStream *stream, int32_t value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeEnum, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + [stream writeEnum:fieldNum value:value]; +} + +static size_t ComputeDictFloatFieldSize(float value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeFloat, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + return GPBComputeFloatSize(fieldNum, value); +} + +static void WriteDictFloatField(GPBCodedOutputStream *stream, float value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeFloat, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + [stream writeFloat:fieldNum value:value]; +} + +static size_t ComputeDictDoubleFieldSize(double value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeDouble, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + return GPBComputeDoubleSize(fieldNum, value); +} + +static void WriteDictDoubleField(GPBCodedOutputStream *stream, double value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeDouble, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + [stream writeDouble:fieldNum value:value]; +} + +static size_t ComputeDictStringFieldSize(NSString *value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeString, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + return GPBComputeStringSize(fieldNum, value); +} + +static void WriteDictStringField(GPBCodedOutputStream *stream, NSString *value, uint32_t fieldNum, GPBDataType dataType) { + NSCAssert(dataType == GPBDataTypeString, @"bad type: %d", dataType); + #pragma unused(dataType) // For when asserts are off in release. + [stream writeString:fieldNum value:value]; +} + +static size_t ComputeDictObjectFieldSize(id value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeMessage) { + return GPBComputeMessageSize(fieldNum, value); + } else if (dataType == GPBDataTypeString) { + return GPBComputeStringSize(fieldNum, value); + } else if (dataType == GPBDataTypeBytes) { + return GPBComputeBytesSize(fieldNum, value); + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + return 0; + } +} + +static void WriteDictObjectField(GPBCodedOutputStream *stream, id value, uint32_t fieldNum, GPBDataType dataType) { + if (dataType == GPBDataTypeMessage) { + [stream writeMessage:fieldNum value:value]; + } else if (dataType == GPBDataTypeString) { + [stream writeString:fieldNum value:value]; + } else if (dataType == GPBDataTypeBytes) { + [stream writeBytes:fieldNum value:value]; + } else { + NSCAssert(NO, @"Unexpected type %d", dataType); + } +} + +//%PDDM-EXPAND-END SERIALIZE_SUPPORT_HELPERS() + +size_t GPBDictionaryComputeSizeInternalHelper(NSDictionary *dict, GPBFieldDescriptor *field) { + GPBDataType mapValueType = GPBGetFieldDataType(field); + __block size_t result = 0; + [dict enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) { + #pragma unused(stop) + size_t msgSize = GPBComputeStringSize(kMapKeyFieldNumber, key); + msgSize += ComputeDictObjectFieldSize(obj, kMapValueFieldNumber, mapValueType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * dict.count; + return result; +} + +void GPBDictionaryWriteToStreamInternalHelper(GPBCodedOutputStream *outputStream, + NSDictionary *dict, + GPBFieldDescriptor *field) { + NSCAssert(field.mapKeyDataType == GPBDataTypeString, @"Unexpected key type"); + GPBDataType mapValueType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [dict enumerateKeysAndObjectsUsingBlock:^(NSString *key, id obj, BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = GPBComputeStringSize(kMapKeyFieldNumber, key); + msgSize += ComputeDictObjectFieldSize(obj, kMapValueFieldNumber, mapValueType); + + // Write the size and fields. + [outputStream writeInt32NoTag:(int32_t)msgSize]; + [outputStream writeString:kMapKeyFieldNumber value:key]; + WriteDictObjectField(outputStream, obj, kMapValueFieldNumber, mapValueType); + }]; +} + +BOOL GPBDictionaryIsInitializedInternalHelper(NSDictionary *dict, GPBFieldDescriptor *field) { + NSCAssert(field.mapKeyDataType == GPBDataTypeString, @"Unexpected key type"); + NSCAssert(GPBGetFieldDataType(field) == GPBDataTypeMessage, @"Unexpected value type"); + #pragma unused(field) // For when asserts are off in release. + for (GPBMessage *msg in [dict objectEnumerator]) { + if (!msg.initialized) { + return NO; + } + } + return YES; +} + +// Note: if the type is an object, it the retain pass back to the caller. +static void ReadValue(GPBCodedInputStream *stream, + GPBGenericValue *valueToFill, + GPBDataType type, + GPBExtensionRegistry *registry, + GPBFieldDescriptor *field) { + switch (type) { + case GPBDataTypeBool: + valueToFill->valueBool = GPBCodedInputStreamReadBool(&stream->state_); + break; + case GPBDataTypeFixed32: + valueToFill->valueUInt32 = GPBCodedInputStreamReadFixed32(&stream->state_); + break; + case GPBDataTypeSFixed32: + valueToFill->valueInt32 = GPBCodedInputStreamReadSFixed32(&stream->state_); + break; + case GPBDataTypeFloat: + valueToFill->valueFloat = GPBCodedInputStreamReadFloat(&stream->state_); + break; + case GPBDataTypeFixed64: + valueToFill->valueUInt64 = GPBCodedInputStreamReadFixed64(&stream->state_); + break; + case GPBDataTypeSFixed64: + valueToFill->valueInt64 = GPBCodedInputStreamReadSFixed64(&stream->state_); + break; + case GPBDataTypeDouble: + valueToFill->valueDouble = GPBCodedInputStreamReadDouble(&stream->state_); + break; + case GPBDataTypeInt32: + valueToFill->valueInt32 = GPBCodedInputStreamReadInt32(&stream->state_); + break; + case GPBDataTypeInt64: + valueToFill->valueInt64 = GPBCodedInputStreamReadInt32(&stream->state_); + break; + case GPBDataTypeSInt32: + valueToFill->valueInt32 = GPBCodedInputStreamReadSInt32(&stream->state_); + break; + case GPBDataTypeSInt64: + valueToFill->valueInt64 = GPBCodedInputStreamReadSInt64(&stream->state_); + break; + case GPBDataTypeUInt32: + valueToFill->valueUInt32 = GPBCodedInputStreamReadUInt32(&stream->state_); + break; + case GPBDataTypeUInt64: + valueToFill->valueUInt64 = GPBCodedInputStreamReadUInt64(&stream->state_); + break; + case GPBDataTypeBytes: + [valueToFill->valueData release]; + valueToFill->valueData = GPBCodedInputStreamReadRetainedBytes(&stream->state_); + break; + case GPBDataTypeString: + [valueToFill->valueString release]; + valueToFill->valueString = GPBCodedInputStreamReadRetainedString(&stream->state_); + break; + case GPBDataTypeMessage: { + GPBMessage *message = [[field.msgClass alloc] init]; + [stream readMessage:message extensionRegistry:registry]; + [valueToFill->valueMessage release]; + valueToFill->valueMessage = message; + break; + } + case GPBDataTypeGroup: + NSCAssert(NO, @"Can't happen"); + break; + case GPBDataTypeEnum: + valueToFill->valueEnum = GPBCodedInputStreamReadEnum(&stream->state_); + break; + } +} + +void GPBDictionaryReadEntry(id mapDictionary, + GPBCodedInputStream *stream, + GPBExtensionRegistry *registry, + GPBFieldDescriptor *field, + GPBMessage *parentMessage) { + GPBDataType keyDataType = field.mapKeyDataType; + GPBDataType valueDataType = GPBGetFieldDataType(field); + + GPBGenericValue key; + GPBGenericValue value; + // Zero them (but pick up any enum default for proto2). + key.valueString = value.valueString = nil; + if (valueDataType == GPBDataTypeEnum) { + value = field.defaultValue; + } + + GPBCodedInputStreamState *state = &stream->state_; + uint32_t keyTag = + GPBWireFormatMakeTag(kMapKeyFieldNumber, GPBWireFormatForType(keyDataType, NO)); + uint32_t valueTag = + GPBWireFormatMakeTag(kMapValueFieldNumber, GPBWireFormatForType(valueDataType, NO)); + + BOOL hitError = NO; + while (YES) { + uint32_t tag = GPBCodedInputStreamReadTag(state); + if (tag == keyTag) { + ReadValue(stream, &key, keyDataType, registry, field); + } else if (tag == valueTag) { + ReadValue(stream, &value, valueDataType, registry, field); + } else if (tag == 0) { + // zero signals EOF / limit reached + break; + } else { // Unknown + if (![stream skipField:tag]){ + hitError = YES; + break; + } + } + } + + if (!hitError) { + // Handle the special defaults and/or missing key/value. + if ((keyDataType == GPBDataTypeString) && (key.valueString == nil)) { + key.valueString = [@"" retain]; + } + if (GPBDataTypeIsObject(valueDataType) && value.valueString == nil) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" + switch (valueDataType) { + case GPBDataTypeString: + value.valueString = [@"" retain]; + break; + case GPBDataTypeBytes: + value.valueData = [GPBEmptyNSData() retain]; + break; +#if defined(__clang_analyzer__) + case GPBDataTypeGroup: + // Maps can't really have Groups as the value type, but this case is needed + // so the analyzer won't report the posibility of send nil in for the value + // in the NSMutableDictionary case below. +#endif + case GPBDataTypeMessage: { + value.valueMessage = [[field.msgClass alloc] init]; + break; + } + default: + // Nothing + break; + } +#pragma clang diagnostic pop + } + + if ((keyDataType == GPBDataTypeString) && GPBDataTypeIsObject(valueDataType)) { +#if GPB_STATIC_ANALYZER_ONLY(6020053, 7000181) + // Limited to Xcode 6.4 - 7.2, are known to fail here. The upper end can + // be raised as needed for new Xcodes. + // + // This is only needed on a "shallow" analyze; on a "deep" analyze, the + // existing code path gets this correct. In shallow, the analyzer decides + // GPBDataTypeIsObject(valueDataType) is both false and true on a single + // path through this function, allowing nil to be used for the + // setObject:forKey:. + if (value.valueString == nil) { + value.valueString = [@"" retain]; + } +#endif + // mapDictionary is an NSMutableDictionary + [(NSMutableDictionary *)mapDictionary setObject:value.valueString + forKey:key.valueString]; + } else { + if (valueDataType == GPBDataTypeEnum) { + if (GPBHasPreservingUnknownEnumSemantics([parentMessage descriptor].file.syntax) || + [field isValidEnumValue:value.valueEnum]) { + [mapDictionary setGPBGenericValue:&value forGPBGenericValueKey:&key]; + } else { + NSData *data = [mapDictionary serializedDataForUnknownValue:value.valueEnum + forKey:&key + keyDataType:keyDataType]; + [parentMessage addUnknownMapEntry:GPBFieldNumber(field) value:data]; + } + } else { + [mapDictionary setGPBGenericValue:&value forGPBGenericValueKey:&key]; + } + } + } + + if (GPBDataTypeIsObject(keyDataType)) { + [key.valueString release]; + } + if (GPBDataTypeIsObject(valueDataType)) { + [value.valueString release]; + } +} + +// +// Macros for the common basic cases. +// + +//%PDDM-DEFINE DICTIONARY_IMPL_FOR_POD_KEY(KEY_NAME, KEY_TYPE) +//%DICTIONARY_POD_IMPL_FOR_KEY(KEY_NAME, KEY_TYPE, , POD) +//%DICTIONARY_POD_KEY_TO_OBJECT_IMPL(KEY_NAME, KEY_TYPE, Object, id) + +//%PDDM-DEFINE DICTIONARY_POD_IMPL_FOR_KEY(KEY_NAME, KEY_TYPE, KisP, KHELPER) +//%DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, UInt32, uint32_t, KHELPER) +//%DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, Int32, int32_t, KHELPER) +//%DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, UInt64, uint64_t, KHELPER) +//%DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, Int64, int64_t, KHELPER) +//%DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, Bool, BOOL, KHELPER) +//%DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, Float, float, KHELPER) +//%DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, Double, double, KHELPER) +//%DICTIONARY_KEY_TO_ENUM_IMPL(KEY_NAME, KEY_TYPE, KisP, Enum, int32_t, KHELPER) + +//%PDDM-DEFINE DICTIONARY_KEY_TO_POD_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER) +//%DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, POD, VALUE_NAME, value) + +//%PDDM-DEFINE DICTIONARY_POD_KEY_TO_OBJECT_IMPL(KEY_NAME, KEY_TYPE, VALUE_NAME, VALUE_TYPE) +//%DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, , VALUE_NAME, VALUE_TYPE, POD, OBJECT, Object, object) + +//%PDDM-DEFINE DICTIONARY_COMMON_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, VNAME_VAR) +//%#pragma mark - KEY_NAME -> VALUE_NAME +//% +//%@implementation GPB##KEY_NAME##VALUE_NAME##Dictionary { +//% @package +//% NSMutableDictionary *_dictionary; +//%} +//% +//%+ (instancetype)dictionary { +//% return [[[self alloc] initWith##VNAME##s:NULL forKeys:NULL count:0] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWith##VNAME##:(VALUE_TYPE)##VNAME_VAR +//% ##VNAME$S## forKey:(KEY_TYPE##KisP$S##KisP)key { +//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME##s:forKeys:count: +//% // on to get the type correct. +//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME##s:&##VNAME_VAR +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## forKeys:&key +//% KEY_NAME$S VALUE_NAME$S ##VNAME$S## count:1] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWith##VNAME##s:(const VALUE_TYPE [])##VNAME_VAR##s +//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP [])keys +//% ##VNAME$S## count:(NSUInteger)count { +//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME##s:forKeys:count: +//% // on to get the type correct. +//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME##s:##VNAME_VAR##s +//% KEY_NAME$S VALUE_NAME$S forKeys:keys +//% KEY_NAME$S VALUE_NAME$S count:count] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary { +//% // Cast is needed so the compiler knows what class we are invoking initWithDictionary: +//% // on to get the type correct. +//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { +//% return [[[self alloc] initWithCapacity:numItems] autorelease]; +//%} +//% +//%- (instancetype)init { +//% return [self initWith##VNAME##s:NULL forKeys:NULL count:0]; +//%} +//% +//%- (instancetype)initWith##VNAME##s:(const VALUE_TYPE [])##VNAME_VAR##s +//% ##VNAME$S## forKeys:(const KEY_TYPE##KisP$S##KisP [])keys +//% ##VNAME$S## count:(NSUInteger)count { +//% self = [super init]; +//% if (self) { +//% _dictionary = [[NSMutableDictionary alloc] init]; +//% if (count && VNAME_VAR##s && keys) { +//% for (NSUInteger i = 0; i < count; ++i) { +//%DICTIONARY_VALIDATE_VALUE_##VHELPER(VNAME_VAR##s[i], ______)##DICTIONARY_VALIDATE_KEY_##KHELPER(keys[i], ______) [_dictionary setObject:WRAPPED##VHELPER(VNAME_VAR##s[i]) forKey:WRAPPED##KHELPER(keys[i])]; +//% } +//% } +//% } +//% return self; +//%} +//% +//%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary { +//% self = [self initWith##VNAME##s:NULL forKeys:NULL count:0]; +//% if (self) { +//% if (dictionary) { +//% [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; +//% } +//% } +//% return self; +//%} +//% +//%- (instancetype)initWithCapacity:(NSUInteger)numItems { +//% #pragma unused(numItems) +//% return [self initWith##VNAME##s:NULL forKeys:NULL count:0]; +//%} +//% +//%DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, VNAME_VAR, ) +//% +//%VALUE_FOR_KEY_##VHELPER(KEY_TYPE##KisP$S##KisP, VALUE_NAME, VALUE_TYPE, KHELPER) +//% +//%DICTIONARY_MUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, VNAME_VAR, ) +//% +//%@end +//% + +//%PDDM-DEFINE DICTIONARY_KEY_TO_ENUM_IMPL(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER) +//%DICTIONARY_KEY_TO_ENUM_IMPL2(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, POD) +//%PDDM-DEFINE DICTIONARY_KEY_TO_ENUM_IMPL2(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER) +//%#pragma mark - KEY_NAME -> VALUE_NAME +//% +//%@implementation GPB##KEY_NAME##VALUE_NAME##Dictionary { +//% @package +//% NSMutableDictionary *_dictionary; +//% GPBEnumValidationFunc _validationFunc; +//%} +//% +//%@synthesize validationFunc = _validationFunc; +//% +//%+ (instancetype)dictionary { +//% return [[[self alloc] initWithValidationFunction:NULL +//% rawValues:NULL +//% forKeys:NULL +//% count:0] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { +//% return [[[self alloc] initWithValidationFunction:func +//% rawValues:NULL +//% forKeys:NULL +//% count:0] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func +//% rawValue:(VALUE_TYPE)rawValue +//% forKey:(KEY_TYPE##KisP$S##KisP)key { +//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//% // on to get the type correct. +//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithValidationFunction:func +//% KEY_NAME$S VALUE_NAME$S rawValues:&rawValue +//% KEY_NAME$S VALUE_NAME$S forKeys:&key +//% KEY_NAME$S VALUE_NAME$S count:1] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func +//% rawValues:(const VALUE_TYPE [])rawValues +//% forKeys:(const KEY_TYPE##KisP$S##KisP [])keys +//% count:(NSUInteger)count { +//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//% // on to get the type correct. +//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithValidationFunction:func +//% KEY_NAME$S VALUE_NAME$S rawValues:rawValues +//% KEY_NAME$S VALUE_NAME$S forKeys:keys +//% KEY_NAME$S VALUE_NAME$S count:count] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary { +//% // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: +//% // on to get the type correct. +//% return [[(GPB##KEY_NAME##VALUE_NAME##Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func +//% capacity:(NSUInteger)numItems { +//% return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; +//%} +//% +//%- (instancetype)init { +//% return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; +//%} +//% +//%- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func { +//% return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +//%} +//% +//%- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func +//% rawValues:(const VALUE_TYPE [])rawValues +//% forKeys:(const KEY_TYPE##KisP$S##KisP [])keys +//% count:(NSUInteger)count { +//% self = [super init]; +//% if (self) { +//% _dictionary = [[NSMutableDictionary alloc] init]; +//% _validationFunc = (func != NULL ? func : DictDefault_IsValidValue); +//% if (count && rawValues && keys) { +//% for (NSUInteger i = 0; i < count; ++i) { +//%DICTIONARY_VALIDATE_KEY_##KHELPER(keys[i], ______) [_dictionary setObject:WRAPPED##VHELPER(rawValues[i]) forKey:WRAPPED##KHELPER(keys[i])]; +//% } +//% } +//% } +//% return self; +//%} +//% +//%- (instancetype)initWithDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)dictionary { +//% self = [self initWithValidationFunction:dictionary.validationFunc +//% rawValues:NULL +//% forKeys:NULL +//% count:0]; +//% if (self) { +//% if (dictionary) { +//% [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; +//% } +//% } +//% return self; +//%} +//% +//%- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func +//% capacity:(NSUInteger)numItems { +//% #pragma unused(numItems) +//% return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +//%} +//% +//%DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, Value, value, Raw) +//% +//%- (BOOL)getEnum:(VALUE_TYPE *)value forKey:(KEY_TYPE##KisP$S##KisP)key { +//% NSNumber *wrapped = [_dictionary objectForKey:WRAPPED##KHELPER(key)]; +//% if (wrapped && value) { +//% VALUE_TYPE result = UNWRAP##VALUE_NAME(wrapped); +//% if (!_validationFunc(result)) { +//% result = kGPBUnrecognizedEnumeratorValue; +//% } +//% *value = result; +//% } +//% return (wrapped != NULL); +//%} +//% +//%- (BOOL)getRawValue:(VALUE_TYPE *)rawValue forKey:(KEY_TYPE##KisP$S##KisP)key { +//% NSNumber *wrapped = [_dictionary objectForKey:WRAPPED##KHELPER(key)]; +//% if (wrapped && rawValue) { +//% *rawValue = UNWRAP##VALUE_NAME(wrapped); +//% } +//% return (wrapped != NULL); +//%} +//% +//%- (void)enumerateKeysAndEnumsUsingBlock: +//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE value, BOOL *stop))block { +//% GPBEnumValidationFunc func = _validationFunc; +//% [_dictionary enumerateKeysAndObjectsUsingBlock:^(ENUM_TYPE##KHELPER(KEY_TYPE)##aKey, +//% ENUM_TYPE##VHELPER(VALUE_TYPE)##aValue, +//% BOOL *stop) { +//% VALUE_TYPE unwrapped = UNWRAP##VALUE_NAME(aValue); +//% if (!func(unwrapped)) { +//% unwrapped = kGPBUnrecognizedEnumeratorValue; +//% } +//% block(UNWRAP##KEY_NAME(aKey), unwrapped, stop); +//% }]; +//%} +//% +//%DICTIONARY_MUTABLE_CORE2(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, Value, Enum, value, Raw) +//% +//%- (void)setEnum:(VALUE_TYPE)value forKey:(KEY_TYPE##KisP$S##KisP)key { +//%DICTIONARY_VALIDATE_KEY_##KHELPER(key, ) if (!_validationFunc(value)) { +//% [NSException raise:NSInvalidArgumentException +//% format:@"GPB##KEY_NAME##VALUE_NAME##Dictionary: Attempt to set an unknown enum value (%d)", +//% value]; +//% } +//% +//% [_dictionary setObject:WRAPPED##VHELPER(value) forKey:WRAPPED##KHELPER(key)]; +//% if (_autocreator) { +//% GPBAutocreatedDictionaryModified(_autocreator, self); +//% } +//%} +//% +//%@end +//% + +//%PDDM-DEFINE DICTIONARY_IMMUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, VNAME_VAR, ACCESSOR_NAME) +//%- (void)dealloc { +//% NSAssert(!_autocreator, +//% @"%@: Autocreator must be cleared before release, autocreator: %@", +//% [self class], _autocreator); +//% [_dictionary release]; +//% [super dealloc]; +//%} +//% +//%- (instancetype)copyWithZone:(NSZone *)zone { +//% return [[GPB##KEY_NAME##VALUE_NAME##Dictionary allocWithZone:zone] initWithDictionary:self]; +//%} +//% +//%- (BOOL)isEqual:(id)other { +//% if (self == other) { +//% return YES; +//% } +//% if (![other isKindOfClass:[GPB##KEY_NAME##VALUE_NAME##Dictionary class]]) { +//% return NO; +//% } +//% GPB##KEY_NAME##VALUE_NAME##Dictionary *otherDictionary = other; +//% return [_dictionary isEqual:otherDictionary->_dictionary]; +//%} +//% +//%- (NSUInteger)hash { +//% return _dictionary.count; +//%} +//% +//%- (NSString *)description { +//% return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +//%} +//% +//%- (NSUInteger)count { +//% return _dictionary.count; +//%} +//% +//%- (void)enumerateKeysAnd##ACCESSOR_NAME##VNAME##sUsingBlock: +//% (void (^)(KEY_TYPE KisP##key, VALUE_TYPE VNAME_VAR, BOOL *stop))block { +//% [_dictionary enumerateKeysAndObjectsUsingBlock:^(ENUM_TYPE##KHELPER(KEY_TYPE)##aKey, +//% ENUM_TYPE##VHELPER(VALUE_TYPE)##a##VNAME_VAR$u, +//% BOOL *stop) { +//% block(UNWRAP##KEY_NAME(aKey), UNWRAP##VALUE_NAME(a##VNAME_VAR$u), stop); +//% }]; +//%} +//% +//%EXTRA_METHODS_##VHELPER(KEY_NAME, VALUE_NAME)- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { +//% NSUInteger count = _dictionary.count; +//% if (count == 0) { +//% return 0; +//% } +//% +//% GPBDataType valueDataType = GPBGetFieldDataType(field); +//% GPBDataType keyDataType = field.mapKeyDataType; +//% __block size_t result = 0; +//% [_dictionary enumerateKeysAndObjectsUsingBlock:^(ENUM_TYPE##KHELPER(KEY_TYPE)##aKey, +//% ENUM_TYPE##VHELPER(VALUE_TYPE)##a##VNAME_VAR$u##, +//% BOOL *stop) { +//% #pragma unused(stop) +//% size_t msgSize = ComputeDict##KEY_NAME##FieldSize(UNWRAP##KEY_NAME(aKey), kMapKeyFieldNumber, keyDataType); +//% msgSize += ComputeDict##VALUE_NAME##FieldSize(UNWRAP##VALUE_NAME(a##VNAME_VAR$u), kMapValueFieldNumber, valueDataType); +//% result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; +//% }]; +//% size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); +//% result += tagSize * count; +//% return result; +//%} +//% +//%- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream +//% asField:(GPBFieldDescriptor *)field { +//% GPBDataType valueDataType = GPBGetFieldDataType(field); +//% GPBDataType keyDataType = field.mapKeyDataType; +//% uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); +//% [_dictionary enumerateKeysAndObjectsUsingBlock:^(ENUM_TYPE##KHELPER(KEY_TYPE)##aKey, +//% ENUM_TYPE##VHELPER(VALUE_TYPE)##a##VNAME_VAR$u, +//% BOOL *stop) { +//% #pragma unused(stop) +//% // Write the tag. +//% [outputStream writeInt32NoTag:tag]; +//% // Write the size of the message. +//% size_t msgSize = ComputeDict##KEY_NAME##FieldSize(UNWRAP##KEY_NAME(aKey), kMapKeyFieldNumber, keyDataType); +//% msgSize += ComputeDict##VALUE_NAME##FieldSize(UNWRAP##VALUE_NAME(a##VNAME_VAR$u), kMapValueFieldNumber, valueDataType); +//% [outputStream writeInt32NoTag:(int32_t)msgSize]; +//% // Write the fields. +//% WriteDict##KEY_NAME##Field(outputStream, UNWRAP##KEY_NAME(aKey), kMapKeyFieldNumber, keyDataType); +//% WriteDict##VALUE_NAME##Field(outputStream, UNWRAP##VALUE_NAME(a##VNAME_VAR$u), kMapValueFieldNumber, valueDataType); +//% }]; +//%} +//% +//%SERIAL_DATA_FOR_ENTRY_##VHELPER(KEY_NAME, VALUE_NAME)- (void)setGPBGenericValue:(GPBGenericValue *)value +//% forGPBGenericValueKey:(GPBGenericValue *)key { +//% [_dictionary setObject:WRAPPED##VHELPER(value->##GPBVALUE_##VHELPER(VALUE_NAME)##) forKey:WRAPPED##KHELPER(key->value##KEY_NAME)]; +//%} +//% +//%- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { +//% [self enumerateKeysAnd##ACCESSOR_NAME##VNAME##sUsingBlock:^(KEY_TYPE KisP##key, VALUE_TYPE VNAME_VAR, BOOL *stop) { +//% #pragma unused(stop) +//% block(TEXT_FORMAT_OBJ##KEY_NAME(key), TEXT_FORMAT_OBJ##VALUE_NAME(VNAME_VAR)); +//% }]; +//%} +//%PDDM-DEFINE DICTIONARY_MUTABLE_CORE(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, VNAME_VAR, ACCESSOR_NAME) +//%DICTIONARY_MUTABLE_CORE2(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, VNAME, VNAME_VAR, ACCESSOR_NAME) +//%PDDM-DEFINE DICTIONARY_MUTABLE_CORE2(KEY_NAME, KEY_TYPE, KisP, VALUE_NAME, VALUE_TYPE, KHELPER, VHELPER, VNAME, VNAME_REMOVE, VNAME_VAR, ACCESSOR_NAME) +//%- (void)add##ACCESSOR_NAME##EntriesFromDictionary:(GPB##KEY_NAME##VALUE_NAME##Dictionary *)otherDictionary { +//% if (otherDictionary) { +//% [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; +//% if (_autocreator) { +//% GPBAutocreatedDictionaryModified(_autocreator, self); +//% } +//% } +//%} +//% +//%- (void)set##ACCESSOR_NAME##VNAME##:(VALUE_TYPE)VNAME_VAR forKey:(KEY_TYPE##KisP$S##KisP)key { +//%DICTIONARY_VALIDATE_VALUE_##VHELPER(VNAME_VAR, )##DICTIONARY_VALIDATE_KEY_##KHELPER(key, ) [_dictionary setObject:WRAPPED##VHELPER(VNAME_VAR) forKey:WRAPPED##KHELPER(key)]; +//% if (_autocreator) { +//% GPBAutocreatedDictionaryModified(_autocreator, self); +//% } +//%} +//% +//%- (void)remove##VNAME_REMOVE##ForKey:(KEY_TYPE##KisP$S##KisP)aKey { +//% [_dictionary removeObjectForKey:WRAPPED##KHELPER(aKey)]; +//%} +//% +//%- (void)removeAll { +//% [_dictionary removeAllObjects]; +//%} + +// +// Custom Generation for Bool keys +// + +//%PDDM-DEFINE DICTIONARY_BOOL_KEY_TO_POD_IMPL(VALUE_NAME, VALUE_TYPE) +//%DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, POD, VALUE_NAME, value) +//%PDDM-DEFINE DICTIONARY_BOOL_KEY_TO_OBJECT_IMPL(VALUE_NAME, VALUE_TYPE) +//%DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, OBJECT, Object, object) + +//%PDDM-DEFINE DICTIONARY_BOOL_KEY_TO_VALUE_IMPL(VALUE_NAME, VALUE_TYPE, HELPER, VNAME, VNAME_VAR) +//%#pragma mark - Bool -> VALUE_NAME +//% +//%@implementation GPBBool##VALUE_NAME##Dictionary { +//% @package +//% VALUE_TYPE _values[2]; +//%BOOL_DICT_HAS_STORAGE_##HELPER()} +//% +//%+ (instancetype)dictionary { +//% return [[[self alloc] initWith##VNAME##s:NULL forKeys:NULL count:0] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWith##VNAME##:(VALUE_TYPE)VNAME_VAR +//% ##VNAME$S## forKey:(BOOL)key { +//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME##s:forKeys:count: +//% // on to get the type correct. +//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME##s:&##VNAME_VAR +//% VALUE_NAME$S ##VNAME$S## forKeys:&key +//% VALUE_NAME$S ##VNAME$S## count:1] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWith##VNAME##s:(const VALUE_TYPE [])##VNAME_VAR##s +//% ##VNAME$S## forKeys:(const BOOL [])keys +//% ##VNAME$S## count:(NSUInteger)count { +//% // Cast is needed so the compiler knows what class we are invoking initWith##VNAME##s:forKeys:count: +//% // on to get the type correct. +//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWith##VNAME##s:##VNAME_VAR##s +//% VALUE_NAME$S ##VNAME$S## forKeys:keys +//% VALUE_NAME$S ##VNAME$S## count:count] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithDictionary:(GPBBool##VALUE_NAME##Dictionary *)dictionary { +//% // Cast is needed so the compiler knows what class we are invoking initWithDictionary: +//% // on to get the type correct. +//% return [[(GPBBool##VALUE_NAME##Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +//%} +//% +//%+ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { +//% return [[[self alloc] initWithCapacity:numItems] autorelease]; +//%} +//% +//%- (instancetype)init { +//% return [self initWith##VNAME##s:NULL forKeys:NULL count:0]; +//%} +//% +//%BOOL_DICT_INITS_##HELPER(VALUE_NAME, VALUE_TYPE) +//% +//%- (instancetype)initWithCapacity:(NSUInteger)numItems { +//% #pragma unused(numItems) +//% return [self initWith##VNAME##s:NULL forKeys:NULL count:0]; +//%} +//% +//%BOOL_DICT_DEALLOC##HELPER() +//% +//%- (instancetype)copyWithZone:(NSZone *)zone { +//% return [[GPBBool##VALUE_NAME##Dictionary allocWithZone:zone] initWithDictionary:self]; +//%} +//% +//%- (BOOL)isEqual:(id)other { +//% if (self == other) { +//% return YES; +//% } +//% if (![other isKindOfClass:[GPBBool##VALUE_NAME##Dictionary class]]) { +//% return NO; +//% } +//% GPBBool##VALUE_NAME##Dictionary *otherDictionary = other; +//% if ((BOOL_DICT_W_HAS##HELPER(0, ) != BOOL_DICT_W_HAS##HELPER(0, otherDictionary->)) || +//% (BOOL_DICT_W_HAS##HELPER(1, ) != BOOL_DICT_W_HAS##HELPER(1, otherDictionary->))) { +//% return NO; +//% } +//% if ((BOOL_DICT_W_HAS##HELPER(0, ) && (NEQ_##HELPER(_values[0], otherDictionary->_values[0]))) || +//% (BOOL_DICT_W_HAS##HELPER(1, ) && (NEQ_##HELPER(_values[1], otherDictionary->_values[1])))) { +//% return NO; +//% } +//% return YES; +//%} +//% +//%- (NSUInteger)hash { +//% return (BOOL_DICT_W_HAS##HELPER(0, ) ? 1 : 0) + (BOOL_DICT_W_HAS##HELPER(1, ) ? 1 : 0); +//%} +//% +//%- (NSString *)description { +//% NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; +//% if (BOOL_DICT_W_HAS##HELPER(0, )) { +//% [result appendFormat:@"NO: STR_FORMAT_##HELPER(VALUE_NAME)", _values[0]]; +//% } +//% if (BOOL_DICT_W_HAS##HELPER(1, )) { +//% [result appendFormat:@"YES: STR_FORMAT_##HELPER(VALUE_NAME)", _values[1]]; +//% } +//% [result appendString:@" }"]; +//% return result; +//%} +//% +//%- (NSUInteger)count { +//% return (BOOL_DICT_W_HAS##HELPER(0, ) ? 1 : 0) + (BOOL_DICT_W_HAS##HELPER(1, ) ? 1 : 0); +//%} +//% +//%BOOL_VALUE_FOR_KEY_##HELPER(VALUE_NAME, VALUE_TYPE) +//% +//%BOOL_SET_GPBVALUE_FOR_KEY_##HELPER(VALUE_NAME, VALUE_TYPE, VisP) +//% +//%- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { +//% if (BOOL_DICT_HAS##HELPER(0, )) { +//% block(@"false", TEXT_FORMAT_OBJ##VALUE_NAME(_values[0])); +//% } +//% if (BOOL_DICT_W_HAS##HELPER(1, )) { +//% block(@"true", TEXT_FORMAT_OBJ##VALUE_NAME(_values[1])); +//% } +//%} +//% +//%- (void)enumerateKeysAnd##VNAME##sUsingBlock: +//% (void (^)(BOOL key, VALUE_TYPE VNAME_VAR, BOOL *stop))block { +//% BOOL stop = NO; +//% if (BOOL_DICT_HAS##HELPER(0, )) { +//% block(NO, _values[0], &stop); +//% } +//% if (!stop && BOOL_DICT_W_HAS##HELPER(1, )) { +//% block(YES, _values[1], &stop); +//% } +//%} +//% +//%BOOL_EXTRA_METHODS_##HELPER(Bool, VALUE_NAME)- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { +//% GPBDataType valueDataType = GPBGetFieldDataType(field); +//% NSUInteger count = 0; +//% size_t result = 0; +//% for (int i = 0; i < 2; ++i) { +//% if (BOOL_DICT_HAS##HELPER(i, )) { +//% ++count; +//% size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); +//% msgSize += ComputeDict##VALUE_NAME##FieldSize(_values[i], kMapValueFieldNumber, valueDataType); +//% result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; +//% } +//% } +//% size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); +//% result += tagSize * count; +//% return result; +//%} +//% +//%- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream +//% asField:(GPBFieldDescriptor *)field { +//% GPBDataType valueDataType = GPBGetFieldDataType(field); +//% uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); +//% for (int i = 0; i < 2; ++i) { +//% if (BOOL_DICT_HAS##HELPER(i, )) { +//% // Write the tag. +//% [outputStream writeInt32NoTag:tag]; +//% // Write the size of the message. +//% size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); +//% msgSize += ComputeDict##VALUE_NAME##FieldSize(_values[i], kMapValueFieldNumber, valueDataType); +//% [outputStream writeInt32NoTag:(int32_t)msgSize]; +//% // Write the fields. +//% WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); +//% WriteDict##VALUE_NAME##Field(outputStream, _values[i], kMapValueFieldNumber, valueDataType); +//% } +//% } +//%} +//% +//%BOOL_DICT_MUTATIONS_##HELPER(VALUE_NAME, VALUE_TYPE) +//% +//%@end +//% + + +// +// Helpers for PODs +// + +//%PDDM-DEFINE VALUE_FOR_KEY_POD(KEY_TYPE, VALUE_NAME, VALUE_TYPE, KHELPER) +//%- (BOOL)get##VALUE_NAME##:(nullable VALUE_TYPE *)value forKey:(KEY_TYPE)key { +//% NSNumber *wrapped = [_dictionary objectForKey:WRAPPED##KHELPER(key)]; +//% if (wrapped && value) { +//% *value = UNWRAP##VALUE_NAME(wrapped); +//% } +//% return (wrapped != NULL); +//%} +//%PDDM-DEFINE WRAPPEDPOD(VALUE) +//%@(VALUE) +//%PDDM-DEFINE UNWRAPUInt32(VALUE) +//%[VALUE unsignedIntValue] +//%PDDM-DEFINE UNWRAPInt32(VALUE) +//%[VALUE intValue] +//%PDDM-DEFINE UNWRAPUInt64(VALUE) +//%[VALUE unsignedLongLongValue] +//%PDDM-DEFINE UNWRAPInt64(VALUE) +//%[VALUE longLongValue] +//%PDDM-DEFINE UNWRAPBool(VALUE) +//%[VALUE boolValue] +//%PDDM-DEFINE UNWRAPFloat(VALUE) +//%[VALUE floatValue] +//%PDDM-DEFINE UNWRAPDouble(VALUE) +//%[VALUE doubleValue] +//%PDDM-DEFINE UNWRAPEnum(VALUE) +//%[VALUE intValue] +//%PDDM-DEFINE TEXT_FORMAT_OBJUInt32(VALUE) +//%[NSString stringWithFormat:@"%u", VALUE] +//%PDDM-DEFINE TEXT_FORMAT_OBJInt32(VALUE) +//%[NSString stringWithFormat:@"%d", VALUE] +//%PDDM-DEFINE TEXT_FORMAT_OBJUInt64(VALUE) +//%[NSString stringWithFormat:@"%llu", VALUE] +//%PDDM-DEFINE TEXT_FORMAT_OBJInt64(VALUE) +//%[NSString stringWithFormat:@"%lld", VALUE] +//%PDDM-DEFINE TEXT_FORMAT_OBJBool(VALUE) +//%(VALUE ? @"true" : @"false") +//%PDDM-DEFINE TEXT_FORMAT_OBJFloat(VALUE) +//%[NSString stringWithFormat:@"%.*g", FLT_DIG, VALUE] +//%PDDM-DEFINE TEXT_FORMAT_OBJDouble(VALUE) +//%[NSString stringWithFormat:@"%.*lg", DBL_DIG, VALUE] +//%PDDM-DEFINE TEXT_FORMAT_OBJEnum(VALUE) +//%@(VALUE) +//%PDDM-DEFINE ENUM_TYPEPOD(TYPE) +//%NSNumber * +//%PDDM-DEFINE NEQ_POD(VAL1, VAL2) +//%VAL1 != VAL2 +//%PDDM-DEFINE EXTRA_METHODS_POD(KEY_NAME, VALUE_NAME) +// Empty +//%PDDM-DEFINE BOOL_EXTRA_METHODS_POD(KEY_NAME, VALUE_NAME) +// Empty +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD(KEY_NAME, VALUE_NAME) +//%SERIAL_DATA_FOR_ENTRY_POD_##VALUE_NAME(KEY_NAME) +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD_UInt32(KEY_NAME) +// Empty +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD_Int32(KEY_NAME) +// Empty +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD_UInt64(KEY_NAME) +// Empty +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD_Int64(KEY_NAME) +// Empty +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD_Bool(KEY_NAME) +// Empty +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD_Float(KEY_NAME) +// Empty +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD_Double(KEY_NAME) +// Empty +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_POD_Enum(KEY_NAME) +//%- (NSData *)serializedDataForUnknownValue:(int32_t)value +//% forKey:(GPBGenericValue *)key +//% keyDataType:(GPBDataType)keyDataType { +//% size_t msgSize = ComputeDict##KEY_NAME##FieldSize(key->value##KEY_NAME, kMapKeyFieldNumber, keyDataType); +//% msgSize += ComputeDictEnumFieldSize(value, kMapValueFieldNumber, GPBDataTypeEnum); +//% NSMutableData *data = [NSMutableData dataWithLength:msgSize]; +//% GPBCodedOutputStream *outputStream = [[GPBCodedOutputStream alloc] initWithData:data]; +//% WriteDict##KEY_NAME##Field(outputStream, key->value##KEY_NAME, kMapKeyFieldNumber, keyDataType); +//% WriteDictEnumField(outputStream, value, kMapValueFieldNumber, GPBDataTypeEnum); +//% [outputStream release]; +//% return data; +//%} +//% +//%PDDM-DEFINE GPBVALUE_POD(VALUE_NAME) +//%value##VALUE_NAME +//%PDDM-DEFINE DICTIONARY_VALIDATE_VALUE_POD(VALUE_NAME, EXTRA_INDENT) +// Empty +//%PDDM-DEFINE DICTIONARY_VALIDATE_KEY_POD(KEY_NAME, EXTRA_INDENT) +// Empty + +//%PDDM-DEFINE BOOL_DICT_HAS_STORAGE_POD() +//% BOOL _valueSet[2]; +//% +//%PDDM-DEFINE BOOL_DICT_INITS_POD(VALUE_NAME, VALUE_TYPE) +//%- (instancetype)initWith##VALUE_NAME##s:(const VALUE_TYPE [])values +//% ##VALUE_NAME$S## forKeys:(const BOOL [])keys +//% ##VALUE_NAME$S## count:(NSUInteger)count { +//% self = [super init]; +//% if (self) { +//% for (NSUInteger i = 0; i < count; ++i) { +//% int idx = keys[i] ? 1 : 0; +//% _values[idx] = values[i]; +//% _valueSet[idx] = YES; +//% } +//% } +//% return self; +//%} +//% +//%- (instancetype)initWithDictionary:(GPBBool##VALUE_NAME##Dictionary *)dictionary { +//% self = [self initWith##VALUE_NAME##s:NULL forKeys:NULL count:0]; +//% if (self) { +//% if (dictionary) { +//% for (int i = 0; i < 2; ++i) { +//% if (dictionary->_valueSet[i]) { +//% _values[i] = dictionary->_values[i]; +//% _valueSet[i] = YES; +//% } +//% } +//% } +//% } +//% return self; +//%} +//%PDDM-DEFINE BOOL_DICT_DEALLOCPOD() +//%#if !defined(NS_BLOCK_ASSERTIONS) +//%- (void)dealloc { +//% NSAssert(!_autocreator, +//% @"%@: Autocreator must be cleared before release, autocreator: %@", +//% [self class], _autocreator); +//% [super dealloc]; +//%} +//%#endif // !defined(NS_BLOCK_ASSERTIONS) +//%PDDM-DEFINE BOOL_DICT_W_HASPOD(IDX, REF) +//%BOOL_DICT_HASPOD(IDX, REF) +//%PDDM-DEFINE BOOL_DICT_HASPOD(IDX, REF) +//%REF##_valueSet[IDX] +//%PDDM-DEFINE BOOL_VALUE_FOR_KEY_POD(VALUE_NAME, VALUE_TYPE) +//%- (BOOL)get##VALUE_NAME##:(VALUE_TYPE *)value forKey:(BOOL)key { +//% int idx = (key ? 1 : 0); +//% if (_valueSet[idx]) { +//% if (value) { +//% *value = _values[idx]; +//% } +//% return YES; +//% } +//% return NO; +//%} +//%PDDM-DEFINE BOOL_SET_GPBVALUE_FOR_KEY_POD(VALUE_NAME, VALUE_TYPE, VisP) +//%- (void)setGPBGenericValue:(GPBGenericValue *)value +//% forGPBGenericValueKey:(GPBGenericValue *)key { +//% int idx = (key->valueBool ? 1 : 0); +//% _values[idx] = value->value##VALUE_NAME; +//% _valueSet[idx] = YES; +//%} +//%PDDM-DEFINE BOOL_DICT_MUTATIONS_POD(VALUE_NAME, VALUE_TYPE) +//%- (void)addEntriesFromDictionary:(GPBBool##VALUE_NAME##Dictionary *)otherDictionary { +//% if (otherDictionary) { +//% for (int i = 0; i < 2; ++i) { +//% if (otherDictionary->_valueSet[i]) { +//% _valueSet[i] = YES; +//% _values[i] = otherDictionary->_values[i]; +//% } +//% } +//% if (_autocreator) { +//% GPBAutocreatedDictionaryModified(_autocreator, self); +//% } +//% } +//%} +//% +//%- (void)set##VALUE_NAME:(VALUE_TYPE)value forKey:(BOOL)key { +//% int idx = (key ? 1 : 0); +//% _values[idx] = value; +//% _valueSet[idx] = YES; +//% if (_autocreator) { +//% GPBAutocreatedDictionaryModified(_autocreator, self); +//% } +//%} +//% +//%- (void)remove##VALUE_NAME##ForKey:(BOOL)aKey { +//% _valueSet[aKey ? 1 : 0] = NO; +//%} +//% +//%- (void)removeAll { +//% _valueSet[0] = NO; +//% _valueSet[1] = NO; +//%} +//%PDDM-DEFINE STR_FORMAT_POD(VALUE_NAME) +//%STR_FORMAT_##VALUE_NAME() +//%PDDM-DEFINE STR_FORMAT_UInt32() +//%%u +//%PDDM-DEFINE STR_FORMAT_Int32() +//%%d +//%PDDM-DEFINE STR_FORMAT_UInt64() +//%%llu +//%PDDM-DEFINE STR_FORMAT_Int64() +//%%lld +//%PDDM-DEFINE STR_FORMAT_Bool() +//%%d +//%PDDM-DEFINE STR_FORMAT_Float() +//%%f +//%PDDM-DEFINE STR_FORMAT_Double() +//%%lf + +// +// Helpers for Objects +// + +//%PDDM-DEFINE VALUE_FOR_KEY_OBJECT(KEY_TYPE, VALUE_NAME, VALUE_TYPE, KHELPER) +//%- (VALUE_TYPE)objectForKey:(KEY_TYPE)key { +//% VALUE_TYPE result = [_dictionary objectForKey:WRAPPED##KHELPER(key)]; +//% return result; +//%} +//%PDDM-DEFINE WRAPPEDOBJECT(VALUE) +//%VALUE +//%PDDM-DEFINE UNWRAPString(VALUE) +//%VALUE +//%PDDM-DEFINE UNWRAPObject(VALUE) +//%VALUE +//%PDDM-DEFINE TEXT_FORMAT_OBJString(VALUE) +//%VALUE +//%PDDM-DEFINE TEXT_FORMAT_OBJObject(VALUE) +//%VALUE +//%PDDM-DEFINE ENUM_TYPEOBJECT(TYPE) +//%ENUM_TYPEOBJECT_##TYPE() +//%PDDM-DEFINE ENUM_TYPEOBJECT_NSString() +//%NSString * +//%PDDM-DEFINE ENUM_TYPEOBJECT_id() +//%id ## +//%PDDM-DEFINE NEQ_OBJECT(VAL1, VAL2) +//%![VAL1 isEqual:VAL2] +//%PDDM-DEFINE EXTRA_METHODS_OBJECT(KEY_NAME, VALUE_NAME) +//%- (BOOL)isInitialized { +//% for (GPBMessage *msg in [_dictionary objectEnumerator]) { +//% if (!msg.initialized) { +//% return NO; +//% } +//% } +//% return YES; +//%} +//% +//%- (instancetype)deepCopyWithZone:(NSZone *)zone { +//% GPB##KEY_NAME##VALUE_NAME##Dictionary *newDict = +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] init]; +//% [_dictionary enumerateKeysAndObjectsUsingBlock:^(id aKey, +//% GPBMessage *msg, +//% BOOL *stop) { +//% #pragma unused(stop) +//% GPBMessage *copiedMsg = [msg copyWithZone:zone]; +//% [newDict->_dictionary setObject:copiedMsg forKey:aKey]; +//% [copiedMsg release]; +//% }]; +//% return newDict; +//%} +//% +//% +//%PDDM-DEFINE BOOL_EXTRA_METHODS_OBJECT(KEY_NAME, VALUE_NAME) +//%- (BOOL)isInitialized { +//% if (_values[0] && ![_values[0] isInitialized]) { +//% return NO; +//% } +//% if (_values[1] && ![_values[1] isInitialized]) { +//% return NO; +//% } +//% return YES; +//%} +//% +//%- (instancetype)deepCopyWithZone:(NSZone *)zone { +//% GPB##KEY_NAME##VALUE_NAME##Dictionary *newDict = +//% [[GPB##KEY_NAME##VALUE_NAME##Dictionary alloc] init]; +//% for (int i = 0; i < 2; ++i) { +//% if (_values[i] != nil) { +//% newDict->_values[i] = [_values[i] copyWithZone:zone]; +//% } +//% } +//% return newDict; +//%} +//% +//% +//%PDDM-DEFINE SERIAL_DATA_FOR_ENTRY_OBJECT(KEY_NAME, VALUE_NAME) +// Empty +//%PDDM-DEFINE GPBVALUE_OBJECT(VALUE_NAME) +//%valueString +//%PDDM-DEFINE DICTIONARY_VALIDATE_VALUE_OBJECT(VALUE_NAME, EXTRA_INDENT) +//%##EXTRA_INDENT$S## if (!##VALUE_NAME) { +//%##EXTRA_INDENT$S## [NSException raise:NSInvalidArgumentException +//%##EXTRA_INDENT$S## format:@"Attempting to add nil object to a Dictionary"]; +//%##EXTRA_INDENT$S## } +//% +//%PDDM-DEFINE DICTIONARY_VALIDATE_KEY_OBJECT(KEY_NAME, EXTRA_INDENT) +//%##EXTRA_INDENT$S## if (!##KEY_NAME) { +//%##EXTRA_INDENT$S## [NSException raise:NSInvalidArgumentException +//%##EXTRA_INDENT$S## format:@"Attempting to add nil key to a Dictionary"]; +//%##EXTRA_INDENT$S## } +//% + +//%PDDM-DEFINE BOOL_DICT_HAS_STORAGE_OBJECT() +// Empty +//%PDDM-DEFINE BOOL_DICT_INITS_OBJECT(VALUE_NAME, VALUE_TYPE) +//%- (instancetype)initWithObjects:(const VALUE_TYPE [])objects +//% forKeys:(const BOOL [])keys +//% count:(NSUInteger)count { +//% self = [super init]; +//% if (self) { +//% for (NSUInteger i = 0; i < count; ++i) { +//% if (!objects[i]) { +//% [NSException raise:NSInvalidArgumentException +//% format:@"Attempting to add nil object to a Dictionary"]; +//% } +//% int idx = keys[i] ? 1 : 0; +//% [_values[idx] release]; +//% _values[idx] = (VALUE_TYPE)[objects[i] retain]; +//% } +//% } +//% return self; +//%} +//% +//%- (instancetype)initWithDictionary:(GPBBool##VALUE_NAME##Dictionary *)dictionary { +//% self = [self initWithObjects:NULL forKeys:NULL count:0]; +//% if (self) { +//% if (dictionary) { +//% _values[0] = [dictionary->_values[0] retain]; +//% _values[1] = [dictionary->_values[1] retain]; +//% } +//% } +//% return self; +//%} +//%PDDM-DEFINE BOOL_DICT_DEALLOCOBJECT() +//%- (void)dealloc { +//% NSAssert(!_autocreator, +//% @"%@: Autocreator must be cleared before release, autocreator: %@", +//% [self class], _autocreator); +//% [_values[0] release]; +//% [_values[1] release]; +//% [super dealloc]; +//%} +//%PDDM-DEFINE BOOL_DICT_W_HASOBJECT(IDX, REF) +//%(BOOL_DICT_HASOBJECT(IDX, REF)) +//%PDDM-DEFINE BOOL_DICT_HASOBJECT(IDX, REF) +//%REF##_values[IDX] != nil +//%PDDM-DEFINE BOOL_VALUE_FOR_KEY_OBJECT(VALUE_NAME, VALUE_TYPE) +//%- (VALUE_TYPE)objectForKey:(BOOL)key { +//% return _values[key ? 1 : 0]; +//%} +//%PDDM-DEFINE BOOL_SET_GPBVALUE_FOR_KEY_OBJECT(VALUE_NAME, VALUE_TYPE, VisP) +//%- (void)setGPBGenericValue:(GPBGenericValue *)value +//% forGPBGenericValueKey:(GPBGenericValue *)key { +//% int idx = (key->valueBool ? 1 : 0); +//% [_values[idx] release]; +//% _values[idx] = [value->valueString retain]; +//%} + +//%PDDM-DEFINE BOOL_DICT_MUTATIONS_OBJECT(VALUE_NAME, VALUE_TYPE) +//%- (void)addEntriesFromDictionary:(GPBBool##VALUE_NAME##Dictionary *)otherDictionary { +//% if (otherDictionary) { +//% for (int i = 0; i < 2; ++i) { +//% if (otherDictionary->_values[i] != nil) { +//% [_values[i] release]; +//% _values[i] = [otherDictionary->_values[i] retain]; +//% } +//% } +//% if (_autocreator) { +//% GPBAutocreatedDictionaryModified(_autocreator, self); +//% } +//% } +//%} +//% +//%- (void)setObject:(VALUE_TYPE)object forKey:(BOOL)key { +//% if (!object) { +//% [NSException raise:NSInvalidArgumentException +//% format:@"Attempting to add nil object to a Dictionary"]; +//% } +//% int idx = (key ? 1 : 0); +//% [_values[idx] release]; +//% _values[idx] = [object retain]; +//% if (_autocreator) { +//% GPBAutocreatedDictionaryModified(_autocreator, self); +//% } +//%} +//% +//%- (void)removeObjectForKey:(BOOL)aKey { +//% int idx = (aKey ? 1 : 0); +//% [_values[idx] release]; +//% _values[idx] = nil; +//%} +//% +//%- (void)removeAll { +//% for (int i = 0; i < 2; ++i) { +//% [_values[i] release]; +//% _values[i] = nil; +//% } +//%} +//%PDDM-DEFINE STR_FORMAT_OBJECT(VALUE_NAME) +//%%@ + + +//%PDDM-EXPAND DICTIONARY_IMPL_FOR_POD_KEY(UInt32, uint32_t) +// This block of code is generated, do not edit it directly. + +#pragma mark - UInt32 -> UInt32 + +@implementation GPBUInt32UInt32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32UInt32Dictionary*)[self alloc] initWithUInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32UInt32Dictionary*)[self alloc] initWithUInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt32UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt32s:(const uint32_t [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32UInt32Dictionary *)dictionary { + self = [self initWithUInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32UInt32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32UInt32Dictionary class]]) { + return NO; + } + GPBUInt32UInt32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(uint32_t key, uint32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedIntValue], [aValue unsignedIntValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictUInt32Field(outputStream, [aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt32) forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt32sUsingBlock:^(uint32_t key, uint32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], [NSString stringWithFormat:@"%u", value]); + }]; +} + +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped unsignedIntValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt32UInt32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt32:(uint32_t)value forKey:(uint32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt32ForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt32 -> Int32 + +@implementation GPBUInt32Int32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32Int32Dictionary*)[self alloc] initWithInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt32s:(const int32_t [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32Int32Dictionary*)[self alloc] initWithInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32Int32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt32Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt32s:(const int32_t [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32Int32Dictionary *)dictionary { + self = [self initWithInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32Int32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32Int32Dictionary class]]) { + return NO; + } + GPBUInt32Int32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(uint32_t key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedIntValue], [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictInt32Field(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt32) forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt32sUsingBlock:^(uint32_t key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], [NSString stringWithFormat:@"%d", value]); + }]; +} + +- (BOOL)getInt32:(nullable int32_t *)value forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt32Int32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt32:(int32_t)value forKey:(uint32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt32ForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt32 -> UInt64 + +@implementation GPBUInt32UInt64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32UInt64Dictionary*)[self alloc] initWithUInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32UInt64Dictionary*)[self alloc] initWithUInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt32UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt64s:(const uint64_t [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32UInt64Dictionary *)dictionary { + self = [self initWithUInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32UInt64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32UInt64Dictionary class]]) { + return NO; + } + GPBUInt32UInt64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(uint32_t key, uint64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedIntValue], [aValue unsignedLongLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictUInt64Field(outputStream, [aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt64) forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt64sUsingBlock:^(uint32_t key, uint64_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], [NSString stringWithFormat:@"%llu", value]); + }]; +} + +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped unsignedLongLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt32UInt64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt64:(uint64_t)value forKey:(uint32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt64ForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt32 -> Int64 + +@implementation GPBUInt32Int64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32Int64Dictionary*)[self alloc] initWithInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt64s:(const int64_t [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32Int64Dictionary*)[self alloc] initWithInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32Int64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt32Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt64s:(const int64_t [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32Int64Dictionary *)dictionary { + self = [self initWithInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32Int64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32Int64Dictionary class]]) { + return NO; + } + GPBUInt32Int64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(uint32_t key, int64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedIntValue], [aValue longLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictInt64Field(outputStream, [aValue longLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt64) forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt64sUsingBlock:^(uint32_t key, int64_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], [NSString stringWithFormat:@"%lld", value]); + }]; +} + +- (BOOL)getInt64:(nullable int64_t *)value forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped longLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt32Int64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt64:(int64_t)value forKey:(uint32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt64ForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt32 -> Bool + +@implementation GPBUInt32BoolDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32BoolDictionary*)[self alloc] initWithBools:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithBools:(const BOOL [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32BoolDictionary*)[self alloc] initWithBools:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32BoolDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt32BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithBools:(const BOOL [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32BoolDictionary *)dictionary { + self = [self initWithBools:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32BoolDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32BoolDictionary class]]) { + return NO; + } + GPBUInt32BoolDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(uint32_t key, BOOL value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedIntValue], [aValue boolValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictBoolField(outputStream, [aValue boolValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueBool) forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndBoolsUsingBlock:^(uint32_t key, BOOL value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], (value ? @"true" : @"false")); + }]; +} + +- (BOOL)getBool:(nullable BOOL *)value forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped boolValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt32BoolDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setBool:(BOOL)value forKey:(uint32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeBoolForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt32 -> Float + +@implementation GPBUInt32FloatDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32FloatDictionary*)[self alloc] initWithFloats:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithFloats:(const float [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32FloatDictionary*)[self alloc] initWithFloats:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32FloatDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt32FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithFloats:(const float [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32FloatDictionary *)dictionary { + self = [self initWithFloats:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32FloatDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32FloatDictionary class]]) { + return NO; + } + GPBUInt32FloatDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(uint32_t key, float value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedIntValue], [aValue floatValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictFloatField(outputStream, [aValue floatValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueFloat) forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndFloatsUsingBlock:^(uint32_t key, float value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], [NSString stringWithFormat:@"%.*g", FLT_DIG, value]); + }]; +} + +- (BOOL)getFloat:(nullable float *)value forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped floatValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt32FloatDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setFloat:(float)value forKey:(uint32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeFloatForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt32 -> Double + +@implementation GPBUInt32DoubleDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32DoubleDictionary*)[self alloc] initWithDoubles:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithDoubles:(const double [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32DoubleDictionary*)[self alloc] initWithDoubles:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32DoubleDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt32DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithDoubles:(const double [])values + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32DoubleDictionary *)dictionary { + self = [self initWithDoubles:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32DoubleDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32DoubleDictionary class]]) { + return NO; + } + GPBUInt32DoubleDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(uint32_t key, double value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedIntValue], [aValue doubleValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictDoubleField(outputStream, [aValue doubleValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueDouble) forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndDoublesUsingBlock:^(uint32_t key, double value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], [NSString stringWithFormat:@"%.*lg", DBL_DIG, value]); + }]; +} + +- (BOOL)getDouble:(nullable double *)value forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped doubleValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt32DoubleDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setDouble:(double)value forKey:(uint32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeDoubleForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt32 -> Enum + +@implementation GPBUInt32EnumDictionary { + @package + NSMutableDictionary *_dictionary; + GPBEnumValidationFunc _validationFunc; +} + +@synthesize validationFunc = _validationFunc; + ++ (instancetype)dictionary { + return [[[self alloc] initWithValidationFunction:NULL + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { + return [[[self alloc] initWithValidationFunction:func + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32EnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:&rawValue + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32EnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:rawValues + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32EnumDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32EnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func { + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + _validationFunc = (func != NULL ? func : DictDefault_IsValidValue); + if (count && rawValues && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(rawValues[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32EnumDictionary *)dictionary { + self = [self initWithValidationFunction:dictionary.validationFunc + rawValues:NULL + forKeys:NULL + count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32EnumDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32EnumDictionary class]]) { + return NO; + } + GPBUInt32EnumDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(uint32_t key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedIntValue], [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType { + size_t msgSize = ComputeDictUInt32FieldSize(key->valueUInt32, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize(value, kMapValueFieldNumber, GPBDataTypeEnum); + NSMutableData *data = [NSMutableData dataWithLength:msgSize]; + GPBCodedOutputStream *outputStream = [[GPBCodedOutputStream alloc] initWithData:data]; + WriteDictUInt32Field(outputStream, key->valueUInt32, kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, value, kMapValueFieldNumber, GPBDataTypeEnum); + [outputStream release]; + return data; +} +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueEnum) forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndRawValuesUsingBlock:^(uint32_t key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], @(value)); + }]; +} + +- (BOOL)getEnum:(int32_t *)value forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + int32_t result = [wrapped intValue]; + if (!_validationFunc(result)) { + result = kGPBUnrecognizedEnumeratorValue; + } + *value = result; + } + return (wrapped != NULL); +} + +- (BOOL)getRawValue:(int32_t *)rawValue forKey:(uint32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && rawValue) { + *rawValue = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(uint32_t key, int32_t value, BOOL *stop))block { + GPBEnumValidationFunc func = _validationFunc; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + int32_t unwrapped = [aValue intValue]; + if (!func(unwrapped)) { + unwrapped = kGPBUnrecognizedEnumeratorValue; + } + block([aKey unsignedIntValue], unwrapped, stop); + }]; +} + +- (void)addRawEntriesFromDictionary:(GPBUInt32EnumDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setRawValue:(int32_t)value forKey:(uint32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeEnumForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +- (void)setEnum:(int32_t)value forKey:(uint32_t)key { + if (!_validationFunc(value)) { + [NSException raise:NSInvalidArgumentException + format:@"GPBUInt32EnumDictionary: Attempt to set an unknown enum value (%d)", + value]; + } + + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +@end + +#pragma mark - UInt32 -> Object + +@implementation GPBUInt32ObjectDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithObject:(id)object + forKey:(uint32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithObjects:objects + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt32ObjectDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt32ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const uint32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && objects && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!objects[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + [_dictionary setObject:objects[i] forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt32ObjectDictionary *)dictionary { + self = [self initWithObjects:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt32ObjectDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt32ObjectDictionary class]]) { + return NO; + } + GPBUInt32ObjectDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(uint32_t key, id object, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + block([aKey unsignedIntValue], aObject, stop); + }]; +} + +- (BOOL)isInitialized { + for (GPBMessage *msg in [_dictionary objectEnumerator]) { + if (!msg.initialized) { + return NO; + } + } + return YES; +} + +- (instancetype)deepCopyWithZone:(NSZone *)zone { + GPBUInt32ObjectDictionary *newDict = + [[GPBUInt32ObjectDictionary alloc] init]; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(id aKey, + GPBMessage *msg, + BOOL *stop) { + #pragma unused(stop) + GPBMessage *copiedMsg = [msg copyWithZone:zone]; + [newDict->_dictionary setObject:copiedMsg forKey:aKey]; + [copiedMsg release]; + }]; + return newDict; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt32FieldSize([aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt32Field(outputStream, [aKey unsignedIntValue], kMapKeyFieldNumber, keyDataType); + WriteDictObjectField(outputStream, aObject, kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:value->valueString forKey:@(key->valueUInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndObjectsUsingBlock:^(uint32_t key, id object, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%u", key], object); + }]; +} + +- (id)objectForKey:(uint32_t)key { + id result = [_dictionary objectForKey:@(key)]; + return result; +} + +- (void)addEntriesFromDictionary:(GPBUInt32ObjectDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setObject:(id)object forKey:(uint32_t)key { + if (!object) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + [_dictionary setObject:object forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeObjectForKey:(uint32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +//%PDDM-EXPAND DICTIONARY_IMPL_FOR_POD_KEY(Int32, int32_t) +// This block of code is generated, do not edit it directly. + +#pragma mark - Int32 -> UInt32 + +@implementation GPBInt32UInt32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBInt32UInt32Dictionary*)[self alloc] initWithUInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBInt32UInt32Dictionary*)[self alloc] initWithUInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32UInt32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt32UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt32s:(const uint32_t [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32UInt32Dictionary *)dictionary { + self = [self initWithUInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32UInt32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32UInt32Dictionary class]]) { + return NO; + } + GPBInt32UInt32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(int32_t key, uint32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey intValue], [aValue unsignedIntValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictUInt32Field(outputStream, [aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt32) forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt32sUsingBlock:^(int32_t key, uint32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], [NSString stringWithFormat:@"%u", value]); + }]; +} + +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped unsignedIntValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt32UInt32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt32:(uint32_t)value forKey:(int32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt32ForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int32 -> Int32 + +@implementation GPBInt32Int32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBInt32Int32Dictionary*)[self alloc] initWithInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt32s:(const int32_t [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBInt32Int32Dictionary*)[self alloc] initWithInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32Int32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt32Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt32s:(const int32_t [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32Int32Dictionary *)dictionary { + self = [self initWithInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32Int32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32Int32Dictionary class]]) { + return NO; + } + GPBInt32Int32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(int32_t key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey intValue], [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictInt32Field(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt32) forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt32sUsingBlock:^(int32_t key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], [NSString stringWithFormat:@"%d", value]); + }]; +} + +- (BOOL)getInt32:(nullable int32_t *)value forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt32Int32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt32:(int32_t)value forKey:(int32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt32ForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int32 -> UInt64 + +@implementation GPBInt32UInt64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBInt32UInt64Dictionary*)[self alloc] initWithUInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBInt32UInt64Dictionary*)[self alloc] initWithUInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32UInt64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt32UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt64s:(const uint64_t [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32UInt64Dictionary *)dictionary { + self = [self initWithUInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32UInt64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32UInt64Dictionary class]]) { + return NO; + } + GPBInt32UInt64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(int32_t key, uint64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey intValue], [aValue unsignedLongLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictUInt64Field(outputStream, [aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt64) forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt64sUsingBlock:^(int32_t key, uint64_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], [NSString stringWithFormat:@"%llu", value]); + }]; +} + +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped unsignedLongLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt32UInt64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt64:(uint64_t)value forKey:(int32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt64ForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int32 -> Int64 + +@implementation GPBInt32Int64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBInt32Int64Dictionary*)[self alloc] initWithInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt64s:(const int64_t [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBInt32Int64Dictionary*)[self alloc] initWithInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32Int64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt32Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt64s:(const int64_t [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32Int64Dictionary *)dictionary { + self = [self initWithInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32Int64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32Int64Dictionary class]]) { + return NO; + } + GPBInt32Int64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(int32_t key, int64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey intValue], [aValue longLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictInt64Field(outputStream, [aValue longLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt64) forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt64sUsingBlock:^(int32_t key, int64_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], [NSString stringWithFormat:@"%lld", value]); + }]; +} + +- (BOOL)getInt64:(nullable int64_t *)value forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped longLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt32Int64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt64:(int64_t)value forKey:(int32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt64ForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int32 -> Bool + +@implementation GPBInt32BoolDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBInt32BoolDictionary*)[self alloc] initWithBools:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithBools:(const BOOL [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBInt32BoolDictionary*)[self alloc] initWithBools:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32BoolDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt32BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithBools:(const BOOL [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32BoolDictionary *)dictionary { + self = [self initWithBools:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32BoolDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32BoolDictionary class]]) { + return NO; + } + GPBInt32BoolDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(int32_t key, BOOL value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey intValue], [aValue boolValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictBoolField(outputStream, [aValue boolValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueBool) forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndBoolsUsingBlock:^(int32_t key, BOOL value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], (value ? @"true" : @"false")); + }]; +} + +- (BOOL)getBool:(nullable BOOL *)value forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped boolValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt32BoolDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setBool:(BOOL)value forKey:(int32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeBoolForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int32 -> Float + +@implementation GPBInt32FloatDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBInt32FloatDictionary*)[self alloc] initWithFloats:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithFloats:(const float [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBInt32FloatDictionary*)[self alloc] initWithFloats:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32FloatDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt32FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithFloats:(const float [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32FloatDictionary *)dictionary { + self = [self initWithFloats:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32FloatDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32FloatDictionary class]]) { + return NO; + } + GPBInt32FloatDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(int32_t key, float value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey intValue], [aValue floatValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictFloatField(outputStream, [aValue floatValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueFloat) forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndFloatsUsingBlock:^(int32_t key, float value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], [NSString stringWithFormat:@"%.*g", FLT_DIG, value]); + }]; +} + +- (BOOL)getFloat:(nullable float *)value forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped floatValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt32FloatDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setFloat:(float)value forKey:(int32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeFloatForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int32 -> Double + +@implementation GPBInt32DoubleDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBInt32DoubleDictionary*)[self alloc] initWithDoubles:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithDoubles:(const double [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBInt32DoubleDictionary*)[self alloc] initWithDoubles:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32DoubleDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt32DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithDoubles:(const double [])values + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32DoubleDictionary *)dictionary { + self = [self initWithDoubles:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32DoubleDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32DoubleDictionary class]]) { + return NO; + } + GPBInt32DoubleDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(int32_t key, double value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey intValue], [aValue doubleValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictDoubleField(outputStream, [aValue doubleValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueDouble) forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndDoublesUsingBlock:^(int32_t key, double value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], [NSString stringWithFormat:@"%.*lg", DBL_DIG, value]); + }]; +} + +- (BOOL)getDouble:(nullable double *)value forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped doubleValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt32DoubleDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setDouble:(double)value forKey:(int32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeDoubleForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int32 -> Enum + +@implementation GPBInt32EnumDictionary { + @package + NSMutableDictionary *_dictionary; + GPBEnumValidationFunc _validationFunc; +} + +@synthesize validationFunc = _validationFunc; + ++ (instancetype)dictionary { + return [[[self alloc] initWithValidationFunction:NULL + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { + return [[[self alloc] initWithValidationFunction:func + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBInt32EnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:&rawValue + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBInt32EnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:rawValues + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32EnumDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBInt32EnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func { + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + _validationFunc = (func != NULL ? func : DictDefault_IsValidValue); + if (count && rawValues && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(rawValues[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32EnumDictionary *)dictionary { + self = [self initWithValidationFunction:dictionary.validationFunc + rawValues:NULL + forKeys:NULL + count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32EnumDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32EnumDictionary class]]) { + return NO; + } + GPBInt32EnumDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(int32_t key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey intValue], [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType { + size_t msgSize = ComputeDictInt32FieldSize(key->valueInt32, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize(value, kMapValueFieldNumber, GPBDataTypeEnum); + NSMutableData *data = [NSMutableData dataWithLength:msgSize]; + GPBCodedOutputStream *outputStream = [[GPBCodedOutputStream alloc] initWithData:data]; + WriteDictInt32Field(outputStream, key->valueInt32, kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, value, kMapValueFieldNumber, GPBDataTypeEnum); + [outputStream release]; + return data; +} +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueEnum) forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndRawValuesUsingBlock:^(int32_t key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], @(value)); + }]; +} + +- (BOOL)getEnum:(int32_t *)value forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + int32_t result = [wrapped intValue]; + if (!_validationFunc(result)) { + result = kGPBUnrecognizedEnumeratorValue; + } + *value = result; + } + return (wrapped != NULL); +} + +- (BOOL)getRawValue:(int32_t *)rawValue forKey:(int32_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && rawValue) { + *rawValue = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(int32_t key, int32_t value, BOOL *stop))block { + GPBEnumValidationFunc func = _validationFunc; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + int32_t unwrapped = [aValue intValue]; + if (!func(unwrapped)) { + unwrapped = kGPBUnrecognizedEnumeratorValue; + } + block([aKey intValue], unwrapped, stop); + }]; +} + +- (void)addRawEntriesFromDictionary:(GPBInt32EnumDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setRawValue:(int32_t)value forKey:(int32_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeEnumForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +- (void)setEnum:(int32_t)value forKey:(int32_t)key { + if (!_validationFunc(value)) { + [NSException raise:NSInvalidArgumentException + format:@"GPBInt32EnumDictionary: Attempt to set an unknown enum value (%d)", + value]; + } + + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +@end + +#pragma mark - Int32 -> Object + +@implementation GPBInt32ObjectDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithObject:(id)object + forKey:(int32_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBInt32ObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBInt32ObjectDictionary*)[self alloc] initWithObjects:objects + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt32ObjectDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt32ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const int32_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && objects && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!objects[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + [_dictionary setObject:objects[i] forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt32ObjectDictionary *)dictionary { + self = [self initWithObjects:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt32ObjectDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt32ObjectDictionary class]]) { + return NO; + } + GPBInt32ObjectDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(int32_t key, id object, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + block([aKey intValue], aObject, stop); + }]; +} + +- (BOOL)isInitialized { + for (GPBMessage *msg in [_dictionary objectEnumerator]) { + if (!msg.initialized) { + return NO; + } + } + return YES; +} + +- (instancetype)deepCopyWithZone:(NSZone *)zone { + GPBInt32ObjectDictionary *newDict = + [[GPBInt32ObjectDictionary alloc] init]; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(id aKey, + GPBMessage *msg, + BOOL *stop) { + #pragma unused(stop) + GPBMessage *copiedMsg = [msg copyWithZone:zone]; + [newDict->_dictionary setObject:copiedMsg forKey:aKey]; + [copiedMsg release]; + }]; + return newDict; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt32FieldSize([aKey intValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt32Field(outputStream, [aKey intValue], kMapKeyFieldNumber, keyDataType); + WriteDictObjectField(outputStream, aObject, kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:value->valueString forKey:@(key->valueInt32)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndObjectsUsingBlock:^(int32_t key, id object, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%d", key], object); + }]; +} + +- (id)objectForKey:(int32_t)key { + id result = [_dictionary objectForKey:@(key)]; + return result; +} + +- (void)addEntriesFromDictionary:(GPBInt32ObjectDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setObject:(id)object forKey:(int32_t)key { + if (!object) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + [_dictionary setObject:object forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeObjectForKey:(int32_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +//%PDDM-EXPAND DICTIONARY_IMPL_FOR_POD_KEY(UInt64, uint64_t) +// This block of code is generated, do not edit it directly. + +#pragma mark - UInt64 -> UInt32 + +@implementation GPBUInt64UInt32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64UInt32Dictionary*)[self alloc] initWithUInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64UInt32Dictionary*)[self alloc] initWithUInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt64UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt32s:(const uint32_t [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64UInt32Dictionary *)dictionary { + self = [self initWithUInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64UInt32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64UInt32Dictionary class]]) { + return NO; + } + GPBUInt64UInt32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(uint64_t key, uint32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedLongLongValue], [aValue unsignedIntValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictUInt32Field(outputStream, [aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt32) forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt32sUsingBlock:^(uint64_t key, uint32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], [NSString stringWithFormat:@"%u", value]); + }]; +} + +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped unsignedIntValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt64UInt32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt32:(uint32_t)value forKey:(uint64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt32ForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt64 -> Int32 + +@implementation GPBUInt64Int32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64Int32Dictionary*)[self alloc] initWithInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt32s:(const int32_t [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64Int32Dictionary*)[self alloc] initWithInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64Int32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt64Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt32s:(const int32_t [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64Int32Dictionary *)dictionary { + self = [self initWithInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64Int32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64Int32Dictionary class]]) { + return NO; + } + GPBUInt64Int32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(uint64_t key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedLongLongValue], [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictInt32Field(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt32) forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt32sUsingBlock:^(uint64_t key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], [NSString stringWithFormat:@"%d", value]); + }]; +} + +- (BOOL)getInt32:(nullable int32_t *)value forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt64Int32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt32:(int32_t)value forKey:(uint64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt32ForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt64 -> UInt64 + +@implementation GPBUInt64UInt64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64UInt64Dictionary*)[self alloc] initWithUInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64UInt64Dictionary*)[self alloc] initWithUInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt64UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt64s:(const uint64_t [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64UInt64Dictionary *)dictionary { + self = [self initWithUInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64UInt64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64UInt64Dictionary class]]) { + return NO; + } + GPBUInt64UInt64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(uint64_t key, uint64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedLongLongValue], [aValue unsignedLongLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictUInt64Field(outputStream, [aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt64) forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt64sUsingBlock:^(uint64_t key, uint64_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], [NSString stringWithFormat:@"%llu", value]); + }]; +} + +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped unsignedLongLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt64UInt64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt64:(uint64_t)value forKey:(uint64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt64ForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt64 -> Int64 + +@implementation GPBUInt64Int64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64Int64Dictionary*)[self alloc] initWithInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt64s:(const int64_t [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64Int64Dictionary*)[self alloc] initWithInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64Int64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt64Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt64s:(const int64_t [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64Int64Dictionary *)dictionary { + self = [self initWithInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64Int64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64Int64Dictionary class]]) { + return NO; + } + GPBUInt64Int64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(uint64_t key, int64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedLongLongValue], [aValue longLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictInt64Field(outputStream, [aValue longLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt64) forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt64sUsingBlock:^(uint64_t key, int64_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], [NSString stringWithFormat:@"%lld", value]); + }]; +} + +- (BOOL)getInt64:(nullable int64_t *)value forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped longLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt64Int64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt64:(int64_t)value forKey:(uint64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt64ForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt64 -> Bool + +@implementation GPBUInt64BoolDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64BoolDictionary*)[self alloc] initWithBools:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithBools:(const BOOL [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64BoolDictionary*)[self alloc] initWithBools:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64BoolDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt64BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithBools:(const BOOL [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64BoolDictionary *)dictionary { + self = [self initWithBools:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64BoolDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64BoolDictionary class]]) { + return NO; + } + GPBUInt64BoolDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(uint64_t key, BOOL value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedLongLongValue], [aValue boolValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictBoolField(outputStream, [aValue boolValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueBool) forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndBoolsUsingBlock:^(uint64_t key, BOOL value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], (value ? @"true" : @"false")); + }]; +} + +- (BOOL)getBool:(nullable BOOL *)value forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped boolValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt64BoolDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setBool:(BOOL)value forKey:(uint64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeBoolForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt64 -> Float + +@implementation GPBUInt64FloatDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64FloatDictionary*)[self alloc] initWithFloats:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithFloats:(const float [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64FloatDictionary*)[self alloc] initWithFloats:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64FloatDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt64FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithFloats:(const float [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64FloatDictionary *)dictionary { + self = [self initWithFloats:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64FloatDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64FloatDictionary class]]) { + return NO; + } + GPBUInt64FloatDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(uint64_t key, float value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedLongLongValue], [aValue floatValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictFloatField(outputStream, [aValue floatValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueFloat) forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndFloatsUsingBlock:^(uint64_t key, float value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], [NSString stringWithFormat:@"%.*g", FLT_DIG, value]); + }]; +} + +- (BOOL)getFloat:(nullable float *)value forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped floatValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt64FloatDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setFloat:(float)value forKey:(uint64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeFloatForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt64 -> Double + +@implementation GPBUInt64DoubleDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64DoubleDictionary*)[self alloc] initWithDoubles:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithDoubles:(const double [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64DoubleDictionary*)[self alloc] initWithDoubles:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64DoubleDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt64DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithDoubles:(const double [])values + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64DoubleDictionary *)dictionary { + self = [self initWithDoubles:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64DoubleDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64DoubleDictionary class]]) { + return NO; + } + GPBUInt64DoubleDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(uint64_t key, double value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedLongLongValue], [aValue doubleValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictDoubleField(outputStream, [aValue doubleValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueDouble) forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndDoublesUsingBlock:^(uint64_t key, double value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], [NSString stringWithFormat:@"%.*lg", DBL_DIG, value]); + }]; +} + +- (BOOL)getDouble:(nullable double *)value forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped doubleValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBUInt64DoubleDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setDouble:(double)value forKey:(uint64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeDoubleForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - UInt64 -> Enum + +@implementation GPBUInt64EnumDictionary { + @package + NSMutableDictionary *_dictionary; + GPBEnumValidationFunc _validationFunc; +} + +@synthesize validationFunc = _validationFunc; + ++ (instancetype)dictionary { + return [[[self alloc] initWithValidationFunction:NULL + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { + return [[[self alloc] initWithValidationFunction:func + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64EnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:&rawValue + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64EnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:rawValues + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64EnumDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64EnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func { + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + _validationFunc = (func != NULL ? func : DictDefault_IsValidValue); + if (count && rawValues && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(rawValues[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64EnumDictionary *)dictionary { + self = [self initWithValidationFunction:dictionary.validationFunc + rawValues:NULL + forKeys:NULL + count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64EnumDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64EnumDictionary class]]) { + return NO; + } + GPBUInt64EnumDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(uint64_t key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey unsignedLongLongValue], [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType { + size_t msgSize = ComputeDictUInt64FieldSize(key->valueUInt64, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize(value, kMapValueFieldNumber, GPBDataTypeEnum); + NSMutableData *data = [NSMutableData dataWithLength:msgSize]; + GPBCodedOutputStream *outputStream = [[GPBCodedOutputStream alloc] initWithData:data]; + WriteDictUInt64Field(outputStream, key->valueUInt64, kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, value, kMapValueFieldNumber, GPBDataTypeEnum); + [outputStream release]; + return data; +} +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueEnum) forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndRawValuesUsingBlock:^(uint64_t key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], @(value)); + }]; +} + +- (BOOL)getEnum:(int32_t *)value forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + int32_t result = [wrapped intValue]; + if (!_validationFunc(result)) { + result = kGPBUnrecognizedEnumeratorValue; + } + *value = result; + } + return (wrapped != NULL); +} + +- (BOOL)getRawValue:(int32_t *)rawValue forKey:(uint64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && rawValue) { + *rawValue = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(uint64_t key, int32_t value, BOOL *stop))block { + GPBEnumValidationFunc func = _validationFunc; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + int32_t unwrapped = [aValue intValue]; + if (!func(unwrapped)) { + unwrapped = kGPBUnrecognizedEnumeratorValue; + } + block([aKey unsignedLongLongValue], unwrapped, stop); + }]; +} + +- (void)addRawEntriesFromDictionary:(GPBUInt64EnumDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setRawValue:(int32_t)value forKey:(uint64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeEnumForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +- (void)setEnum:(int32_t)value forKey:(uint64_t)key { + if (!_validationFunc(value)) { + [NSException raise:NSInvalidArgumentException + format:@"GPBUInt64EnumDictionary: Attempt to set an unknown enum value (%d)", + value]; + } + + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +@end + +#pragma mark - UInt64 -> Object + +@implementation GPBUInt64ObjectDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithObject:(id)object + forKey:(uint64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithObjects:objects + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBUInt64ObjectDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBUInt64ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const uint64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && objects && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!objects[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + [_dictionary setObject:objects[i] forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBUInt64ObjectDictionary *)dictionary { + self = [self initWithObjects:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBUInt64ObjectDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBUInt64ObjectDictionary class]]) { + return NO; + } + GPBUInt64ObjectDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(uint64_t key, id object, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + block([aKey unsignedLongLongValue], aObject, stop); + }]; +} + +- (BOOL)isInitialized { + for (GPBMessage *msg in [_dictionary objectEnumerator]) { + if (!msg.initialized) { + return NO; + } + } + return YES; +} + +- (instancetype)deepCopyWithZone:(NSZone *)zone { + GPBUInt64ObjectDictionary *newDict = + [[GPBUInt64ObjectDictionary alloc] init]; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(id aKey, + GPBMessage *msg, + BOOL *stop) { + #pragma unused(stop) + GPBMessage *copiedMsg = [msg copyWithZone:zone]; + [newDict->_dictionary setObject:copiedMsg forKey:aKey]; + [copiedMsg release]; + }]; + return newDict; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictUInt64FieldSize([aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictUInt64Field(outputStream, [aKey unsignedLongLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictObjectField(outputStream, aObject, kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:value->valueString forKey:@(key->valueUInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndObjectsUsingBlock:^(uint64_t key, id object, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%llu", key], object); + }]; +} + +- (id)objectForKey:(uint64_t)key { + id result = [_dictionary objectForKey:@(key)]; + return result; +} + +- (void)addEntriesFromDictionary:(GPBUInt64ObjectDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setObject:(id)object forKey:(uint64_t)key { + if (!object) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + [_dictionary setObject:object forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeObjectForKey:(uint64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +//%PDDM-EXPAND DICTIONARY_IMPL_FOR_POD_KEY(Int64, int64_t) +// This block of code is generated, do not edit it directly. + +#pragma mark - Int64 -> UInt32 + +@implementation GPBInt64UInt32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBInt64UInt32Dictionary*)[self alloc] initWithUInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBInt64UInt32Dictionary*)[self alloc] initWithUInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64UInt32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt64UInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt32s:(const uint32_t [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64UInt32Dictionary *)dictionary { + self = [self initWithUInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64UInt32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64UInt32Dictionary class]]) { + return NO; + } + GPBInt64UInt32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(int64_t key, uint32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey longLongValue], [aValue unsignedIntValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictUInt32Field(outputStream, [aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt32) forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt32sUsingBlock:^(int64_t key, uint32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], [NSString stringWithFormat:@"%u", value]); + }]; +} + +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped unsignedIntValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt64UInt32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt32:(uint32_t)value forKey:(int64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt32ForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int64 -> Int32 + +@implementation GPBInt64Int32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBInt64Int32Dictionary*)[self alloc] initWithInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt32s:(const int32_t [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBInt64Int32Dictionary*)[self alloc] initWithInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64Int32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt64Int32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt32s:(const int32_t [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64Int32Dictionary *)dictionary { + self = [self initWithInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64Int32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64Int32Dictionary class]]) { + return NO; + } + GPBInt64Int32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(int64_t key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey longLongValue], [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictInt32Field(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt32) forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt32sUsingBlock:^(int64_t key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], [NSString stringWithFormat:@"%d", value]); + }]; +} + +- (BOOL)getInt32:(nullable int32_t *)value forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt64Int32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt32:(int32_t)value forKey:(int64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt32ForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int64 -> UInt64 + +@implementation GPBInt64UInt64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBInt64UInt64Dictionary*)[self alloc] initWithUInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBInt64UInt64Dictionary*)[self alloc] initWithUInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64UInt64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt64UInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt64s:(const uint64_t [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64UInt64Dictionary *)dictionary { + self = [self initWithUInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64UInt64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64UInt64Dictionary class]]) { + return NO; + } + GPBInt64UInt64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(int64_t key, uint64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey longLongValue], [aValue unsignedLongLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictUInt64Field(outputStream, [aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt64) forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt64sUsingBlock:^(int64_t key, uint64_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], [NSString stringWithFormat:@"%llu", value]); + }]; +} + +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped unsignedLongLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt64UInt64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt64:(uint64_t)value forKey:(int64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt64ForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int64 -> Int64 + +@implementation GPBInt64Int64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBInt64Int64Dictionary*)[self alloc] initWithInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt64s:(const int64_t [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBInt64Int64Dictionary*)[self alloc] initWithInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64Int64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt64Int64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt64s:(const int64_t [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64Int64Dictionary *)dictionary { + self = [self initWithInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64Int64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64Int64Dictionary class]]) { + return NO; + } + GPBInt64Int64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(int64_t key, int64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey longLongValue], [aValue longLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictInt64Field(outputStream, [aValue longLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt64) forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt64sUsingBlock:^(int64_t key, int64_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], [NSString stringWithFormat:@"%lld", value]); + }]; +} + +- (BOOL)getInt64:(nullable int64_t *)value forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped longLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt64Int64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt64:(int64_t)value forKey:(int64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt64ForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int64 -> Bool + +@implementation GPBInt64BoolDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBInt64BoolDictionary*)[self alloc] initWithBools:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithBools:(const BOOL [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBInt64BoolDictionary*)[self alloc] initWithBools:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64BoolDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt64BoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithBools:(const BOOL [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64BoolDictionary *)dictionary { + self = [self initWithBools:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64BoolDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64BoolDictionary class]]) { + return NO; + } + GPBInt64BoolDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(int64_t key, BOOL value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey longLongValue], [aValue boolValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictBoolField(outputStream, [aValue boolValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueBool) forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndBoolsUsingBlock:^(int64_t key, BOOL value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], (value ? @"true" : @"false")); + }]; +} + +- (BOOL)getBool:(nullable BOOL *)value forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped boolValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt64BoolDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setBool:(BOOL)value forKey:(int64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeBoolForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int64 -> Float + +@implementation GPBInt64FloatDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBInt64FloatDictionary*)[self alloc] initWithFloats:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithFloats:(const float [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBInt64FloatDictionary*)[self alloc] initWithFloats:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64FloatDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt64FloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithFloats:(const float [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64FloatDictionary *)dictionary { + self = [self initWithFloats:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64FloatDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64FloatDictionary class]]) { + return NO; + } + GPBInt64FloatDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(int64_t key, float value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey longLongValue], [aValue floatValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictFloatField(outputStream, [aValue floatValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueFloat) forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndFloatsUsingBlock:^(int64_t key, float value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], [NSString stringWithFormat:@"%.*g", FLT_DIG, value]); + }]; +} + +- (BOOL)getFloat:(nullable float *)value forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped floatValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt64FloatDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setFloat:(float)value forKey:(int64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeFloatForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int64 -> Double + +@implementation GPBInt64DoubleDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBInt64DoubleDictionary*)[self alloc] initWithDoubles:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithDoubles:(const double [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBInt64DoubleDictionary*)[self alloc] initWithDoubles:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64DoubleDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt64DoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithDoubles:(const double [])values + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(values[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64DoubleDictionary *)dictionary { + self = [self initWithDoubles:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64DoubleDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64DoubleDictionary class]]) { + return NO; + } + GPBInt64DoubleDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(int64_t key, double value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey longLongValue], [aValue doubleValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictDoubleField(outputStream, [aValue doubleValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueDouble) forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndDoublesUsingBlock:^(int64_t key, double value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], [NSString stringWithFormat:@"%.*lg", DBL_DIG, value]); + }]; +} + +- (BOOL)getDouble:(nullable double *)value forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + *value = [wrapped doubleValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBInt64DoubleDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setDouble:(double)value forKey:(int64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeDoubleForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - Int64 -> Enum + +@implementation GPBInt64EnumDictionary { + @package + NSMutableDictionary *_dictionary; + GPBEnumValidationFunc _validationFunc; +} + +@synthesize validationFunc = _validationFunc; + ++ (instancetype)dictionary { + return [[[self alloc] initWithValidationFunction:NULL + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { + return [[[self alloc] initWithValidationFunction:func + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBInt64EnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:&rawValue + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBInt64EnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:rawValues + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64EnumDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBInt64EnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func { + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + _validationFunc = (func != NULL ? func : DictDefault_IsValidValue); + if (count && rawValues && keys) { + for (NSUInteger i = 0; i < count; ++i) { + [_dictionary setObject:@(rawValues[i]) forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64EnumDictionary *)dictionary { + self = [self initWithValidationFunction:dictionary.validationFunc + rawValues:NULL + forKeys:NULL + count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64EnumDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64EnumDictionary class]]) { + return NO; + } + GPBInt64EnumDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(int64_t key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + block([aKey longLongValue], [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType { + size_t msgSize = ComputeDictInt64FieldSize(key->valueInt64, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize(value, kMapValueFieldNumber, GPBDataTypeEnum); + NSMutableData *data = [NSMutableData dataWithLength:msgSize]; + GPBCodedOutputStream *outputStream = [[GPBCodedOutputStream alloc] initWithData:data]; + WriteDictInt64Field(outputStream, key->valueInt64, kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, value, kMapValueFieldNumber, GPBDataTypeEnum); + [outputStream release]; + return data; +} +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueEnum) forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndRawValuesUsingBlock:^(int64_t key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], @(value)); + }]; +} + +- (BOOL)getEnum:(int32_t *)value forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && value) { + int32_t result = [wrapped intValue]; + if (!_validationFunc(result)) { + result = kGPBUnrecognizedEnumeratorValue; + } + *value = result; + } + return (wrapped != NULL); +} + +- (BOOL)getRawValue:(int32_t *)rawValue forKey:(int64_t)key { + NSNumber *wrapped = [_dictionary objectForKey:@(key)]; + if (wrapped && rawValue) { + *rawValue = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(int64_t key, int32_t value, BOOL *stop))block { + GPBEnumValidationFunc func = _validationFunc; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + NSNumber *aValue, + BOOL *stop) { + int32_t unwrapped = [aValue intValue]; + if (!func(unwrapped)) { + unwrapped = kGPBUnrecognizedEnumeratorValue; + } + block([aKey longLongValue], unwrapped, stop); + }]; +} + +- (void)addRawEntriesFromDictionary:(GPBInt64EnumDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setRawValue:(int32_t)value forKey:(int64_t)key { + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeEnumForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +- (void)setEnum:(int32_t)value forKey:(int64_t)key { + if (!_validationFunc(value)) { + [NSException raise:NSInvalidArgumentException + format:@"GPBInt64EnumDictionary: Attempt to set an unknown enum value (%d)", + value]; + } + + [_dictionary setObject:@(value) forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +@end + +#pragma mark - Int64 -> Object + +@implementation GPBInt64ObjectDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithObject:(id)object + forKey:(int64_t)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBInt64ObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBInt64ObjectDictionary*)[self alloc] initWithObjects:objects + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBInt64ObjectDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBInt64ObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const int64_t [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && objects && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!objects[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + [_dictionary setObject:objects[i] forKey:@(keys[i])]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBInt64ObjectDictionary *)dictionary { + self = [self initWithObjects:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBInt64ObjectDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBInt64ObjectDictionary class]]) { + return NO; + } + GPBInt64ObjectDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(int64_t key, id object, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + block([aKey longLongValue], aObject, stop); + }]; +} + +- (BOOL)isInitialized { + for (GPBMessage *msg in [_dictionary objectEnumerator]) { + if (!msg.initialized) { + return NO; + } + } + return YES; +} + +- (instancetype)deepCopyWithZone:(NSZone *)zone { + GPBInt64ObjectDictionary *newDict = + [[GPBInt64ObjectDictionary alloc] init]; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(id aKey, + GPBMessage *msg, + BOOL *stop) { + #pragma unused(stop) + GPBMessage *copiedMsg = [msg copyWithZone:zone]; + [newDict->_dictionary setObject:copiedMsg forKey:aKey]; + [copiedMsg release]; + }]; + return newDict; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSNumber *aKey, + id aObject, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictInt64FieldSize([aKey longLongValue], kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictObjectFieldSize(aObject, kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictInt64Field(outputStream, [aKey longLongValue], kMapKeyFieldNumber, keyDataType); + WriteDictObjectField(outputStream, aObject, kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:value->valueString forKey:@(key->valueInt64)]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndObjectsUsingBlock:^(int64_t key, id object, BOOL *stop) { + #pragma unused(stop) + block([NSString stringWithFormat:@"%lld", key], object); + }]; +} + +- (id)objectForKey:(int64_t)key { + id result = [_dictionary objectForKey:@(key)]; + return result; +} + +- (void)addEntriesFromDictionary:(GPBInt64ObjectDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setObject:(id)object forKey:(int64_t)key { + if (!object) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + [_dictionary setObject:object forKey:@(key)]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeObjectForKey:(int64_t)aKey { + [_dictionary removeObjectForKey:@(aKey)]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +//%PDDM-EXPAND DICTIONARY_POD_IMPL_FOR_KEY(String, NSString, *, OBJECT) +// This block of code is generated, do not edit it directly. + +#pragma mark - String -> UInt32 + +@implementation GPBStringUInt32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(NSString *)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBStringUInt32Dictionary*)[self alloc] initWithUInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBStringUInt32Dictionary*)[self alloc] initWithUInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBStringUInt32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBStringUInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt32s:(const uint32_t [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!keys[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(values[i]) forKey:keys[i]]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBStringUInt32Dictionary *)dictionary { + self = [self initWithUInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBStringUInt32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBStringUInt32Dictionary class]]) { + return NO; + } + GPBStringUInt32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(NSString *key, uint32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + block(aKey, [aValue unsignedIntValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt32FieldSize([aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictStringField(outputStream, aKey, kMapKeyFieldNumber, keyDataType); + WriteDictUInt32Field(outputStream, [aValue unsignedIntValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt32) forKey:key->valueString]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt32sUsingBlock:^(NSString *key, uint32_t value, BOOL *stop) { + #pragma unused(stop) + block(key, [NSString stringWithFormat:@"%u", value]); + }]; +} + +- (BOOL)getUInt32:(nullable uint32_t *)value forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && value) { + *value = [wrapped unsignedIntValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBStringUInt32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt32:(uint32_t)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt32ForKey:(NSString *)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - String -> Int32 + +@implementation GPBStringInt32Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(NSString *)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBStringInt32Dictionary*)[self alloc] initWithInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt32s:(const int32_t [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBStringInt32Dictionary*)[self alloc] initWithInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBStringInt32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBStringInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt32s:(const int32_t [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!keys[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(values[i]) forKey:keys[i]]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBStringInt32Dictionary *)dictionary { + self = [self initWithInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBStringInt32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBStringInt32Dictionary class]]) { + return NO; + } + GPBStringInt32Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(NSString *key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + block(aKey, [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt32FieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictStringField(outputStream, aKey, kMapKeyFieldNumber, keyDataType); + WriteDictInt32Field(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt32) forKey:key->valueString]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt32sUsingBlock:^(NSString *key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block(key, [NSString stringWithFormat:@"%d", value]); + }]; +} + +- (BOOL)getInt32:(nullable int32_t *)value forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && value) { + *value = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBStringInt32Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt32:(int32_t)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt32ForKey:(NSString *)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - String -> UInt64 + +@implementation GPBStringUInt64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(NSString *)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBStringUInt64Dictionary*)[self alloc] initWithUInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBStringUInt64Dictionary*)[self alloc] initWithUInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBStringUInt64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBStringUInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt64s:(const uint64_t [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!keys[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(values[i]) forKey:keys[i]]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBStringUInt64Dictionary *)dictionary { + self = [self initWithUInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBStringUInt64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBStringUInt64Dictionary class]]) { + return NO; + } + GPBStringUInt64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(NSString *key, uint64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + block(aKey, [aValue unsignedLongLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictUInt64FieldSize([aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictStringField(outputStream, aKey, kMapKeyFieldNumber, keyDataType); + WriteDictUInt64Field(outputStream, [aValue unsignedLongLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueUInt64) forKey:key->valueString]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndUInt64sUsingBlock:^(NSString *key, uint64_t value, BOOL *stop) { + #pragma unused(stop) + block(key, [NSString stringWithFormat:@"%llu", value]); + }]; +} + +- (BOOL)getUInt64:(nullable uint64_t *)value forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && value) { + *value = [wrapped unsignedLongLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBStringUInt64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt64:(uint64_t)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt64ForKey:(NSString *)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - String -> Int64 + +@implementation GPBStringInt64Dictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(NSString *)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBStringInt64Dictionary*)[self alloc] initWithInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt64s:(const int64_t [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBStringInt64Dictionary*)[self alloc] initWithInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBStringInt64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBStringInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt64s:(const int64_t [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!keys[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(values[i]) forKey:keys[i]]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBStringInt64Dictionary *)dictionary { + self = [self initWithInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBStringInt64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBStringInt64Dictionary class]]) { + return NO; + } + GPBStringInt64Dictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(NSString *key, int64_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + block(aKey, [aValue longLongValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictInt64FieldSize([aValue longLongValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictStringField(outputStream, aKey, kMapKeyFieldNumber, keyDataType); + WriteDictInt64Field(outputStream, [aValue longLongValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueInt64) forKey:key->valueString]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndInt64sUsingBlock:^(NSString *key, int64_t value, BOOL *stop) { + #pragma unused(stop) + block(key, [NSString stringWithFormat:@"%lld", value]); + }]; +} + +- (BOOL)getInt64:(nullable int64_t *)value forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && value) { + *value = [wrapped longLongValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBStringInt64Dictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt64:(int64_t)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt64ForKey:(NSString *)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - String -> Bool + +@implementation GPBStringBoolDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(NSString *)key { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBStringBoolDictionary*)[self alloc] initWithBools:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithBools:(const BOOL [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBStringBoolDictionary*)[self alloc] initWithBools:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBStringBoolDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBStringBoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithBools:(const BOOL [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!keys[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(values[i]) forKey:keys[i]]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBStringBoolDictionary *)dictionary { + self = [self initWithBools:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBStringBoolDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBStringBoolDictionary class]]) { + return NO; + } + GPBStringBoolDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(NSString *key, BOOL value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + block(aKey, [aValue boolValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictBoolFieldSize([aValue boolValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictStringField(outputStream, aKey, kMapKeyFieldNumber, keyDataType); + WriteDictBoolField(outputStream, [aValue boolValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueBool) forKey:key->valueString]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndBoolsUsingBlock:^(NSString *key, BOOL value, BOOL *stop) { + #pragma unused(stop) + block(key, (value ? @"true" : @"false")); + }]; +} + +- (BOOL)getBool:(nullable BOOL *)value forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && value) { + *value = [wrapped boolValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBStringBoolDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setBool:(BOOL)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeBoolForKey:(NSString *)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - String -> Float + +@implementation GPBStringFloatDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(NSString *)key { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBStringFloatDictionary*)[self alloc] initWithFloats:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithFloats:(const float [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBStringFloatDictionary*)[self alloc] initWithFloats:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBStringFloatDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBStringFloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithFloats:(const float [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!keys[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(values[i]) forKey:keys[i]]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBStringFloatDictionary *)dictionary { + self = [self initWithFloats:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBStringFloatDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBStringFloatDictionary class]]) { + return NO; + } + GPBStringFloatDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(NSString *key, float value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + block(aKey, [aValue floatValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictFloatFieldSize([aValue floatValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictStringField(outputStream, aKey, kMapKeyFieldNumber, keyDataType); + WriteDictFloatField(outputStream, [aValue floatValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueFloat) forKey:key->valueString]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndFloatsUsingBlock:^(NSString *key, float value, BOOL *stop) { + #pragma unused(stop) + block(key, [NSString stringWithFormat:@"%.*g", FLT_DIG, value]); + }]; +} + +- (BOOL)getFloat:(nullable float *)value forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && value) { + *value = [wrapped floatValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBStringFloatDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setFloat:(float)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeFloatForKey:(NSString *)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - String -> Double + +@implementation GPBStringDoubleDictionary { + @package + NSMutableDictionary *_dictionary; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(NSString *)key { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBStringDoubleDictionary*)[self alloc] initWithDoubles:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithDoubles:(const double [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBStringDoubleDictionary*)[self alloc] initWithDoubles:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBStringDoubleDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBStringDoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithDoubles:(const double [])values + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + if (count && values && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!keys[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(values[i]) forKey:keys[i]]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBStringDoubleDictionary *)dictionary { + self = [self initWithDoubles:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBStringDoubleDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBStringDoubleDictionary class]]) { + return NO; + } + GPBStringDoubleDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(NSString *key, double value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + block(aKey, [aValue doubleValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictDoubleFieldSize([aValue doubleValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictStringField(outputStream, aKey, kMapKeyFieldNumber, keyDataType); + WriteDictDoubleField(outputStream, [aValue doubleValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueDouble) forKey:key->valueString]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndDoublesUsingBlock:^(NSString *key, double value, BOOL *stop) { + #pragma unused(stop) + block(key, [NSString stringWithFormat:@"%.*lg", DBL_DIG, value]); + }]; +} + +- (BOOL)getDouble:(nullable double *)value forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && value) { + *value = [wrapped doubleValue]; + } + return (wrapped != NULL); +} + +- (void)addEntriesFromDictionary:(GPBStringDoubleDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setDouble:(double)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeDoubleForKey:(NSString *)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +@end + +#pragma mark - String -> Enum + +@implementation GPBStringEnumDictionary { + @package + NSMutableDictionary *_dictionary; + GPBEnumValidationFunc _validationFunc; +} + +@synthesize validationFunc = _validationFunc; + ++ (instancetype)dictionary { + return [[[self alloc] initWithValidationFunction:NULL + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { + return [[[self alloc] initWithValidationFunction:func + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(NSString *)key { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBStringEnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:&rawValue + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBStringEnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:rawValues + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBStringEnumDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBStringEnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func { + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const NSString * [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] init]; + _validationFunc = (func != NULL ? func : DictDefault_IsValidValue); + if (count && rawValues && keys) { + for (NSUInteger i = 0; i < count; ++i) { + if (!keys[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(rawValues[i]) forKey:keys[i]]; + } + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBStringEnumDictionary *)dictionary { + self = [self initWithValidationFunction:dictionary.validationFunc + rawValues:NULL + forKeys:NULL + count:0]; + if (self) { + if (dictionary) { + [_dictionary addEntriesFromDictionary:dictionary->_dictionary]; + } + } + return self; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBStringEnumDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBStringEnumDictionary class]]) { + return NO; + } + GPBStringEnumDictionary *otherDictionary = other; + return [_dictionary isEqual:otherDictionary->_dictionary]; +} + +- (NSUInteger)hash { + return _dictionary.count; +} + +- (NSString *)description { + return [NSString stringWithFormat:@"<%@ %p> { %@ }", [self class], self, _dictionary]; +} + +- (NSUInteger)count { + return _dictionary.count; +} + +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(NSString *key, int32_t value, BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + block(aKey, [aValue intValue], stop); + }]; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + NSUInteger count = _dictionary.count; + if (count == 0) { + return 0; + } + + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + __block size_t result = 0; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + }]; + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + GPBDataType keyDataType = field.mapKeyDataType; + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + #pragma unused(stop) + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictStringFieldSize(aKey, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize([aValue intValue], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictStringField(outputStream, aKey, kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, [aValue intValue], kMapValueFieldNumber, valueDataType); + }]; +} + +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType { + size_t msgSize = ComputeDictStringFieldSize(key->valueString, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize(value, kMapValueFieldNumber, GPBDataTypeEnum); + NSMutableData *data = [NSMutableData dataWithLength:msgSize]; + GPBCodedOutputStream *outputStream = [[GPBCodedOutputStream alloc] initWithData:data]; + WriteDictStringField(outputStream, key->valueString, kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, value, kMapValueFieldNumber, GPBDataTypeEnum); + [outputStream release]; + return data; +} +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + [_dictionary setObject:@(value->valueEnum) forKey:key->valueString]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + [self enumerateKeysAndRawValuesUsingBlock:^(NSString *key, int32_t value, BOOL *stop) { + #pragma unused(stop) + block(key, @(value)); + }]; +} + +- (BOOL)getEnum:(int32_t *)value forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && value) { + int32_t result = [wrapped intValue]; + if (!_validationFunc(result)) { + result = kGPBUnrecognizedEnumeratorValue; + } + *value = result; + } + return (wrapped != NULL); +} + +- (BOOL)getRawValue:(int32_t *)rawValue forKey:(NSString *)key { + NSNumber *wrapped = [_dictionary objectForKey:key]; + if (wrapped && rawValue) { + *rawValue = [wrapped intValue]; + } + return (wrapped != NULL); +} + +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(NSString *key, int32_t value, BOOL *stop))block { + GPBEnumValidationFunc func = _validationFunc; + [_dictionary enumerateKeysAndObjectsUsingBlock:^(NSString *aKey, + NSNumber *aValue, + BOOL *stop) { + int32_t unwrapped = [aValue intValue]; + if (!func(unwrapped)) { + unwrapped = kGPBUnrecognizedEnumeratorValue; + } + block(aKey, unwrapped, stop); + }]; +} + +- (void)addRawEntriesFromDictionary:(GPBStringEnumDictionary *)otherDictionary { + if (otherDictionary) { + [_dictionary addEntriesFromDictionary:otherDictionary->_dictionary]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setRawValue:(int32_t)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeEnumForKey:(NSString *)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +- (void)removeAll { + [_dictionary removeAllObjects]; +} + +- (void)setEnum:(int32_t)value forKey:(NSString *)key { + if (!key) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil key to a Dictionary"]; + } + if (!_validationFunc(value)) { + [NSException raise:NSInvalidArgumentException + format:@"GPBStringEnumDictionary: Attempt to set an unknown enum value (%d)", + value]; + } + + [_dictionary setObject:@(value) forKey:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +@end + +//%PDDM-EXPAND-END (5 expansions) + + +//%PDDM-EXPAND DICTIONARY_BOOL_KEY_TO_POD_IMPL(UInt32, uint32_t) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool -> UInt32 + +@implementation GPBBoolUInt32Dictionary { + @package + uint32_t _values[2]; + BOOL _valueSet[2]; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32:(uint32_t)value + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBBoolUInt32Dictionary*)[self alloc] initWithUInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt32s:(const uint32_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBBoolUInt32Dictionary*)[self alloc] initWithUInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolUInt32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBBoolUInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt32s:(const uint32_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + for (NSUInteger i = 0; i < count; ++i) { + int idx = keys[i] ? 1 : 0; + _values[idx] = values[i]; + _valueSet[idx] = YES; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolUInt32Dictionary *)dictionary { + self = [self initWithUInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + for (int i = 0; i < 2; ++i) { + if (dictionary->_valueSet[i]) { + _values[i] = dictionary->_values[i]; + _valueSet[i] = YES; + } + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt32s:NULL forKeys:NULL count:0]; +} + +#if !defined(NS_BLOCK_ASSERTIONS) +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [super dealloc]; +} +#endif // !defined(NS_BLOCK_ASSERTIONS) + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolUInt32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolUInt32Dictionary class]]) { + return NO; + } + GPBBoolUInt32Dictionary *otherDictionary = other; + if ((_valueSet[0] != otherDictionary->_valueSet[0]) || + (_valueSet[1] != otherDictionary->_valueSet[1])) { + return NO; + } + if ((_valueSet[0] && (_values[0] != otherDictionary->_values[0])) || + (_valueSet[1] && (_values[1] != otherDictionary->_values[1]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if (_valueSet[0]) { + [result appendFormat:@"NO: %u", _values[0]]; + } + if (_valueSet[1]) { + [result appendFormat:@"YES: %u", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (BOOL)getUInt32:(uint32_t *)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (value) { + *value = _values[idx]; + } + return YES; + } + return NO; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + _values[idx] = value->valueUInt32; + _valueSet[idx] = YES; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_valueSet[0]) { + block(@"false", [NSString stringWithFormat:@"%u", _values[0]]); + } + if (_valueSet[1]) { + block(@"true", [NSString stringWithFormat:@"%u", _values[1]]); + } +} + +- (void)enumerateKeysAndUInt32sUsingBlock: + (void (^)(BOOL key, uint32_t value, BOOL *stop))block { + BOOL stop = NO; + if (_valueSet[0]) { + block(NO, _values[0], &stop); + } + if (!stop && _valueSet[1]) { + block(YES, _values[1], &stop); + } +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictUInt32FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictUInt32FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictUInt32Field(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)addEntriesFromDictionary:(GPBBoolUInt32Dictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_valueSet[i]) { + _valueSet[i] = YES; + _values[i] = otherDictionary->_values[i]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt32:(uint32_t)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + _values[idx] = value; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt32ForKey:(BOOL)aKey { + _valueSet[aKey ? 1 : 0] = NO; +} + +- (void)removeAll { + _valueSet[0] = NO; + _valueSet[1] = NO; +} + +@end + +//%PDDM-EXPAND DICTIONARY_BOOL_KEY_TO_POD_IMPL(Int32, int32_t) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool -> Int32 + +@implementation GPBBoolInt32Dictionary { + @package + int32_t _values[2]; + BOOL _valueSet[2]; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt32s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt32:(int32_t)value + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBBoolInt32Dictionary*)[self alloc] initWithInt32s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt32s:(const int32_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt32s:forKeys:count: + // on to get the type correct. + return [[(GPBBoolInt32Dictionary*)[self alloc] initWithInt32s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolInt32Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBBoolInt32Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt32s:(const int32_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + for (NSUInteger i = 0; i < count; ++i) { + int idx = keys[i] ? 1 : 0; + _values[idx] = values[i]; + _valueSet[idx] = YES; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolInt32Dictionary *)dictionary { + self = [self initWithInt32s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + for (int i = 0; i < 2; ++i) { + if (dictionary->_valueSet[i]) { + _values[i] = dictionary->_values[i]; + _valueSet[i] = YES; + } + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt32s:NULL forKeys:NULL count:0]; +} + +#if !defined(NS_BLOCK_ASSERTIONS) +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [super dealloc]; +} +#endif // !defined(NS_BLOCK_ASSERTIONS) + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolInt32Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolInt32Dictionary class]]) { + return NO; + } + GPBBoolInt32Dictionary *otherDictionary = other; + if ((_valueSet[0] != otherDictionary->_valueSet[0]) || + (_valueSet[1] != otherDictionary->_valueSet[1])) { + return NO; + } + if ((_valueSet[0] && (_values[0] != otherDictionary->_values[0])) || + (_valueSet[1] && (_values[1] != otherDictionary->_values[1]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if (_valueSet[0]) { + [result appendFormat:@"NO: %d", _values[0]]; + } + if (_valueSet[1]) { + [result appendFormat:@"YES: %d", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (BOOL)getInt32:(int32_t *)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (value) { + *value = _values[idx]; + } + return YES; + } + return NO; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + _values[idx] = value->valueInt32; + _valueSet[idx] = YES; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_valueSet[0]) { + block(@"false", [NSString stringWithFormat:@"%d", _values[0]]); + } + if (_valueSet[1]) { + block(@"true", [NSString stringWithFormat:@"%d", _values[1]]); + } +} + +- (void)enumerateKeysAndInt32sUsingBlock: + (void (^)(BOOL key, int32_t value, BOOL *stop))block { + BOOL stop = NO; + if (_valueSet[0]) { + block(NO, _values[0], &stop); + } + if (!stop && _valueSet[1]) { + block(YES, _values[1], &stop); + } +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictInt32FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictInt32FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictInt32Field(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)addEntriesFromDictionary:(GPBBoolInt32Dictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_valueSet[i]) { + _valueSet[i] = YES; + _values[i] = otherDictionary->_values[i]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt32:(int32_t)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + _values[idx] = value; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt32ForKey:(BOOL)aKey { + _valueSet[aKey ? 1 : 0] = NO; +} + +- (void)removeAll { + _valueSet[0] = NO; + _valueSet[1] = NO; +} + +@end + +//%PDDM-EXPAND DICTIONARY_BOOL_KEY_TO_POD_IMPL(UInt64, uint64_t) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool -> UInt64 + +@implementation GPBBoolUInt64Dictionary { + @package + uint64_t _values[2]; + BOOL _valueSet[2]; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithUInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64:(uint64_t)value + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBBoolUInt64Dictionary*)[self alloc] initWithUInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithUInt64s:(const uint64_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithUInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBBoolUInt64Dictionary*)[self alloc] initWithUInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolUInt64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBBoolUInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithUInt64s:(const uint64_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + for (NSUInteger i = 0; i < count; ++i) { + int idx = keys[i] ? 1 : 0; + _values[idx] = values[i]; + _valueSet[idx] = YES; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolUInt64Dictionary *)dictionary { + self = [self initWithUInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + for (int i = 0; i < 2; ++i) { + if (dictionary->_valueSet[i]) { + _values[i] = dictionary->_values[i]; + _valueSet[i] = YES; + } + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithUInt64s:NULL forKeys:NULL count:0]; +} + +#if !defined(NS_BLOCK_ASSERTIONS) +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [super dealloc]; +} +#endif // !defined(NS_BLOCK_ASSERTIONS) + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolUInt64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolUInt64Dictionary class]]) { + return NO; + } + GPBBoolUInt64Dictionary *otherDictionary = other; + if ((_valueSet[0] != otherDictionary->_valueSet[0]) || + (_valueSet[1] != otherDictionary->_valueSet[1])) { + return NO; + } + if ((_valueSet[0] && (_values[0] != otherDictionary->_values[0])) || + (_valueSet[1] && (_values[1] != otherDictionary->_values[1]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if (_valueSet[0]) { + [result appendFormat:@"NO: %llu", _values[0]]; + } + if (_valueSet[1]) { + [result appendFormat:@"YES: %llu", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (BOOL)getUInt64:(uint64_t *)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (value) { + *value = _values[idx]; + } + return YES; + } + return NO; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + _values[idx] = value->valueUInt64; + _valueSet[idx] = YES; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_valueSet[0]) { + block(@"false", [NSString stringWithFormat:@"%llu", _values[0]]); + } + if (_valueSet[1]) { + block(@"true", [NSString stringWithFormat:@"%llu", _values[1]]); + } +} + +- (void)enumerateKeysAndUInt64sUsingBlock: + (void (^)(BOOL key, uint64_t value, BOOL *stop))block { + BOOL stop = NO; + if (_valueSet[0]) { + block(NO, _values[0], &stop); + } + if (!stop && _valueSet[1]) { + block(YES, _values[1], &stop); + } +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictUInt64FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictUInt64FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictUInt64Field(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)addEntriesFromDictionary:(GPBBoolUInt64Dictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_valueSet[i]) { + _valueSet[i] = YES; + _values[i] = otherDictionary->_values[i]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setUInt64:(uint64_t)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + _values[idx] = value; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeUInt64ForKey:(BOOL)aKey { + _valueSet[aKey ? 1 : 0] = NO; +} + +- (void)removeAll { + _valueSet[0] = NO; + _valueSet[1] = NO; +} + +@end + +//%PDDM-EXPAND DICTIONARY_BOOL_KEY_TO_POD_IMPL(Int64, int64_t) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool -> Int64 + +@implementation GPBBoolInt64Dictionary { + @package + int64_t _values[2]; + BOOL _valueSet[2]; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithInt64s:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithInt64:(int64_t)value + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBBoolInt64Dictionary*)[self alloc] initWithInt64s:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithInt64s:(const int64_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithInt64s:forKeys:count: + // on to get the type correct. + return [[(GPBBoolInt64Dictionary*)[self alloc] initWithInt64s:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolInt64Dictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBBoolInt64Dictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithInt64s:(const int64_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + for (NSUInteger i = 0; i < count; ++i) { + int idx = keys[i] ? 1 : 0; + _values[idx] = values[i]; + _valueSet[idx] = YES; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolInt64Dictionary *)dictionary { + self = [self initWithInt64s:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + for (int i = 0; i < 2; ++i) { + if (dictionary->_valueSet[i]) { + _values[i] = dictionary->_values[i]; + _valueSet[i] = YES; + } + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithInt64s:NULL forKeys:NULL count:0]; +} + +#if !defined(NS_BLOCK_ASSERTIONS) +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [super dealloc]; +} +#endif // !defined(NS_BLOCK_ASSERTIONS) + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolInt64Dictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolInt64Dictionary class]]) { + return NO; + } + GPBBoolInt64Dictionary *otherDictionary = other; + if ((_valueSet[0] != otherDictionary->_valueSet[0]) || + (_valueSet[1] != otherDictionary->_valueSet[1])) { + return NO; + } + if ((_valueSet[0] && (_values[0] != otherDictionary->_values[0])) || + (_valueSet[1] && (_values[1] != otherDictionary->_values[1]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if (_valueSet[0]) { + [result appendFormat:@"NO: %lld", _values[0]]; + } + if (_valueSet[1]) { + [result appendFormat:@"YES: %lld", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (BOOL)getInt64:(int64_t *)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (value) { + *value = _values[idx]; + } + return YES; + } + return NO; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + _values[idx] = value->valueInt64; + _valueSet[idx] = YES; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_valueSet[0]) { + block(@"false", [NSString stringWithFormat:@"%lld", _values[0]]); + } + if (_valueSet[1]) { + block(@"true", [NSString stringWithFormat:@"%lld", _values[1]]); + } +} + +- (void)enumerateKeysAndInt64sUsingBlock: + (void (^)(BOOL key, int64_t value, BOOL *stop))block { + BOOL stop = NO; + if (_valueSet[0]) { + block(NO, _values[0], &stop); + } + if (!stop && _valueSet[1]) { + block(YES, _values[1], &stop); + } +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictInt64FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictInt64FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictInt64Field(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)addEntriesFromDictionary:(GPBBoolInt64Dictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_valueSet[i]) { + _valueSet[i] = YES; + _values[i] = otherDictionary->_values[i]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setInt64:(int64_t)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + _values[idx] = value; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeInt64ForKey:(BOOL)aKey { + _valueSet[aKey ? 1 : 0] = NO; +} + +- (void)removeAll { + _valueSet[0] = NO; + _valueSet[1] = NO; +} + +@end + +//%PDDM-EXPAND DICTIONARY_BOOL_KEY_TO_POD_IMPL(Bool, BOOL) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool -> Bool + +@implementation GPBBoolBoolDictionary { + @package + BOOL _values[2]; + BOOL _valueSet[2]; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithBools:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithBool:(BOOL)value + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBBoolBoolDictionary*)[self alloc] initWithBools:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithBools:(const BOOL [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithBools:forKeys:count: + // on to get the type correct. + return [[(GPBBoolBoolDictionary*)[self alloc] initWithBools:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolBoolDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBBoolBoolDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithBools:(const BOOL [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + for (NSUInteger i = 0; i < count; ++i) { + int idx = keys[i] ? 1 : 0; + _values[idx] = values[i]; + _valueSet[idx] = YES; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolBoolDictionary *)dictionary { + self = [self initWithBools:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + for (int i = 0; i < 2; ++i) { + if (dictionary->_valueSet[i]) { + _values[i] = dictionary->_values[i]; + _valueSet[i] = YES; + } + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithBools:NULL forKeys:NULL count:0]; +} + +#if !defined(NS_BLOCK_ASSERTIONS) +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [super dealloc]; +} +#endif // !defined(NS_BLOCK_ASSERTIONS) + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolBoolDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolBoolDictionary class]]) { + return NO; + } + GPBBoolBoolDictionary *otherDictionary = other; + if ((_valueSet[0] != otherDictionary->_valueSet[0]) || + (_valueSet[1] != otherDictionary->_valueSet[1])) { + return NO; + } + if ((_valueSet[0] && (_values[0] != otherDictionary->_values[0])) || + (_valueSet[1] && (_values[1] != otherDictionary->_values[1]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if (_valueSet[0]) { + [result appendFormat:@"NO: %d", _values[0]]; + } + if (_valueSet[1]) { + [result appendFormat:@"YES: %d", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (BOOL)getBool:(BOOL *)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (value) { + *value = _values[idx]; + } + return YES; + } + return NO; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + _values[idx] = value->valueBool; + _valueSet[idx] = YES; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_valueSet[0]) { + block(@"false", (_values[0] ? @"true" : @"false")); + } + if (_valueSet[1]) { + block(@"true", (_values[1] ? @"true" : @"false")); + } +} + +- (void)enumerateKeysAndBoolsUsingBlock: + (void (^)(BOOL key, BOOL value, BOOL *stop))block { + BOOL stop = NO; + if (_valueSet[0]) { + block(NO, _values[0], &stop); + } + if (!stop && _valueSet[1]) { + block(YES, _values[1], &stop); + } +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictBoolFieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictBoolFieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictBoolField(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)addEntriesFromDictionary:(GPBBoolBoolDictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_valueSet[i]) { + _valueSet[i] = YES; + _values[i] = otherDictionary->_values[i]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setBool:(BOOL)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + _values[idx] = value; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeBoolForKey:(BOOL)aKey { + _valueSet[aKey ? 1 : 0] = NO; +} + +- (void)removeAll { + _valueSet[0] = NO; + _valueSet[1] = NO; +} + +@end + +//%PDDM-EXPAND DICTIONARY_BOOL_KEY_TO_POD_IMPL(Float, float) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool -> Float + +@implementation GPBBoolFloatDictionary { + @package + float _values[2]; + BOOL _valueSet[2]; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithFloats:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithFloat:(float)value + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBBoolFloatDictionary*)[self alloc] initWithFloats:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithFloats:(const float [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithFloats:forKeys:count: + // on to get the type correct. + return [[(GPBBoolFloatDictionary*)[self alloc] initWithFloats:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolFloatDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBBoolFloatDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithFloats:(const float [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + for (NSUInteger i = 0; i < count; ++i) { + int idx = keys[i] ? 1 : 0; + _values[idx] = values[i]; + _valueSet[idx] = YES; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolFloatDictionary *)dictionary { + self = [self initWithFloats:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + for (int i = 0; i < 2; ++i) { + if (dictionary->_valueSet[i]) { + _values[i] = dictionary->_values[i]; + _valueSet[i] = YES; + } + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithFloats:NULL forKeys:NULL count:0]; +} + +#if !defined(NS_BLOCK_ASSERTIONS) +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [super dealloc]; +} +#endif // !defined(NS_BLOCK_ASSERTIONS) + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolFloatDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolFloatDictionary class]]) { + return NO; + } + GPBBoolFloatDictionary *otherDictionary = other; + if ((_valueSet[0] != otherDictionary->_valueSet[0]) || + (_valueSet[1] != otherDictionary->_valueSet[1])) { + return NO; + } + if ((_valueSet[0] && (_values[0] != otherDictionary->_values[0])) || + (_valueSet[1] && (_values[1] != otherDictionary->_values[1]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if (_valueSet[0]) { + [result appendFormat:@"NO: %f", _values[0]]; + } + if (_valueSet[1]) { + [result appendFormat:@"YES: %f", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (BOOL)getFloat:(float *)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (value) { + *value = _values[idx]; + } + return YES; + } + return NO; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + _values[idx] = value->valueFloat; + _valueSet[idx] = YES; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_valueSet[0]) { + block(@"false", [NSString stringWithFormat:@"%.*g", FLT_DIG, _values[0]]); + } + if (_valueSet[1]) { + block(@"true", [NSString stringWithFormat:@"%.*g", FLT_DIG, _values[1]]); + } +} + +- (void)enumerateKeysAndFloatsUsingBlock: + (void (^)(BOOL key, float value, BOOL *stop))block { + BOOL stop = NO; + if (_valueSet[0]) { + block(NO, _values[0], &stop); + } + if (!stop && _valueSet[1]) { + block(YES, _values[1], &stop); + } +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictFloatFieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictFloatFieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictFloatField(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)addEntriesFromDictionary:(GPBBoolFloatDictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_valueSet[i]) { + _valueSet[i] = YES; + _values[i] = otherDictionary->_values[i]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setFloat:(float)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + _values[idx] = value; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeFloatForKey:(BOOL)aKey { + _valueSet[aKey ? 1 : 0] = NO; +} + +- (void)removeAll { + _valueSet[0] = NO; + _valueSet[1] = NO; +} + +@end + +//%PDDM-EXPAND DICTIONARY_BOOL_KEY_TO_POD_IMPL(Double, double) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool -> Double + +@implementation GPBBoolDoubleDictionary { + @package + double _values[2]; + BOOL _valueSet[2]; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithDoubles:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithDouble:(double)value + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBBoolDoubleDictionary*)[self alloc] initWithDoubles:&value + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithDoubles:(const double [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithDoubles:forKeys:count: + // on to get the type correct. + return [[(GPBBoolDoubleDictionary*)[self alloc] initWithDoubles:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolDoubleDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBBoolDoubleDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithDoubles:(const double [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + for (NSUInteger i = 0; i < count; ++i) { + int idx = keys[i] ? 1 : 0; + _values[idx] = values[i]; + _valueSet[idx] = YES; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolDoubleDictionary *)dictionary { + self = [self initWithDoubles:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + for (int i = 0; i < 2; ++i) { + if (dictionary->_valueSet[i]) { + _values[i] = dictionary->_values[i]; + _valueSet[i] = YES; + } + } + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithDoubles:NULL forKeys:NULL count:0]; +} + +#if !defined(NS_BLOCK_ASSERTIONS) +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [super dealloc]; +} +#endif // !defined(NS_BLOCK_ASSERTIONS) + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolDoubleDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolDoubleDictionary class]]) { + return NO; + } + GPBBoolDoubleDictionary *otherDictionary = other; + if ((_valueSet[0] != otherDictionary->_valueSet[0]) || + (_valueSet[1] != otherDictionary->_valueSet[1])) { + return NO; + } + if ((_valueSet[0] && (_values[0] != otherDictionary->_values[0])) || + (_valueSet[1] && (_values[1] != otherDictionary->_values[1]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if (_valueSet[0]) { + [result appendFormat:@"NO: %lf", _values[0]]; + } + if (_valueSet[1]) { + [result appendFormat:@"YES: %lf", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (BOOL)getDouble:(double *)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (value) { + *value = _values[idx]; + } + return YES; + } + return NO; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + _values[idx] = value->valueDouble; + _valueSet[idx] = YES; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_valueSet[0]) { + block(@"false", [NSString stringWithFormat:@"%.*lg", DBL_DIG, _values[0]]); + } + if (_valueSet[1]) { + block(@"true", [NSString stringWithFormat:@"%.*lg", DBL_DIG, _values[1]]); + } +} + +- (void)enumerateKeysAndDoublesUsingBlock: + (void (^)(BOOL key, double value, BOOL *stop))block { + BOOL stop = NO; + if (_valueSet[0]) { + block(NO, _values[0], &stop); + } + if (!stop && _valueSet[1]) { + block(YES, _values[1], &stop); + } +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictDoubleFieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictDoubleFieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictDoubleField(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)addEntriesFromDictionary:(GPBBoolDoubleDictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_valueSet[i]) { + _valueSet[i] = YES; + _values[i] = otherDictionary->_values[i]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setDouble:(double)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + _values[idx] = value; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeDoubleForKey:(BOOL)aKey { + _valueSet[aKey ? 1 : 0] = NO; +} + +- (void)removeAll { + _valueSet[0] = NO; + _valueSet[1] = NO; +} + +@end + +//%PDDM-EXPAND DICTIONARY_BOOL_KEY_TO_OBJECT_IMPL(Object, id) +// This block of code is generated, do not edit it directly. + +#pragma mark - Bool -> Object + +@implementation GPBBoolObjectDictionary { + @package + id _values[2]; +} + ++ (instancetype)dictionary { + return [[[self alloc] initWithObjects:NULL forKeys:NULL count:0] autorelease]; +} + ++ (instancetype)dictionaryWithObject:(id)object + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBBoolObjectDictionary*)[self alloc] initWithObjects:&object + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithObjects:(const id [])objects + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithObjects:forKeys:count: + // on to get the type correct. + return [[(GPBBoolObjectDictionary*)[self alloc] initWithObjects:objects + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolObjectDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithDictionary: + // on to get the type correct. + return [[(GPBBoolObjectDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithCapacity:(NSUInteger)numItems { + return [[[self alloc] initWithCapacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + for (NSUInteger i = 0; i < count; ++i) { + if (!objects[i]) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + int idx = keys[i] ? 1 : 0; + [_values[idx] release]; + _values[idx] = (id)[objects[i] retain]; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolObjectDictionary *)dictionary { + self = [self initWithObjects:NULL forKeys:NULL count:0]; + if (self) { + if (dictionary) { + _values[0] = [dictionary->_values[0] retain]; + _values[1] = [dictionary->_values[1] retain]; + } + } + return self; +} + +- (instancetype)initWithCapacity:(NSUInteger)numItems { + #pragma unused(numItems) + return [self initWithObjects:NULL forKeys:NULL count:0]; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_values[0] release]; + [_values[1] release]; + [super dealloc]; +} + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolObjectDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolObjectDictionary class]]) { + return NO; + } + GPBBoolObjectDictionary *otherDictionary = other; + if (((_values[0] != nil) != (otherDictionary->_values[0] != nil)) || + ((_values[1] != nil) != (otherDictionary->_values[1] != nil))) { + return NO; + } + if (((_values[0] != nil) && (![_values[0] isEqual:otherDictionary->_values[0]])) || + ((_values[1] != nil) && (![_values[1] isEqual:otherDictionary->_values[1]]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return ((_values[0] != nil) ? 1 : 0) + ((_values[1] != nil) ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if ((_values[0] != nil)) { + [result appendFormat:@"NO: %@", _values[0]]; + } + if ((_values[1] != nil)) { + [result appendFormat:@"YES: %@", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return ((_values[0] != nil) ? 1 : 0) + ((_values[1] != nil) ? 1 : 0); +} + +- (id)objectForKey:(BOOL)key { + return _values[key ? 1 : 0]; +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + [_values[idx] release]; + _values[idx] = [value->valueString retain]; +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_values[0] != nil) { + block(@"false", _values[0]); + } + if ((_values[1] != nil)) { + block(@"true", _values[1]); + } +} + +- (void)enumerateKeysAndObjectsUsingBlock: + (void (^)(BOOL key, id object, BOOL *stop))block { + BOOL stop = NO; + if (_values[0] != nil) { + block(NO, _values[0], &stop); + } + if (!stop && (_values[1] != nil)) { + block(YES, _values[1], &stop); + } +} + +- (BOOL)isInitialized { + if (_values[0] && ![_values[0] isInitialized]) { + return NO; + } + if (_values[1] && ![_values[1] isInitialized]) { + return NO; + } + return YES; +} + +- (instancetype)deepCopyWithZone:(NSZone *)zone { + GPBBoolObjectDictionary *newDict = + [[GPBBoolObjectDictionary alloc] init]; + for (int i = 0; i < 2; ++i) { + if (_values[i] != nil) { + newDict->_values[i] = [_values[i] copyWithZone:zone]; + } + } + return newDict; +} + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_values[i] != nil) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictObjectFieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_values[i] != nil) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictObjectFieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictObjectField(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)addEntriesFromDictionary:(GPBBoolObjectDictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_values[i] != nil) { + [_values[i] release]; + _values[i] = [otherDictionary->_values[i] retain]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setObject:(id)object forKey:(BOOL)key { + if (!object) { + [NSException raise:NSInvalidArgumentException + format:@"Attempting to add nil object to a Dictionary"]; + } + int idx = (key ? 1 : 0); + [_values[idx] release]; + _values[idx] = [object retain]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeObjectForKey:(BOOL)aKey { + int idx = (aKey ? 1 : 0); + [_values[idx] release]; + _values[idx] = nil; +} + +- (void)removeAll { + for (int i = 0; i < 2; ++i) { + [_values[i] release]; + _values[i] = nil; + } +} + +@end + +//%PDDM-EXPAND-END (8 expansions) + +#pragma mark - Bool -> Enum + +@implementation GPBBoolEnumDictionary { + @package + GPBEnumValidationFunc _validationFunc; + int32_t _values[2]; + BOOL _valueSet[2]; +} + +@synthesize validationFunc = _validationFunc; + ++ (instancetype)dictionary { + return [[[self alloc] initWithValidationFunction:NULL + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func { + return [[[self alloc] initWithValidationFunction:func + rawValues:NULL + forKeys:NULL + count:0] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValue:(int32_t)rawValue + forKey:(BOOL)key { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBBoolEnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:&rawValue + forKeys:&key + count:1] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])values + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBBoolEnumDictionary*)[self alloc] initWithValidationFunction:func + rawValues:values + forKeys:keys + count:count] autorelease]; +} + ++ (instancetype)dictionaryWithDictionary:(GPBBoolEnumDictionary *)dictionary { + // Cast is needed so the compiler knows what class we are invoking initWithValues:forKeys:count: + // on to get the type correct. + return [[(GPBBoolEnumDictionary*)[self alloc] initWithDictionary:dictionary] autorelease]; +} + ++ (instancetype)dictionaryWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { + return [[[self alloc] initWithValidationFunction:func capacity:numItems] autorelease]; +} + +- (instancetype)init { + return [self initWithValidationFunction:NULL rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func { + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + rawValues:(const int32_t [])rawValues + forKeys:(const BOOL [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _validationFunc = (func != NULL ? func : DictDefault_IsValidValue); + for (NSUInteger i = 0; i < count; ++i) { + int idx = keys[i] ? 1 : 0; + _values[idx] = rawValues[i]; + _valueSet[idx] = YES; + } + } + return self; +} + +- (instancetype)initWithDictionary:(GPBBoolEnumDictionary *)dictionary { + self = [self initWithValidationFunction:dictionary.validationFunc + rawValues:NULL + forKeys:NULL + count:0]; + if (self) { + if (dictionary) { + for (int i = 0; i < 2; ++i) { + if (dictionary->_valueSet[i]) { + _values[i] = dictionary->_values[i]; + _valueSet[i] = YES; + } + } + } + } + return self; +} + +- (instancetype)initWithValidationFunction:(GPBEnumValidationFunc)func + capacity:(NSUInteger)numItems { +#pragma unused(numItems) + return [self initWithValidationFunction:func rawValues:NULL forKeys:NULL count:0]; +} + +#if !defined(NS_BLOCK_ASSERTIONS) +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [super dealloc]; +} +#endif // !defined(NS_BLOCK_ASSERTIONS) + +- (instancetype)copyWithZone:(NSZone *)zone { + return [[GPBBoolEnumDictionary allocWithZone:zone] initWithDictionary:self]; +} + +- (BOOL)isEqual:(id)other { + if (self == other) { + return YES; + } + if (![other isKindOfClass:[GPBBoolEnumDictionary class]]) { + return NO; + } + GPBBoolEnumDictionary *otherDictionary = other; + if ((_valueSet[0] != otherDictionary->_valueSet[0]) || + (_valueSet[1] != otherDictionary->_valueSet[1])) { + return NO; + } + if ((_valueSet[0] && (_values[0] != otherDictionary->_values[0])) || + (_valueSet[1] && (_values[1] != otherDictionary->_values[1]))) { + return NO; + } + return YES; +} + +- (NSUInteger)hash { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (NSString *)description { + NSMutableString *result = [NSMutableString stringWithFormat:@"<%@ %p> {", [self class], self]; + if (_valueSet[0]) { + [result appendFormat:@"NO: %d", _values[0]]; + } + if (_valueSet[1]) { + [result appendFormat:@"YES: %d", _values[1]]; + } + [result appendString:@" }"]; + return result; +} + +- (NSUInteger)count { + return (_valueSet[0] ? 1 : 0) + (_valueSet[1] ? 1 : 0); +} + +- (BOOL)getEnum:(int32_t*)value forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (value) { + int32_t result = _values[idx]; + if (!_validationFunc(result)) { + result = kGPBUnrecognizedEnumeratorValue; + } + *value = result; + } + return YES; + } + return NO; +} + +- (BOOL)getRawValue:(int32_t*)rawValue forKey:(BOOL)key { + int idx = (key ? 1 : 0); + if (_valueSet[idx]) { + if (rawValue) { + *rawValue = _values[idx]; + } + return YES; + } + return NO; +} + +- (void)enumerateKeysAndRawValuesUsingBlock: + (void (^)(BOOL key, int32_t value, BOOL *stop))block { + BOOL stop = NO; + if (_valueSet[0]) { + block(NO, _values[0], &stop); + } + if (!stop && _valueSet[1]) { + block(YES, _values[1], &stop); + } +} + +- (void)enumerateKeysAndEnumsUsingBlock: + (void (^)(BOOL key, int32_t rawValue, BOOL *stop))block { + BOOL stop = NO; + GPBEnumValidationFunc func = _validationFunc; + int32_t validatedValue; + if (_valueSet[0]) { + validatedValue = _values[0]; + if (!func(validatedValue)) { + validatedValue = kGPBUnrecognizedEnumeratorValue; + } + block(NO, validatedValue, &stop); + } + if (!stop && _valueSet[1]) { + validatedValue = _values[1]; + if (!func(validatedValue)) { + validatedValue = kGPBUnrecognizedEnumeratorValue; + } + block(YES, validatedValue, &stop); + } +} + +//%PDDM-EXPAND SERIAL_DATA_FOR_ENTRY_POD_Enum(Bool) +// This block of code is generated, do not edit it directly. + +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType { + size_t msgSize = ComputeDictBoolFieldSize(key->valueBool, kMapKeyFieldNumber, keyDataType); + msgSize += ComputeDictEnumFieldSize(value, kMapValueFieldNumber, GPBDataTypeEnum); + NSMutableData *data = [NSMutableData dataWithLength:msgSize]; + GPBCodedOutputStream *outputStream = [[GPBCodedOutputStream alloc] initWithData:data]; + WriteDictBoolField(outputStream, key->valueBool, kMapKeyFieldNumber, keyDataType); + WriteDictEnumField(outputStream, value, kMapValueFieldNumber, GPBDataTypeEnum); + [outputStream release]; + return data; +} + +//%PDDM-EXPAND-END SERIAL_DATA_FOR_ENTRY_POD_Enum(Bool) + +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSUInteger count = 0; + size_t result = 0; + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + ++count; + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictInt32FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + result += GPBComputeRawVarint32SizeForInteger(msgSize) + msgSize; + } + } + size_t tagSize = GPBComputeWireFormatTagSize(GPBFieldNumber(field), GPBDataTypeMessage); + result += tagSize * count; + return result; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field { + GPBDataType valueDataType = GPBGetFieldDataType(field); + uint32_t tag = GPBWireFormatMakeTag(GPBFieldNumber(field), GPBWireFormatLengthDelimited); + for (int i = 0; i < 2; ++i) { + if (_valueSet[i]) { + // Write the tag. + [outputStream writeInt32NoTag:tag]; + // Write the size of the message. + size_t msgSize = ComputeDictBoolFieldSize((i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + msgSize += ComputeDictInt32FieldSize(_values[i], kMapValueFieldNumber, valueDataType); + [outputStream writeInt32NoTag:(int32_t)msgSize]; + // Write the fields. + WriteDictBoolField(outputStream, (i == 1), kMapKeyFieldNumber, GPBDataTypeBool); + WriteDictInt32Field(outputStream, _values[i], kMapValueFieldNumber, valueDataType); + } + } +} + +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block { + if (_valueSet[0]) { + block(@"false", @(_values[0])); + } + if (_valueSet[1]) { + block(@"true", @(_values[1])); + } +} + +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key { + int idx = (key->valueBool ? 1 : 0); + _values[idx] = value->valueInt32; + _valueSet[idx] = YES; +} + +- (void)addRawEntriesFromDictionary:(GPBBoolEnumDictionary *)otherDictionary { + if (otherDictionary) { + for (int i = 0; i < 2; ++i) { + if (otherDictionary->_valueSet[i]) { + _valueSet[i] = YES; + _values[i] = otherDictionary->_values[i]; + } + } + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } + } +} + +- (void)setEnum:(int32_t)value forKey:(BOOL)key { + if (!_validationFunc(value)) { + [NSException raise:NSInvalidArgumentException + format:@"GPBBoolEnumDictionary: Attempt to set an unknown enum value (%d)", + value]; + } + int idx = (key ? 1 : 0); + _values[idx] = value; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)setRawValue:(int32_t)rawValue forKey:(BOOL)key { + int idx = (key ? 1 : 0); + _values[idx] = rawValue; + _valueSet[idx] = YES; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeEnumForKey:(BOOL)aKey { + _valueSet[aKey ? 1 : 0] = NO; +} + +- (void)removeAll { + _valueSet[0] = NO; + _valueSet[1] = NO; +} + +@end + +#pragma mark - NSDictionary Subclass + +@implementation GPBAutocreatedDictionary { + NSMutableDictionary *_dictionary; +} + +- (void)dealloc { + NSAssert(!_autocreator, + @"%@: Autocreator must be cleared before release, autocreator: %@", + [self class], _autocreator); + [_dictionary release]; + [super dealloc]; +} + +#pragma mark Required NSDictionary overrides + +- (instancetype)initWithObjects:(const id [])objects + forKeys:(const id<NSCopying> [])keys + count:(NSUInteger)count { + self = [super init]; + if (self) { + _dictionary = [[NSMutableDictionary alloc] initWithObjects:objects + forKeys:keys + count:count]; + } + return self; +} + +- (NSUInteger)count { + return [_dictionary count]; +} + +- (id)objectForKey:(id)aKey { + return [_dictionary objectForKey:aKey]; +} + +- (NSEnumerator *)keyEnumerator { + if (_dictionary == nil) { + _dictionary = [[NSMutableDictionary alloc] init]; + } + return [_dictionary keyEnumerator]; +} + +#pragma mark Required NSMutableDictionary overrides + +// Only need to call GPBAutocreatedDictionaryModified() when adding things +// since we only autocreate empty dictionaries. + +- (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey { + if (_dictionary == nil) { + _dictionary = [[NSMutableDictionary alloc] init]; + } + [_dictionary setObject:anObject forKey:aKey]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)removeObjectForKey:(id)aKey { + [_dictionary removeObjectForKey:aKey]; +} + +#pragma mark Extra things hooked + +- (id)copyWithZone:(NSZone *)zone { + if (_dictionary == nil) { + return [[NSMutableDictionary allocWithZone:zone] init]; + } + return [_dictionary copyWithZone:zone]; +} + +- (id)mutableCopyWithZone:(NSZone *)zone { + if (_dictionary == nil) { + return [[NSMutableDictionary allocWithZone:zone] init]; + } + return [_dictionary mutableCopyWithZone:zone]; +} + +// Not really needed, but subscripting is likely common enough it doesn't hurt +// to ensure it goes directly to the real NSMutableDictionary. +- (id)objectForKeyedSubscript:(id)key { + return [_dictionary objectForKeyedSubscript:key]; +} + +// Not really needed, but subscripting is likely common enough it doesn't hurt +// to ensure it goes directly to the real NSMutableDictionary. +- (void)setObject:(id)obj forKeyedSubscript:(id<NSCopying>)key { + if (_dictionary == nil) { + _dictionary = [[NSMutableDictionary alloc] init]; + } + [_dictionary setObject:obj forKeyedSubscript:key]; + if (_autocreator) { + GPBAutocreatedDictionaryModified(_autocreator, self); + } +} + +- (void)enumerateKeysAndObjectsUsingBlock:(void (^)(id key, + id obj, + BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsUsingBlock:block]; +} + +- (void)enumerateKeysAndObjectsWithOptions:(NSEnumerationOptions)opts + usingBlock:(void (^)(id key, + id obj, + BOOL *stop))block { + [_dictionary enumerateKeysAndObjectsWithOptions:opts usingBlock:block]; +} + +@end + +#pragma clang diagnostic pop diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary_PackagePrivate.h new file mode 100644 index 00000000..7b921e8e --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBDictionary_PackagePrivate.h @@ -0,0 +1,488 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBDictionary.h" + +@class GPBCodedInputStream; +@class GPBCodedOutputStream; +@class GPBExtensionRegistry; +@class GPBFieldDescriptor; + +@protocol GPBDictionaryInternalsProtocol +- (size_t)computeSerializedSizeAsField:(GPBFieldDescriptor *)field; +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)outputStream + asField:(GPBFieldDescriptor *)field; +- (void)setGPBGenericValue:(GPBGenericValue *)value + forGPBGenericValueKey:(GPBGenericValue *)key; +- (void)enumerateForTextFormat:(void (^)(id keyObj, id valueObj))block; +@end + +//%PDDM-DEFINE DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(KEY_NAME) +//%DICTIONARY_POD_PRIV_INTERFACES_FOR_KEY(KEY_NAME) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Object, Object) +//%PDDM-DEFINE DICTIONARY_POD_PRIV_INTERFACES_FOR_KEY(KEY_NAME) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, UInt32, Basic) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Int32, Basic) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, UInt64, Basic) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Int64, Basic) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Bool, Basic) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Float, Basic) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Double, Basic) +//%DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, Enum, Enum) + +//%PDDM-DEFINE DICTIONARY_PRIVATE_INTERFACES(KEY_NAME, VALUE_NAME, HELPER) +//%@interface GPB##KEY_NAME##VALUE_NAME##Dictionary () <GPBDictionaryInternalsProtocol> { +//% @package +//% GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +//%} +//%EXTRA_DICTIONARY_PRIVATE_INTERFACES_##HELPER()@end +//% + +//%PDDM-DEFINE EXTRA_DICTIONARY_PRIVATE_INTERFACES_Basic() +// Empty +//%PDDM-DEFINE EXTRA_DICTIONARY_PRIVATE_INTERFACES_Object() +//%- (BOOL)isInitialized; +//%- (instancetype)deepCopyWithZone:(NSZone *)zone +//% __attribute__((ns_returns_retained)); +//% +//%PDDM-DEFINE EXTRA_DICTIONARY_PRIVATE_INTERFACES_Enum() +//%- (NSData *)serializedDataForUnknownValue:(int32_t)value +//% forKey:(GPBGenericValue *)key +//% keyDataType:(GPBDataType)keyDataType; +//% + +//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(UInt32) +// This block of code is generated, do not edit it directly. + +@interface GPBUInt32UInt32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt32Int32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt32UInt64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt32Int64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt32BoolDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt32FloatDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt32DoubleDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt32EnumDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType; +@end + +@interface GPBUInt32ObjectDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (BOOL)isInitialized; +- (instancetype)deepCopyWithZone:(NSZone *)zone + __attribute__((ns_returns_retained)); +@end + +//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Int32) +// This block of code is generated, do not edit it directly. + +@interface GPBInt32UInt32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt32Int32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt32UInt64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt32Int64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt32BoolDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt32FloatDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt32DoubleDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt32EnumDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType; +@end + +@interface GPBInt32ObjectDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (BOOL)isInitialized; +- (instancetype)deepCopyWithZone:(NSZone *)zone + __attribute__((ns_returns_retained)); +@end + +//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(UInt64) +// This block of code is generated, do not edit it directly. + +@interface GPBUInt64UInt32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt64Int32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt64UInt64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt64Int64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt64BoolDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt64FloatDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt64DoubleDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBUInt64EnumDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType; +@end + +@interface GPBUInt64ObjectDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (BOOL)isInitialized; +- (instancetype)deepCopyWithZone:(NSZone *)zone + __attribute__((ns_returns_retained)); +@end + +//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Int64) +// This block of code is generated, do not edit it directly. + +@interface GPBInt64UInt32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt64Int32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt64UInt64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt64Int64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt64BoolDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt64FloatDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt64DoubleDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBInt64EnumDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType; +@end + +@interface GPBInt64ObjectDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (BOOL)isInitialized; +- (instancetype)deepCopyWithZone:(NSZone *)zone + __attribute__((ns_returns_retained)); +@end + +//%PDDM-EXPAND DICTIONARY_PRIV_INTERFACES_FOR_POD_KEY(Bool) +// This block of code is generated, do not edit it directly. + +@interface GPBBoolUInt32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBBoolInt32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBBoolUInt64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBBoolInt64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBBoolBoolDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBBoolFloatDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBBoolDoubleDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBBoolEnumDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType; +@end + +@interface GPBBoolObjectDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (BOOL)isInitialized; +- (instancetype)deepCopyWithZone:(NSZone *)zone + __attribute__((ns_returns_retained)); +@end + +//%PDDM-EXPAND DICTIONARY_POD_PRIV_INTERFACES_FOR_KEY(String) +// This block of code is generated, do not edit it directly. + +@interface GPBStringUInt32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBStringInt32Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBStringUInt64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBStringInt64Dictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBStringBoolDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBStringFloatDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBStringDoubleDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +@interface GPBStringEnumDictionary () <GPBDictionaryInternalsProtocol> { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +- (NSData *)serializedDataForUnknownValue:(int32_t)value + forKey:(GPBGenericValue *)key + keyDataType:(GPBDataType)keyDataType; +@end + +//%PDDM-EXPAND-END (6 expansions) + +#pragma mark - NSDictionary Subclass + +@interface GPBAutocreatedDictionary : NSMutableDictionary { + @package + GPB_UNSAFE_UNRETAINED GPBMessage *_autocreator; +} +@end + +#pragma mark - Helpers + +CF_EXTERN_C_BEGIN + +// Helper to compute size when an NSDictionary is used for the map instead +// of a custom type. +size_t GPBDictionaryComputeSizeInternalHelper(NSDictionary *dict, + GPBFieldDescriptor *field); + +// Helper to write out when an NSDictionary is used for the map instead +// of a custom type. +void GPBDictionaryWriteToStreamInternalHelper( + GPBCodedOutputStream *outputStream, NSDictionary *dict, + GPBFieldDescriptor *field); + +// Helper to check message initialization when an NSDictionary is used for +// the map instead of a custom type. +BOOL GPBDictionaryIsInitializedInternalHelper(NSDictionary *dict, + GPBFieldDescriptor *field); + +// Helper to read a map instead. +void GPBDictionaryReadEntry(id mapDictionary, GPBCodedInputStream *stream, + GPBExtensionRegistry *registry, + GPBFieldDescriptor *field, + GPBMessage *parentMessage); + +CF_EXTERN_C_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionInternals.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionInternals.h new file mode 100644 index 00000000..2b980aef --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionInternals.h @@ -0,0 +1,50 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBDescriptor.h" + +@class GPBCodedInputStream; +@class GPBCodedOutputStream; +@class GPBExtensionRegistry; + +void GPBExtensionMergeFromInputStream(GPBExtensionDescriptor *extension, + BOOL isPackedOnStream, + GPBCodedInputStream *input, + GPBExtensionRegistry *extensionRegistry, + GPBMessage *message); + +size_t GPBComputeExtensionSerializedSizeIncludingTag( + GPBExtensionDescriptor *extension, id value); + +void GPBWriteExtensionValueToOutputStream(GPBExtensionDescriptor *extension, + id value, + GPBCodedOutputStream *output); diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionInternals.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionInternals.m new file mode 100644 index 00000000..290c82a1 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionInternals.m @@ -0,0 +1,391 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBExtensionInternals.h" + +#import <objc/runtime.h> + +#import "GPBCodedInputStream_PackagePrivate.h" +#import "GPBCodedOutputStream_PackagePrivate.h" +#import "GPBDescriptor_PackagePrivate.h" +#import "GPBMessage_PackagePrivate.h" +#import "GPBUtilities_PackagePrivate.h" + +static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension, + GPBCodedInputStream *input, + GPBExtensionRegistry *extensionRegistry, + GPBMessage *existingValue) + __attribute__((ns_returns_retained)); + +GPB_INLINE size_t DataTypeSize(GPBDataType dataType) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" + switch (dataType) { + case GPBDataTypeBool: + return 1; + case GPBDataTypeFixed32: + case GPBDataTypeSFixed32: + case GPBDataTypeFloat: + return 4; + case GPBDataTypeFixed64: + case GPBDataTypeSFixed64: + case GPBDataTypeDouble: + return 8; + default: + return 0; + } +#pragma clang diagnostic pop +} + +static size_t ComputePBSerializedSizeNoTagOfObject(GPBDataType dataType, id object) { +#define FIELD_CASE(TYPE, ACCESSOR) \ + case GPBDataType##TYPE: \ + return GPBCompute##TYPE##SizeNoTag([(NSNumber *)object ACCESSOR]); +#define FIELD_CASE2(TYPE) \ + case GPBDataType##TYPE: \ + return GPBCompute##TYPE##SizeNoTag(object); + switch (dataType) { + FIELD_CASE(Bool, boolValue) + FIELD_CASE(Float, floatValue) + FIELD_CASE(Double, doubleValue) + FIELD_CASE(Int32, intValue) + FIELD_CASE(SFixed32, intValue) + FIELD_CASE(SInt32, intValue) + FIELD_CASE(Enum, intValue) + FIELD_CASE(Int64, longLongValue) + FIELD_CASE(SInt64, longLongValue) + FIELD_CASE(SFixed64, longLongValue) + FIELD_CASE(UInt32, unsignedIntValue) + FIELD_CASE(Fixed32, unsignedIntValue) + FIELD_CASE(UInt64, unsignedLongLongValue) + FIELD_CASE(Fixed64, unsignedLongLongValue) + FIELD_CASE2(Bytes) + FIELD_CASE2(String) + FIELD_CASE2(Message) + FIELD_CASE2(Group) + } +#undef FIELD_CASE +#undef FIELD_CASE2 +} + +static size_t ComputeSerializedSizeIncludingTagOfObject( + GPBExtensionDescription *description, id object) { +#define FIELD_CASE(TYPE, ACCESSOR) \ + case GPBDataType##TYPE: \ + return GPBCompute##TYPE##Size(description->fieldNumber, \ + [(NSNumber *)object ACCESSOR]); +#define FIELD_CASE2(TYPE) \ + case GPBDataType##TYPE: \ + return GPBCompute##TYPE##Size(description->fieldNumber, object); + switch (description->dataType) { + FIELD_CASE(Bool, boolValue) + FIELD_CASE(Float, floatValue) + FIELD_CASE(Double, doubleValue) + FIELD_CASE(Int32, intValue) + FIELD_CASE(SFixed32, intValue) + FIELD_CASE(SInt32, intValue) + FIELD_CASE(Enum, intValue) + FIELD_CASE(Int64, longLongValue) + FIELD_CASE(SInt64, longLongValue) + FIELD_CASE(SFixed64, longLongValue) + FIELD_CASE(UInt32, unsignedIntValue) + FIELD_CASE(Fixed32, unsignedIntValue) + FIELD_CASE(UInt64, unsignedLongLongValue) + FIELD_CASE(Fixed64, unsignedLongLongValue) + FIELD_CASE2(Bytes) + FIELD_CASE2(String) + FIELD_CASE2(Group) + case GPBDataTypeMessage: + if (GPBExtensionIsWireFormat(description)) { + return GPBComputeMessageSetExtensionSize(description->fieldNumber, + object); + } else { + return GPBComputeMessageSize(description->fieldNumber, object); + } + } +#undef FIELD_CASE +#undef FIELD_CASE2 +} + +static size_t ComputeSerializedSizeIncludingTagOfArray( + GPBExtensionDescription *description, NSArray *values) { + if (GPBExtensionIsPacked(description)) { + size_t size = 0; + size_t typeSize = DataTypeSize(description->dataType); + if (typeSize != 0) { + size = values.count * typeSize; + } else { + for (id value in values) { + size += + ComputePBSerializedSizeNoTagOfObject(description->dataType, value); + } + } + return size + GPBComputeTagSize(description->fieldNumber) + + GPBComputeRawVarint32SizeForInteger(size); + } else { + size_t size = 0; + for (id value in values) { + size += ComputeSerializedSizeIncludingTagOfObject(description, value); + } + return size; + } +} + +static void WriteObjectIncludingTagToCodedOutputStream( + id object, GPBExtensionDescription *description, + GPBCodedOutputStream *output) { +#define FIELD_CASE(TYPE, ACCESSOR) \ + case GPBDataType##TYPE: \ + [output write##TYPE:description->fieldNumber \ + value:[(NSNumber *)object ACCESSOR]]; \ + return; +#define FIELD_CASE2(TYPE) \ + case GPBDataType##TYPE: \ + [output write##TYPE:description->fieldNumber value:object]; \ + return; + switch (description->dataType) { + FIELD_CASE(Bool, boolValue) + FIELD_CASE(Float, floatValue) + FIELD_CASE(Double, doubleValue) + FIELD_CASE(Int32, intValue) + FIELD_CASE(SFixed32, intValue) + FIELD_CASE(SInt32, intValue) + FIELD_CASE(Enum, intValue) + FIELD_CASE(Int64, longLongValue) + FIELD_CASE(SInt64, longLongValue) + FIELD_CASE(SFixed64, longLongValue) + FIELD_CASE(UInt32, unsignedIntValue) + FIELD_CASE(Fixed32, unsignedIntValue) + FIELD_CASE(UInt64, unsignedLongLongValue) + FIELD_CASE(Fixed64, unsignedLongLongValue) + FIELD_CASE2(Bytes) + FIELD_CASE2(String) + FIELD_CASE2(Group) + case GPBDataTypeMessage: + if (GPBExtensionIsWireFormat(description)) { + [output writeMessageSetExtension:description->fieldNumber value:object]; + } else { + [output writeMessage:description->fieldNumber value:object]; + } + return; + } +#undef FIELD_CASE +#undef FIELD_CASE2 +} + +static void WriteObjectNoTagToCodedOutputStream( + id object, GPBExtensionDescription *description, + GPBCodedOutputStream *output) { +#define FIELD_CASE(TYPE, ACCESSOR) \ + case GPBDataType##TYPE: \ + [output write##TYPE##NoTag:[(NSNumber *)object ACCESSOR]]; \ + return; +#define FIELD_CASE2(TYPE) \ + case GPBDataType##TYPE: \ + [output write##TYPE##NoTag:object]; \ + return; + switch (description->dataType) { + FIELD_CASE(Bool, boolValue) + FIELD_CASE(Float, floatValue) + FIELD_CASE(Double, doubleValue) + FIELD_CASE(Int32, intValue) + FIELD_CASE(SFixed32, intValue) + FIELD_CASE(SInt32, intValue) + FIELD_CASE(Enum, intValue) + FIELD_CASE(Int64, longLongValue) + FIELD_CASE(SInt64, longLongValue) + FIELD_CASE(SFixed64, longLongValue) + FIELD_CASE(UInt32, unsignedIntValue) + FIELD_CASE(Fixed32, unsignedIntValue) + FIELD_CASE(UInt64, unsignedLongLongValue) + FIELD_CASE(Fixed64, unsignedLongLongValue) + FIELD_CASE2(Bytes) + FIELD_CASE2(String) + FIELD_CASE2(Message) + case GPBDataTypeGroup: + [output writeGroupNoTag:description->fieldNumber value:object]; + return; + } +#undef FIELD_CASE +#undef FIELD_CASE2 +} + +static void WriteArrayIncludingTagsToCodedOutputStream( + NSArray *values, GPBExtensionDescription *description, + GPBCodedOutputStream *output) { + if (GPBExtensionIsPacked(description)) { + [output writeTag:description->fieldNumber + format:GPBWireFormatLengthDelimited]; + size_t dataSize = 0; + size_t typeSize = DataTypeSize(description->dataType); + if (typeSize != 0) { + dataSize = values.count * typeSize; + } else { + for (id value in values) { + dataSize += + ComputePBSerializedSizeNoTagOfObject(description->dataType, value); + } + } + [output writeRawVarintSizeTAs32:dataSize]; + for (id value in values) { + WriteObjectNoTagToCodedOutputStream(value, description, output); + } + } else { + for (id value in values) { + WriteObjectIncludingTagToCodedOutputStream(value, description, output); + } + } +} + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +void GPBExtensionMergeFromInputStream(GPBExtensionDescriptor *extension, + BOOL isPackedOnStream, + GPBCodedInputStream *input, + GPBExtensionRegistry *extensionRegistry, + GPBMessage *message) { + GPBExtensionDescription *description = extension->description_; + GPBCodedInputStreamState *state = &input->state_; + if (isPackedOnStream) { + NSCAssert(GPBExtensionIsRepeated(description), + @"How was it packed if it isn't repeated?"); + int32_t length = GPBCodedInputStreamReadInt32(state); + size_t limit = GPBCodedInputStreamPushLimit(state, length); + while (GPBCodedInputStreamBytesUntilLimit(state) > 0) { + id value = NewSingleValueFromInputStream(extension, + input, + extensionRegistry, + nil); + [message addExtension:extension value:value]; + [value release]; + } + GPBCodedInputStreamPopLimit(state, limit); + } else { + id existingValue = nil; + BOOL isRepeated = GPBExtensionIsRepeated(description); + if (!isRepeated && GPBDataTypeIsMessage(description->dataType)) { + existingValue = [message getExistingExtension:extension]; + } + id value = NewSingleValueFromInputStream(extension, + input, + extensionRegistry, + existingValue); + if (isRepeated) { + [message addExtension:extension value:value]; + } else { + [message setExtension:extension value:value]; + } + [value release]; + } +} + +void GPBWriteExtensionValueToOutputStream(GPBExtensionDescriptor *extension, + id value, + GPBCodedOutputStream *output) { + GPBExtensionDescription *description = extension->description_; + if (GPBExtensionIsRepeated(description)) { + WriteArrayIncludingTagsToCodedOutputStream(value, description, output); + } else { + WriteObjectIncludingTagToCodedOutputStream(value, description, output); + } +} + +size_t GPBComputeExtensionSerializedSizeIncludingTag( + GPBExtensionDescriptor *extension, id value) { + GPBExtensionDescription *description = extension->description_; + if (GPBExtensionIsRepeated(description)) { + return ComputeSerializedSizeIncludingTagOfArray(description, value); + } else { + return ComputeSerializedSizeIncludingTagOfObject(description, value); + } +} + +// Note that this returns a retained value intentionally. +static id NewSingleValueFromInputStream(GPBExtensionDescriptor *extension, + GPBCodedInputStream *input, + GPBExtensionRegistry *extensionRegistry, + GPBMessage *existingValue) { + GPBExtensionDescription *description = extension->description_; + GPBCodedInputStreamState *state = &input->state_; + switch (description->dataType) { + case GPBDataTypeBool: return [[NSNumber alloc] initWithBool:GPBCodedInputStreamReadBool(state)]; + case GPBDataTypeFixed32: return [[NSNumber alloc] initWithUnsignedInt:GPBCodedInputStreamReadFixed32(state)]; + case GPBDataTypeSFixed32: return [[NSNumber alloc] initWithInt:GPBCodedInputStreamReadSFixed32(state)]; + case GPBDataTypeFloat: return [[NSNumber alloc] initWithFloat:GPBCodedInputStreamReadFloat(state)]; + case GPBDataTypeFixed64: return [[NSNumber alloc] initWithUnsignedLongLong:GPBCodedInputStreamReadFixed64(state)]; + case GPBDataTypeSFixed64: return [[NSNumber alloc] initWithLongLong:GPBCodedInputStreamReadSFixed64(state)]; + case GPBDataTypeDouble: return [[NSNumber alloc] initWithDouble:GPBCodedInputStreamReadDouble(state)]; + case GPBDataTypeInt32: return [[NSNumber alloc] initWithInt:GPBCodedInputStreamReadInt32(state)]; + case GPBDataTypeInt64: return [[NSNumber alloc] initWithLongLong:GPBCodedInputStreamReadInt64(state)]; + case GPBDataTypeSInt32: return [[NSNumber alloc] initWithInt:GPBCodedInputStreamReadSInt32(state)]; + case GPBDataTypeSInt64: return [[NSNumber alloc] initWithLongLong:GPBCodedInputStreamReadSInt64(state)]; + case GPBDataTypeUInt32: return [[NSNumber alloc] initWithUnsignedInt:GPBCodedInputStreamReadUInt32(state)]; + case GPBDataTypeUInt64: return [[NSNumber alloc] initWithUnsignedLongLong:GPBCodedInputStreamReadUInt64(state)]; + case GPBDataTypeBytes: return GPBCodedInputStreamReadRetainedBytes(state); + case GPBDataTypeString: return GPBCodedInputStreamReadRetainedString(state); + case GPBDataTypeEnum: return [[NSNumber alloc] initWithInt:GPBCodedInputStreamReadEnum(state)]; + case GPBDataTypeGroup: + case GPBDataTypeMessage: { + GPBMessage *message; + if (existingValue) { + message = [existingValue retain]; + } else { + GPBDescriptor *decriptor = [extension.msgClass descriptor]; + message = [[decriptor.messageClass alloc] init]; + } + + if (description->dataType == GPBDataTypeGroup) { + [input readGroup:description->fieldNumber + message:message + extensionRegistry:extensionRegistry]; + } else { + // description->dataType == GPBDataTypeMessage + if (GPBExtensionIsWireFormat(description)) { + // For MessageSet fields the message length will have already been + // read. + [message mergeFromCodedInputStream:input + extensionRegistry:extensionRegistry]; + } else { + [input readMessage:message extensionRegistry:extensionRegistry]; + } + } + + return message; + } + } + + return nil; +} + +#pragma clang diagnostic pop diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionRegistry.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionRegistry.h new file mode 100644 index 00000000..d79632d2 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionRegistry.h @@ -0,0 +1,87 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +@class GPBDescriptor; +@class GPBExtensionDescriptor; + +NS_ASSUME_NONNULL_BEGIN + +/** + * A table of known extensions, searchable by name or field number. When + * parsing a protocol message that might have extensions, you must provide a + * GPBExtensionRegistry in which you have registered any extensions that you + * want to be able to parse. Otherwise, those extensions will just be treated + * like unknown fields. + * + * The *Root classes provide `+extensionRegistry` for the extensions defined + * in a given file *and* all files it imports. You can also create a + * GPBExtensionRegistry, and merge those registries to handle parsing + * extensions defined from non overlapping files. + * + * ``` + * GPBExtensionRegistry *registry = [[MyProtoFileRoot extensionRegistry] copy]; + * [registry addExtension:[OtherMessage neededExtension]]; // Not in MyProtoFile + * NSError *parseError; + * MyMessage *msg = [MyMessage parseData:data extensionRegistry:registry error:&parseError]; + * ``` + **/ +@interface GPBExtensionRegistry : NSObject<NSCopying> + +/** + * Adds the given GPBExtensionDescriptor to this registry. + * + * @param extension The extension description to add. + **/ +- (void)addExtension:(GPBExtensionDescriptor *)extension; + +/** + * Adds all the extensions from another registry to this registry. + * + * @param registry The registry to merge into this registry. + **/ +- (void)addExtensions:(GPBExtensionRegistry *)registry; + +/** + * Looks for the extension registered for the given field number on a given + * GPBDescriptor. + * + * @param descriptor The descriptor to look for a registered extension on. + * @param fieldNumber The field number of the extension to look for. + * + * @return The registered GPBExtensionDescriptor or nil if none was found. + **/ +- (nullable GPBExtensionDescriptor *)extensionForDescriptor:(GPBDescriptor *)descriptor + fieldNumber:(NSInteger)fieldNumber; + +@end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionRegistry.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionRegistry.m new file mode 100644 index 00000000..65534b67 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBExtensionRegistry.m @@ -0,0 +1,131 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBExtensionRegistry.h" + +#import "GPBBootstrap.h" +#import "GPBDescriptor.h" + +@implementation GPBExtensionRegistry { + NSMutableDictionary *mutableClassMap_; +} + +- (instancetype)init { + if ((self = [super init])) { + mutableClassMap_ = [[NSMutableDictionary alloc] init]; + } + return self; +} + +- (void)dealloc { + [mutableClassMap_ release]; + [super dealloc]; +} + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +- (instancetype)copyWithZone:(NSZone *)zone { + GPBExtensionRegistry *result = [[[self class] allocWithZone:zone] init]; + if (result && mutableClassMap_.count) { + [result->mutableClassMap_ addEntriesFromDictionary:mutableClassMap_]; + } + return result; +} + +- (CFMutableDictionaryRef)extensionMapForContainingMessageClass: + (Class)containingMessageClass { + CFMutableDictionaryRef extensionMap = (CFMutableDictionaryRef) + [mutableClassMap_ objectForKey:containingMessageClass]; + if (extensionMap == nil) { + // Use a custom dictionary here because the keys are numbers and conversion + // back and forth from NSNumber isn't worth the cost. + extensionMap = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, + &kCFTypeDictionaryValueCallBacks); + [mutableClassMap_ setObject:(id)extensionMap + forKey:(id<NSCopying>)containingMessageClass]; + } + return extensionMap; +} + +- (void)addExtension:(GPBExtensionDescriptor *)extension { + if (extension == nil) { + return; + } + + Class containingMessageClass = extension.containingMessageClass; + CFMutableDictionaryRef extensionMap = + [self extensionMapForContainingMessageClass:containingMessageClass]; + ssize_t key = extension.fieldNumber; + CFDictionarySetValue(extensionMap, (const void *)key, extension); +} + +- (GPBExtensionDescriptor *)extensionForDescriptor:(GPBDescriptor *)descriptor + fieldNumber:(NSInteger)fieldNumber { + Class messageClass = descriptor.messageClass; + CFMutableDictionaryRef extensionMap = (CFMutableDictionaryRef) + [mutableClassMap_ objectForKey:messageClass]; + ssize_t key = fieldNumber; + GPBExtensionDescriptor *result = + (extensionMap + ? CFDictionaryGetValue(extensionMap, (const void *)key) + : nil); + return result; +} + +static void CopyKeyValue(const void *key, const void *value, void *context) { + CFMutableDictionaryRef extensionMap = (CFMutableDictionaryRef)context; + CFDictionarySetValue(extensionMap, key, value); +} + +- (void)addExtensions:(GPBExtensionRegistry *)registry { + if (registry == nil) { + // In the case where there are no extensions just ignore. + return; + } + NSMutableDictionary *otherClassMap = registry->mutableClassMap_; + [otherClassMap enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL * stop) { +#pragma unused(stop) + Class containingMessageClass = key; + CFMutableDictionaryRef otherExtensionMap = (CFMutableDictionaryRef)value; + + CFMutableDictionaryRef extensionMap = + [self extensionMapForContainingMessageClass:containingMessageClass]; + + CFDictionaryApplyFunction(otherExtensionMap, CopyKeyValue, extensionMap); + }]; +} + +#pragma clang diagnostic pop + +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage.h new file mode 100644 index 00000000..2c325ba8 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage.h @@ -0,0 +1,461 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBBootstrap.h" + +@class GPBDescriptor; +@class GPBCodedInputStream; +@class GPBCodedOutputStream; +@class GPBExtensionDescriptor; +@class GPBExtensionRegistry; +@class GPBFieldDescriptor; +@class GPBUnknownFieldSet; + +NS_ASSUME_NONNULL_BEGIN + +CF_EXTERN_C_BEGIN + +/** NSError domain used for errors. */ +extern NSString *const GPBMessageErrorDomain; + +/** Error codes for NSErrors originated in GPBMessage. */ +typedef NS_ENUM(NSInteger, GPBMessageErrorCode) { + /** Uncategorized error. */ + GPBMessageErrorCodeOther = -100, + /** Message couldn't be serialized because it is missing required fields. */ + GPBMessageErrorCodeMissingRequiredField = -101, +}; + +/** + * Key under which the GPBMessage error's reason is stored inside the userInfo + * dictionary. + **/ +extern NSString *const GPBErrorReasonKey; + +CF_EXTERN_C_END + +/** + * Base class that each generated message subclasses from. + * + * @note @c NSCopying support is a "deep copy", in that all sub objects are + * copied. Just like you wouldn't want a UIView/NSView trying to + * exist in two places, you don't want a sub message to be a property + * property of two other messages. + * + * @note While the class support NSSecureCoding, if the message has any + * extensions, they will end up reloaded in @c unknownFields as there is + * no way for the @c NSCoding plumbing to pass through a + * @c GPBExtensionRegistry. To support extensions, instead of passing the + * calls off to the Message, simple store the result of @c data, and then + * when loading, fetch the data and use + * @c +parseFromData:extensionRegistry:error: to provide an extension + * registry. + **/ +@interface GPBMessage : NSObject<NSSecureCoding, NSCopying> + +// If you add an instance method/property to this class that may conflict with +// fields declared in protos, you need to update objective_helpers.cc. The main +// cases are methods that take no arguments, or setFoo:/hasFoo: type methods. + +/** + * The set of unknown fields for this message. + * + * Only messages from proto files declared with "proto2" syntax support unknown + * fields. For "proto3" syntax, any unknown fields found while parsing are + * dropped. + **/ +@property(nonatomic, copy, nullable) GPBUnknownFieldSet *unknownFields; + +/** + * Whether the message, along with all submessages, have the required fields + * set. This is only applicable for files declared with "proto2" syntax, as + * there are no required fields for "proto3" syntax. + **/ +@property(nonatomic, readonly, getter=isInitialized) BOOL initialized; + +/** + * @return An autoreleased message with the default values set. + **/ ++ (instancetype)message; + +/** + * Creates a new instance by parsing the provided data. This method should be + * sent to the generated message class that the data should be interpreted as. + * If there is an error the method returns nil and the error is returned in + * errorPtr (when provided). + * + * @note In DEBUG builds, the parsed message is checked to be sure all required + * fields were provided, and the parse will fail if some are missing. + * + * @note The errors returned are likely coming from the domain and codes listed + * at the top of this file and GPBCodedInputStream.h. + * + * @param data The data to parse. + * @param errorPtr An optional error pointer to fill in with a failure reason if + * the data can not be parsed. + * + * @return A new instance of the generated class. + **/ ++ (nullable instancetype)parseFromData:(NSData *)data error:(NSError **)errorPtr; + +/** + * Creates a new instance by parsing the data. This method should be sent to + * the generated message class that the data should be interpreted as. If + * there is an error the method returns nil and the error is returned in + * errorPtr (when provided). + * + * @note In DEBUG builds, the parsed message is checked to be sure all required + * fields were provided, and the parse will fail if some are missing. + * + * @note The errors returned are likely coming from the domain and codes listed + * at the top of this file and GPBCodedInputStream.h. + * + * @param data The data to parse. + * @param extensionRegistry The extension registry to use to look up extensions. + * @param errorPtr An optional error pointer to fill in with a failure + * reason if the data can not be parsed. + * + * @return A new instance of the generated class. + **/ ++ (nullable instancetype)parseFromData:(NSData *)data + extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr; + +/** + * Creates a new instance by parsing the data from the given input stream. This + * method should be sent to the generated message class that the data should + * be interpreted as. If there is an error the method returns nil and the error + * is returned in errorPtr (when provided). + * + * @note In DEBUG builds, the parsed message is checked to be sure all required + * fields were provided, and the parse will fail if some are missing. + * + * @note The errors returned are likely coming from the domain and codes listed + * at the top of this file and GPBCodedInputStream.h. + * + * @param input The stream to read data from. + * @param extensionRegistry The extension registry to use to look up extensions. + * @param errorPtr An optional error pointer to fill in with a failure + * reason if the data can not be parsed. + * + * @return A new instance of the generated class. + **/ ++ (nullable instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry: + (nullable GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr; + +/** + * Creates a new instance by parsing the data from the given input stream. This + * method should be sent to the generated message class that the data should + * be interpreted as. If there is an error the method returns nil and the error + * is returned in errorPtr (when provided). + * + * @note Unlike the parseFrom... methods, this never checks to see if all of + * the required fields are set. So this method can be used to reload + * messages that may not be complete. + * + * @note The errors returned are likely coming from the domain and codes listed + * at the top of this file and GPBCodedInputStream.h. + * + * @param input The stream to read data from. + * @param extensionRegistry The extension registry to use to look up extensions. + * @param errorPtr An optional error pointer to fill in with a failure + * reason if the data can not be parsed. + * + * @return A new instance of the generated class. + **/ ++ (nullable instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry: + (nullable GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr; + +/** + * Initializes an instance by parsing the data. This method should be sent to + * the generated message class that the data should be interpreted as. If + * there is an error the method returns nil and the error is returned in + * errorPtr (when provided). + * + * @note In DEBUG builds, the parsed message is checked to be sure all required + * fields were provided, and the parse will fail if some are missing. + * + * @note The errors returned are likely coming from the domain and codes listed + * at the top of this file and GPBCodedInputStream.h. + * + * @param data The data to parse. + * @param errorPtr An optional error pointer to fill in with a failure reason if + * the data can not be parsed. + * + * @return An initialized instance of the generated class. + **/ +- (nullable instancetype)initWithData:(NSData *)data error:(NSError **)errorPtr; + +/** + * Initializes an instance by parsing the data. This method should be sent to + * the generated message class that the data should be interpreted as. If + * there is an error the method returns nil and the error is returned in + * errorPtr (when provided). + * + * @note In DEBUG builds, the parsed message is checked to be sure all required + * fields were provided, and the parse will fail if some are missing. + * + * @note The errors returned are likely coming from the domain and codes listed + * at the top of this file and GPBCodedInputStream.h. + * + * @param data The data to parse. + * @param extensionRegistry The extension registry to use to look up extensions. + * @param errorPtr An optional error pointer to fill in with a failure + * reason if the data can not be parsed. + * + * @return An initialized instance of the generated class. + **/ +- (nullable instancetype)initWithData:(NSData *)data + extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr; + +/** + * Initializes an instance by parsing the data from the given input stream. This + * method should be sent to the generated message class that the data should + * be interpreted as. If there is an error the method returns nil and the error + * is returned in errorPtr (when provided). + * + * @note Unlike the parseFrom... methods, this never checks to see if all of + * the required fields are set. So this method can be used to reload + * messages that may not be complete. + * + * @note The errors returned are likely coming from the domain and codes listed + * at the top of this file and GPBCodedInputStream.h. + * + * @param input The stream to read data from. + * @param extensionRegistry The extension registry to use to look up extensions. + * @param errorPtr An optional error pointer to fill in with a failure + * reason if the data can not be parsed. + * + * @return An initialized instance of the generated class. + **/ +- (nullable instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry: + (nullable GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr; + +/** + * Parses the given data as this message's class, and merges those values into + * this message. + * + * @param data The binary representation of the message to merge. + * @param extensionRegistry The extension registry to use to look up extensions. + * + * @exception GPBCodedInputStreamException Exception thrown when parsing was + * unsuccessful. + **/ +- (void)mergeFromData:(NSData *)data + extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry; + +/** + * Merges the fields from another message (of the same type) into this + * message. + * + * @param other Message to merge into this message. + **/ +- (void)mergeFrom:(GPBMessage *)other; + +/** + * Writes out the message to the given coded output stream. + * + * @param output The coded output stream into which to write the message. + **/ +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)output; + +/** + * Writes out the message to the given output stream. + * + * @param output The output stream into which to write the message. + **/ +- (void)writeToOutputStream:(NSOutputStream *)output; + +/** + * Writes out a varint for the message size followed by the the message to + * the given output stream. + * + * @param output The coded output stream into which to write the message. + **/ +- (void)writeDelimitedToCodedOutputStream:(GPBCodedOutputStream *)output; + +/** + * Writes out a varint for the message size followed by the the message to + * the given output stream. + * + * @param output The output stream into which to write the message. + **/ +- (void)writeDelimitedToOutputStream:(NSOutputStream *)output; + +/** + * Serializes the message to an NSData. + * + * If there is an error while generating the data, nil is returned. + * + * @note This value is not cached, so if you are using it repeatedly, cache + * it yourself. + * + * @note In DEBUG ONLY, the message is also checked for all required field, + * if one is missing, nil will be returned. + * + * @return The binary representation of the message. + **/ +- (nullable NSData *)data; + +/** + * Serializes a varint with the message size followed by the message data, + * returning that as an NSData. + * + * @note This value is not cached, so if you are using it repeatedly, it is + * recommended to keep a local copy. + * + * @return The binary representation of the size along with the message. + **/ +- (NSData *)delimitedData; + +/** + * Calculates the size of the object if it were serialized. + * + * This is not a cached value. If you are following a pattern like this: + * + * ``` + * size_t size = [aMsg serializedSize]; + * NSMutableData *foo = [NSMutableData dataWithCapacity:size + sizeof(size)]; + * [foo writeSize:size]; + * [foo appendData:[aMsg data]]; + * ``` + * + * you would be better doing: + * + * ``` + * NSData *data = [aMsg data]; + * NSUInteger size = [aMsg length]; + * NSMutableData *foo = [NSMutableData dataWithCapacity:size + sizeof(size)]; + * [foo writeSize:size]; + * [foo appendData:data]; + * ``` + * + * @return The size of the message in it's binary representation. + **/ +- (size_t)serializedSize; + +/** + * @return The descriptor for the message class. + **/ ++ (GPBDescriptor *)descriptor; + +/** + * Return the descriptor for the message. + **/ +- (GPBDescriptor *)descriptor; + +/** + * @return An array with the extension descriptors that are currently set on the + * message. + **/ +- (NSArray *)extensionsCurrentlySet; + +/** + * Checks whether there is an extension set on the message which matches the + * given extension descriptor. + * + * @param extension Extension descriptor to check if it's set on the message. + * + * @return Whether the extension is currently set on the message. + **/ +- (BOOL)hasExtension:(GPBExtensionDescriptor *)extension; + +/* + * Fetches the given extension's value for this message. + * + * Extensions use boxed values (NSNumbers) for PODs and NSMutableArrays for + * repeated fields. If the extension is a Message one will be auto created for + * you and returned similar to fields. + * + * @param extension The extension descriptor of the extension to fetch. + * + * @return The extension matching the given descriptor, or nil if none found. + **/ +- (nullable id)getExtension:(GPBExtensionDescriptor *)extension; + +/** + * Sets the given extension's value for this message. This only applies for + * single field extensions (i.e. - not repeated fields). + * + * Extensions use boxed values (NSNumbers). + * + * @param extension The extension descriptor under which to set the value. + * @param value The value to be set as the extension. + **/ +- (void)setExtension:(GPBExtensionDescriptor *)extension + value:(nullable id)value; + +/** + * Adds the given value to the extension for this message. This only applies + * to repeated field extensions. If the field is a repeated POD type, the value + * should be an NSNumber. + * + * @param extension The extension descriptor under which to add the value. + * @param value The value to be added to the repeated extension. + **/ +- (void)addExtension:(GPBExtensionDescriptor *)extension value:(id)value; + +/** + * Replaces the value at the given index with the given value for the extension + * on this message. This only applies to repeated field extensions. If the field + * is a repeated POD type, the value is should be an NSNumber. + * + * @param extension The extension descriptor under which to replace the value. + * @param index The index of the extension to be replaced. + * @param value The value to be replaced in the repeated extension. + **/ +- (void)setExtension:(GPBExtensionDescriptor *)extension + index:(NSUInteger)index + value:(id)value; + +/** + * Clears the given extension for this message. + * + * @param extension The extension descriptor to be cleared from this message. + **/ +- (void)clearExtension:(GPBExtensionDescriptor *)extension; + +/** + * Resets all of the fields of this message to their default values. + **/ +- (void)clear; + +@end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage.m new file mode 100644 index 00000000..78935b19 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage.m @@ -0,0 +1,3262 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBMessage_PackagePrivate.h" + +#import <objc/runtime.h> +#import <objc/message.h> + +#import "GPBArray_PackagePrivate.h" +#import "GPBCodedInputStream_PackagePrivate.h" +#import "GPBCodedOutputStream_PackagePrivate.h" +#import "GPBDescriptor_PackagePrivate.h" +#import "GPBDictionary_PackagePrivate.h" +#import "GPBExtensionInternals.h" +#import "GPBExtensionRegistry.h" +#import "GPBRootObject_PackagePrivate.h" +#import "GPBUnknownFieldSet_PackagePrivate.h" +#import "GPBUtilities_PackagePrivate.h" + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +NSString *const GPBMessageErrorDomain = + GPBNSStringifySymbol(GPBMessageErrorDomain); + +NSString *const GPBErrorReasonKey = @"Reason"; + +static NSString *const kGPBDataCoderKey = @"GPBData"; + +// +// PLEASE REMEMBER: +// +// This is the base class for *all* messages generated, so any selector defined, +// *public* or *private* could end up colliding with a proto message field. So +// avoid using selectors that could match a property, use C functions to hide +// them, etc. +// + +@interface GPBMessage () { + @package + GPBUnknownFieldSet *unknownFields_; + NSMutableDictionary *extensionMap_; + NSMutableDictionary *autocreatedExtensionMap_; + + // If the object was autocreated, we remember the creator so that if we get + // mutated, we can inform the creator to make our field visible. + GPBMessage *autocreator_; + GPBFieldDescriptor *autocreatorField_; + GPBExtensionDescriptor *autocreatorExtension_; +} +@end + +static id CreateArrayForField(GPBFieldDescriptor *field, + GPBMessage *autocreator) + __attribute__((ns_returns_retained)); +static id GetOrCreateArrayIvarWithField(GPBMessage *self, + GPBFieldDescriptor *field, + GPBFileSyntax syntax); +static id GetArrayIvarWithField(GPBMessage *self, GPBFieldDescriptor *field); +static id CreateMapForField(GPBFieldDescriptor *field, + GPBMessage *autocreator) + __attribute__((ns_returns_retained)); +static id GetOrCreateMapIvarWithField(GPBMessage *self, + GPBFieldDescriptor *field, + GPBFileSyntax syntax); +static id GetMapIvarWithField(GPBMessage *self, GPBFieldDescriptor *field); +static NSMutableDictionary *CloneExtensionMap(NSDictionary *extensionMap, + NSZone *zone) + __attribute__((ns_returns_retained)); + +#ifdef DEBUG +static NSError *MessageError(NSInteger code, NSDictionary *userInfo) { + return [NSError errorWithDomain:GPBMessageErrorDomain + code:code + userInfo:userInfo]; +} +#endif + +static NSError *ErrorFromException(NSException *exception) { + NSError *error = nil; + + if ([exception.name isEqual:GPBCodedInputStreamException]) { + NSDictionary *exceptionInfo = exception.userInfo; + error = exceptionInfo[GPBCodedInputStreamUnderlyingErrorKey]; + } + + if (!error) { + NSString *reason = exception.reason; + NSDictionary *userInfo = nil; + if ([reason length]) { + userInfo = @{ GPBErrorReasonKey : reason }; + } + + error = [NSError errorWithDomain:GPBMessageErrorDomain + code:GPBMessageErrorCodeOther + userInfo:userInfo]; + } + return error; +} + +static void CheckExtension(GPBMessage *self, + GPBExtensionDescriptor *extension) { + if ([self class] != extension.containingMessageClass) { + [NSException + raise:NSInvalidArgumentException + format:@"Extension %@ used on wrong class (%@ instead of %@)", + extension.singletonName, + [self class], extension.containingMessageClass]; + } +} + +static NSMutableDictionary *CloneExtensionMap(NSDictionary *extensionMap, + NSZone *zone) { + if (extensionMap.count == 0) { + return nil; + } + NSMutableDictionary *result = [[NSMutableDictionary allocWithZone:zone] + initWithCapacity:extensionMap.count]; + + for (GPBExtensionDescriptor *extension in extensionMap) { + id value = [extensionMap objectForKey:extension]; + BOOL isMessageExtension = GPBExtensionIsMessage(extension); + + if (extension.repeated) { + if (isMessageExtension) { + NSMutableArray *list = + [[NSMutableArray alloc] initWithCapacity:[value count]]; + for (GPBMessage *listValue in value) { + GPBMessage *copiedValue = [listValue copyWithZone:zone]; + [list addObject:copiedValue]; + [copiedValue release]; + } + [result setObject:list forKey:extension]; + [list release]; + } else { + NSMutableArray *copiedValue = [value mutableCopyWithZone:zone]; + [result setObject:copiedValue forKey:extension]; + [copiedValue release]; + } + } else { + if (isMessageExtension) { + GPBMessage *copiedValue = [value copyWithZone:zone]; + [result setObject:copiedValue forKey:extension]; + [copiedValue release]; + } else { + [result setObject:value forKey:extension]; + } + } + } + + return result; +} + +static id CreateArrayForField(GPBFieldDescriptor *field, + GPBMessage *autocreator) { + id result; + GPBDataType fieldDataType = GPBGetFieldDataType(field); + switch (fieldDataType) { + case GPBDataTypeBool: + result = [[GPBBoolArray alloc] init]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + result = [[GPBUInt32Array alloc] init]; + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + result = [[GPBInt32Array alloc] init]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + result = [[GPBUInt64Array alloc] init]; + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + result = [[GPBInt64Array alloc] init]; + break; + case GPBDataTypeFloat: + result = [[GPBFloatArray alloc] init]; + break; + case GPBDataTypeDouble: + result = [[GPBDoubleArray alloc] init]; + break; + + case GPBDataTypeEnum: + result = [[GPBEnumArray alloc] + initWithValidationFunction:field.enumDescriptor.enumVerifier]; + break; + + case GPBDataTypeBytes: + case GPBDataTypeGroup: + case GPBDataTypeMessage: + case GPBDataTypeString: + if (autocreator) { + result = [[GPBAutocreatedArray alloc] init]; + } else { + result = [[NSMutableArray alloc] init]; + } + break; + } + + if (autocreator) { + if (GPBDataTypeIsObject(fieldDataType)) { + GPBAutocreatedArray *autoArray = result; + autoArray->_autocreator = autocreator; + } else { + GPBInt32Array *gpbArray = result; + gpbArray->_autocreator = autocreator; + } + } + + return result; +} + +static id CreateMapForField(GPBFieldDescriptor *field, + GPBMessage *autocreator) { + id result; + GPBDataType keyDataType = field.mapKeyDataType; + GPBDataType valueDataType = GPBGetFieldDataType(field); + switch (keyDataType) { + case GPBDataTypeBool: + switch (valueDataType) { + case GPBDataTypeBool: + result = [[GPBBoolBoolDictionary alloc] init]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + result = [[GPBBoolUInt32Dictionary alloc] init]; + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + result = [[GPBBoolInt32Dictionary alloc] init]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + result = [[GPBBoolUInt64Dictionary alloc] init]; + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + result = [[GPBBoolInt64Dictionary alloc] init]; + break; + case GPBDataTypeFloat: + result = [[GPBBoolFloatDictionary alloc] init]; + break; + case GPBDataTypeDouble: + result = [[GPBBoolDoubleDictionary alloc] init]; + break; + case GPBDataTypeEnum: + result = [[GPBBoolEnumDictionary alloc] + initWithValidationFunction:field.enumDescriptor.enumVerifier]; + break; + case GPBDataTypeBytes: + case GPBDataTypeMessage: + case GPBDataTypeString: + result = [[GPBBoolObjectDictionary alloc] init]; + break; + case GPBDataTypeGroup: + NSCAssert(NO, @"shouldn't happen"); + return nil; + } + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + switch (valueDataType) { + case GPBDataTypeBool: + result = [[GPBUInt32BoolDictionary alloc] init]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + result = [[GPBUInt32UInt32Dictionary alloc] init]; + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + result = [[GPBUInt32Int32Dictionary alloc] init]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + result = [[GPBUInt32UInt64Dictionary alloc] init]; + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + result = [[GPBUInt32Int64Dictionary alloc] init]; + break; + case GPBDataTypeFloat: + result = [[GPBUInt32FloatDictionary alloc] init]; + break; + case GPBDataTypeDouble: + result = [[GPBUInt32DoubleDictionary alloc] init]; + break; + case GPBDataTypeEnum: + result = [[GPBUInt32EnumDictionary alloc] + initWithValidationFunction:field.enumDescriptor.enumVerifier]; + break; + case GPBDataTypeBytes: + case GPBDataTypeMessage: + case GPBDataTypeString: + result = [[GPBUInt32ObjectDictionary alloc] init]; + break; + case GPBDataTypeGroup: + NSCAssert(NO, @"shouldn't happen"); + return nil; + } + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + switch (valueDataType) { + case GPBDataTypeBool: + result = [[GPBInt32BoolDictionary alloc] init]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + result = [[GPBInt32UInt32Dictionary alloc] init]; + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + result = [[GPBInt32Int32Dictionary alloc] init]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + result = [[GPBInt32UInt64Dictionary alloc] init]; + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + result = [[GPBInt32Int64Dictionary alloc] init]; + break; + case GPBDataTypeFloat: + result = [[GPBInt32FloatDictionary alloc] init]; + break; + case GPBDataTypeDouble: + result = [[GPBInt32DoubleDictionary alloc] init]; + break; + case GPBDataTypeEnum: + result = [[GPBInt32EnumDictionary alloc] + initWithValidationFunction:field.enumDescriptor.enumVerifier]; + break; + case GPBDataTypeBytes: + case GPBDataTypeMessage: + case GPBDataTypeString: + result = [[GPBInt32ObjectDictionary alloc] init]; + break; + case GPBDataTypeGroup: + NSCAssert(NO, @"shouldn't happen"); + return nil; + } + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + switch (valueDataType) { + case GPBDataTypeBool: + result = [[GPBUInt64BoolDictionary alloc] init]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + result = [[GPBUInt64UInt32Dictionary alloc] init]; + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + result = [[GPBUInt64Int32Dictionary alloc] init]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + result = [[GPBUInt64UInt64Dictionary alloc] init]; + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + result = [[GPBUInt64Int64Dictionary alloc] init]; + break; + case GPBDataTypeFloat: + result = [[GPBUInt64FloatDictionary alloc] init]; + break; + case GPBDataTypeDouble: + result = [[GPBUInt64DoubleDictionary alloc] init]; + break; + case GPBDataTypeEnum: + result = [[GPBUInt64EnumDictionary alloc] + initWithValidationFunction:field.enumDescriptor.enumVerifier]; + break; + case GPBDataTypeBytes: + case GPBDataTypeMessage: + case GPBDataTypeString: + result = [[GPBUInt64ObjectDictionary alloc] init]; + break; + case GPBDataTypeGroup: + NSCAssert(NO, @"shouldn't happen"); + return nil; + } + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + switch (valueDataType) { + case GPBDataTypeBool: + result = [[GPBInt64BoolDictionary alloc] init]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + result = [[GPBInt64UInt32Dictionary alloc] init]; + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + result = [[GPBInt64Int32Dictionary alloc] init]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + result = [[GPBInt64UInt64Dictionary alloc] init]; + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + result = [[GPBInt64Int64Dictionary alloc] init]; + break; + case GPBDataTypeFloat: + result = [[GPBInt64FloatDictionary alloc] init]; + break; + case GPBDataTypeDouble: + result = [[GPBInt64DoubleDictionary alloc] init]; + break; + case GPBDataTypeEnum: + result = [[GPBInt64EnumDictionary alloc] + initWithValidationFunction:field.enumDescriptor.enumVerifier]; + break; + case GPBDataTypeBytes: + case GPBDataTypeMessage: + case GPBDataTypeString: + result = [[GPBInt64ObjectDictionary alloc] init]; + break; + case GPBDataTypeGroup: + NSCAssert(NO, @"shouldn't happen"); + return nil; + } + break; + case GPBDataTypeString: + switch (valueDataType) { + case GPBDataTypeBool: + result = [[GPBStringBoolDictionary alloc] init]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + result = [[GPBStringUInt32Dictionary alloc] init]; + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + result = [[GPBStringInt32Dictionary alloc] init]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + result = [[GPBStringUInt64Dictionary alloc] init]; + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + result = [[GPBStringInt64Dictionary alloc] init]; + break; + case GPBDataTypeFloat: + result = [[GPBStringFloatDictionary alloc] init]; + break; + case GPBDataTypeDouble: + result = [[GPBStringDoubleDictionary alloc] init]; + break; + case GPBDataTypeEnum: + result = [[GPBStringEnumDictionary alloc] + initWithValidationFunction:field.enumDescriptor.enumVerifier]; + break; + case GPBDataTypeBytes: + case GPBDataTypeMessage: + case GPBDataTypeString: + if (autocreator) { + result = [[GPBAutocreatedDictionary alloc] init]; + } else { + result = [[NSMutableDictionary alloc] init]; + } + break; + case GPBDataTypeGroup: + NSCAssert(NO, @"shouldn't happen"); + return nil; + } + break; + + case GPBDataTypeFloat: + case GPBDataTypeDouble: + case GPBDataTypeEnum: + case GPBDataTypeBytes: + case GPBDataTypeGroup: + case GPBDataTypeMessage: + NSCAssert(NO, @"shouldn't happen"); + return nil; + } + + if (autocreator) { + if ((keyDataType == GPBDataTypeString) && + GPBDataTypeIsObject(valueDataType)) { + GPBAutocreatedDictionary *autoDict = result; + autoDict->_autocreator = autocreator; + } else { + GPBInt32Int32Dictionary *gpbDict = result; + gpbDict->_autocreator = autocreator; + } + } + + return result; +} + +#if !defined(__clang_analyzer__) +// These functions are blocked from the analyzer because the analyzer sees the +// GPBSetRetainedObjectIvarWithFieldInternal() call as consuming the array/map, +// so use of the array/map after the call returns is flagged as a use after +// free. +// But GPBSetRetainedObjectIvarWithFieldInternal() is "consuming" the retain +// count be holding onto the object (it is transfering it), the object is +// still valid after returning from the call. The other way to avoid this +// would be to add a -retain/-autorelease, but that would force every +// repeated/map field parsed into the autorelease pool which is both a memory +// and performance hit. + +static id GetOrCreateArrayIvarWithField(GPBMessage *self, + GPBFieldDescriptor *field, + GPBFileSyntax syntax) { + id array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (!array) { + // No lock needed, this is called from places expecting to mutate + // so no threading protection is needed. + array = CreateArrayForField(field, nil); + GPBSetRetainedObjectIvarWithFieldInternal(self, field, array, syntax); + } + return array; +} + +// This is like GPBGetObjectIvarWithField(), but for arrays, it should +// only be used to wire the method into the class. +static id GetArrayIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { + id array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (!array) { + // Check again after getting the lock. + GPBPrepareReadOnlySemaphore(self); + dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); + array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (!array) { + array = CreateArrayForField(field, self); + GPBSetAutocreatedRetainedObjectIvarWithField(self, field, array); + } + dispatch_semaphore_signal(self->readOnlySemaphore_); + } + return array; +} + +static id GetOrCreateMapIvarWithField(GPBMessage *self, + GPBFieldDescriptor *field, + GPBFileSyntax syntax) { + id dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (!dict) { + // No lock needed, this is called from places expecting to mutate + // so no threading protection is needed. + dict = CreateMapForField(field, nil); + GPBSetRetainedObjectIvarWithFieldInternal(self, field, dict, syntax); + } + return dict; +} + +// This is like GPBGetObjectIvarWithField(), but for maps, it should +// only be used to wire the method into the class. +static id GetMapIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { + id dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (!dict) { + // Check again after getting the lock. + GPBPrepareReadOnlySemaphore(self); + dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); + dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (!dict) { + dict = CreateMapForField(field, self); + GPBSetAutocreatedRetainedObjectIvarWithField(self, field, dict); + } + dispatch_semaphore_signal(self->readOnlySemaphore_); + } + return dict; +} + +#endif // !defined(__clang_analyzer__) + +GPBMessage *GPBCreateMessageWithAutocreator(Class msgClass, + GPBMessage *autocreator, + GPBFieldDescriptor *field) { + GPBMessage *message = [[msgClass alloc] init]; + message->autocreator_ = autocreator; + message->autocreatorField_ = [field retain]; + return message; +} + +static GPBMessage *CreateMessageWithAutocreatorForExtension( + Class msgClass, GPBMessage *autocreator, GPBExtensionDescriptor *extension) + __attribute__((ns_returns_retained)); + +static GPBMessage *CreateMessageWithAutocreatorForExtension( + Class msgClass, GPBMessage *autocreator, + GPBExtensionDescriptor *extension) { + GPBMessage *message = [[msgClass alloc] init]; + message->autocreator_ = autocreator; + message->autocreatorExtension_ = [extension retain]; + return message; +} + +BOOL GPBWasMessageAutocreatedBy(GPBMessage *message, GPBMessage *parent) { + return (message->autocreator_ == parent); +} + +void GPBBecomeVisibleToAutocreator(GPBMessage *self) { + // Message objects that are implicitly created by accessing a message field + // are initially not visible via the hasX selector. This method makes them + // visible. + if (self->autocreator_) { + // This will recursively make all parent messages visible until it reaches a + // super-creator that's visible. + if (self->autocreatorField_) { + GPBFileSyntax syntax = [self->autocreator_ descriptor].file.syntax; + GPBSetObjectIvarWithFieldInternal(self->autocreator_, + self->autocreatorField_, self, syntax); + } else { + [self->autocreator_ setExtension:self->autocreatorExtension_ value:self]; + } + } +} + +void GPBAutocreatedArrayModified(GPBMessage *self, id array) { + // When one of our autocreated arrays adds elements, make it visible. + GPBDescriptor *descriptor = [[self class] descriptor]; + for (GPBFieldDescriptor *field in descriptor->fields_) { + if (field.fieldType == GPBFieldTypeRepeated) { + id curArray = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (curArray == array) { + if (GPBFieldDataTypeIsObject(field)) { + GPBAutocreatedArray *autoArray = array; + autoArray->_autocreator = nil; + } else { + GPBInt32Array *gpbArray = array; + gpbArray->_autocreator = nil; + } + GPBBecomeVisibleToAutocreator(self); + return; + } + } + } + NSCAssert(NO, @"Unknown autocreated %@ for %@.", [array class], self); +} + +void GPBAutocreatedDictionaryModified(GPBMessage *self, id dictionary) { + // When one of our autocreated dicts adds elements, make it visible. + GPBDescriptor *descriptor = [[self class] descriptor]; + for (GPBFieldDescriptor *field in descriptor->fields_) { + if (field.fieldType == GPBFieldTypeMap) { + id curDict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (curDict == dictionary) { + if ((field.mapKeyDataType == GPBDataTypeString) && + GPBFieldDataTypeIsObject(field)) { + GPBAutocreatedDictionary *autoDict = dictionary; + autoDict->_autocreator = nil; + } else { + GPBInt32Int32Dictionary *gpbDict = dictionary; + gpbDict->_autocreator = nil; + } + GPBBecomeVisibleToAutocreator(self); + return; + } + } + } + NSCAssert(NO, @"Unknown autocreated %@ for %@.", [dictionary class], self); +} + +void GPBClearMessageAutocreator(GPBMessage *self) { + if ((self == nil) || !self->autocreator_) { + return; + } + +#if defined(DEBUG) && DEBUG && !defined(NS_BLOCK_ASSERTIONS) + // Either the autocreator must have its "has" flag set to YES, or it must be + // NO and not equal to ourselves. + BOOL autocreatorHas = + (self->autocreatorField_ + ? GPBGetHasIvarField(self->autocreator_, self->autocreatorField_) + : [self->autocreator_ hasExtension:self->autocreatorExtension_]); + GPBMessage *autocreatorFieldValue = + (self->autocreatorField_ + ? GPBGetObjectIvarWithFieldNoAutocreate(self->autocreator_, + self->autocreatorField_) + : [self->autocreator_->autocreatedExtensionMap_ + objectForKey:self->autocreatorExtension_]); + NSCAssert(autocreatorHas || autocreatorFieldValue != self, + @"Cannot clear autocreator because it still refers to self, self: %@.", + self); + +#endif // DEBUG && !defined(NS_BLOCK_ASSERTIONS) + + self->autocreator_ = nil; + [self->autocreatorField_ release]; + self->autocreatorField_ = nil; + [self->autocreatorExtension_ release]; + self->autocreatorExtension_ = nil; +} + +// Call this before using the readOnlySemaphore_. This ensures it is created only once. +void GPBPrepareReadOnlySemaphore(GPBMessage *self) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + + // Create the semaphore on demand (rather than init) as developers might not cause them + // to be needed, and the heap usage can add up. The atomic swap is used to avoid needing + // another lock around creating it. + if (self->readOnlySemaphore_ == nil) { + dispatch_semaphore_t worker = dispatch_semaphore_create(1); + if (!OSAtomicCompareAndSwapPtrBarrier(NULL, worker, (void * volatile *)&(self->readOnlySemaphore_))) { + dispatch_release(worker); + } + } + +#pragma clang diagnostic pop +} + +static GPBUnknownFieldSet *GetOrMakeUnknownFields(GPBMessage *self) { + if (!self->unknownFields_) { + self->unknownFields_ = [[GPBUnknownFieldSet alloc] init]; + GPBBecomeVisibleToAutocreator(self); + } + return self->unknownFields_; +} + +@implementation GPBMessage + ++ (void)initialize { + Class pbMessageClass = [GPBMessage class]; + if ([self class] == pbMessageClass) { + // This is here to start up the "base" class descriptor. + [self descriptor]; + // Message shares extension method resolving with GPBRootObject so insure + // it is started up at the same time. + (void)[GPBRootObject class]; + } else if ([self superclass] == pbMessageClass) { + // This is here to start up all the "message" subclasses. Just needs to be + // done for the messages, not any of the subclasses. + // This must be done in initialize to enforce thread safety of start up of + // the protocol buffer library. + // Note: The generated code for -descriptor calls + // +[GPBDescriptor allocDescriptorForClass:...], passing the GPBRootObject + // subclass for the file. That call chain is what ensures that *Root class + // is started up to support extension resolution off the message class + // (+resolveClassMethod: below) in a thread safe manner. + [self descriptor]; + } +} + ++ (instancetype)allocWithZone:(NSZone *)zone { + // Override alloc to allocate our classes with the additional storage + // required for the instance variables. + GPBDescriptor *descriptor = [self descriptor]; + return NSAllocateObject(self, descriptor->storageSize_, zone); +} + ++ (instancetype)alloc { + return [self allocWithZone:nil]; +} + ++ (GPBDescriptor *)descriptor { + // This is thread safe because it is called from +initialize. + static GPBDescriptor *descriptor = NULL; + static GPBFileDescriptor *fileDescriptor = NULL; + if (!descriptor) { + // Use a dummy file that marks it as proto2 syntax so when used generically + // it supports unknowns/etc. + fileDescriptor = + [[GPBFileDescriptor alloc] initWithPackage:@"internal" + syntax:GPBFileSyntaxProto2]; + + descriptor = [GPBDescriptor allocDescriptorForClass:[GPBMessage class] + rootClass:Nil + file:fileDescriptor + fields:NULL + fieldCount:0 + storageSize:0 + flags:0]; + } + return descriptor; +} + ++ (instancetype)message { + return [[[self alloc] init] autorelease]; +} + +- (instancetype)init { + if ((self = [super init])) { + messageStorage_ = (GPBMessage_StoragePtr)( + ((uint8_t *)self) + class_getInstanceSize([self class])); + } + + return self; +} + +- (instancetype)initWithData:(NSData *)data error:(NSError **)errorPtr { + return [self initWithData:data extensionRegistry:nil error:errorPtr]; +} + +- (instancetype)initWithData:(NSData *)data + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr { + if ((self = [self init])) { + @try { + [self mergeFromData:data extensionRegistry:extensionRegistry]; + if (errorPtr) { + *errorPtr = nil; + } + } + @catch (NSException *exception) { + [self release]; + self = nil; + if (errorPtr) { + *errorPtr = ErrorFromException(exception); + } + } +#ifdef DEBUG + if (self && !self.initialized) { + [self release]; + self = nil; + if (errorPtr) { + *errorPtr = MessageError(GPBMessageErrorCodeMissingRequiredField, nil); + } + } +#endif + } + return self; +} + +- (instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry: + (GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr { + if ((self = [self init])) { + @try { + [self mergeFromCodedInputStream:input extensionRegistry:extensionRegistry]; + if (errorPtr) { + *errorPtr = nil; + } + } + @catch (NSException *exception) { + [self release]; + self = nil; + if (errorPtr) { + *errorPtr = ErrorFromException(exception); + } + } +#ifdef DEBUG + if (self && !self.initialized) { + [self release]; + self = nil; + if (errorPtr) { + *errorPtr = MessageError(GPBMessageErrorCodeMissingRequiredField, nil); + } + } +#endif + } + return self; +} + +- (void)dealloc { + [self internalClear:NO]; + NSCAssert(!autocreator_, @"Autocreator was not cleared before dealloc."); + if (readOnlySemaphore_) { + dispatch_release(readOnlySemaphore_); + } + [super dealloc]; +} + +- (void)copyFieldsInto:(GPBMessage *)message + zone:(NSZone *)zone + descriptor:(GPBDescriptor *)descriptor { + // Copy all the storage... + memcpy(message->messageStorage_, messageStorage_, descriptor->storageSize_); + + GPBFileSyntax syntax = descriptor.file.syntax; + + // Loop over the fields doing fixup... + for (GPBFieldDescriptor *field in descriptor->fields_) { + if (GPBFieldIsMapOrArray(field)) { + id value = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (value) { + // We need to copy the array/map, but the catch is for message fields, + // we also need to ensure all the messages as those need copying also. + id newValue; + if (GPBFieldDataTypeIsMessage(field)) { + if (field.fieldType == GPBFieldTypeRepeated) { + NSArray *existingArray = (NSArray *)value; + NSMutableArray *newArray = + [[NSMutableArray alloc] initWithCapacity:existingArray.count]; + newValue = newArray; + for (GPBMessage *msg in existingArray) { + GPBMessage *copiedMsg = [msg copyWithZone:zone]; + [newArray addObject:copiedMsg]; + [copiedMsg release]; + } + } else { + if (field.mapKeyDataType == GPBDataTypeString) { + // Map is an NSDictionary. + NSDictionary *existingDict = value; + NSMutableDictionary *newDict = [[NSMutableDictionary alloc] + initWithCapacity:existingDict.count]; + newValue = newDict; + [existingDict enumerateKeysAndObjectsUsingBlock:^(NSString *key, + GPBMessage *msg, + BOOL *stop) { +#pragma unused(stop) + GPBMessage *copiedMsg = [msg copyWithZone:zone]; + [newDict setObject:copiedMsg forKey:key]; + [copiedMsg release]; + }]; + } else { + // Is one of the GPB*ObjectDictionary classes. Type doesn't + // matter, just need one to invoke the selector. + GPBInt32ObjectDictionary *existingDict = value; + newValue = [existingDict deepCopyWithZone:zone]; + } + } + } else { + // Not messages (but is a map/array)... + if (field.fieldType == GPBFieldTypeRepeated) { + if (GPBFieldDataTypeIsObject(field)) { + // NSArray + newValue = [value mutableCopyWithZone:zone]; + } else { + // GPB*Array + newValue = [value copyWithZone:zone]; + } + } else { + if (field.mapKeyDataType == GPBDataTypeString) { + // NSDictionary + newValue = [value mutableCopyWithZone:zone]; + } else { + // Is one of the GPB*Dictionary classes. Type doesn't matter, + // just need one to invoke the selector. + GPBInt32Int32Dictionary *existingDict = value; + newValue = [existingDict copyWithZone:zone]; + } + } + } + // We retain here because the memcpy picked up the pointer value and + // the next call to SetRetainedObject... will release the current value. + [value retain]; + GPBSetRetainedObjectIvarWithFieldInternal(message, field, newValue, + syntax); + } + } else if (GPBFieldDataTypeIsMessage(field)) { + // For object types, if we have a value, copy it. If we don't, + // zero it to remove the pointer to something that was autocreated + // (and the ptr just got memcpyed). + if (GPBGetHasIvarField(self, field)) { + GPBMessage *value = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + GPBMessage *newValue = [value copyWithZone:zone]; + // We retain here because the memcpy picked up the pointer value and + // the next call to SetRetainedObject... will release the current value. + [value retain]; + GPBSetRetainedObjectIvarWithFieldInternal(message, field, newValue, + syntax); + } else { + uint8_t *storage = (uint8_t *)message->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + *typePtr = NULL; + } + } else if (GPBFieldDataTypeIsObject(field) && + GPBGetHasIvarField(self, field)) { + // A set string/data value (message picked off above), copy it. + id value = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + id newValue = [value copyWithZone:zone]; + // We retain here because the memcpy picked up the pointer value and + // the next call to SetRetainedObject... will release the current value. + [value retain]; + GPBSetRetainedObjectIvarWithFieldInternal(message, field, newValue, + syntax); + } else { + // memcpy took care of the rest of the primitive fields if they were set. + } + } // for (field in descriptor->fields_) +} + +- (id)copyWithZone:(NSZone *)zone { + GPBDescriptor *descriptor = [self descriptor]; + GPBMessage *result = [[descriptor.messageClass allocWithZone:zone] init]; + + [self copyFieldsInto:result zone:zone descriptor:descriptor]; + // Make immutable copies of the extra bits. + result->unknownFields_ = [unknownFields_ copyWithZone:zone]; + result->extensionMap_ = CloneExtensionMap(extensionMap_, zone); + return result; +} + +- (void)clear { + [self internalClear:YES]; +} + +- (void)internalClear:(BOOL)zeroStorage { + GPBDescriptor *descriptor = [self descriptor]; + for (GPBFieldDescriptor *field in descriptor->fields_) { + if (GPBFieldIsMapOrArray(field)) { + id arrayOrMap = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (arrayOrMap) { + if (field.fieldType == GPBFieldTypeRepeated) { + if (GPBFieldDataTypeIsObject(field)) { + if ([arrayOrMap isKindOfClass:[GPBAutocreatedArray class]]) { + GPBAutocreatedArray *autoArray = arrayOrMap; + if (autoArray->_autocreator == self) { + autoArray->_autocreator = nil; + } + } + } else { + // Type doesn't matter, it is a GPB*Array. + GPBInt32Array *gpbArray = arrayOrMap; + if (gpbArray->_autocreator == self) { + gpbArray->_autocreator = nil; + } + } + } else { + if ((field.mapKeyDataType == GPBDataTypeString) && + GPBFieldDataTypeIsObject(field)) { + if ([arrayOrMap isKindOfClass:[GPBAutocreatedDictionary class]]) { + GPBAutocreatedDictionary *autoDict = arrayOrMap; + if (autoDict->_autocreator == self) { + autoDict->_autocreator = nil; + } + } + } else { + // Type doesn't matter, it is a GPB*Dictionary. + GPBInt32Int32Dictionary *gpbDict = arrayOrMap; + if (gpbDict->_autocreator == self) { + gpbDict->_autocreator = nil; + } + } + } + [arrayOrMap release]; + } + } else if (GPBFieldDataTypeIsMessage(field)) { + GPBClearAutocreatedMessageIvarWithField(self, field); + GPBMessage *value = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [value release]; + } else if (GPBFieldDataTypeIsObject(field) && + GPBGetHasIvarField(self, field)) { + id value = GPBGetObjectIvarWithField(self, field); + [value release]; + } + } + + // GPBClearMessageAutocreator() expects that its caller has already been + // removed from autocreatedExtensionMap_ so we set to nil first. + NSArray *autocreatedValues = [autocreatedExtensionMap_ allValues]; + [autocreatedExtensionMap_ release]; + autocreatedExtensionMap_ = nil; + + // Since we're clearing all of our extensions, make sure that we clear the + // autocreator on any that we've created so they no longer refer to us. + for (GPBMessage *value in autocreatedValues) { + NSCAssert(GPBWasMessageAutocreatedBy(value, self), + @"Autocreated extension does not refer back to self."); + GPBClearMessageAutocreator(value); + } + + [extensionMap_ release]; + extensionMap_ = nil; + [unknownFields_ release]; + unknownFields_ = nil; + + // Note that clearing does not affect autocreator_. If we are being cleared + // because of a dealloc, then autocreator_ should be nil anyway. If we are + // being cleared because someone explicitly clears us, we don't want to + // sever our relationship with our autocreator. + + if (zeroStorage) { + memset(messageStorage_, 0, descriptor->storageSize_); + } +} + +- (BOOL)isInitialized { + GPBDescriptor *descriptor = [self descriptor]; + for (GPBFieldDescriptor *field in descriptor->fields_) { + if (field.isRequired) { + if (!GPBGetHasIvarField(self, field)) { + return NO; + } + } + if (GPBFieldDataTypeIsMessage(field)) { + GPBFieldType fieldType = field.fieldType; + if (fieldType == GPBFieldTypeSingle) { + if (field.isRequired) { + GPBMessage *message = GPBGetMessageMessageField(self, field); + if (!message.initialized) { + return NO; + } + } else { + NSAssert(field.isOptional, + @"%@: Single message field %@ not required or optional?", + [self class], field.name); + if (GPBGetHasIvarField(self, field)) { + GPBMessage *message = GPBGetMessageMessageField(self, field); + if (!message.initialized) { + return NO; + } + } + } + } else if (fieldType == GPBFieldTypeRepeated) { + NSArray *array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + for (GPBMessage *message in array) { + if (!message.initialized) { + return NO; + } + } + } else { // fieldType == GPBFieldTypeMap + if (field.mapKeyDataType == GPBDataTypeString) { + NSDictionary *map = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (map && !GPBDictionaryIsInitializedInternalHelper(map, field)) { + return NO; + } + } else { + // Real type is GPB*ObjectDictionary, exact type doesn't matter. + GPBInt32ObjectDictionary *map = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (map && ![map isInitialized]) { + return NO; + } + } + } + } + } + + __block BOOL result = YES; + [extensionMap_ + enumerateKeysAndObjectsUsingBlock:^(GPBExtensionDescriptor *extension, + id obj, + BOOL *stop) { + if (GPBExtensionIsMessage(extension)) { + if (extension.isRepeated) { + for (GPBMessage *msg in obj) { + if (!msg.initialized) { + result = NO; + *stop = YES; + break; + } + } + } else { + GPBMessage *asMsg = obj; + if (!asMsg.initialized) { + result = NO; + *stop = YES; + } + } + } + }]; + return result; +} + +- (GPBDescriptor *)descriptor { + return [[self class] descriptor]; +} + +- (NSData *)data { +#ifdef DEBUG + if (!self.initialized) { + return nil; + } +#endif + NSMutableData *data = [NSMutableData dataWithLength:[self serializedSize]]; + GPBCodedOutputStream *stream = + [[GPBCodedOutputStream alloc] initWithData:data]; + @try { + [self writeToCodedOutputStream:stream]; + } + @catch (NSException *exception) { + // This really shouldn't happen. The only way writeToCodedOutputStream: + // could throw is if something in the library has a bug and the + // serializedSize was wrong. +#ifdef DEBUG + NSLog(@"%@: Internal exception while building message data: %@", + [self class], exception); +#endif + data = nil; + } + [stream release]; + return data; +} + +- (NSData *)delimitedData { + size_t serializedSize = [self serializedSize]; + size_t varintSize = GPBComputeRawVarint32SizeForInteger(serializedSize); + NSMutableData *data = + [NSMutableData dataWithLength:(serializedSize + varintSize)]; + GPBCodedOutputStream *stream = + [[GPBCodedOutputStream alloc] initWithData:data]; + @try { + [self writeDelimitedToCodedOutputStream:stream]; + } + @catch (NSException *exception) { + // This really shouldn't happen. The only way writeToCodedOutputStream: + // could throw is if something in the library has a bug and the + // serializedSize was wrong. +#ifdef DEBUG + NSLog(@"%@: Internal exception while building message delimitedData: %@", + [self class], exception); +#endif + // If it happens, truncate. + data.length = 0; + } + [stream release]; + return data; +} + +- (void)writeToOutputStream:(NSOutputStream *)output { + GPBCodedOutputStream *stream = + [[GPBCodedOutputStream alloc] initWithOutputStream:output]; + [self writeToCodedOutputStream:stream]; + [stream release]; +} + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)output { + GPBDescriptor *descriptor = [self descriptor]; + NSArray *fieldsArray = descriptor->fields_; + NSUInteger fieldCount = fieldsArray.count; + const GPBExtensionRange *extensionRanges = descriptor.extensionRanges; + NSUInteger extensionRangesCount = descriptor.extensionRangesCount; + for (NSUInteger i = 0, j = 0; i < fieldCount || j < extensionRangesCount;) { + if (i == fieldCount) { + [self writeExtensionsToCodedOutputStream:output + range:extensionRanges[j++]]; + } else if (j == extensionRangesCount || + GPBFieldNumber(fieldsArray[i]) < extensionRanges[j].start) { + [self writeField:fieldsArray[i++] toCodedOutputStream:output]; + } else { + [self writeExtensionsToCodedOutputStream:output + range:extensionRanges[j++]]; + } + } + if (descriptor.isWireFormat) { + [unknownFields_ writeAsMessageSetTo:output]; + } else { + [unknownFields_ writeToCodedOutputStream:output]; + } +} + +- (void)writeDelimitedToOutputStream:(NSOutputStream *)output { + GPBCodedOutputStream *codedOutput = + [[GPBCodedOutputStream alloc] initWithOutputStream:output]; + [self writeDelimitedToCodedOutputStream:codedOutput]; + [codedOutput release]; +} + +- (void)writeDelimitedToCodedOutputStream:(GPBCodedOutputStream *)output { + [output writeRawVarintSizeTAs32:[self serializedSize]]; + [self writeToCodedOutputStream:output]; +} + +- (void)writeField:(GPBFieldDescriptor *)field + toCodedOutputStream:(GPBCodedOutputStream *)output { + GPBFieldType fieldType = field.fieldType; + if (fieldType == GPBFieldTypeSingle) { + BOOL has = GPBGetHasIvarField(self, field); + if (!has) { + return; + } + } + uint32_t fieldNumber = GPBFieldNumber(field); + +//%PDDM-DEFINE FIELD_CASE(TYPE, REAL_TYPE) +//%FIELD_CASE_FULL(TYPE, REAL_TYPE, REAL_TYPE) +//%PDDM-DEFINE FIELD_CASE_FULL(TYPE, REAL_TYPE, ARRAY_TYPE) +//% case GPBDataType##TYPE: +//% if (fieldType == GPBFieldTypeRepeated) { +//% uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; +//% GPB##ARRAY_TYPE##Array *array = +//% GPBGetObjectIvarWithFieldNoAutocreate(self, field); +//% [output write##TYPE##Array:fieldNumber values:array tag:tag]; +//% } else if (fieldType == GPBFieldTypeSingle) { +//% [output write##TYPE:fieldNumber +//% TYPE$S value:GPBGetMessage##REAL_TYPE##Field(self, field)]; +//% } else { // fieldType == GPBFieldTypeMap +//% // Exact type here doesn't matter. +//% GPBInt32##ARRAY_TYPE##Dictionary *dict = +//% GPBGetObjectIvarWithFieldNoAutocreate(self, field); +//% [dict writeToCodedOutputStream:output asField:field]; +//% } +//% break; +//% +//%PDDM-DEFINE FIELD_CASE2(TYPE) +//% case GPBDataType##TYPE: +//% if (fieldType == GPBFieldTypeRepeated) { +//% NSArray *array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); +//% [output write##TYPE##Array:fieldNumber values:array]; +//% } else if (fieldType == GPBFieldTypeSingle) { +//% // GPBGetObjectIvarWithFieldNoAutocreate() avoids doing the has check +//% // again. +//% [output write##TYPE:fieldNumber +//% TYPE$S value:GPBGetObjectIvarWithFieldNoAutocreate(self, field)]; +//% } else { // fieldType == GPBFieldTypeMap +//% // Exact type here doesn't matter. +//% id dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); +//% GPBDataType mapKeyDataType = field.mapKeyDataType; +//% if (mapKeyDataType == GPBDataTypeString) { +//% GPBDictionaryWriteToStreamInternalHelper(output, dict, field); +//% } else { +//% [dict writeToCodedOutputStream:output asField:field]; +//% } +//% } +//% break; +//% + + switch (GPBGetFieldDataType(field)) { + +//%PDDM-EXPAND FIELD_CASE(Bool, Bool) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeBool: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBBoolArray *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeBoolArray:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeBool:fieldNumber + value:GPBGetMessageBoolField(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32BoolDictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(Fixed32, UInt32) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeFixed32: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBUInt32Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeFixed32Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeFixed32:fieldNumber + value:GPBGetMessageUInt32Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32UInt32Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(SFixed32, Int32) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeSFixed32: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBInt32Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeSFixed32Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeSFixed32:fieldNumber + value:GPBGetMessageInt32Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32Int32Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(Float, Float) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeFloat: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBFloatArray *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeFloatArray:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeFloat:fieldNumber + value:GPBGetMessageFloatField(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32FloatDictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(Fixed64, UInt64) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeFixed64: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBUInt64Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeFixed64Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeFixed64:fieldNumber + value:GPBGetMessageUInt64Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32UInt64Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(SFixed64, Int64) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeSFixed64: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBInt64Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeSFixed64Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeSFixed64:fieldNumber + value:GPBGetMessageInt64Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32Int64Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(Double, Double) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeDouble: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBDoubleArray *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeDoubleArray:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeDouble:fieldNumber + value:GPBGetMessageDoubleField(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32DoubleDictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(Int32, Int32) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeInt32: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBInt32Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeInt32Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeInt32:fieldNumber + value:GPBGetMessageInt32Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32Int32Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(Int64, Int64) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeInt64: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBInt64Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeInt64Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeInt64:fieldNumber + value:GPBGetMessageInt64Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32Int64Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(SInt32, Int32) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeSInt32: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBInt32Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeSInt32Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeSInt32:fieldNumber + value:GPBGetMessageInt32Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32Int32Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(SInt64, Int64) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeSInt64: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBInt64Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeSInt64Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeSInt64:fieldNumber + value:GPBGetMessageInt64Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32Int64Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(UInt32, UInt32) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeUInt32: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBUInt32Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeUInt32Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeUInt32:fieldNumber + value:GPBGetMessageUInt32Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32UInt32Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE(UInt64, UInt64) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeUInt64: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBUInt64Array *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeUInt64Array:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeUInt64:fieldNumber + value:GPBGetMessageUInt64Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32UInt64Dictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE_FULL(Enum, Int32, Enum) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeEnum: + if (fieldType == GPBFieldTypeRepeated) { + uint32_t tag = field.isPackable ? GPBFieldTag(field) : 0; + GPBEnumArray *array = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeEnumArray:fieldNumber values:array tag:tag]; + } else if (fieldType == GPBFieldTypeSingle) { + [output writeEnum:fieldNumber + value:GPBGetMessageInt32Field(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + GPBInt32EnumDictionary *dict = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [dict writeToCodedOutputStream:output asField:field]; + } + break; + +//%PDDM-EXPAND FIELD_CASE2(Bytes) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeBytes: + if (fieldType == GPBFieldTypeRepeated) { + NSArray *array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeBytesArray:fieldNumber values:array]; + } else if (fieldType == GPBFieldTypeSingle) { + // GPBGetObjectIvarWithFieldNoAutocreate() avoids doing the has check + // again. + [output writeBytes:fieldNumber + value:GPBGetObjectIvarWithFieldNoAutocreate(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + id dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + GPBDataType mapKeyDataType = field.mapKeyDataType; + if (mapKeyDataType == GPBDataTypeString) { + GPBDictionaryWriteToStreamInternalHelper(output, dict, field); + } else { + [dict writeToCodedOutputStream:output asField:field]; + } + } + break; + +//%PDDM-EXPAND FIELD_CASE2(String) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeString: + if (fieldType == GPBFieldTypeRepeated) { + NSArray *array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeStringArray:fieldNumber values:array]; + } else if (fieldType == GPBFieldTypeSingle) { + // GPBGetObjectIvarWithFieldNoAutocreate() avoids doing the has check + // again. + [output writeString:fieldNumber + value:GPBGetObjectIvarWithFieldNoAutocreate(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + id dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + GPBDataType mapKeyDataType = field.mapKeyDataType; + if (mapKeyDataType == GPBDataTypeString) { + GPBDictionaryWriteToStreamInternalHelper(output, dict, field); + } else { + [dict writeToCodedOutputStream:output asField:field]; + } + } + break; + +//%PDDM-EXPAND FIELD_CASE2(Message) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeMessage: + if (fieldType == GPBFieldTypeRepeated) { + NSArray *array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeMessageArray:fieldNumber values:array]; + } else if (fieldType == GPBFieldTypeSingle) { + // GPBGetObjectIvarWithFieldNoAutocreate() avoids doing the has check + // again. + [output writeMessage:fieldNumber + value:GPBGetObjectIvarWithFieldNoAutocreate(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + id dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + GPBDataType mapKeyDataType = field.mapKeyDataType; + if (mapKeyDataType == GPBDataTypeString) { + GPBDictionaryWriteToStreamInternalHelper(output, dict, field); + } else { + [dict writeToCodedOutputStream:output asField:field]; + } + } + break; + +//%PDDM-EXPAND FIELD_CASE2(Group) +// This block of code is generated, do not edit it directly. + + case GPBDataTypeGroup: + if (fieldType == GPBFieldTypeRepeated) { + NSArray *array = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [output writeGroupArray:fieldNumber values:array]; + } else if (fieldType == GPBFieldTypeSingle) { + // GPBGetObjectIvarWithFieldNoAutocreate() avoids doing the has check + // again. + [output writeGroup:fieldNumber + value:GPBGetObjectIvarWithFieldNoAutocreate(self, field)]; + } else { // fieldType == GPBFieldTypeMap + // Exact type here doesn't matter. + id dict = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + GPBDataType mapKeyDataType = field.mapKeyDataType; + if (mapKeyDataType == GPBDataTypeString) { + GPBDictionaryWriteToStreamInternalHelper(output, dict, field); + } else { + [dict writeToCodedOutputStream:output asField:field]; + } + } + break; + +//%PDDM-EXPAND-END (18 expansions) + } +} + +#pragma mark - Extensions + +- (id)getExtension:(GPBExtensionDescriptor *)extension { + CheckExtension(self, extension); + id value = [extensionMap_ objectForKey:extension]; + if (value != nil) { + return value; + } + + // No default for repeated. + if (extension.isRepeated) { + return nil; + } + // Non messages get their default. + if (!GPBExtensionIsMessage(extension)) { + return extension.defaultValue; + } + + // Check for an autocreated value. + GPBPrepareReadOnlySemaphore(self); + dispatch_semaphore_wait(readOnlySemaphore_, DISPATCH_TIME_FOREVER); + value = [autocreatedExtensionMap_ objectForKey:extension]; + if (!value) { + // Auto create the message extensions to match normal fields. + value = CreateMessageWithAutocreatorForExtension(extension.msgClass, self, + extension); + + if (autocreatedExtensionMap_ == nil) { + autocreatedExtensionMap_ = [[NSMutableDictionary alloc] init]; + } + + // We can't simply call setExtension here because that would clear the new + // value's autocreator. + [autocreatedExtensionMap_ setObject:value forKey:extension]; + [value release]; + } + + dispatch_semaphore_signal(readOnlySemaphore_); + return value; +} + +- (id)getExistingExtension:(GPBExtensionDescriptor *)extension { + // This is an internal method so we don't need to call CheckExtension(). + return [extensionMap_ objectForKey:extension]; +} + +- (BOOL)hasExtension:(GPBExtensionDescriptor *)extension { +#if defined(DEBUG) && DEBUG + CheckExtension(self, extension); +#endif // DEBUG + return nil != [extensionMap_ objectForKey:extension]; +} + +- (NSArray *)extensionsCurrentlySet { + return [extensionMap_ allKeys]; +} + +- (void)writeExtensionsToCodedOutputStream:(GPBCodedOutputStream *)output + range:(GPBExtensionRange)range { + NSArray *sortedExtensions = [[extensionMap_ allKeys] + sortedArrayUsingSelector:@selector(compareByFieldNumber:)]; + uint32_t start = range.start; + uint32_t end = range.end; + for (GPBExtensionDescriptor *extension in sortedExtensions) { + uint32_t fieldNumber = extension.fieldNumber; + if (fieldNumber >= start && fieldNumber < end) { + id value = [extensionMap_ objectForKey:extension]; + GPBWriteExtensionValueToOutputStream(extension, value, output); + } + } +} + +- (void)setExtension:(GPBExtensionDescriptor *)extension value:(id)value { + if (!value) { + [self clearExtension:extension]; + return; + } + + CheckExtension(self, extension); + + if (extension.repeated) { + [NSException raise:NSInvalidArgumentException + format:@"Must call addExtension() for repeated types."]; + } + + if (extensionMap_ == nil) { + extensionMap_ = [[NSMutableDictionary alloc] init]; + } + + // This pointless cast is for CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION. + // Without it, the compiler complains we're passing an id nullable when + // setObject:forKey: requires a id nonnull for the value. The check for + // !value at the start of the method ensures it isn't nil, but the check + // isn't smart enough to realize that. + [extensionMap_ setObject:(id)value forKey:extension]; + + GPBExtensionDescriptor *descriptor = extension; + + if (GPBExtensionIsMessage(descriptor) && !descriptor.isRepeated) { + GPBMessage *autocreatedValue = + [[autocreatedExtensionMap_ objectForKey:extension] retain]; + // Must remove from the map before calling GPBClearMessageAutocreator() so + // that GPBClearMessageAutocreator() knows its safe to clear. + [autocreatedExtensionMap_ removeObjectForKey:extension]; + GPBClearMessageAutocreator(autocreatedValue); + [autocreatedValue release]; + } + + GPBBecomeVisibleToAutocreator(self); +} + +- (void)addExtension:(GPBExtensionDescriptor *)extension value:(id)value { + CheckExtension(self, extension); + + if (!extension.repeated) { + [NSException raise:NSInvalidArgumentException + format:@"Must call setExtension() for singular types."]; + } + + if (extensionMap_ == nil) { + extensionMap_ = [[NSMutableDictionary alloc] init]; + } + NSMutableArray *list = [extensionMap_ objectForKey:extension]; + if (list == nil) { + list = [NSMutableArray array]; + [extensionMap_ setObject:list forKey:extension]; + } + + [list addObject:value]; + GPBBecomeVisibleToAutocreator(self); +} + +- (void)setExtension:(GPBExtensionDescriptor *)extension + index:(NSUInteger)idx + value:(id)value { + CheckExtension(self, extension); + + if (!extension.repeated) { + [NSException raise:NSInvalidArgumentException + format:@"Must call setExtension() for singular types."]; + } + + if (extensionMap_ == nil) { + extensionMap_ = [[NSMutableDictionary alloc] init]; + } + + NSMutableArray *list = [extensionMap_ objectForKey:extension]; + + [list replaceObjectAtIndex:idx withObject:value]; + GPBBecomeVisibleToAutocreator(self); +} + +- (void)clearExtension:(GPBExtensionDescriptor *)extension { + CheckExtension(self, extension); + + // Only become visible if there was actually a value to clear. + if ([extensionMap_ objectForKey:extension]) { + [extensionMap_ removeObjectForKey:extension]; + GPBBecomeVisibleToAutocreator(self); + } +} + +#pragma mark - mergeFrom + +- (void)mergeFromData:(NSData *)data + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { + GPBCodedInputStream *input = [[GPBCodedInputStream alloc] initWithData:data]; + [self mergeFromCodedInputStream:input extensionRegistry:extensionRegistry]; + [input checkLastTagWas:0]; + [input release]; +} + +#pragma mark - mergeDelimitedFrom + +- (void)mergeDelimitedFromCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { + GPBCodedInputStreamState *state = &input->state_; + if (GPBCodedInputStreamIsAtEnd(state)) { + return; + } + NSData *data = GPBCodedInputStreamReadRetainedBytesNoCopy(state); + if (data == nil) { + return; + } + [self mergeFromData:data extensionRegistry:extensionRegistry]; + [data release]; +} + +#pragma mark - Parse From Data Support + ++ (instancetype)parseFromData:(NSData *)data error:(NSError **)errorPtr { + return [self parseFromData:data extensionRegistry:nil error:errorPtr]; +} + ++ (instancetype)parseFromData:(NSData *)data + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr { + return [[[self alloc] initWithData:data + extensionRegistry:extensionRegistry + error:errorPtr] autorelease]; +} + ++ (instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr { + return + [[[self alloc] initWithCodedInputStream:input + extensionRegistry:extensionRegistry + error:errorPtr] autorelease]; +} + +#pragma mark - Parse Delimited From Data Support + ++ (instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry: + (GPBExtensionRegistry *)extensionRegistry + error:(NSError **)errorPtr { + GPBMessage *message = [[[self alloc] init] autorelease]; + @try { + [message mergeDelimitedFromCodedInputStream:input + extensionRegistry:extensionRegistry]; + if (errorPtr) { + *errorPtr = nil; + } + } + @catch (NSException *exception) { + message = nil; + if (errorPtr) { + *errorPtr = ErrorFromException(exception); + } + } +#ifdef DEBUG + if (message && !message.initialized) { + message = nil; + if (errorPtr) { + *errorPtr = MessageError(GPBMessageErrorCodeMissingRequiredField, nil); + } + } +#endif + return message; +} + +#pragma mark - Unknown Field Support + +- (GPBUnknownFieldSet *)unknownFields { + return unknownFields_; +} + +- (void)setUnknownFields:(GPBUnknownFieldSet *)unknownFields { + if (unknownFields != unknownFields_) { + [unknownFields_ release]; + unknownFields_ = [unknownFields copy]; + GPBBecomeVisibleToAutocreator(self); + } +} + +- (void)parseMessageSet:(GPBCodedInputStream *)input + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { + uint32_t typeId = 0; + NSData *rawBytes = nil; + GPBExtensionDescriptor *extension = nil; + GPBCodedInputStreamState *state = &input->state_; + while (true) { + uint32_t tag = GPBCodedInputStreamReadTag(state); + if (tag == 0) { + break; + } + + if (tag == GPBWireFormatMessageSetTypeIdTag) { + typeId = GPBCodedInputStreamReadUInt32(state); + if (typeId != 0) { + extension = [extensionRegistry extensionForDescriptor:[self descriptor] + fieldNumber:typeId]; + } + } else if (tag == GPBWireFormatMessageSetMessageTag) { + rawBytes = + [GPBCodedInputStreamReadRetainedBytesNoCopy(state) autorelease]; + } else { + if (![input skipField:tag]) { + break; + } + } + } + + [input checkLastTagWas:GPBWireFormatMessageSetItemEndTag]; + + if (rawBytes != nil && typeId != 0) { + if (extension != nil) { + GPBCodedInputStream *newInput = + [[GPBCodedInputStream alloc] initWithData:rawBytes]; + GPBExtensionMergeFromInputStream(extension, + extension.packable, + newInput, + extensionRegistry, + self); + [newInput release]; + } else { + GPBUnknownFieldSet *unknownFields = GetOrMakeUnknownFields(self); + [unknownFields mergeMessageSetMessage:typeId data:rawBytes]; + } + } +} + +- (BOOL)parseUnknownField:(GPBCodedInputStream *)input + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry + tag:(uint32_t)tag { + GPBWireFormat wireType = GPBWireFormatGetTagWireType(tag); + int32_t fieldNumber = GPBWireFormatGetTagFieldNumber(tag); + + GPBDescriptor *descriptor = [self descriptor]; + GPBExtensionDescriptor *extension = + [extensionRegistry extensionForDescriptor:descriptor + fieldNumber:fieldNumber]; + if (extension == nil) { + if (descriptor.wireFormat && GPBWireFormatMessageSetItemTag == tag) { + [self parseMessageSet:input extensionRegistry:extensionRegistry]; + return YES; + } + } else { + if (extension.wireType == wireType) { + GPBExtensionMergeFromInputStream(extension, + extension.packable, + input, + extensionRegistry, + self); + return YES; + } + // Primitive, repeated types can be packed on unpacked on the wire, and are + // parsed either way. + if ([extension isRepeated] && + !GPBDataTypeIsObject(extension->description_->dataType) && + (extension.alternateWireType == wireType)) { + GPBExtensionMergeFromInputStream(extension, + !extension.packable, + input, + extensionRegistry, + self); + return YES; + } + } + if ([GPBUnknownFieldSet isFieldTag:tag]) { + GPBUnknownFieldSet *unknownFields = GetOrMakeUnknownFields(self); + return [unknownFields mergeFieldFrom:tag input:input]; + } else { + return NO; + } +} + +- (void)addUnknownMapEntry:(int32_t)fieldNum value:(NSData *)data { + GPBUnknownFieldSet *unknownFields = GetOrMakeUnknownFields(self); + [unknownFields addUnknownMapEntry:fieldNum value:data]; +} + +#pragma mark - MergeFromCodedInputStream Support + +static void MergeSingleFieldFromCodedInputStream( + GPBMessage *self, GPBFieldDescriptor *field, GPBFileSyntax syntax, + GPBCodedInputStream *input, GPBExtensionRegistry *extensionRegistry) { + GPBDataType fieldDataType = GPBGetFieldDataType(field); + switch (fieldDataType) { +#define CASE_SINGLE_POD(NAME, TYPE, FUNC_TYPE) \ + case GPBDataType##NAME: { \ + TYPE val = GPBCodedInputStreamRead##NAME(&input->state_); \ + GPBSet##FUNC_TYPE##IvarWithFieldInternal(self, field, val, syntax); \ + break; \ + } +#define CASE_SINGLE_OBJECT(NAME) \ + case GPBDataType##NAME: { \ + id val = GPBCodedInputStreamReadRetained##NAME(&input->state_); \ + GPBSetRetainedObjectIvarWithFieldInternal(self, field, val, syntax); \ + break; \ + } + CASE_SINGLE_POD(Bool, BOOL, Bool) + CASE_SINGLE_POD(Fixed32, uint32_t, UInt32) + CASE_SINGLE_POD(SFixed32, int32_t, Int32) + CASE_SINGLE_POD(Float, float, Float) + CASE_SINGLE_POD(Fixed64, uint64_t, UInt64) + CASE_SINGLE_POD(SFixed64, int64_t, Int64) + CASE_SINGLE_POD(Double, double, Double) + CASE_SINGLE_POD(Int32, int32_t, Int32) + CASE_SINGLE_POD(Int64, int64_t, Int64) + CASE_SINGLE_POD(SInt32, int32_t, Int32) + CASE_SINGLE_POD(SInt64, int64_t, Int64) + CASE_SINGLE_POD(UInt32, uint32_t, UInt32) + CASE_SINGLE_POD(UInt64, uint64_t, UInt64) + CASE_SINGLE_OBJECT(Bytes) + CASE_SINGLE_OBJECT(String) +#undef CASE_SINGLE_POD +#undef CASE_SINGLE_OBJECT + + case GPBDataTypeMessage: { + if (GPBGetHasIvarField(self, field)) { + // GPBGetObjectIvarWithFieldNoAutocreate() avoids doing the has + // check again. + GPBMessage *message = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [input readMessage:message extensionRegistry:extensionRegistry]; + } else { + GPBMessage *message = [[field.msgClass alloc] init]; + [input readMessage:message extensionRegistry:extensionRegistry]; + GPBSetRetainedObjectIvarWithFieldInternal(self, field, message, syntax); + } + break; + } + + case GPBDataTypeGroup: { + if (GPBGetHasIvarField(self, field)) { + // GPBGetObjectIvarWithFieldNoAutocreate() avoids doing the has + // check again. + GPBMessage *message = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [input readGroup:GPBFieldNumber(field) + message:message + extensionRegistry:extensionRegistry]; + } else { + GPBMessage *message = [[field.msgClass alloc] init]; + [input readGroup:GPBFieldNumber(field) + message:message + extensionRegistry:extensionRegistry]; + GPBSetRetainedObjectIvarWithFieldInternal(self, field, message, syntax); + } + break; + } + + case GPBDataTypeEnum: { + int32_t val = GPBCodedInputStreamReadEnum(&input->state_); + if (GPBHasPreservingUnknownEnumSemantics(syntax) || + [field isValidEnumValue:val]) { + GPBSetInt32IvarWithFieldInternal(self, field, val, syntax); + } else { + GPBUnknownFieldSet *unknownFields = GetOrMakeUnknownFields(self); + [unknownFields mergeVarintField:GPBFieldNumber(field) value:val]; + } + } + } // switch +} + +static void MergeRepeatedPackedFieldFromCodedInputStream( + GPBMessage *self, GPBFieldDescriptor *field, GPBFileSyntax syntax, + GPBCodedInputStream *input) { + GPBDataType fieldDataType = GPBGetFieldDataType(field); + GPBCodedInputStreamState *state = &input->state_; + id genericArray = GetOrCreateArrayIvarWithField(self, field, syntax); + int32_t length = GPBCodedInputStreamReadInt32(state); + size_t limit = GPBCodedInputStreamPushLimit(state, length); + while (GPBCodedInputStreamBytesUntilLimit(state) > 0) { + switch (fieldDataType) { +#define CASE_REPEATED_PACKED_POD(NAME, TYPE, ARRAY_TYPE) \ + case GPBDataType##NAME: { \ + TYPE val = GPBCodedInputStreamRead##NAME(state); \ + [(GPB##ARRAY_TYPE##Array *)genericArray addValue:val]; \ + break; \ + } + CASE_REPEATED_PACKED_POD(Bool, BOOL, Bool) + CASE_REPEATED_PACKED_POD(Fixed32, uint32_t, UInt32) + CASE_REPEATED_PACKED_POD(SFixed32, int32_t, Int32) + CASE_REPEATED_PACKED_POD(Float, float, Float) + CASE_REPEATED_PACKED_POD(Fixed64, uint64_t, UInt64) + CASE_REPEATED_PACKED_POD(SFixed64, int64_t, Int64) + CASE_REPEATED_PACKED_POD(Double, double, Double) + CASE_REPEATED_PACKED_POD(Int32, int32_t, Int32) + CASE_REPEATED_PACKED_POD(Int64, int64_t, Int64) + CASE_REPEATED_PACKED_POD(SInt32, int32_t, Int32) + CASE_REPEATED_PACKED_POD(SInt64, int64_t, Int64) + CASE_REPEATED_PACKED_POD(UInt32, uint32_t, UInt32) + CASE_REPEATED_PACKED_POD(UInt64, uint64_t, UInt64) +#undef CASE_REPEATED_PACKED_POD + + case GPBDataTypeBytes: + case GPBDataTypeString: + case GPBDataTypeMessage: + case GPBDataTypeGroup: + NSCAssert(NO, @"Non primitive types can't be packed"); + break; + + case GPBDataTypeEnum: { + int32_t val = GPBCodedInputStreamReadEnum(state); + if (GPBHasPreservingUnknownEnumSemantics(syntax) || + [field isValidEnumValue:val]) { + [(GPBEnumArray*)genericArray addRawValue:val]; + } else { + GPBUnknownFieldSet *unknownFields = GetOrMakeUnknownFields(self); + [unknownFields mergeVarintField:GPBFieldNumber(field) value:val]; + } + break; + } + } // switch + } // while(BytesUntilLimit() > 0) + GPBCodedInputStreamPopLimit(state, limit); +} + +static void MergeRepeatedNotPackedFieldFromCodedInputStream( + GPBMessage *self, GPBFieldDescriptor *field, GPBFileSyntax syntax, + GPBCodedInputStream *input, GPBExtensionRegistry *extensionRegistry) { + GPBCodedInputStreamState *state = &input->state_; + id genericArray = GetOrCreateArrayIvarWithField(self, field, syntax); + switch (GPBGetFieldDataType(field)) { +#define CASE_REPEATED_NOT_PACKED_POD(NAME, TYPE, ARRAY_TYPE) \ + case GPBDataType##NAME: { \ + TYPE val = GPBCodedInputStreamRead##NAME(state); \ + [(GPB##ARRAY_TYPE##Array *)genericArray addValue:val]; \ + break; \ + } +#define CASE_REPEATED_NOT_PACKED_OBJECT(NAME) \ + case GPBDataType##NAME: { \ + id val = GPBCodedInputStreamReadRetained##NAME(state); \ + [(NSMutableArray*)genericArray addObject:val]; \ + [val release]; \ + break; \ + } + CASE_REPEATED_NOT_PACKED_POD(Bool, BOOL, Bool) + CASE_REPEATED_NOT_PACKED_POD(Fixed32, uint32_t, UInt32) + CASE_REPEATED_NOT_PACKED_POD(SFixed32, int32_t, Int32) + CASE_REPEATED_NOT_PACKED_POD(Float, float, Float) + CASE_REPEATED_NOT_PACKED_POD(Fixed64, uint64_t, UInt64) + CASE_REPEATED_NOT_PACKED_POD(SFixed64, int64_t, Int64) + CASE_REPEATED_NOT_PACKED_POD(Double, double, Double) + CASE_REPEATED_NOT_PACKED_POD(Int32, int32_t, Int32) + CASE_REPEATED_NOT_PACKED_POD(Int64, int64_t, Int64) + CASE_REPEATED_NOT_PACKED_POD(SInt32, int32_t, Int32) + CASE_REPEATED_NOT_PACKED_POD(SInt64, int64_t, Int64) + CASE_REPEATED_NOT_PACKED_POD(UInt32, uint32_t, UInt32) + CASE_REPEATED_NOT_PACKED_POD(UInt64, uint64_t, UInt64) + CASE_REPEATED_NOT_PACKED_OBJECT(Bytes) + CASE_REPEATED_NOT_PACKED_OBJECT(String) +#undef CASE_REPEATED_NOT_PACKED_POD +#undef CASE_NOT_PACKED_OBJECT + case GPBDataTypeMessage: { + GPBMessage *message = [[field.msgClass alloc] init]; + [input readMessage:message extensionRegistry:extensionRegistry]; + [(NSMutableArray*)genericArray addObject:message]; + [message release]; + break; + } + case GPBDataTypeGroup: { + GPBMessage *message = [[field.msgClass alloc] init]; + [input readGroup:GPBFieldNumber(field) + message:message + extensionRegistry:extensionRegistry]; + [(NSMutableArray*)genericArray addObject:message]; + [message release]; + break; + } + case GPBDataTypeEnum: { + int32_t val = GPBCodedInputStreamReadEnum(state); + if (GPBHasPreservingUnknownEnumSemantics(syntax) || + [field isValidEnumValue:val]) { + [(GPBEnumArray*)genericArray addRawValue:val]; + } else { + GPBUnknownFieldSet *unknownFields = GetOrMakeUnknownFields(self); + [unknownFields mergeVarintField:GPBFieldNumber(field) value:val]; + } + break; + } + } // switch +} + +- (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry { + GPBDescriptor *descriptor = [self descriptor]; + GPBFileSyntax syntax = descriptor.file.syntax; + GPBCodedInputStreamState *state = &input->state_; + uint32_t tag = 0; + NSUInteger startingIndex = 0; + NSArray *fields = descriptor->fields_; + NSUInteger numFields = fields.count; + while (YES) { + BOOL merged = NO; + tag = GPBCodedInputStreamReadTag(state); + if (tag == 0) { + break; // Reached end. + } + for (NSUInteger i = 0; i < numFields; ++i) { + if (startingIndex >= numFields) startingIndex = 0; + GPBFieldDescriptor *fieldDescriptor = fields[startingIndex]; + if (GPBFieldTag(fieldDescriptor) == tag) { + GPBFieldType fieldType = fieldDescriptor.fieldType; + if (fieldType == GPBFieldTypeSingle) { + MergeSingleFieldFromCodedInputStream(self, fieldDescriptor, syntax, + input, extensionRegistry); + // Well formed protos will only have a single field once, advance + // the starting index to the next field. + startingIndex += 1; + } else if (fieldType == GPBFieldTypeRepeated) { + if (fieldDescriptor.isPackable) { + MergeRepeatedPackedFieldFromCodedInputStream( + self, fieldDescriptor, syntax, input); + // Well formed protos will only have a repeated field that is + // packed once, advance the starting index to the next field. + startingIndex += 1; + } else { + MergeRepeatedNotPackedFieldFromCodedInputStream( + self, fieldDescriptor, syntax, input, extensionRegistry); + } + } else { // fieldType == GPBFieldTypeMap + // GPB*Dictionary or NSDictionary, exact type doesn't matter at this + // point. + id map = GetOrCreateMapIvarWithField(self, fieldDescriptor, syntax); + [input readMapEntry:map + extensionRegistry:extensionRegistry + field:fieldDescriptor + parentMessage:self]; + } + merged = YES; + break; + } else { + startingIndex += 1; + } + } // for(i < numFields) + + if (!merged && (tag != 0)) { + // Primitive, repeated types can be packed on unpacked on the wire, and + // are parsed either way. The above loop covered tag in the preferred + // for, so this need to check the alternate form. + for (NSUInteger i = 0; i < numFields; ++i) { + if (startingIndex >= numFields) startingIndex = 0; + GPBFieldDescriptor *fieldDescriptor = fields[startingIndex]; + if ((fieldDescriptor.fieldType == GPBFieldTypeRepeated) && + !GPBFieldDataTypeIsObject(fieldDescriptor) && + (GPBFieldAlternateTag(fieldDescriptor) == tag)) { + BOOL alternateIsPacked = !fieldDescriptor.isPackable; + if (alternateIsPacked) { + MergeRepeatedPackedFieldFromCodedInputStream( + self, fieldDescriptor, syntax, input); + // Well formed protos will only have a repeated field that is + // packed once, advance the starting index to the next field. + startingIndex += 1; + } else { + MergeRepeatedNotPackedFieldFromCodedInputStream( + self, fieldDescriptor, syntax, input, extensionRegistry); + } + merged = YES; + break; + } else { + startingIndex += 1; + } + } + } + + if (!merged) { + if (tag == 0) { + // zero signals EOF / limit reached + return; + } else { + if (GPBPreserveUnknownFields(syntax)) { + if (![self parseUnknownField:input + extensionRegistry:extensionRegistry + tag:tag]) { + // it's an endgroup tag + return; + } + } else { + if (![input skipField:tag]) { + return; + } + } + } + } // if(!merged) + + } // while(YES) +} + +#pragma mark - MergeFrom Support + +- (void)mergeFrom:(GPBMessage *)other { + Class selfClass = [self class]; + Class otherClass = [other class]; + if (!([selfClass isSubclassOfClass:otherClass] || + [otherClass isSubclassOfClass:selfClass])) { + [NSException raise:NSInvalidArgumentException + format:@"Classes must match %@ != %@", selfClass, otherClass]; + } + + // We assume something will be done and become visible. + GPBBecomeVisibleToAutocreator(self); + + GPBDescriptor *descriptor = [[self class] descriptor]; + GPBFileSyntax syntax = descriptor.file.syntax; + + for (GPBFieldDescriptor *field in descriptor->fields_) { + GPBFieldType fieldType = field.fieldType; + if (fieldType == GPBFieldTypeSingle) { + int32_t hasIndex = GPBFieldHasIndex(field); + uint32_t fieldNumber = GPBFieldNumber(field); + if (!GPBGetHasIvar(other, hasIndex, fieldNumber)) { + // Other doesn't have the field set, on to the next. + continue; + } + GPBDataType fieldDataType = GPBGetFieldDataType(field); + switch (fieldDataType) { + case GPBDataTypeBool: + GPBSetBoolIvarWithFieldInternal( + self, field, GPBGetMessageBoolField(other, field), syntax); + break; + case GPBDataTypeSFixed32: + case GPBDataTypeEnum: + case GPBDataTypeInt32: + case GPBDataTypeSInt32: + GPBSetInt32IvarWithFieldInternal( + self, field, GPBGetMessageInt32Field(other, field), syntax); + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + GPBSetUInt32IvarWithFieldInternal( + self, field, GPBGetMessageUInt32Field(other, field), syntax); + break; + case GPBDataTypeSFixed64: + case GPBDataTypeInt64: + case GPBDataTypeSInt64: + GPBSetInt64IvarWithFieldInternal( + self, field, GPBGetMessageInt64Field(other, field), syntax); + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + GPBSetUInt64IvarWithFieldInternal( + self, field, GPBGetMessageUInt64Field(other, field), syntax); + break; + case GPBDataTypeFloat: + GPBSetFloatIvarWithFieldInternal( + self, field, GPBGetMessageFloatField(other, field), syntax); + break; + case GPBDataTypeDouble: + GPBSetDoubleIvarWithFieldInternal( + self, field, GPBGetMessageDoubleField(other, field), syntax); + break; + case GPBDataTypeBytes: + case GPBDataTypeString: { + id otherVal = GPBGetObjectIvarWithFieldNoAutocreate(other, field); + GPBSetObjectIvarWithFieldInternal(self, field, otherVal, syntax); + break; + } + case GPBDataTypeMessage: + case GPBDataTypeGroup: { + id otherVal = GPBGetObjectIvarWithFieldNoAutocreate(other, field); + if (GPBGetHasIvar(self, hasIndex, fieldNumber)) { + GPBMessage *message = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + [message mergeFrom:otherVal]; + } else { + GPBMessage *message = [otherVal copy]; + GPBSetRetainedObjectIvarWithFieldInternal(self, field, message, + syntax); + } + break; + } + } // switch() + } else if (fieldType == GPBFieldTypeRepeated) { + // In the case of a list, they need to be appended, and there is no + // _hasIvar to worry about setting. + id otherArray = + GPBGetObjectIvarWithFieldNoAutocreate(other, field); + if (otherArray) { + GPBDataType fieldDataType = field->description_->dataType; + if (GPBDataTypeIsObject(fieldDataType)) { + NSMutableArray *resultArray = + GetOrCreateArrayIvarWithField(self, field, syntax); + [resultArray addObjectsFromArray:otherArray]; + } else if (fieldDataType == GPBDataTypeEnum) { + GPBEnumArray *resultArray = + GetOrCreateArrayIvarWithField(self, field, syntax); + [resultArray addRawValuesFromArray:otherArray]; + } else { + // The array type doesn't matter, that all implment + // -addValuesFromArray:. + GPBInt32Array *resultArray = + GetOrCreateArrayIvarWithField(self, field, syntax); + [resultArray addValuesFromArray:otherArray]; + } + } + } else { // fieldType = GPBFieldTypeMap + // In the case of a map, they need to be merged, and there is no + // _hasIvar to worry about setting. + id otherDict = GPBGetObjectIvarWithFieldNoAutocreate(other, field); + if (otherDict) { + GPBDataType keyDataType = field.mapKeyDataType; + GPBDataType valueDataType = field->description_->dataType; + if (GPBDataTypeIsObject(keyDataType) && + GPBDataTypeIsObject(valueDataType)) { + NSMutableDictionary *resultDict = + GetOrCreateMapIvarWithField(self, field, syntax); + [resultDict addEntriesFromDictionary:otherDict]; + } else if (valueDataType == GPBDataTypeEnum) { + // The exact type doesn't matter, just need to know it is a + // GPB*EnumDictionary. + GPBInt32EnumDictionary *resultDict = + GetOrCreateMapIvarWithField(self, field, syntax); + [resultDict addRawEntriesFromDictionary:otherDict]; + } else { + // The exact type doesn't matter, they all implement + // -addEntriesFromDictionary:. + GPBInt32Int32Dictionary *resultDict = + GetOrCreateMapIvarWithField(self, field, syntax); + [resultDict addEntriesFromDictionary:otherDict]; + } + } + } // if (fieldType)..else if...else + } // for(fields) + + // Unknown fields. + if (!unknownFields_) { + [self setUnknownFields:other.unknownFields]; + } else { + [unknownFields_ mergeUnknownFields:other.unknownFields]; + } + + // Extensions + + if (other->extensionMap_.count == 0) { + return; + } + + if (extensionMap_ == nil) { + extensionMap_ = + CloneExtensionMap(other->extensionMap_, NSZoneFromPointer(self)); + } else { + for (GPBExtensionDescriptor *extension in other->extensionMap_) { + id otherValue = [other->extensionMap_ objectForKey:extension]; + id value = [extensionMap_ objectForKey:extension]; + BOOL isMessageExtension = GPBExtensionIsMessage(extension); + + if (extension.repeated) { + NSMutableArray *list = value; + if (list == nil) { + list = [[NSMutableArray alloc] init]; + [extensionMap_ setObject:list forKey:extension]; + [list release]; + } + if (isMessageExtension) { + for (GPBMessage *otherListValue in otherValue) { + GPBMessage *copiedValue = [otherListValue copy]; + [list addObject:copiedValue]; + [copiedValue release]; + } + } else { + [list addObjectsFromArray:otherValue]; + } + } else { + if (isMessageExtension) { + if (value) { + [(GPBMessage *)value mergeFrom:(GPBMessage *)otherValue]; + } else { + GPBMessage *copiedValue = [otherValue copy]; + [extensionMap_ setObject:copiedValue forKey:extension]; + [copiedValue release]; + } + } else { + [extensionMap_ setObject:otherValue forKey:extension]; + } + } + + if (isMessageExtension && !extension.isRepeated) { + GPBMessage *autocreatedValue = + [[autocreatedExtensionMap_ objectForKey:extension] retain]; + // Must remove from the map before calling GPBClearMessageAutocreator() + // so that GPBClearMessageAutocreator() knows its safe to clear. + [autocreatedExtensionMap_ removeObjectForKey:extension]; + GPBClearMessageAutocreator(autocreatedValue); + [autocreatedValue release]; + } + } + } +} + +#pragma mark - isEqual: & hash Support + +- (BOOL)isEqual:(id)other { + if (other == self) { + return YES; + } + if (![other isKindOfClass:[self class]] && + ![self isKindOfClass:[other class]]) { + return NO; + } + + GPBMessage *otherMsg = other; + GPBDescriptor *descriptor = [[self class] descriptor]; + uint8_t *selfStorage = (uint8_t *)messageStorage_; + uint8_t *otherStorage = (uint8_t *)otherMsg->messageStorage_; + + for (GPBFieldDescriptor *field in descriptor->fields_) { + if (GPBFieldIsMapOrArray(field)) { + // In the case of a list or map, there is no _hasIvar to worry about. + // NOTE: These are NSArray/GPB*Array or NSDictionary/GPB*Dictionary, but + // the type doesn't really matter as the objects all support -count and + // -isEqual:. + NSArray *resultMapOrArray = + GPBGetObjectIvarWithFieldNoAutocreate(self, field); + NSArray *otherMapOrArray = + GPBGetObjectIvarWithFieldNoAutocreate(other, field); + // nil and empty are equal + if (resultMapOrArray.count != 0 || otherMapOrArray.count != 0) { + if (![resultMapOrArray isEqual:otherMapOrArray]) { + return NO; + } + } + } else { // Single field + int32_t hasIndex = GPBFieldHasIndex(field); + uint32_t fieldNum = GPBFieldNumber(field); + BOOL selfHas = GPBGetHasIvar(self, hasIndex, fieldNum); + BOOL otherHas = GPBGetHasIvar(other, hasIndex, fieldNum); + if (selfHas != otherHas) { + return NO; // Differing has values, not equal. + } + if (!selfHas) { + // Same has values, was no, nothing else to check for this field. + continue; + } + // Now compare the values. + GPBDataType fieldDataType = GPBGetFieldDataType(field); + size_t fieldOffset = field->description_->offset; + switch (fieldDataType) { + case GPBDataTypeBool: { + // Bools are stored in has_bits to avoid needing explicit space in + // the storage structure. + // (the field number passed to the HasIvar helper doesn't really + // matter since the offset is never negative) + BOOL selfValue = GPBGetHasIvar(self, (int32_t)(fieldOffset), 0); + BOOL otherValue = GPBGetHasIvar(other, (int32_t)(fieldOffset), 0); + if (selfValue != otherValue) { + return NO; + } + break; + } + case GPBDataTypeSFixed32: + case GPBDataTypeInt32: + case GPBDataTypeSInt32: + case GPBDataTypeEnum: + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + case GPBDataTypeFloat: { + GPBInternalCompileAssert(sizeof(float) == sizeof(uint32_t), float_not_32_bits); + // These are all 32bit, signed/unsigned doesn't matter for equality. + uint32_t *selfValPtr = (uint32_t *)&selfStorage[fieldOffset]; + uint32_t *otherValPtr = (uint32_t *)&otherStorage[fieldOffset]; + if (*selfValPtr != *otherValPtr) { + return NO; + } + break; + } + case GPBDataTypeSFixed64: + case GPBDataTypeInt64: + case GPBDataTypeSInt64: + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + case GPBDataTypeDouble: { + GPBInternalCompileAssert(sizeof(double) == sizeof(uint64_t), double_not_64_bits); + // These are all 64bit, signed/unsigned doesn't matter for equality. + uint64_t *selfValPtr = (uint64_t *)&selfStorage[fieldOffset]; + uint64_t *otherValPtr = (uint64_t *)&otherStorage[fieldOffset]; + if (*selfValPtr != *otherValPtr) { + return NO; + } + break; + } + case GPBDataTypeBytes: + case GPBDataTypeString: + case GPBDataTypeMessage: + case GPBDataTypeGroup: { + // Type doesn't matter here, they all implement -isEqual:. + id *selfValPtr = (id *)&selfStorage[fieldOffset]; + id *otherValPtr = (id *)&otherStorage[fieldOffset]; + if (![*selfValPtr isEqual:*otherValPtr]) { + return NO; + } + break; + } + } // switch() + } // if(mapOrArray)...else + } // for(fields) + + // nil and empty are equal + if (extensionMap_.count != 0 || otherMsg->extensionMap_.count != 0) { + if (![extensionMap_ isEqual:otherMsg->extensionMap_]) { + return NO; + } + } + + // nil and empty are equal + GPBUnknownFieldSet *otherUnknowns = otherMsg->unknownFields_; + if ([unknownFields_ countOfFields] != 0 || + [otherUnknowns countOfFields] != 0) { + if (![unknownFields_ isEqual:otherUnknowns]) { + return NO; + } + } + + return YES; +} + +// It is very difficult to implement a generic hash for ProtoBuf messages that +// will perform well. If you need hashing on your ProtoBufs (eg you are using +// them as dictionary keys) you will probably want to implement a ProtoBuf +// message specific hash as a category on your protobuf class. Do not make it a +// category on GPBMessage as you will conflict with this hash, and will possibly +// override hash for all generated protobufs. A good implementation of hash will +// be really fast, so we would recommend only hashing protobufs that have an +// identifier field of some kind that you can easily hash. If you implement +// hash, we would strongly recommend overriding isEqual: in your category as +// well, as the default implementation of isEqual: is extremely slow, and may +// drastically affect performance in large sets. +- (NSUInteger)hash { + GPBDescriptor *descriptor = [[self class] descriptor]; + const NSUInteger prime = 19; + uint8_t *storage = (uint8_t *)messageStorage_; + + // Start with the descriptor and then mix it with some instance info. + // Hopefully that will give a spread based on classes and what fields are set. + NSUInteger result = (NSUInteger)descriptor; + + for (GPBFieldDescriptor *field in descriptor->fields_) { + if (GPBFieldIsMapOrArray(field)) { + // Exact type doesn't matter, just check if there are any elements. + NSArray *mapOrArray = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + NSUInteger count = mapOrArray.count; + if (count) { + // NSArray/NSDictionary use count, use the field number and the count. + result = prime * result + GPBFieldNumber(field); + result = prime * result + count; + } + } else if (GPBGetHasIvarField(self, field)) { + // Just using the field number seemed simple/fast, but then a small + // message class where all the same fields are always set (to different + // things would end up all with the same hash, so pull in some data). + GPBDataType fieldDataType = GPBGetFieldDataType(field); + size_t fieldOffset = field->description_->offset; + switch (fieldDataType) { + case GPBDataTypeBool: { + // Bools are stored in has_bits to avoid needing explicit space in + // the storage structure. + // (the field number passed to the HasIvar helper doesn't really + // matter since the offset is never negative) + BOOL value = GPBGetHasIvar(self, (int32_t)(fieldOffset), 0); + result = prime * result + value; + break; + } + case GPBDataTypeSFixed32: + case GPBDataTypeInt32: + case GPBDataTypeSInt32: + case GPBDataTypeEnum: + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + case GPBDataTypeFloat: { + GPBInternalCompileAssert(sizeof(float) == sizeof(uint32_t), float_not_32_bits); + // These are all 32bit, just mix it in. + uint32_t *valPtr = (uint32_t *)&storage[fieldOffset]; + result = prime * result + *valPtr; + break; + } + case GPBDataTypeSFixed64: + case GPBDataTypeInt64: + case GPBDataTypeSInt64: + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + case GPBDataTypeDouble: { + GPBInternalCompileAssert(sizeof(double) == sizeof(uint64_t), double_not_64_bits); + // These are all 64bit, just mix what fits into an NSUInteger in. + uint64_t *valPtr = (uint64_t *)&storage[fieldOffset]; + result = prime * result + (NSUInteger)(*valPtr); + break; + } + case GPBDataTypeBytes: + case GPBDataTypeString: { + // Type doesn't matter here, they both implement -hash:. + id *valPtr = (id *)&storage[fieldOffset]; + result = prime * result + [*valPtr hash]; + break; + } + + case GPBDataTypeMessage: + case GPBDataTypeGroup: { + GPBMessage **valPtr = (GPBMessage **)&storage[fieldOffset]; + // Could call -hash on the sub message, but that could recurse pretty + // deep; follow the lead of NSArray/NSDictionary and don't really + // recurse for hash, instead use the field number and the descriptor + // of the sub message. Yes, this could suck for a bunch of messages + // where they all only differ in the sub messages, but if you are + // using a message with sub messages for something that needs -hash, + // odds are you are also copying them as keys, and that deep copy + // will also suck. + result = prime * result + GPBFieldNumber(field); + result = prime * result + (NSUInteger)[[*valPtr class] descriptor]; + break; + } + } // switch() + } + } + + // Unknowns and extensions are not included. + + return result; +} + +#pragma mark - Description Support + +- (NSString *)description { + NSString *textFormat = GPBTextFormatForMessage(self, @" "); + NSString *description = [NSString + stringWithFormat:@"<%@ %p>: {\n%@}", [self class], self, textFormat]; + return description; +} + +#if defined(DEBUG) && DEBUG + +// Xcode 5.1 added support for custom quick look info. +// https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/CustomClassDisplay_in_QuickLook/CH01-quick_look_for_custom_objects/CH01-quick_look_for_custom_objects.html#//apple_ref/doc/uid/TP40014001-CH2-SW1 +- (id)debugQuickLookObject { + return GPBTextFormatForMessage(self, nil); +} + +#endif // DEBUG + +#pragma mark - SerializedSize + +- (size_t)serializedSize { + GPBDescriptor *descriptor = [[self class] descriptor]; + size_t result = 0; + + // Has check is done explicitly, so GPBGetObjectIvarWithFieldNoAutocreate() + // avoids doing the has check again. + + // Fields. + for (GPBFieldDescriptor *fieldDescriptor in descriptor->fields_) { + GPBFieldType fieldType = fieldDescriptor.fieldType; + GPBDataType fieldDataType = GPBGetFieldDataType(fieldDescriptor); + + // Single Fields + if (fieldType == GPBFieldTypeSingle) { + BOOL selfHas = GPBGetHasIvarField(self, fieldDescriptor); + if (!selfHas) { + continue; // Nothing to do. + } + + uint32_t fieldNumber = GPBFieldNumber(fieldDescriptor); + + switch (fieldDataType) { +#define CASE_SINGLE_POD(NAME, TYPE, FUNC_TYPE) \ + case GPBDataType##NAME: { \ + TYPE fieldVal = GPBGetMessage##FUNC_TYPE##Field(self, fieldDescriptor); \ + result += GPBCompute##NAME##Size(fieldNumber, fieldVal); \ + break; \ + } +#define CASE_SINGLE_OBJECT(NAME) \ + case GPBDataType##NAME: { \ + id fieldVal = GPBGetObjectIvarWithFieldNoAutocreate(self, fieldDescriptor); \ + result += GPBCompute##NAME##Size(fieldNumber, fieldVal); \ + break; \ + } + CASE_SINGLE_POD(Bool, BOOL, Bool) + CASE_SINGLE_POD(Fixed32, uint32_t, UInt32) + CASE_SINGLE_POD(SFixed32, int32_t, Int32) + CASE_SINGLE_POD(Float, float, Float) + CASE_SINGLE_POD(Fixed64, uint64_t, UInt64) + CASE_SINGLE_POD(SFixed64, int64_t, Int64) + CASE_SINGLE_POD(Double, double, Double) + CASE_SINGLE_POD(Int32, int32_t, Int32) + CASE_SINGLE_POD(Int64, int64_t, Int64) + CASE_SINGLE_POD(SInt32, int32_t, Int32) + CASE_SINGLE_POD(SInt64, int64_t, Int64) + CASE_SINGLE_POD(UInt32, uint32_t, UInt32) + CASE_SINGLE_POD(UInt64, uint64_t, UInt64) + CASE_SINGLE_OBJECT(Bytes) + CASE_SINGLE_OBJECT(String) + CASE_SINGLE_OBJECT(Message) + CASE_SINGLE_OBJECT(Group) + CASE_SINGLE_POD(Enum, int32_t, Int32) +#undef CASE_SINGLE_POD +#undef CASE_SINGLE_OBJECT + } + + // Repeated Fields + } else if (fieldType == GPBFieldTypeRepeated) { + id genericArray = + GPBGetObjectIvarWithFieldNoAutocreate(self, fieldDescriptor); + NSUInteger count = [genericArray count]; + if (count == 0) { + continue; // Nothing to add. + } + __block size_t dataSize = 0; + + switch (fieldDataType) { +#define CASE_REPEATED_POD(NAME, TYPE, ARRAY_TYPE) \ + CASE_REPEATED_POD_EXTRA(NAME, TYPE, ARRAY_TYPE, ) +#define CASE_REPEATED_POD_EXTRA(NAME, TYPE, ARRAY_TYPE, ARRAY_ACCESSOR_NAME) \ + case GPBDataType##NAME: { \ + GPB##ARRAY_TYPE##Array *array = genericArray; \ + [array enumerate##ARRAY_ACCESSOR_NAME##ValuesWithBlock:^(TYPE value, NSUInteger idx, BOOL *stop) { \ + _Pragma("unused(idx, stop)"); \ + dataSize += GPBCompute##NAME##SizeNoTag(value); \ + }]; \ + break; \ + } +#define CASE_REPEATED_OBJECT(NAME) \ + case GPBDataType##NAME: { \ + for (id value in genericArray) { \ + dataSize += GPBCompute##NAME##SizeNoTag(value); \ + } \ + break; \ + } + CASE_REPEATED_POD(Bool, BOOL, Bool) + CASE_REPEATED_POD(Fixed32, uint32_t, UInt32) + CASE_REPEATED_POD(SFixed32, int32_t, Int32) + CASE_REPEATED_POD(Float, float, Float) + CASE_REPEATED_POD(Fixed64, uint64_t, UInt64) + CASE_REPEATED_POD(SFixed64, int64_t, Int64) + CASE_REPEATED_POD(Double, double, Double) + CASE_REPEATED_POD(Int32, int32_t, Int32) + CASE_REPEATED_POD(Int64, int64_t, Int64) + CASE_REPEATED_POD(SInt32, int32_t, Int32) + CASE_REPEATED_POD(SInt64, int64_t, Int64) + CASE_REPEATED_POD(UInt32, uint32_t, UInt32) + CASE_REPEATED_POD(UInt64, uint64_t, UInt64) + CASE_REPEATED_OBJECT(Bytes) + CASE_REPEATED_OBJECT(String) + CASE_REPEATED_OBJECT(Message) + CASE_REPEATED_OBJECT(Group) + CASE_REPEATED_POD_EXTRA(Enum, int32_t, Enum, Raw) +#undef CASE_REPEATED_POD +#undef CASE_REPEATED_POD_EXTRA +#undef CASE_REPEATED_OBJECT + } // switch + result += dataSize; + size_t tagSize = GPBComputeTagSize(GPBFieldNumber(fieldDescriptor)); + if (fieldDataType == GPBDataTypeGroup) { + // Groups have both a start and an end tag. + tagSize *= 2; + } + if (fieldDescriptor.isPackable) { + result += tagSize; + result += GPBComputeSizeTSizeAsInt32NoTag(dataSize); + } else { + result += count * tagSize; + } + + // Map<> Fields + } else { // fieldType == GPBFieldTypeMap + if (GPBDataTypeIsObject(fieldDataType) && + (fieldDescriptor.mapKeyDataType == GPBDataTypeString)) { + // If key type was string, then the map is an NSDictionary. + NSDictionary *map = + GPBGetObjectIvarWithFieldNoAutocreate(self, fieldDescriptor); + if (map) { + result += GPBDictionaryComputeSizeInternalHelper(map, fieldDescriptor); + } + } else { + // Type will be GPB*GroupDictionary, exact type doesn't matter. + GPBInt32Int32Dictionary *map = + GPBGetObjectIvarWithFieldNoAutocreate(self, fieldDescriptor); + result += [map computeSerializedSizeAsField:fieldDescriptor]; + } + } + } // for(fields) + + // Add any unknown fields. + if (descriptor.wireFormat) { + result += [unknownFields_ serializedSizeAsMessageSet]; + } else { + result += [unknownFields_ serializedSize]; + } + + // Add any extensions. + for (GPBExtensionDescriptor *extension in extensionMap_) { + id value = [extensionMap_ objectForKey:extension]; + result += GPBComputeExtensionSerializedSizeIncludingTag(extension, value); + } + + return result; +} + +#pragma mark - Resolve Methods Support + +typedef struct ResolveIvarAccessorMethodResult { + IMP impToAdd; + SEL encodingSelector; +} ResolveIvarAccessorMethodResult; + +static void ResolveIvarGet(GPBFieldDescriptor *field, + ResolveIvarAccessorMethodResult *result) { + GPBDataType fieldDataType = GPBGetFieldDataType(field); + switch (fieldDataType) { +#define CASE_GET(NAME, TYPE, TRUE_NAME) \ + case GPBDataType##NAME: { \ + result->impToAdd = imp_implementationWithBlock(^(id obj) { \ + return GPBGetMessage##TRUE_NAME##Field(obj, field); \ + }); \ + result->encodingSelector = @selector(get##NAME); \ + break; \ + } +#define CASE_GET_OBJECT(NAME, TYPE, TRUE_NAME) \ + case GPBDataType##NAME: { \ + result->impToAdd = imp_implementationWithBlock(^(id obj) { \ + return GPBGetObjectIvarWithField(obj, field); \ + }); \ + result->encodingSelector = @selector(get##NAME); \ + break; \ + } + CASE_GET(Bool, BOOL, Bool) + CASE_GET(Fixed32, uint32_t, UInt32) + CASE_GET(SFixed32, int32_t, Int32) + CASE_GET(Float, float, Float) + CASE_GET(Fixed64, uint64_t, UInt64) + CASE_GET(SFixed64, int64_t, Int64) + CASE_GET(Double, double, Double) + CASE_GET(Int32, int32_t, Int32) + CASE_GET(Int64, int64_t, Int64) + CASE_GET(SInt32, int32_t, Int32) + CASE_GET(SInt64, int64_t, Int64) + CASE_GET(UInt32, uint32_t, UInt32) + CASE_GET(UInt64, uint64_t, UInt64) + CASE_GET_OBJECT(Bytes, id, Object) + CASE_GET_OBJECT(String, id, Object) + CASE_GET_OBJECT(Message, id, Object) + CASE_GET_OBJECT(Group, id, Object) + CASE_GET(Enum, int32_t, Enum) +#undef CASE_GET + } +} + +static void ResolveIvarSet(GPBFieldDescriptor *field, + GPBFileSyntax syntax, + ResolveIvarAccessorMethodResult *result) { + GPBDataType fieldDataType = GPBGetFieldDataType(field); + switch (fieldDataType) { +#define CASE_SET(NAME, TYPE, TRUE_NAME) \ + case GPBDataType##NAME: { \ + result->impToAdd = imp_implementationWithBlock(^(id obj, TYPE value) { \ + return GPBSet##TRUE_NAME##IvarWithFieldInternal(obj, field, value, syntax); \ + }); \ + result->encodingSelector = @selector(set##NAME:); \ + break; \ + } + CASE_SET(Bool, BOOL, Bool) + CASE_SET(Fixed32, uint32_t, UInt32) + CASE_SET(SFixed32, int32_t, Int32) + CASE_SET(Float, float, Float) + CASE_SET(Fixed64, uint64_t, UInt64) + CASE_SET(SFixed64, int64_t, Int64) + CASE_SET(Double, double, Double) + CASE_SET(Int32, int32_t, Int32) + CASE_SET(Int64, int64_t, Int64) + CASE_SET(SInt32, int32_t, Int32) + CASE_SET(SInt64, int64_t, Int64) + CASE_SET(UInt32, uint32_t, UInt32) + CASE_SET(UInt64, uint64_t, UInt64) + CASE_SET(Bytes, id, Object) + CASE_SET(String, id, Object) + CASE_SET(Message, id, Object) + CASE_SET(Group, id, Object) + CASE_SET(Enum, int32_t, Enum) +#undef CASE_SET + } +} + ++ (BOOL)resolveInstanceMethod:(SEL)sel { + const GPBDescriptor *descriptor = [self descriptor]; + if (!descriptor) { + return NO; + } + + // NOTE: hasOrCountSel_/setHasSel_ will be NULL if the field for the given + // message should not have has support (done in GPBDescriptor.m), so there is + // no need for checks here to see if has*/setHas* are allowed. + + ResolveIvarAccessorMethodResult result = {NULL, NULL}; + for (GPBFieldDescriptor *field in descriptor->fields_) { + BOOL isMapOrArray = GPBFieldIsMapOrArray(field); + if (!isMapOrArray) { + // Single fields. + if (sel == field->getSel_) { + ResolveIvarGet(field, &result); + break; + } else if (sel == field->setSel_) { + ResolveIvarSet(field, descriptor.file.syntax, &result); + break; + } else if (sel == field->hasOrCountSel_) { + int32_t index = GPBFieldHasIndex(field); + uint32_t fieldNum = GPBFieldNumber(field); + result.impToAdd = imp_implementationWithBlock(^(id obj) { + return GPBGetHasIvar(obj, index, fieldNum); + }); + result.encodingSelector = @selector(getBool); + break; + } else if (sel == field->setHasSel_) { + result.impToAdd = imp_implementationWithBlock(^(id obj, BOOL value) { + if (value) { + [NSException raise:NSInvalidArgumentException + format:@"%@: %@ can only be set to NO (to clear field).", + [obj class], + NSStringFromSelector(field->setHasSel_)]; + } + GPBClearMessageField(obj, field); + }); + result.encodingSelector = @selector(setBool:); + break; + } else { + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof && (sel == oneof->caseSel_)) { + int32_t index = GPBFieldHasIndex(field); + result.impToAdd = imp_implementationWithBlock(^(id obj) { + return GPBGetHasOneof(obj, index); + }); + result.encodingSelector = @selector(getEnum); + break; + } + } + } else { + // map<>/repeated fields. + if (sel == field->getSel_) { + if (field.fieldType == GPBFieldTypeRepeated) { + result.impToAdd = imp_implementationWithBlock(^(id obj) { + return GetArrayIvarWithField(obj, field); + }); + } else { + result.impToAdd = imp_implementationWithBlock(^(id obj) { + return GetMapIvarWithField(obj, field); + }); + } + result.encodingSelector = @selector(getArray); + break; + } else if (sel == field->setSel_) { + // Local for syntax so the block can directly capture it and not the + // full lookup. + const GPBFileSyntax syntax = descriptor.file.syntax; + result.impToAdd = imp_implementationWithBlock(^(id obj, id value) { + return GPBSetObjectIvarWithFieldInternal(obj, field, value, syntax); + }); + result.encodingSelector = @selector(setArray:); + break; + } else if (sel == field->hasOrCountSel_) { + result.impToAdd = imp_implementationWithBlock(^(id obj) { + // Type doesn't matter, all *Array and *Dictionary types support + // -count. + NSArray *arrayOrMap = + GPBGetObjectIvarWithFieldNoAutocreate(obj, field); + return [arrayOrMap count]; + }); + result.encodingSelector = @selector(getArrayCount); + break; + } + } + } + if (result.impToAdd) { + const char *encoding = + GPBMessageEncodingForSelector(result.encodingSelector, YES); + Class msgClass = descriptor.messageClass; + BOOL methodAdded = class_addMethod(msgClass, sel, result.impToAdd, encoding); + // class_addMethod() is documented as also failing if the method was already + // added; so we check if the method is already there and return success so + // the method dispatch will still happen. Why would it already be added? + // Two threads could cause the same method to be bound at the same time, + // but only one will actually bind it; the other still needs to return true + // so things will dispatch. + if (!methodAdded) { + methodAdded = GPBClassHasSel(msgClass, sel); + } + return methodAdded; + } + return [super resolveInstanceMethod:sel]; +} + ++ (BOOL)resolveClassMethod:(SEL)sel { + // Extensions scoped to a Message and looked up via class methods. + if (GPBResolveExtensionClassMethod(self, sel)) { + return YES; + } + return [super resolveClassMethod:sel]; +} + +#pragma mark - NSCoding Support + ++ (BOOL)supportsSecureCoding { + return YES; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [self init]; + if (self) { + NSData *data = + [aDecoder decodeObjectOfClass:[NSData class] forKey:kGPBDataCoderKey]; + if (data.length) { + [self mergeFromData:data extensionRegistry:nil]; + } + } + return self; +} + +- (void)encodeWithCoder:(NSCoder *)aCoder { + NSData *data = [self data]; + if (data.length) { + [aCoder encodeObject:data forKey:kGPBDataCoderKey]; + } +} + +#pragma mark - KVC Support + ++ (BOOL)accessInstanceVariablesDirectly { + // Make sure KVC doesn't use instance variables. + return NO; +} + +@end + +#pragma mark - Messages from GPBUtilities.h but defined here for access to helpers. + +// Only exists for public api, no core code should use this. +id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + if (field.fieldType != GPBFieldTypeRepeated) { + [NSException raise:NSInvalidArgumentException + format:@"%@.%@ is not a repeated field.", + [self class], field.name]; + } +#endif + GPBDescriptor *descriptor = [[self class] descriptor]; + GPBFileSyntax syntax = descriptor.file.syntax; + return GetOrCreateArrayIvarWithField(self, field, syntax); +} + +// Only exists for public api, no core code should use this. +id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field) { +#if defined(DEBUG) && DEBUG + if (field.fieldType != GPBFieldTypeMap) { + [NSException raise:NSInvalidArgumentException + format:@"%@.%@ is not a map<> field.", + [self class], field.name]; + } +#endif + GPBDescriptor *descriptor = [[self class] descriptor]; + GPBFileSyntax syntax = descriptor.file.syntax; + return GetOrCreateMapIvarWithField(self, field, syntax); +} + +#pragma clang diagnostic pop diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage_PackagePrivate.h new file mode 100644 index 00000000..90834d40 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBMessage_PackagePrivate.h @@ -0,0 +1,134 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This header is private to the ProtobolBuffers library and must NOT be +// included by any sources outside this library. The contents of this file are +// subject to change at any time without notice. + +#import "GPBMessage.h" + +#import <libkern/OSAtomic.h> + +#import "GPBBootstrap.h" + +typedef struct GPBMessage_Storage { + uint32_t _has_storage_[0]; +} GPBMessage_Storage; + +typedef struct GPBMessage_Storage *GPBMessage_StoragePtr; + +@interface GPBMessage () { + @package + // NOTE: Because of the +allocWithZone code using NSAllocateObject(), + // this structure should ideally always be kept pointer aligned where the + // real storage starts is also pointer aligned. The compiler/runtime already + // do this, but it may not be documented. + + // A pointer to the actual fields of the subclasses. The actual structure + // pointed to by this pointer will depend on the subclass. + // All of the actual structures will start the same as + // GPBMessage_Storage with _has_storage__ as the first field. + // Kept public because static functions need to access it. + GPBMessage_StoragePtr messageStorage_; + + // A lock to provide mutual exclusion from internal data that can be modified + // by *read* operations such as getters (autocreation of message fields and + // message extensions, not setting of values). Used to guarantee thread safety + // for concurrent reads on the message. + // NOTE: OSSpinLock may seem like a good fit here but Apple engineers have + // pointed out that they are vulnerable to live locking on iOS in cases of + // priority inversion: + // http://mjtsai.com/blog/2015/12/16/osspinlock-is-unsafe/ + // https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000372.html + // Use of readOnlySemaphore_ must be prefaced by a call to + // GPBPrepareReadOnlySemaphore to ensure it has been created. This allows + // readOnlySemaphore_ to be only created when actually needed. + dispatch_semaphore_t readOnlySemaphore_; +} + +// Gets an extension value without autocreating the result if not found. (i.e. +// returns nil if the extension is not set) +- (id)getExistingExtension:(GPBExtensionDescriptor *)extension; + +// Parses a message of this type from the input and merges it with this +// message. +// +// Warning: This does not verify that all required fields are present in +// the input message. +// Note: The caller should call +// -[CodedInputStream checkLastTagWas:] after calling this to +// verify that the last tag seen was the appropriate end-group tag, +// or zero for EOF. +// NOTE: This will throw if there is an error while parsing. +- (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry:(GPBExtensionRegistry *)extensionRegistry; + +// Parses the next delimited message of this type from the input and merges it +// with this message. +- (void)mergeDelimitedFromCodedInputStream:(GPBCodedInputStream *)input + extensionRegistry: + (GPBExtensionRegistry *)extensionRegistry; + +- (void)addUnknownMapEntry:(int32_t)fieldNum value:(NSData *)data; + +@end + +CF_EXTERN_C_BEGIN + + +// Call this before using the readOnlySemaphore_. This ensures it is created only once. +void GPBPrepareReadOnlySemaphore(GPBMessage *self); + +// Returns a new instance that was automatically created by |autocreator| for +// its field |field|. +GPBMessage *GPBCreateMessageWithAutocreator(Class msgClass, + GPBMessage *autocreator, + GPBFieldDescriptor *field) + __attribute__((ns_returns_retained)); + +// Returns whether |message| autocreated this message. This is NO if the message +// was not autocreated by |message| or if it has been mutated since +// autocreation. +BOOL GPBWasMessageAutocreatedBy(GPBMessage *message, GPBMessage *parent); + +// Call this when you mutate a message. It will cause the message to become +// visible to its autocreator. +void GPBBecomeVisibleToAutocreator(GPBMessage *self); + +// Call this when an array/dictionary is mutated so the parent message that +// autocreated it can react. +void GPBAutocreatedArrayModified(GPBMessage *self, id array); +void GPBAutocreatedDictionaryModified(GPBMessage *self, id dictionary); + +// Clear the autocreator, if any. Asserts if the autocreator still has an +// autocreated reference to this message. +void GPBClearMessageAutocreator(GPBMessage *self); + +CF_EXTERN_C_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBProtocolBuffers.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBProtocolBuffers.h new file mode 100644 index 00000000..68d8854e --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBProtocolBuffers.h @@ -0,0 +1,76 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBBootstrap.h" + +#import "GPBArray.h" +#import "GPBCodedInputStream.h" +#import "GPBCodedOutputStream.h" +#import "GPBDescriptor.h" +#import "GPBDictionary.h" +#import "GPBExtensionRegistry.h" +#import "GPBMessage.h" +#import "GPBRootObject.h" +#import "GPBUnknownField.h" +#import "GPBUnknownFieldSet.h" +#import "GPBUtilities.h" +#import "GPBWellKnownTypes.h" +#import "GPBWireFormat.h" + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +// Well-known proto types +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Any.pbobjc.h> + #import <Protobuf/Api.pbobjc.h> + #import <Protobuf/Duration.pbobjc.h> + #import <Protobuf/Empty.pbobjc.h> + #import <Protobuf/FieldMask.pbobjc.h> + #import <Protobuf/SourceContext.pbobjc.h> + #import <Protobuf/Struct.pbobjc.h> + #import <Protobuf/Timestamp.pbobjc.h> + #import <Protobuf/Type.pbobjc.h> + #import <Protobuf/Wrappers.pbobjc.h> +#else + #import "google/protobuf/Any.pbobjc.h" + #import "google/protobuf/Api.pbobjc.h" + #import "google/protobuf/Duration.pbobjc.h" + #import "google/protobuf/Empty.pbobjc.h" + #import "google/protobuf/FieldMask.pbobjc.h" + #import "google/protobuf/SourceContext.pbobjc.h" + #import "google/protobuf/Struct.pbobjc.h" + #import "google/protobuf/Timestamp.pbobjc.h" + #import "google/protobuf/Type.pbobjc.h" + #import "google/protobuf/Wrappers.pbobjc.h" +#endif diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBProtocolBuffers_RuntimeSupport.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBProtocolBuffers_RuntimeSupport.h new file mode 100644 index 00000000..fea75b93 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBProtocolBuffers_RuntimeSupport.h @@ -0,0 +1,40 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This header is meant to only be used by the generated source, it should not +// be included in code using protocol buffers. + +#import "GPBProtocolBuffers.h" + +#import "GPBDescriptor_PackagePrivate.h" +#import "GPBExtensionInternals.h" +#import "GPBMessage_PackagePrivate.h" +#import "GPBRootObject_PackagePrivate.h" +#import "GPBUtilities_PackagePrivate.h" diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject.h new file mode 100644 index 00000000..d2e2aebf --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject.h @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +@class GPBExtensionRegistry; + +NS_ASSUME_NONNULL_BEGIN + +/** + * Every generated proto file defines a local "Root" class that exposes a + * GPBExtensionRegistry for all the extensions defined by that file and + * the files it depends on. + **/ +@interface GPBRootObject : NSObject + +/** + * @return An extension registry for the given file and all the files it depends + * on. + **/ ++ (GPBExtensionRegistry *)extensionRegistry; + +@end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject.m new file mode 100644 index 00000000..585d205a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject.m @@ -0,0 +1,237 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBRootObject_PackagePrivate.h" + +#import <objc/runtime.h> + +#import <CoreFoundation/CoreFoundation.h> + +#import "GPBDescriptor.h" +#import "GPBExtensionRegistry.h" +#import "GPBUtilities_PackagePrivate.h" + +@interface GPBExtensionDescriptor (GPBRootObject) +// Get singletonName as a c string. +- (const char *)singletonNameC; +@end + +@implementation GPBRootObject + +// Taken from http://www.burtleburtle.net/bob/hash/doobs.html +// Public Domain +static uint32_t jenkins_one_at_a_time_hash(const char *key) { + uint32_t hash = 0; + for (uint32_t i = 0; key[i] != '\0'; ++i) { + hash += key[i]; + hash += (hash << 10); + hash ^= (hash >> 6); + } + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + return hash; +} + +// Key methods for our custom CFDictionary. +// Note that the dictionary lasts for the lifetime of our app, so no need +// to worry about deallocation. All of the items are added to it at +// startup, and so the keys don't need to be retained/released. +// Keys are NULL terminated char *. +static const void *GPBRootExtensionKeyRetain(CFAllocatorRef allocator, + const void *value) { +#pragma unused(allocator) + return value; +} + +static void GPBRootExtensionKeyRelease(CFAllocatorRef allocator, + const void *value) { +#pragma unused(allocator) +#pragma unused(value) +} + +static CFStringRef GPBRootExtensionCopyKeyDescription(const void *value) { + const char *key = (const char *)value; + return CFStringCreateWithCString(kCFAllocatorDefault, key, + kCFStringEncodingUTF8); +} + +static Boolean GPBRootExtensionKeyEqual(const void *value1, + const void *value2) { + const char *key1 = (const char *)value1; + const char *key2 = (const char *)value2; + return strcmp(key1, key2) == 0; +} + +static CFHashCode GPBRootExtensionKeyHash(const void *value) { + const char *key = (const char *)value; + return jenkins_one_at_a_time_hash(key); +} + +// NOTE: OSSpinLock may seem like a good fit here but Apple engineers have +// pointed out that they are vulnerable to live locking on iOS in cases of +// priority inversion: +// http://mjtsai.com/blog/2015/12/16/osspinlock-is-unsafe/ +// https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000372.html +static dispatch_semaphore_t gExtensionSingletonDictionarySemaphore; +static CFMutableDictionaryRef gExtensionSingletonDictionary = NULL; +static GPBExtensionRegistry *gDefaultExtensionRegistry = NULL; + ++ (void)initialize { + // Ensure the global is started up. + if (!gExtensionSingletonDictionary) { + gExtensionSingletonDictionarySemaphore = dispatch_semaphore_create(1); + CFDictionaryKeyCallBacks keyCallBacks = { + // See description above for reason for using custom dictionary. + 0, + GPBRootExtensionKeyRetain, + GPBRootExtensionKeyRelease, + GPBRootExtensionCopyKeyDescription, + GPBRootExtensionKeyEqual, + GPBRootExtensionKeyHash, + }; + gExtensionSingletonDictionary = + CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &keyCallBacks, + &kCFTypeDictionaryValueCallBacks); + gDefaultExtensionRegistry = [[GPBExtensionRegistry alloc] init]; + } + + if ([self superclass] == [GPBRootObject class]) { + // This is here to start up all the per file "Root" subclasses. + // This must be done in initialize to enforce thread safety of start up of + // the protocol buffer library. + [self extensionRegistry]; + } +} + ++ (GPBExtensionRegistry *)extensionRegistry { + // Is overridden in all the subclasses that provide extensions to provide the + // per class one. + return gDefaultExtensionRegistry; +} + ++ (void)globallyRegisterExtension:(GPBExtensionDescriptor *)field { + const char *key = [field singletonNameC]; + dispatch_semaphore_wait(gExtensionSingletonDictionarySemaphore, + DISPATCH_TIME_FOREVER); + CFDictionarySetValue(gExtensionSingletonDictionary, key, field); + dispatch_semaphore_signal(gExtensionSingletonDictionarySemaphore); +} + +static id ExtensionForName(id self, SEL _cmd) { + // Really fast way of doing "classname_selName". + // This came up as a hotspot (creation of NSString *) when accessing a + // lot of extensions. + const char *selName = sel_getName(_cmd); + if (selName[0] == '_') { + return nil; // Apple internal selector. + } + size_t selNameLen = 0; + while (1) { + char c = selName[selNameLen]; + if (c == '\0') { // String end. + break; + } + if (c == ':') { + return nil; // Selector took an arg, not one of the runtime methods. + } + ++selNameLen; + } + + const char *className = class_getName(self); + size_t classNameLen = strlen(className); + char key[classNameLen + selNameLen + 2]; + memcpy(key, className, classNameLen); + key[classNameLen] = '_'; + memcpy(&key[classNameLen + 1], selName, selNameLen); + key[classNameLen + 1 + selNameLen] = '\0'; + + // NOTE: Even though this method is called from another C function, + // gExtensionSingletonDictionarySemaphore and gExtensionSingletonDictionary + // will always be initialized. This is because this call flow is just to + // lookup the Extension, meaning the code is calling an Extension class + // message on a Message or Root class. This guarantees that the class was + // initialized and Message classes ensure their Root was also initialized. + NSAssert(gExtensionSingletonDictionary, @"Startup order broken!"); + + dispatch_semaphore_wait(gExtensionSingletonDictionarySemaphore, + DISPATCH_TIME_FOREVER); + id extension = (id)CFDictionaryGetValue(gExtensionSingletonDictionary, key); + // We can't remove the key from the dictionary here (as an optimization), + // two threads could have gone into +resolveClassMethod: for the same method, + // and ended up here; there's no way to ensure both return YES without letting + // both try to wire in the method. + dispatch_semaphore_signal(gExtensionSingletonDictionarySemaphore); + return extension; +} + +BOOL GPBResolveExtensionClassMethod(Class self, SEL sel) { + // Another option would be to register the extensions with the class at + // globallyRegisterExtension: + // Timing the two solutions, this solution turned out to be much faster + // and reduced startup time, and runtime memory. + // The advantage to globallyRegisterExtension is that it would reduce the + // size of the protos somewhat because the singletonNameC wouldn't need + // to include the class name. For a class with a lot of extensions it + // can add up. You could also significantly reduce the code complexity of this + // file. + id extension = ExtensionForName(self, sel); + if (extension != nil) { + const char *encoding = + GPBMessageEncodingForSelector(@selector(getClassValue), NO); + Class metaClass = objc_getMetaClass(class_getName(self)); + IMP imp = imp_implementationWithBlock(^(id obj) { +#pragma unused(obj) + return extension; + }); + BOOL methodAdded = class_addMethod(metaClass, sel, imp, encoding); + // class_addMethod() is documented as also failing if the method was already + // added; so we check if the method is already there and return success so + // the method dispatch will still happen. Why would it already be added? + // Two threads could cause the same method to be bound at the same time, + // but only one will actually bind it; the other still needs to return true + // so things will dispatch. + if (!methodAdded) { + methodAdded = GPBClassHasSel(metaClass, sel); + } + return methodAdded; + } + return NO; +} + + ++ (BOOL)resolveClassMethod:(SEL)sel { + if (GPBResolveExtensionClassMethod(self, sel)) { + return YES; + } + return [super resolveClassMethod:sel]; +} + +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject_PackagePrivate.h new file mode 100644 index 00000000..3c8f09c8 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRootObject_PackagePrivate.h @@ -0,0 +1,46 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBRootObject.h" + +@class GPBExtensionDescriptor; + +@interface GPBRootObject () + +// Globally register. ++ (void)globallyRegisterExtension:(GPBExtensionDescriptor *)field; + +@end + +// Returns YES if the selector was resolved and added to the class, +// NO otherwise. +BOOL GPBResolveExtensionClassMethod(Class self, SEL sel); diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRuntimeTypes.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRuntimeTypes.h new file mode 100644 index 00000000..4d552060 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBRuntimeTypes.h @@ -0,0 +1,144 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBBootstrap.h" + +@class GPBEnumDescriptor; +@class GPBMessage; +@class GPBInt32Array; + +/** + * Verifies that a given value can be represented by an enum type. + * */ +typedef BOOL (*GPBEnumValidationFunc)(int32_t); + +/** + * Fetches an EnumDescriptor. + * */ +typedef GPBEnumDescriptor *(*GPBEnumDescriptorFunc)(void); + +/** + * Magic value used at runtime to indicate an enum value that wasn't know at + * compile time. + * */ +enum { + kGPBUnrecognizedEnumeratorValue = (int32_t)0xFBADBEEF, +}; + +/** + * A union for storing all possible Protobuf values. Note that owner is + * responsible for memory management of object types. + * */ +typedef union { + BOOL valueBool; + int32_t valueInt32; + int64_t valueInt64; + uint32_t valueUInt32; + uint64_t valueUInt64; + float valueFloat; + double valueDouble; + GPB_UNSAFE_UNRETAINED NSData *valueData; + GPB_UNSAFE_UNRETAINED NSString *valueString; + GPB_UNSAFE_UNRETAINED GPBMessage *valueMessage; + int32_t valueEnum; +} GPBGenericValue; + +/** + * Enum listing the possible data types that a field can contain. + * + * @note Do not change the order of this enum (or add things to it) without + * thinking about it very carefully. There are several things that depend + * on the order. + * */ +typedef NS_ENUM(uint8_t, GPBDataType) { + /** Field contains boolean value(s). */ + GPBDataTypeBool = 0, + /** Field contains unsigned 4 byte value(s). */ + GPBDataTypeFixed32, + /** Field contains signed 4 byte value(s). */ + GPBDataTypeSFixed32, + /** Field contains float value(s). */ + GPBDataTypeFloat, + /** Field contains unsigned 8 byte value(s). */ + GPBDataTypeFixed64, + /** Field contains signed 8 byte value(s). */ + GPBDataTypeSFixed64, + /** Field contains double value(s). */ + GPBDataTypeDouble, + /** + * Field contains variable length value(s). Inefficient for encoding negative + * numbers – if your field is likely to have negative values, use + * GPBDataTypeSInt32 instead. + **/ + GPBDataTypeInt32, + /** + * Field contains variable length value(s). Inefficient for encoding negative + * numbers – if your field is likely to have negative values, use + * GPBDataTypeSInt64 instead. + **/ + GPBDataTypeInt64, + /** Field contains signed variable length integer value(s). */ + GPBDataTypeSInt32, + /** Field contains signed variable length integer value(s). */ + GPBDataTypeSInt64, + /** Field contains unsigned variable length integer value(s). */ + GPBDataTypeUInt32, + /** Field contains unsigned variable length integer value(s). */ + GPBDataTypeUInt64, + /** Field contains an arbitrary sequence of bytes. */ + GPBDataTypeBytes, + /** Field contains UTF-8 encoded or 7-bit ASCII text. */ + GPBDataTypeString, + /** Field contains message type(s). */ + GPBDataTypeMessage, + /** Field contains message type(s). */ + GPBDataTypeGroup, + /** Field contains enum value(s). */ + GPBDataTypeEnum, +}; + +enum { + /** + * A count of the number of types in GPBDataType. Separated out from the + * GPBDataType enum to avoid warnings regarding not handling GPBDataType_Count + * in switch statements. + **/ + GPBDataType_Count = GPBDataTypeEnum + 1 +}; + +/** An extension range. */ +typedef struct GPBExtensionRange { + /** Inclusive. */ + uint32_t start; + /** Exclusive. */ + uint32_t end; +} GPBExtensionRange; diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField.h new file mode 100644 index 00000000..a135cc20 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField.h @@ -0,0 +1,96 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +@class GPBCodedOutputStream; +@class GPBUInt32Array; +@class GPBUInt64Array; +@class GPBUnknownFieldSet; + +NS_ASSUME_NONNULL_BEGIN +/** + * Store an unknown field. These are used in conjunction with + * GPBUnknownFieldSet. + **/ +@interface GPBUnknownField : NSObject<NSCopying> + +/** The field number the data is stored under. */ +@property(nonatomic, readonly, assign) int32_t number; + +/** An array of varint values for this field. */ +@property(nonatomic, readonly, strong) GPBUInt64Array *varintList; + +/** An array of fixed32 values for this field. */ +@property(nonatomic, readonly, strong) GPBUInt32Array *fixed32List; + +/** An array of fixed64 values for this field. */ +@property(nonatomic, readonly, strong) GPBUInt64Array *fixed64List; + +/** An array of data values for this field. */ +@property(nonatomic, readonly, strong) NSArray<NSData*> *lengthDelimitedList; + +/** An array of groups of values for this field. */ +@property(nonatomic, readonly, strong) NSArray<GPBUnknownFieldSet*> *groupList; + +/** + * Add a value to the varintList. + * + * @param value The value to add. + **/ +- (void)addVarint:(uint64_t)value; +/** + * Add a value to the fixed32List. + * + * @param value The value to add. + **/ +- (void)addFixed32:(uint32_t)value; +/** + * Add a value to the fixed64List. + * + * @param value The value to add. + **/ +- (void)addFixed64:(uint64_t)value; +/** + * Add a value to the lengthDelimitedList. + * + * @param value The value to add. + **/ +- (void)addLengthDelimited:(NSData *)value; +/** + * Add a value to the groupList. + * + * @param value The value to add. + **/ +- (void)addGroup:(GPBUnknownFieldSet *)value; + +@end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField.m new file mode 100644 index 00000000..30efe756 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField.m @@ -0,0 +1,334 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBUnknownField_PackagePrivate.h" + +#import "GPBArray.h" +#import "GPBCodedOutputStream_PackagePrivate.h" + +@implementation GPBUnknownField { + @protected + int32_t number_; + GPBUInt64Array *mutableVarintList_; + GPBUInt32Array *mutableFixed32List_; + GPBUInt64Array *mutableFixed64List_; + NSMutableArray<NSData*> *mutableLengthDelimitedList_; + NSMutableArray<GPBUnknownFieldSet*> *mutableGroupList_; +} + +@synthesize number = number_; +@synthesize varintList = mutableVarintList_; +@synthesize fixed32List = mutableFixed32List_; +@synthesize fixed64List = mutableFixed64List_; +@synthesize lengthDelimitedList = mutableLengthDelimitedList_; +@synthesize groupList = mutableGroupList_; + +- (instancetype)initWithNumber:(int32_t)number { + if ((self = [super init])) { + number_ = number; + } + return self; +} + +- (void)dealloc { + [mutableVarintList_ release]; + [mutableFixed32List_ release]; + [mutableFixed64List_ release]; + [mutableLengthDelimitedList_ release]; + [mutableGroupList_ release]; + + [super dealloc]; +} + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +- (id)copyWithZone:(NSZone *)zone { + GPBUnknownField *result = + [[GPBUnknownField allocWithZone:zone] initWithNumber:number_]; + result->mutableFixed32List_ = [mutableFixed32List_ copyWithZone:zone]; + result->mutableFixed64List_ = [mutableFixed64List_ copyWithZone:zone]; + result->mutableLengthDelimitedList_ = + [mutableLengthDelimitedList_ copyWithZone:zone]; + result->mutableVarintList_ = [mutableVarintList_ copyWithZone:zone]; + if (mutableGroupList_.count) { + result->mutableGroupList_ = [[NSMutableArray allocWithZone:zone] + initWithCapacity:mutableGroupList_.count]; + for (GPBUnknownFieldSet *group in mutableGroupList_) { + GPBUnknownFieldSet *copied = [group copyWithZone:zone]; + [result->mutableGroupList_ addObject:copied]; + [copied release]; + } + } + return result; +} + +- (BOOL)isEqual:(id)object { + if (self == object) return YES; + if (![object isKindOfClass:[GPBUnknownField class]]) return NO; + GPBUnknownField *field = (GPBUnknownField *)object; + BOOL equalVarint = + (mutableVarintList_.count == 0 && field->mutableVarintList_.count == 0) || + [mutableVarintList_ isEqual:field->mutableVarintList_]; + if (!equalVarint) return NO; + BOOL equalFixed32 = (mutableFixed32List_.count == 0 && + field->mutableFixed32List_.count == 0) || + [mutableFixed32List_ isEqual:field->mutableFixed32List_]; + if (!equalFixed32) return NO; + BOOL equalFixed64 = (mutableFixed64List_.count == 0 && + field->mutableFixed64List_.count == 0) || + [mutableFixed64List_ isEqual:field->mutableFixed64List_]; + if (!equalFixed64) return NO; + BOOL equalLDList = + (mutableLengthDelimitedList_.count == 0 && + field->mutableLengthDelimitedList_.count == 0) || + [mutableLengthDelimitedList_ isEqual:field->mutableLengthDelimitedList_]; + if (!equalLDList) return NO; + BOOL equalGroupList = + (mutableGroupList_.count == 0 && field->mutableGroupList_.count == 0) || + [mutableGroupList_ isEqual:field->mutableGroupList_]; + if (!equalGroupList) return NO; + return YES; +} + +- (NSUInteger)hash { + // Just mix the hashes of the possible sub arrays. + const int prime = 31; + NSUInteger result = prime + [mutableVarintList_ hash]; + result = prime * result + [mutableFixed32List_ hash]; + result = prime * result + [mutableFixed64List_ hash]; + result = prime * result + [mutableLengthDelimitedList_ hash]; + result = prime * result + [mutableGroupList_ hash]; + return result; +} + +- (void)writeToOutput:(GPBCodedOutputStream *)output { + NSUInteger count = mutableVarintList_.count; + if (count > 0) { + [output writeUInt64Array:number_ values:mutableVarintList_ tag:0]; + } + count = mutableFixed32List_.count; + if (count > 0) { + [output writeFixed32Array:number_ values:mutableFixed32List_ tag:0]; + } + count = mutableFixed64List_.count; + if (count > 0) { + [output writeFixed64Array:number_ values:mutableFixed64List_ tag:0]; + } + count = mutableLengthDelimitedList_.count; + if (count > 0) { + [output writeBytesArray:number_ values:mutableLengthDelimitedList_]; + } + count = mutableGroupList_.count; + if (count > 0) { + [output writeUnknownGroupArray:number_ values:mutableGroupList_]; + } +} + +- (size_t)serializedSize { + __block size_t result = 0; + int32_t number = number_; + [mutableVarintList_ + enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + result += GPBComputeUInt64Size(number, value); + }]; + + [mutableFixed32List_ + enumerateValuesWithBlock:^(uint32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + result += GPBComputeFixed32Size(number, value); + }]; + + [mutableFixed64List_ + enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + result += GPBComputeFixed64Size(number, value); + }]; + + for (NSData *data in mutableLengthDelimitedList_) { + result += GPBComputeBytesSize(number, data); + } + + for (GPBUnknownFieldSet *set in mutableGroupList_) { + result += GPBComputeUnknownGroupSize(number, set); + } + + return result; +} + +- (void)writeAsMessageSetExtensionToOutput:(GPBCodedOutputStream *)output { + for (NSData *data in mutableLengthDelimitedList_) { + [output writeRawMessageSetExtension:number_ value:data]; + } +} + +- (size_t)serializedSizeAsMessageSetExtension { + size_t result = 0; + for (NSData *data in mutableLengthDelimitedList_) { + result += GPBComputeRawMessageSetExtensionSize(number_, data); + } + return result; +} + +- (NSString *)description { + NSMutableString *description = [NSMutableString + stringWithFormat:@"<%@ %p>: Field: %d {\n", [self class], self, number_]; + [mutableVarintList_ + enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [description appendFormat:@"\t%llu\n", value]; + }]; + + [mutableFixed32List_ + enumerateValuesWithBlock:^(uint32_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [description appendFormat:@"\t%u\n", value]; + }]; + + [mutableFixed64List_ + enumerateValuesWithBlock:^(uint64_t value, NSUInteger idx, BOOL *stop) { +#pragma unused(idx, stop) + [description appendFormat:@"\t%llu\n", value]; + }]; + + for (NSData *data in mutableLengthDelimitedList_) { + [description appendFormat:@"\t%@\n", data]; + } + + for (GPBUnknownFieldSet *set in mutableGroupList_) { + [description appendFormat:@"\t%@\n", set]; + } + [description appendString:@"}"]; + return description; +} + +- (void)mergeFromField:(GPBUnknownField *)other { + GPBUInt64Array *otherVarintList = other.varintList; + if (otherVarintList.count > 0) { + if (mutableVarintList_ == nil) { + mutableVarintList_ = [otherVarintList copy]; + } else { + [mutableVarintList_ addValuesFromArray:otherVarintList]; + } + } + + GPBUInt32Array *otherFixed32List = other.fixed32List; + if (otherFixed32List.count > 0) { + if (mutableFixed32List_ == nil) { + mutableFixed32List_ = [otherFixed32List copy]; + } else { + [mutableFixed32List_ addValuesFromArray:otherFixed32List]; + } + } + + GPBUInt64Array *otherFixed64List = other.fixed64List; + if (otherFixed64List.count > 0) { + if (mutableFixed64List_ == nil) { + mutableFixed64List_ = [otherFixed64List copy]; + } else { + [mutableFixed64List_ addValuesFromArray:otherFixed64List]; + } + } + + NSArray *otherLengthDelimitedList = other.lengthDelimitedList; + if (otherLengthDelimitedList.count > 0) { + if (mutableLengthDelimitedList_ == nil) { + mutableLengthDelimitedList_ = [otherLengthDelimitedList mutableCopy]; + } else { + [mutableLengthDelimitedList_ + addObjectsFromArray:otherLengthDelimitedList]; + } + } + + NSArray *otherGroupList = other.groupList; + if (otherGroupList.count > 0) { + if (mutableGroupList_ == nil) { + mutableGroupList_ = + [[NSMutableArray alloc] initWithCapacity:otherGroupList.count]; + } + // Make our own mutable copies. + for (GPBUnknownFieldSet *group in otherGroupList) { + GPBUnknownFieldSet *copied = [group copy]; + [mutableGroupList_ addObject:copied]; + [copied release]; + } + } +} + +- (void)addVarint:(uint64_t)value { + if (mutableVarintList_ == nil) { + mutableVarintList_ = [[GPBUInt64Array alloc] initWithValues:&value count:1]; + } else { + [mutableVarintList_ addValue:value]; + } +} + +- (void)addFixed32:(uint32_t)value { + if (mutableFixed32List_ == nil) { + mutableFixed32List_ = + [[GPBUInt32Array alloc] initWithValues:&value count:1]; + } else { + [mutableFixed32List_ addValue:value]; + } +} + +- (void)addFixed64:(uint64_t)value { + if (mutableFixed64List_ == nil) { + mutableFixed64List_ = + [[GPBUInt64Array alloc] initWithValues:&value count:1]; + } else { + [mutableFixed64List_ addValue:value]; + } +} + +- (void)addLengthDelimited:(NSData *)value { + if (mutableLengthDelimitedList_ == nil) { + mutableLengthDelimitedList_ = + [[NSMutableArray alloc] initWithObjects:&value count:1]; + } else { + [mutableLengthDelimitedList_ addObject:value]; + } +} + +- (void)addGroup:(GPBUnknownFieldSet *)value { + if (mutableGroupList_ == nil) { + mutableGroupList_ = [[NSMutableArray alloc] initWithObjects:&value count:1]; + } else { + [mutableGroupList_ addObject:value]; + } +} + +#pragma clang diagnostic pop + +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet.h new file mode 100644 index 00000000..1b5f24f3 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet.h @@ -0,0 +1,82 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +@class GPBUnknownField; + +NS_ASSUME_NONNULL_BEGIN + +/** + * A collection of unknown fields. Fields parsed from the binary representation + * of a message that are unknown end up in an instance of this set. This only + * applies for files declared with the "proto2" syntax. Files declared with the + * "proto3" syntax discard the unknown values. + **/ +@interface GPBUnknownFieldSet : NSObject<NSCopying> + +/** + * Tests to see if the given field number has a value. + * + * @param number The field number to check. + * + * @return YES if there is an unknown field for the given field number. + **/ +- (BOOL)hasField:(int32_t)number; + +/** + * Fetches the GPBUnknownField for the given field number. + * + * @param number The field number to look up. + * + * @return The GPBUnknownField or nil if none found. + **/ +- (nullable GPBUnknownField *)getField:(int32_t)number; + +/** + * @return The number of fields in this set. + **/ +- (NSUInteger)countOfFields; + +/** + * Adds the given field to the set. + * + * @param field The field to add to the set. + **/ +- (void)addField:(GPBUnknownField *)field; + +/** + * @return An array of the GPBUnknownFields sorted by the field numbers. + **/ +- (NSArray<GPBUnknownField *> *)sortedFields; + +@end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet.m new file mode 100644 index 00000000..a7335f05 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet.m @@ -0,0 +1,395 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBUnknownFieldSet_PackagePrivate.h" + +#import "GPBCodedInputStream_PackagePrivate.h" +#import "GPBCodedOutputStream.h" +#import "GPBUnknownField_PackagePrivate.h" +#import "GPBUtilities.h" +#import "GPBWireFormat.h" + +#pragma mark Helpers + +static void checkNumber(int32_t number) { + if (number == 0) { + [NSException raise:NSInvalidArgumentException + format:@"Zero is not a valid field number."]; + } +} + +@implementation GPBUnknownFieldSet { + @package + CFMutableDictionaryRef fields_; +} + +static void CopyWorker(const void *key, const void *value, void *context) { +#pragma unused(key) + GPBUnknownField *field = value; + GPBUnknownFieldSet *result = context; + + GPBUnknownField *copied = [field copy]; + [result addField:copied]; + [copied release]; +} + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +- (id)copyWithZone:(NSZone *)zone { + GPBUnknownFieldSet *result = [[GPBUnknownFieldSet allocWithZone:zone] init]; + if (fields_) { + CFDictionaryApplyFunction(fields_, CopyWorker, result); + } + return result; +} + +- (void)dealloc { + if (fields_) { + CFRelease(fields_); + } + [super dealloc]; +} + +- (BOOL)isEqual:(id)object { + BOOL equal = NO; + if ([object isKindOfClass:[GPBUnknownFieldSet class]]) { + GPBUnknownFieldSet *set = (GPBUnknownFieldSet *)object; + if ((fields_ == NULL) && (set->fields_ == NULL)) { + equal = YES; + } else if ((fields_ != NULL) && (set->fields_ != NULL)) { + equal = CFEqual(fields_, set->fields_); + } + } + return equal; +} + +- (NSUInteger)hash { + // Return the hash of the fields dictionary (or just some value). + if (fields_) { + return CFHash(fields_); + } + return (NSUInteger)[GPBUnknownFieldSet class]; +} + +#pragma mark - Public Methods + +- (BOOL)hasField:(int32_t)number { + ssize_t key = number; + return fields_ ? (CFDictionaryGetValue(fields_, (void *)key) != nil) : NO; +} + +- (GPBUnknownField *)getField:(int32_t)number { + ssize_t key = number; + GPBUnknownField *result = + fields_ ? CFDictionaryGetValue(fields_, (void *)key) : nil; + return result; +} + +- (NSUInteger)countOfFields { + return fields_ ? CFDictionaryGetCount(fields_) : 0; +} + +- (NSArray *)sortedFields { + if (!fields_) return [NSArray array]; + size_t count = CFDictionaryGetCount(fields_); + ssize_t keys[count]; + GPBUnknownField *values[count]; + CFDictionaryGetKeysAndValues(fields_, (const void **)keys, + (const void **)values); + struct GPBFieldPair { + ssize_t key; + GPBUnknownField *value; + } pairs[count]; + for (size_t i = 0; i < count; ++i) { + pairs[i].key = keys[i]; + pairs[i].value = values[i]; + }; + qsort_b(pairs, count, sizeof(struct GPBFieldPair), + ^(const void *first, const void *second) { + const struct GPBFieldPair *a = first; + const struct GPBFieldPair *b = second; + return (a->key > b->key) ? 1 : ((a->key == b->key) ? 0 : -1); + }); + for (size_t i = 0; i < count; ++i) { + values[i] = pairs[i].value; + }; + return [NSArray arrayWithObjects:values count:count]; +} + +#pragma mark - Internal Methods + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)output { + if (!fields_) return; + size_t count = CFDictionaryGetCount(fields_); + ssize_t keys[count]; + GPBUnknownField *values[count]; + CFDictionaryGetKeysAndValues(fields_, (const void **)keys, + (const void **)values); + if (count > 1) { + struct GPBFieldPair { + ssize_t key; + GPBUnknownField *value; + } pairs[count]; + + for (size_t i = 0; i < count; ++i) { + pairs[i].key = keys[i]; + pairs[i].value = values[i]; + }; + qsort_b(pairs, count, sizeof(struct GPBFieldPair), + ^(const void *first, const void *second) { + const struct GPBFieldPair *a = first; + const struct GPBFieldPair *b = second; + return (a->key > b->key) ? 1 : ((a->key == b->key) ? 0 : -1); + }); + for (size_t i = 0; i < count; ++i) { + GPBUnknownField *value = pairs[i].value; + [value writeToOutput:output]; + } + } else { + [values[0] writeToOutput:output]; + } +} + +- (NSString *)description { + NSMutableString *description = [NSMutableString + stringWithFormat:@"<%@ %p>: TextFormat: {\n", [self class], self]; + NSString *textFormat = GPBTextFormatForUnknownFieldSet(self, @" "); + [description appendString:textFormat]; + [description appendString:@"}"]; + return description; +} + +static void GPBUnknownFieldSetSerializedSize(const void *key, const void *value, + void *context) { +#pragma unused(key) + GPBUnknownField *field = value; + size_t *result = context; + *result += [field serializedSize]; +} + +- (size_t)serializedSize { + size_t result = 0; + if (fields_) { + CFDictionaryApplyFunction(fields_, GPBUnknownFieldSetSerializedSize, + &result); + } + return result; +} + +static void GPBUnknownFieldSetWriteAsMessageSetTo(const void *key, + const void *value, + void *context) { +#pragma unused(key) + GPBUnknownField *field = value; + GPBCodedOutputStream *output = context; + [field writeAsMessageSetExtensionToOutput:output]; +} + +- (void)writeAsMessageSetTo:(GPBCodedOutputStream *)output { + if (fields_) { + CFDictionaryApplyFunction(fields_, GPBUnknownFieldSetWriteAsMessageSetTo, + output); + } +} + +static void GPBUnknownFieldSetSerializedSizeAsMessageSet(const void *key, + const void *value, + void *context) { +#pragma unused(key) + GPBUnknownField *field = value; + size_t *result = context; + *result += [field serializedSizeAsMessageSetExtension]; +} + +- (size_t)serializedSizeAsMessageSet { + size_t result = 0; + if (fields_) { + CFDictionaryApplyFunction( + fields_, GPBUnknownFieldSetSerializedSizeAsMessageSet, &result); + } + return result; +} + +- (NSData *)data { + NSMutableData *data = [NSMutableData dataWithLength:self.serializedSize]; + GPBCodedOutputStream *output = + [[GPBCodedOutputStream alloc] initWithData:data]; + [self writeToCodedOutputStream:output]; + [output release]; + return data; +} + ++ (BOOL)isFieldTag:(int32_t)tag { + return GPBWireFormatGetTagWireType(tag) != GPBWireFormatEndGroup; +} + +- (void)addField:(GPBUnknownField *)field { + int32_t number = [field number]; + checkNumber(number); + if (!fields_) { + // Use a custom dictionary here because the keys are numbers and conversion + // back and forth from NSNumber isn't worth the cost. + fields_ = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, + &kCFTypeDictionaryValueCallBacks); + } + ssize_t key = number; + CFDictionarySetValue(fields_, (const void *)key, field); +} + +- (GPBUnknownField *)mutableFieldForNumber:(int32_t)number create:(BOOL)create { + ssize_t key = number; + GPBUnknownField *existing = + fields_ ? CFDictionaryGetValue(fields_, (const void *)key) : nil; + if (!existing && create) { + existing = [[GPBUnknownField alloc] initWithNumber:number]; + // This retains existing. + [self addField:existing]; + [existing release]; + } + return existing; +} + +static void GPBUnknownFieldSetMergeUnknownFields(const void *key, + const void *value, + void *context) { +#pragma unused(key) + GPBUnknownField *field = value; + GPBUnknownFieldSet *self = context; + + int32_t number = [field number]; + checkNumber(number); + GPBUnknownField *oldField = [self mutableFieldForNumber:number create:NO]; + if (oldField) { + [oldField mergeFromField:field]; + } else { + // Merge only comes from GPBMessage's mergeFrom:, so it means we are on + // mutable message and are an mutable instance, so make sure we need + // mutable fields. + GPBUnknownField *fieldCopy = [field copy]; + [self addField:fieldCopy]; + [fieldCopy release]; + } +} + +- (void)mergeUnknownFields:(GPBUnknownFieldSet *)other { + if (other && other->fields_) { + CFDictionaryApplyFunction(other->fields_, + GPBUnknownFieldSetMergeUnknownFields, self); + } +} + +- (void)mergeFromData:(NSData *)data { + GPBCodedInputStream *input = [[GPBCodedInputStream alloc] initWithData:data]; + [self mergeFromCodedInputStream:input]; + [input checkLastTagWas:0]; + [input release]; +} + +- (void)mergeVarintField:(int32_t)number value:(int32_t)value { + checkNumber(number); + [[self mutableFieldForNumber:number create:YES] addVarint:value]; +} + +- (BOOL)mergeFieldFrom:(int32_t)tag input:(GPBCodedInputStream *)input { + NSAssert(GPBWireFormatIsValidTag(tag), @"Got passed an invalid tag"); + int32_t number = GPBWireFormatGetTagFieldNumber(tag); + GPBCodedInputStreamState *state = &input->state_; + switch (GPBWireFormatGetTagWireType(tag)) { + case GPBWireFormatVarint: { + GPBUnknownField *field = [self mutableFieldForNumber:number create:YES]; + [field addVarint:GPBCodedInputStreamReadInt64(state)]; + return YES; + } + case GPBWireFormatFixed64: { + GPBUnknownField *field = [self mutableFieldForNumber:number create:YES]; + [field addFixed64:GPBCodedInputStreamReadFixed64(state)]; + return YES; + } + case GPBWireFormatLengthDelimited: { + NSData *data = GPBCodedInputStreamReadRetainedBytes(state); + GPBUnknownField *field = [self mutableFieldForNumber:number create:YES]; + [field addLengthDelimited:data]; + [data release]; + return YES; + } + case GPBWireFormatStartGroup: { + GPBUnknownFieldSet *unknownFieldSet = [[GPBUnknownFieldSet alloc] init]; + [input readUnknownGroup:number message:unknownFieldSet]; + GPBUnknownField *field = [self mutableFieldForNumber:number create:YES]; + [field addGroup:unknownFieldSet]; + [unknownFieldSet release]; + return YES; + } + case GPBWireFormatEndGroup: + return NO; + case GPBWireFormatFixed32: { + GPBUnknownField *field = [self mutableFieldForNumber:number create:YES]; + [field addFixed32:GPBCodedInputStreamReadFixed32(state)]; + return YES; + } + } +} + +- (void)mergeMessageSetMessage:(int32_t)number data:(NSData *)messageData { + [[self mutableFieldForNumber:number create:YES] + addLengthDelimited:messageData]; +} + +- (void)addUnknownMapEntry:(int32_t)fieldNum value:(NSData *)data { + GPBUnknownField *field = [self mutableFieldForNumber:fieldNum create:YES]; + [field addLengthDelimited:data]; +} + +- (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input { + while (YES) { + int32_t tag = GPBCodedInputStreamReadTag(&input->state_); + if (tag == 0 || ![self mergeFieldFrom:tag input:input]) { + break; + } + } +} + +- (void)getTags:(int32_t *)tags { + if (!fields_) return; + size_t count = CFDictionaryGetCount(fields_); + ssize_t keys[count]; + CFDictionaryGetKeysAndValues(fields_, (const void **)keys, NULL); + for (size_t i = 0; i < count; ++i) { + tags[i] = (int32_t)keys[i]; + } +} + +#pragma clang diagnostic pop + +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet_PackagePrivate.h new file mode 100644 index 00000000..e27127ad --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownFieldSet_PackagePrivate.h @@ -0,0 +1,61 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBUnknownFieldSet.h" + +@class GPBCodedOutputStream; +@class GPBCodedInputStream; + +@interface GPBUnknownFieldSet () + ++ (BOOL)isFieldTag:(int32_t)tag; + +- (NSData *)data; + +- (size_t)serializedSize; +- (size_t)serializedSizeAsMessageSet; + +- (void)writeToCodedOutputStream:(GPBCodedOutputStream *)output; +- (void)writeAsMessageSetTo:(GPBCodedOutputStream *)output; + +- (void)mergeUnknownFields:(GPBUnknownFieldSet *)other; + +- (void)mergeFromCodedInputStream:(GPBCodedInputStream *)input; +- (void)mergeFromData:(NSData *)data; + +- (void)mergeVarintField:(int32_t)number value:(int32_t)value; +- (BOOL)mergeFieldFrom:(int32_t)tag input:(GPBCodedInputStream *)input; +- (void)mergeMessageSetMessage:(int32_t)number data:(NSData *)messageData; + +- (void)addUnknownMapEntry:(int32_t)fieldNum value:(NSData *)data; + +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField_PackagePrivate.h new file mode 100644 index 00000000..1fbce0f9 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUnknownField_PackagePrivate.h @@ -0,0 +1,49 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBUnknownField.h" + +@class GPBCodedOutputStream; + +@interface GPBUnknownField () + +- (instancetype)initWithNumber:(int32_t)number; + +- (void)writeToOutput:(GPBCodedOutputStream *)output; +- (size_t)serializedSize; + +- (void)writeAsMessageSetExtensionToOutput:(GPBCodedOutputStream *)output; +- (size_t)serializedSizeAsMessageSetExtension; + +- (void)mergeFromField:(GPBUnknownField *)other; + +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities.h new file mode 100644 index 00000000..5464dfb3 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities.h @@ -0,0 +1,539 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBArray.h" +#import "GPBMessage.h" +#import "GPBRuntimeTypes.h" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +/** + * Generates a string that should be a valid "TextFormat" for the C++ version + * of Protocol Buffers. + * + * @param message The message to generate from. + * @param lineIndent A string to use as the prefix for all lines generated. Can + * be nil if no extra indent is needed. + * + * @return An NSString with the TextFormat of the message. + **/ +NSString *GPBTextFormatForMessage(GPBMessage *message, + NSString * __nullable lineIndent); + +/** + * Generates a string that should be a valid "TextFormat" for the C++ version + * of Protocol Buffers. + * + * @param unknownSet The unknown field set to generate from. + * @param lineIndent A string to use as the prefix for all lines generated. Can + * be nil if no extra indent is needed. + * + * @return An NSString with the TextFormat of the unknown field set. + **/ +NSString *GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet * __nullable unknownSet, + NSString * __nullable lineIndent); + +/** + * Checks if the given field number is set on a message. + * + * @param self The message to check. + * @param fieldNumber The field number to check. + * + * @return YES if the field number is set on the given message. + **/ +BOOL GPBMessageHasFieldNumberSet(GPBMessage *self, uint32_t fieldNumber); + +/** + * Checks if the given field is set on a message. + * + * @param self The message to check. + * @param field The field to check. + * + * @return YES if the field is set on the given message. + **/ +BOOL GPBMessageHasFieldSet(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Clears the given field for the given message. + * + * @param self The message for which to clear the field. + * @param field The field to clear. + **/ +void GPBClearMessageField(GPBMessage *self, GPBFieldDescriptor *field); + +//%PDDM-EXPAND GPB_ACCESSORS() +// This block of code is generated, do not edit it directly. + + +// +// Get/Set a given field from/to a message. +// + +// Single Fields + +/** + * Gets the value of a bytes field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +NSData *GPBGetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a bytes field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageBytesField(GPBMessage *self, GPBFieldDescriptor *field, NSData *value); + +/** + * Gets the value of a string field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +NSString *GPBGetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a string field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageStringField(GPBMessage *self, GPBFieldDescriptor *field, NSString *value); + +/** + * Gets the value of a message field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +GPBMessage *GPBGetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a message field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageMessageField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value); + +/** + * Gets the value of a group field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +GPBMessage *GPBGetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a group field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageGroupField(GPBMessage *self, GPBFieldDescriptor *field, GPBMessage *value); + +/** + * Gets the value of a bool field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +BOOL GPBGetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a bool field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageBoolField(GPBMessage *self, GPBFieldDescriptor *field, BOOL value); + +/** + * Gets the value of an int32 field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +int32_t GPBGetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of an int32 field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageInt32Field(GPBMessage *self, GPBFieldDescriptor *field, int32_t value); + +/** + * Gets the value of an uint32 field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +uint32_t GPBGetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of an uint32 field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageUInt32Field(GPBMessage *self, GPBFieldDescriptor *field, uint32_t value); + +/** + * Gets the value of an int64 field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +int64_t GPBGetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of an int64 field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageInt64Field(GPBMessage *self, GPBFieldDescriptor *field, int64_t value); + +/** + * Gets the value of an uint64 field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +uint64_t GPBGetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of an uint64 field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageUInt64Field(GPBMessage *self, GPBFieldDescriptor *field, uint64_t value); + +/** + * Gets the value of a float field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +float GPBGetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a float field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageFloatField(GPBMessage *self, GPBFieldDescriptor *field, float value); + +/** + * Gets the value of a double field. + * + * @param self The message from which to get the field. + * @param field The field to get. + **/ +double GPBGetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a double field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The to set in the field. + **/ +void GPBSetMessageDoubleField(GPBMessage *self, GPBFieldDescriptor *field, double value); + +/** + * Gets the given enum field of a message. For proto3, if the value isn't a + * member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned. + * GPBGetMessageRawEnumField will bypass the check and return whatever value + * was set. + * + * @param self The message from which to get the field. + * @param field The field to get. + * + * @return The enum value for the given field. + **/ +int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Set the given enum field of a message. You can only set values that are + * members of the enum. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The enum value to set in the field. + **/ +void GPBSetMessageEnumField(GPBMessage *self, + GPBFieldDescriptor *field, + int32_t value); + +/** + * Get the given enum field of a message. No check is done to ensure the value + * was defined in the enum. + * + * @param self The message from which to get the field. + * @param field The field to get. + * + * @return The raw enum value for the given field. + **/ +int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Set the given enum field of a message. You can set the value to anything, + * even a value that is not a member of the enum. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param value The raw enum value to set in the field. + **/ +void GPBSetMessageRawEnumField(GPBMessage *self, + GPBFieldDescriptor *field, + int32_t value); + +// Repeated Fields + +/** + * Gets the value of a repeated field. + * + * @param self The message from which to get the field. + * @param field The repeated field to get. + * + * @return A GPB*Array or an NSMutableArray based on the field's type. + **/ +id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a repeated field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param array A GPB*Array or NSMutableArray based on the field's type. + **/ +void GPBSetMessageRepeatedField(GPBMessage *self, + GPBFieldDescriptor *field, + id array); + +// Map Fields + +/** + * Gets the value of a map<> field. + * + * @param self The message from which to get the field. + * @param field The repeated field to get. + * + * @return A GPB*Dictionary or NSMutableDictionary based on the field's type. + **/ +id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field); + +/** + * Sets the value of a map<> field. + * + * @param self The message into which to set the field. + * @param field The field to set. + * @param dictionary A GPB*Dictionary or NSMutableDictionary based on the + * field's type. + **/ +void GPBSetMessageMapField(GPBMessage *self, + GPBFieldDescriptor *field, + id dictionary); + +//%PDDM-EXPAND-END GPB_ACCESSORS() + +/** + * Returns an empty NSData to assign to byte fields when you wish to assign them + * to empty. Prevents allocating a lot of little [NSData data] objects. + **/ +NSData *GPBEmptyNSData(void) __attribute__((pure)); + +/** + * Drops the `unknownFields` from the given message and from all sub message. + **/ +void GPBMessageDropUnknownFieldsRecursively(GPBMessage *message); + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + + +//%PDDM-DEFINE GPB_ACCESSORS() +//% +//%// +//%// Get/Set a given field from/to a message. +//%// +//% +//%// Single Fields +//% +//%GPB_ACCESSOR_SINGLE_FULL(Bytes, NSData, , *) +//%GPB_ACCESSOR_SINGLE_FULL(String, NSString, , *) +//%GPB_ACCESSOR_SINGLE_FULL(Message, GPBMessage, , *) +//%GPB_ACCESSOR_SINGLE_FULL(Group, GPBMessage, , *) +//%GPB_ACCESSOR_SINGLE(Bool, BOOL, ) +//%GPB_ACCESSOR_SINGLE(Int32, int32_t, n) +//%GPB_ACCESSOR_SINGLE(UInt32, uint32_t, n) +//%GPB_ACCESSOR_SINGLE(Int64, int64_t, n) +//%GPB_ACCESSOR_SINGLE(UInt64, uint64_t, n) +//%GPB_ACCESSOR_SINGLE(Float, float, ) +//%GPB_ACCESSOR_SINGLE(Double, double, ) +//%/** +//% * Gets the given enum field of a message. For proto3, if the value isn't a +//% * member of the enum, @c kGPBUnrecognizedEnumeratorValue will be returned. +//% * GPBGetMessageRawEnumField will bypass the check and return whatever value +//% * was set. +//% * +//% * @param self The message from which to get the field. +//% * @param field The field to get. +//% * +//% * @return The enum value for the given field. +//% **/ +//%int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field); +//% +//%/** +//% * Set the given enum field of a message. You can only set values that are +//% * members of the enum. +//% * +//% * @param self The message into which to set the field. +//% * @param field The field to set. +//% * @param value The enum value to set in the field. +//% **/ +//%void GPBSetMessageEnumField(GPBMessage *self, +//% GPBFieldDescriptor *field, +//% int32_t value); +//% +//%/** +//% * Get the given enum field of a message. No check is done to ensure the value +//% * was defined in the enum. +//% * +//% * @param self The message from which to get the field. +//% * @param field The field to get. +//% * +//% * @return The raw enum value for the given field. +//% **/ +//%int32_t GPBGetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field); +//% +//%/** +//% * Set the given enum field of a message. You can set the value to anything, +//% * even a value that is not a member of the enum. +//% * +//% * @param self The message into which to set the field. +//% * @param field The field to set. +//% * @param value The raw enum value to set in the field. +//% **/ +//%void GPBSetMessageRawEnumField(GPBMessage *self, +//% GPBFieldDescriptor *field, +//% int32_t value); +//% +//%// Repeated Fields +//% +//%/** +//% * Gets the value of a repeated field. +//% * +//% * @param self The message from which to get the field. +//% * @param field The repeated field to get. +//% * +//% * @return A GPB*Array or an NSMutableArray based on the field's type. +//% **/ +//%id GPBGetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field); +//% +//%/** +//% * Sets the value of a repeated field. +//% * +//% * @param self The message into which to set the field. +//% * @param field The field to set. +//% * @param array A GPB*Array or NSMutableArray based on the field's type. +//% **/ +//%void GPBSetMessageRepeatedField(GPBMessage *self, +//% GPBFieldDescriptor *field, +//% id array); +//% +//%// Map Fields +//% +//%/** +//% * Gets the value of a map<> field. +//% * +//% * @param self The message from which to get the field. +//% * @param field The repeated field to get. +//% * +//% * @return A GPB*Dictionary or NSMutableDictionary based on the field's type. +//% **/ +//%id GPBGetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field); +//% +//%/** +//% * Sets the value of a map<> field. +//% * +//% * @param self The message into which to set the field. +//% * @param field The field to set. +//% * @param dictionary A GPB*Dictionary or NSMutableDictionary based on the +//% * field's type. +//% **/ +//%void GPBSetMessageMapField(GPBMessage *self, +//% GPBFieldDescriptor *field, +//% id dictionary); +//% + +//%PDDM-DEFINE GPB_ACCESSOR_SINGLE(NAME, TYPE, AN) +//%GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, ) +//%PDDM-DEFINE GPB_ACCESSOR_SINGLE_FULL(NAME, TYPE, AN, TisP) +//%/** +//% * Gets the value of a##AN NAME$L field. +//% * +//% * @param self The message from which to get the field. +//% * @param field The field to get. +//% **/ +//%TYPE TisP##GPBGetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field); +//% +//%/** +//% * Sets the value of a##AN NAME$L field. +//% * +//% * @param self The message into which to set the field. +//% * @param field The field to set. +//% * @param value The to set in the field. +//% **/ +//%void GPBSetMessage##NAME##Field(GPBMessage *self, GPBFieldDescriptor *field, TYPE TisP##value); +//% diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities.m new file mode 100644 index 00000000..5029ec73 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities.m @@ -0,0 +1,1923 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBUtilities_PackagePrivate.h" + +#import <objc/runtime.h> + +#import "GPBArray_PackagePrivate.h" +#import "GPBDescriptor_PackagePrivate.h" +#import "GPBDictionary_PackagePrivate.h" +#import "GPBMessage_PackagePrivate.h" +#import "GPBUnknownField.h" +#import "GPBUnknownFieldSet.h" + +// Direct access is use for speed, to avoid even internally declaring things +// read/write, etc. The warning is enabled in the project to ensure code calling +// protos can turn on -Wdirect-ivar-access without issues. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +static void AppendTextFormatForMessage(GPBMessage *message, + NSMutableString *toStr, + NSString *lineIndent); + +NSData *GPBEmptyNSData(void) { + static dispatch_once_t onceToken; + static NSData *defaultNSData = nil; + dispatch_once(&onceToken, ^{ + defaultNSData = [[NSData alloc] init]; + }); + return defaultNSData; +} + +void GPBMessageDropUnknownFieldsRecursively(GPBMessage *initialMessage) { + if (!initialMessage) { + return; + } + + // Use an array as a list to process to avoid recursion. + NSMutableArray *todo = [NSMutableArray arrayWithObject:initialMessage]; + + while (todo.count) { + GPBMessage *msg = todo.lastObject; + [todo removeLastObject]; + + // Clear unknowns. + msg.unknownFields = nil; + + // Handle the message fields. + GPBDescriptor *descriptor = [[msg class] descriptor]; + for (GPBFieldDescriptor *field in descriptor->fields_) { + if (!GPBFieldDataTypeIsMessage(field)) { + continue; + } + switch (field.fieldType) { + case GPBFieldTypeSingle: + if (GPBGetHasIvarField(msg, field)) { + GPBMessage *fieldMessage = GPBGetObjectIvarWithFieldNoAutocreate(msg, field); + [todo addObject:fieldMessage]; + } + break; + + case GPBFieldTypeRepeated: { + NSArray *fieldMessages = GPBGetObjectIvarWithFieldNoAutocreate(msg, field); + if (fieldMessages.count) { + [todo addObjectsFromArray:fieldMessages]; + } + break; + } + + case GPBFieldTypeMap: { + id rawFieldMap = GPBGetObjectIvarWithFieldNoAutocreate(msg, field); + switch (field.mapKeyDataType) { + case GPBDataTypeBool: + [(GPBBoolObjectDictionary*)rawFieldMap enumerateKeysAndObjectsUsingBlock:^( + BOOL key, id _Nonnull object, BOOL * _Nonnull stop) { + #pragma unused(key, stop) + [todo addObject:object]; + }]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + [(GPBUInt32ObjectDictionary*)rawFieldMap enumerateKeysAndObjectsUsingBlock:^( + uint32_t key, id _Nonnull object, BOOL * _Nonnull stop) { + #pragma unused(key, stop) + [todo addObject:object]; + }]; + break; + case GPBDataTypeInt32: + case GPBDataTypeSFixed32: + case GPBDataTypeSInt32: + [(GPBInt32ObjectDictionary*)rawFieldMap enumerateKeysAndObjectsUsingBlock:^( + int32_t key, id _Nonnull object, BOOL * _Nonnull stop) { + #pragma unused(key, stop) + [todo addObject:object]; + }]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + [(GPBUInt64ObjectDictionary*)rawFieldMap enumerateKeysAndObjectsUsingBlock:^( + uint64_t key, id _Nonnull object, BOOL * _Nonnull stop) { + #pragma unused(key, stop) + [todo addObject:object]; + }]; + break; + case GPBDataTypeInt64: + case GPBDataTypeSFixed64: + case GPBDataTypeSInt64: + [(GPBInt64ObjectDictionary*)rawFieldMap enumerateKeysAndObjectsUsingBlock:^( + int64_t key, id _Nonnull object, BOOL * _Nonnull stop) { + #pragma unused(key, stop) + [todo addObject:object]; + }]; + break; + case GPBDataTypeString: + [(NSDictionary*)rawFieldMap enumerateKeysAndObjectsUsingBlock:^( + NSString * _Nonnull key, GPBMessage * _Nonnull obj, BOOL * _Nonnull stop) { + #pragma unused(key, stop) + [todo addObject:obj]; + }]; + break; + case GPBDataTypeFloat: + case GPBDataTypeDouble: + case GPBDataTypeEnum: + case GPBDataTypeBytes: + case GPBDataTypeGroup: + case GPBDataTypeMessage: + NSCAssert(NO, @"Aren't valid key types."); + } + break; + } // switch(field.mapKeyDataType) + } // switch(field.fieldType) + } // for(fields) + + // Handle any extensions holding messages. + for (GPBExtensionDescriptor *extension in [msg extensionsCurrentlySet]) { + if (!GPBDataTypeIsMessage(extension.dataType)) { + continue; + } + if (extension.isRepeated) { + NSArray *extMessages = [msg getExtension:extension]; + [todo addObjectsFromArray:extMessages]; + } else { + GPBMessage *extMessage = [msg getExtension:extension]; + [todo addObject:extMessage]; + } + } // for(extensionsCurrentlySet) + + } // while(todo.count) +} + + +// -- About Version Checks -- +// There's actually 3 places these checks all come into play: +// 1. When the generated source is compile into .o files, the header check +// happens. This is checking the protoc used matches the library being used +// when making the .o. +// 2. Every place a generated proto header is included in a developer's code, +// the header check comes into play again. But this time it is checking that +// the current library headers being used still support/match the ones for +// the generated code. +// 3. At runtime the final check here (GPBCheckRuntimeVersionsInternal), is +// called from the generated code passing in values captured when the +// generated code's .o was made. This checks that at runtime the generated +// code and runtime library match. + +void GPBCheckRuntimeVersionSupport(int32_t objcRuntimeVersion) { + // NOTE: This is passing the value captured in the compiled code to check + // against the values captured when the runtime support was compiled. This + // ensures the library code isn't in a different framework/library that + // was generated with a non matching version. + if (GOOGLE_PROTOBUF_OBJC_VERSION < objcRuntimeVersion) { + // Library is too old for headers. + [NSException raise:NSInternalInconsistencyException + format:@"Linked to ProtocolBuffer runtime version %d," + @" but code compiled needing atleast %d!", + GOOGLE_PROTOBUF_OBJC_VERSION, objcRuntimeVersion]; + } + if (objcRuntimeVersion < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION) { + // Headers are too old for library. + [NSException raise:NSInternalInconsistencyException + format:@"Proto generation source compiled against runtime" + @" version %d, but this version of the runtime only" + @" supports back to %d!", + objcRuntimeVersion, + GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION]; + } +} + +// This api is no longer used for version checks. 30001 is the last version +// using this old versioning model. When that support is removed, this function +// can be removed (along with the declaration in GPBUtilities_PackagePrivate.h). +void GPBCheckRuntimeVersionInternal(int32_t version) { + GPBInternalCompileAssert(GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION == 30001, + time_to_remove_this_old_version_shim); + if (version != GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION) { + [NSException raise:NSInternalInconsistencyException + format:@"Linked to ProtocolBuffer runtime version %d," + @" but code compiled with version %d!", + GOOGLE_PROTOBUF_OBJC_GEN_VERSION, version]; + } +} + +BOOL GPBMessageHasFieldNumberSet(GPBMessage *self, uint32_t fieldNumber) { + GPBDescriptor *descriptor = [self descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:fieldNumber]; + return GPBMessageHasFieldSet(self, field); +} + +BOOL GPBMessageHasFieldSet(GPBMessage *self, GPBFieldDescriptor *field) { + if (self == nil || field == nil) return NO; + + // Repeated/Map don't use the bit, they check the count. + if (GPBFieldIsMapOrArray(field)) { + // Array/map type doesn't matter, since GPB*Array/NSArray and + // GPB*Dictionary/NSDictionary all support -count; + NSArray *arrayOrMap = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + return (arrayOrMap.count > 0); + } else { + return GPBGetHasIvarField(self, field); + } +} + +void GPBClearMessageField(GPBMessage *self, GPBFieldDescriptor *field) { + // If not set, nothing to do. + if (!GPBGetHasIvarField(self, field)) { + return; + } + + if (GPBFieldStoresObject(field)) { + // Object types are handled slightly differently, they need to be released. + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + [*typePtr release]; + *typePtr = nil; + } else { + // POD types just need to clear the has bit as the Get* method will + // fetch the default when needed. + } + GPBSetHasIvarField(self, field, NO); +} + +BOOL GPBGetHasIvar(GPBMessage *self, int32_t idx, uint32_t fieldNumber) { + NSCAssert(self->messageStorage_ != NULL, + @"%@: All messages should have storage (from init)", + [self class]); + if (idx < 0) { + NSCAssert(fieldNumber != 0, @"Invalid field number."); + BOOL hasIvar = (self->messageStorage_->_has_storage_[-idx] == fieldNumber); + return hasIvar; + } else { + NSCAssert(idx != GPBNoHasBit, @"Invalid has bit."); + uint32_t byteIndex = idx / 32; + uint32_t bitMask = (1 << (idx % 32)); + BOOL hasIvar = + (self->messageStorage_->_has_storage_[byteIndex] & bitMask) ? YES : NO; + return hasIvar; + } +} + +uint32_t GPBGetHasOneof(GPBMessage *self, int32_t idx) { + NSCAssert(idx < 0, @"%@: invalid index (%d) for oneof.", + [self class], idx); + uint32_t result = self->messageStorage_->_has_storage_[-idx]; + return result; +} + +void GPBSetHasIvar(GPBMessage *self, int32_t idx, uint32_t fieldNumber, + BOOL value) { + if (idx < 0) { + NSCAssert(fieldNumber != 0, @"Invalid field number."); + uint32_t *has_storage = self->messageStorage_->_has_storage_; + has_storage[-idx] = (value ? fieldNumber : 0); + } else { + NSCAssert(idx != GPBNoHasBit, @"Invalid has bit."); + uint32_t *has_storage = self->messageStorage_->_has_storage_; + uint32_t byte = idx / 32; + uint32_t bitMask = (1 << (idx % 32)); + if (value) { + has_storage[byte] |= bitMask; + } else { + has_storage[byte] &= ~bitMask; + } + } +} + +void GPBMaybeClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof, + int32_t oneofHasIndex, uint32_t fieldNumberNotToClear) { + uint32_t fieldNumberSet = GPBGetHasOneof(self, oneofHasIndex); + if ((fieldNumberSet == fieldNumberNotToClear) || (fieldNumberSet == 0)) { + // Do nothing/nothing set in the oneof. + return; + } + + // Like GPBClearMessageField(), free the memory if an objecttype is set, + // pod types don't need to do anything. + GPBFieldDescriptor *fieldSet = [oneof fieldWithNumber:fieldNumberSet]; + NSCAssert(fieldSet, + @"%@: oneof set to something (%u) not in the oneof?", + [self class], fieldNumberSet); + if (fieldSet && GPBFieldStoresObject(fieldSet)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[fieldSet->description_->offset]; + [*typePtr release]; + *typePtr = nil; + } + + // Set to nothing stored in the oneof. + // (field number doesn't matter since setting to nothing). + GPBSetHasIvar(self, oneofHasIndex, 1, NO); +} + +#pragma mark - IVar accessors + +//%PDDM-DEFINE IVAR_POD_ACCESSORS_DEFN(NAME, TYPE) +//%TYPE GPBGetMessage##NAME##Field(GPBMessage *self, +//% TYPE$S NAME$S GPBFieldDescriptor *field) { +//% if (GPBGetHasIvarField(self, field)) { +//% uint8_t *storage = (uint8_t *)self->messageStorage_; +//% TYPE *typePtr = (TYPE *)&storage[field->description_->offset]; +//% return *typePtr; +//% } else { +//% return field.defaultValue.value##NAME; +//% } +//%} +//% +//%// Only exists for public api, no core code should use this. +//%void GPBSetMessage##NAME##Field(GPBMessage *self, +//% NAME$S GPBFieldDescriptor *field, +//% NAME$S TYPE value) { +//% if (self == nil || field == nil) return; +//% GPBFileSyntax syntax = [self descriptor].file.syntax; +//% GPBSet##NAME##IvarWithFieldInternal(self, field, value, syntax); +//%} +//% +//%void GPBSet##NAME##IvarWithFieldInternal(GPBMessage *self, +//% NAME$S GPBFieldDescriptor *field, +//% NAME$S TYPE value, +//% NAME$S GPBFileSyntax syntax) { +//% GPBOneofDescriptor *oneof = field->containingOneof_; +//% if (oneof) { +//% GPBMessageFieldDescription *fieldDesc = field->description_; +//% GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); +//% } +//% NSCAssert(self->messageStorage_ != NULL, +//% @"%@: All messages should have storage (from init)", +//% [self class]); +//%#if defined(__clang_analyzer__) +//% if (self->messageStorage_ == NULL) return; +//%#endif +//% uint8_t *storage = (uint8_t *)self->messageStorage_; +//% TYPE *typePtr = (TYPE *)&storage[field->description_->offset]; +//% *typePtr = value; +//% // proto2: any value counts as having been set; proto3, it +//% // has to be a non zero value or be in a oneof. +//% BOOL hasValue = ((syntax == GPBFileSyntaxProto2) +//% || (value != (TYPE)0) +//% || (field->containingOneof_ != NULL)); +//% GPBSetHasIvarField(self, field, hasValue); +//% GPBBecomeVisibleToAutocreator(self); +//%} +//% +//%PDDM-DEFINE IVAR_ALIAS_DEFN_OBJECT(NAME, TYPE) +//%// Only exists for public api, no core code should use this. +//%TYPE *GPBGetMessage##NAME##Field(GPBMessage *self, +//% TYPE$S NAME$S GPBFieldDescriptor *field) { +//% return (TYPE *)GPBGetObjectIvarWithField(self, field); +//%} +//% +//%// Only exists for public api, no core code should use this. +//%void GPBSetMessage##NAME##Field(GPBMessage *self, +//% NAME$S GPBFieldDescriptor *field, +//% NAME$S TYPE *value) { +//% GPBSetObjectIvarWithField(self, field, (id)value); +//%} +//% + +// Object types are handled slightly differently, they need to be released +// and retained. + +void GPBSetAutocreatedRetainedObjectIvarWithField( + GPBMessage *self, GPBFieldDescriptor *field, + id __attribute__((ns_consumed)) value) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + NSCAssert(*typePtr == NULL, @"Can't set autocreated object more than once."); + *typePtr = value; +} + +void GPBClearAutocreatedMessageIvarWithField(GPBMessage *self, + GPBFieldDescriptor *field) { + if (GPBGetHasIvarField(self, field)) { + return; + } + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + GPBMessage *oldValue = *typePtr; + *typePtr = NULL; + GPBClearMessageAutocreator(oldValue); + [oldValue release]; +} + +// This exists only for briging some aliased types, nothing else should use it. +static void GPBSetObjectIvarWithField(GPBMessage *self, + GPBFieldDescriptor *field, id value) { + if (self == nil || field == nil) return; + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetRetainedObjectIvarWithFieldInternal(self, field, [value retain], + syntax); +} + +void GPBSetObjectIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, id value, + GPBFileSyntax syntax) { + GPBSetRetainedObjectIvarWithFieldInternal(self, field, [value retain], + syntax); +} + +void GPBSetRetainedObjectIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + id value, GPBFileSyntax syntax) { + NSCAssert(self->messageStorage_ != NULL, + @"%@: All messages should have storage (from init)", + [self class]); +#if defined(__clang_analyzer__) + if (self->messageStorage_ == NULL) return; +#endif + GPBDataType fieldType = GPBGetFieldDataType(field); + BOOL isMapOrArray = GPBFieldIsMapOrArray(field); + BOOL fieldIsMessage = GPBDataTypeIsMessage(fieldType); +#ifdef DEBUG + if (value == nil && !isMapOrArray && !fieldIsMessage && + field.hasDefaultValue) { + // Setting a message to nil is an obvious way to "clear" the value + // as there is no way to set a non-empty default value for messages. + // + // For Strings and Bytes that have default values set it is not clear what + // should be done when their value is set to nil. Is the intention just to + // clear the set value and reset to default, or is the intention to set the + // value to the empty string/data? Arguments can be made for both cases. + // 'nil' has been abused as a replacement for an empty string/data in ObjC. + // We decided to be consistent with all "object" types and clear the has + // field, and fall back on the default value. The warning below will only + // appear in debug, but the could should be changed so the intention is + // clear. + NSString *hasSel = NSStringFromSelector(field->hasOrCountSel_); + NSString *propName = field.name; + NSString *className = self.descriptor.name; + NSLog(@"warning: '%@.%@ = nil;' is not clearly defined for fields with " + @"default values. Please use '%@.%@ = %@' if you want to set it to " + @"empty, or call '%@.%@ = NO' to reset it to it's default value of " + @"'%@'. Defaulting to resetting default value.", + className, propName, className, propName, + (fieldType == GPBDataTypeString) ? @"@\"\"" : @"GPBEmptyNSData()", + className, hasSel, field.defaultValue.valueString); + // Note: valueString, depending on the type, it could easily be + // valueData/valueMessage. + } +#endif // DEBUG + if (!isMapOrArray) { + // Non repeated/map can be in an oneof, clear any existing value from the + // oneof. + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); + } + // Clear "has" if they are being set to nil. + BOOL setHasValue = (value != nil); + // Under proto3, Bytes & String fields get cleared by resetting them to + // their default (empty) values, so if they are set to something of length + // zero, they are being cleared. + if ((syntax == GPBFileSyntaxProto3) && !fieldIsMessage && + ([value length] == 0)) { + // Except, if the field was in a oneof, then it still gets recorded as + // having been set so the state of the oneof can be serialized back out. + if (!oneof) { + setHasValue = NO; + } + if (setHasValue) { + NSCAssert(value != nil, @"Should never be setting has for nil"); + } else { + // The value passed in was retained, it must be released since we + // aren't saving anything in the field. + [value release]; + value = nil; + } + } + GPBSetHasIvarField(self, field, setHasValue); + } + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + + id oldValue = *typePtr; + + *typePtr = value; + + if (oldValue) { + if (isMapOrArray) { + if (field.fieldType == GPBFieldTypeRepeated) { + // If the old array was autocreated by us, then clear it. + if (GPBDataTypeIsObject(fieldType)) { + if ([oldValue isKindOfClass:[GPBAutocreatedArray class]]) { + GPBAutocreatedArray *autoArray = oldValue; + if (autoArray->_autocreator == self) { + autoArray->_autocreator = nil; + } + } + } else { + // Type doesn't matter, it is a GPB*Array. + GPBInt32Array *gpbArray = oldValue; + if (gpbArray->_autocreator == self) { + gpbArray->_autocreator = nil; + } + } + } else { // GPBFieldTypeMap + // If the old map was autocreated by us, then clear it. + if ((field.mapKeyDataType == GPBDataTypeString) && + GPBDataTypeIsObject(fieldType)) { + if ([oldValue isKindOfClass:[GPBAutocreatedDictionary class]]) { + GPBAutocreatedDictionary *autoDict = oldValue; + if (autoDict->_autocreator == self) { + autoDict->_autocreator = nil; + } + } + } else { + // Type doesn't matter, it is a GPB*Dictionary. + GPBInt32Int32Dictionary *gpbDict = oldValue; + if (gpbDict->_autocreator == self) { + gpbDict->_autocreator = nil; + } + } + } + } else if (fieldIsMessage) { + // If the old message value was autocreated by us, then clear it. + GPBMessage *oldMessageValue = oldValue; + if (GPBWasMessageAutocreatedBy(oldMessageValue, self)) { + GPBClearMessageAutocreator(oldMessageValue); + } + } + [oldValue release]; + } + + GPBBecomeVisibleToAutocreator(self); +} + +id GPBGetObjectIvarWithFieldNoAutocreate(GPBMessage *self, + GPBFieldDescriptor *field) { + if (self->messageStorage_ == nil) { + return nil; + } + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + return *typePtr; +} + +id GPBGetObjectIvarWithField(GPBMessage *self, GPBFieldDescriptor *field) { + NSCAssert(!GPBFieldIsMapOrArray(field), @"Shouldn't get here"); + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + id *typePtr = (id *)&storage[field->description_->offset]; + return *typePtr; + } + // Not set... + + // Non messages (string/data), get their default. + if (!GPBFieldDataTypeIsMessage(field)) { + return field.defaultValue.valueMessage; + } + + GPBPrepareReadOnlySemaphore(self); + dispatch_semaphore_wait(self->readOnlySemaphore_, DISPATCH_TIME_FOREVER); + GPBMessage *result = GPBGetObjectIvarWithFieldNoAutocreate(self, field); + if (!result) { + // For non repeated messages, create the object, set it and return it. + // This object will not initially be visible via GPBGetHasIvar, so + // we save its creator so it can become visible if it's mutated later. + result = GPBCreateMessageWithAutocreator(field.msgClass, self, field); + GPBSetAutocreatedRetainedObjectIvarWithField(self, field, result); + } + dispatch_semaphore_signal(self->readOnlySemaphore_); + return result; +} + +// Only exists for public api, no core code should use this. +int32_t GPBGetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field) { + GPBFileSyntax syntax = [self descriptor].file.syntax; + return GPBGetEnumIvarWithFieldInternal(self, field, syntax); +} + +int32_t GPBGetEnumIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + GPBFileSyntax syntax) { + int32_t result = GPBGetMessageInt32Field(self, field); + // If this is presevering unknown enums, make sure the value is valid before + // returning it. + if (GPBHasPreservingUnknownEnumSemantics(syntax) && + ![field isValidEnumValue:result]) { + result = kGPBUnrecognizedEnumeratorValue; + } + return result; +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageEnumField(GPBMessage *self, GPBFieldDescriptor *field, + int32_t value) { + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetInt32IvarWithFieldInternal(self, field, value, syntax); +} + +void GPBSetEnumIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, int32_t value, + GPBFileSyntax syntax) { + // Don't allow in unknown values. Proto3 can use the Raw method. + if (![field isValidEnumValue:value]) { + [NSException raise:NSInvalidArgumentException + format:@"%@.%@: Attempt to set an unknown enum value (%d)", + [self class], field.name, value]; + } + GPBSetInt32IvarWithFieldInternal(self, field, value, syntax); +} + +// Only exists for public api, no core code should use this. +int32_t GPBGetMessageRawEnumField(GPBMessage *self, + GPBFieldDescriptor *field) { + int32_t result = GPBGetMessageInt32Field(self, field); + return result; +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageRawEnumField(GPBMessage *self, GPBFieldDescriptor *field, + int32_t value) { + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetInt32IvarWithFieldInternal(self, field, value, syntax); +} + +BOOL GPBGetMessageBoolField(GPBMessage *self, + GPBFieldDescriptor *field) { + if (GPBGetHasIvarField(self, field)) { + // Bools are stored in the has bits to avoid needing explicit space in the + // storage structure. + // (the field number passed to the HasIvar helper doesn't really matter + // since the offset is never negative) + GPBMessageFieldDescription *fieldDesc = field->description_; + return GPBGetHasIvar(self, (int32_t)(fieldDesc->offset), fieldDesc->number); + } else { + return field.defaultValue.valueBool; + } +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageBoolField(GPBMessage *self, + GPBFieldDescriptor *field, + BOOL value) { + if (self == nil || field == nil) return; + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetBoolIvarWithFieldInternal(self, field, value, syntax); +} + +void GPBSetBoolIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + BOOL value, + GPBFileSyntax syntax) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof) { + GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); + } + + // Bools are stored in the has bits to avoid needing explicit space in the + // storage structure. + // (the field number passed to the HasIvar helper doesn't really matter since + // the offset is never negative) + GPBSetHasIvar(self, (int32_t)(fieldDesc->offset), fieldDesc->number, value); + + // proto2: any value counts as having been set; proto3, it + // has to be a non zero value or be in a oneof. + BOOL hasValue = ((syntax == GPBFileSyntaxProto2) + || (value != (BOOL)0) + || (field->containingOneof_ != NULL)); + GPBSetHasIvarField(self, field, hasValue); + GPBBecomeVisibleToAutocreator(self); +} + +//%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(Int32, int32_t) +// This block of code is generated, do not edit it directly. + +int32_t GPBGetMessageInt32Field(GPBMessage *self, + GPBFieldDescriptor *field) { + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + int32_t *typePtr = (int32_t *)&storage[field->description_->offset]; + return *typePtr; + } else { + return field.defaultValue.valueInt32; + } +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageInt32Field(GPBMessage *self, + GPBFieldDescriptor *field, + int32_t value) { + if (self == nil || field == nil) return; + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetInt32IvarWithFieldInternal(self, field, value, syntax); +} + +void GPBSetInt32IvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + int32_t value, + GPBFileSyntax syntax) { + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); + } + NSCAssert(self->messageStorage_ != NULL, + @"%@: All messages should have storage (from init)", + [self class]); +#if defined(__clang_analyzer__) + if (self->messageStorage_ == NULL) return; +#endif + uint8_t *storage = (uint8_t *)self->messageStorage_; + int32_t *typePtr = (int32_t *)&storage[field->description_->offset]; + *typePtr = value; + // proto2: any value counts as having been set; proto3, it + // has to be a non zero value or be in a oneof. + BOOL hasValue = ((syntax == GPBFileSyntaxProto2) + || (value != (int32_t)0) + || (field->containingOneof_ != NULL)); + GPBSetHasIvarField(self, field, hasValue); + GPBBecomeVisibleToAutocreator(self); +} + +//%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(UInt32, uint32_t) +// This block of code is generated, do not edit it directly. + +uint32_t GPBGetMessageUInt32Field(GPBMessage *self, + GPBFieldDescriptor *field) { + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + uint32_t *typePtr = (uint32_t *)&storage[field->description_->offset]; + return *typePtr; + } else { + return field.defaultValue.valueUInt32; + } +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageUInt32Field(GPBMessage *self, + GPBFieldDescriptor *field, + uint32_t value) { + if (self == nil || field == nil) return; + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetUInt32IvarWithFieldInternal(self, field, value, syntax); +} + +void GPBSetUInt32IvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + uint32_t value, + GPBFileSyntax syntax) { + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); + } + NSCAssert(self->messageStorage_ != NULL, + @"%@: All messages should have storage (from init)", + [self class]); +#if defined(__clang_analyzer__) + if (self->messageStorage_ == NULL) return; +#endif + uint8_t *storage = (uint8_t *)self->messageStorage_; + uint32_t *typePtr = (uint32_t *)&storage[field->description_->offset]; + *typePtr = value; + // proto2: any value counts as having been set; proto3, it + // has to be a non zero value or be in a oneof. + BOOL hasValue = ((syntax == GPBFileSyntaxProto2) + || (value != (uint32_t)0) + || (field->containingOneof_ != NULL)); + GPBSetHasIvarField(self, field, hasValue); + GPBBecomeVisibleToAutocreator(self); +} + +//%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(Int64, int64_t) +// This block of code is generated, do not edit it directly. + +int64_t GPBGetMessageInt64Field(GPBMessage *self, + GPBFieldDescriptor *field) { + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + int64_t *typePtr = (int64_t *)&storage[field->description_->offset]; + return *typePtr; + } else { + return field.defaultValue.valueInt64; + } +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageInt64Field(GPBMessage *self, + GPBFieldDescriptor *field, + int64_t value) { + if (self == nil || field == nil) return; + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetInt64IvarWithFieldInternal(self, field, value, syntax); +} + +void GPBSetInt64IvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + int64_t value, + GPBFileSyntax syntax) { + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); + } + NSCAssert(self->messageStorage_ != NULL, + @"%@: All messages should have storage (from init)", + [self class]); +#if defined(__clang_analyzer__) + if (self->messageStorage_ == NULL) return; +#endif + uint8_t *storage = (uint8_t *)self->messageStorage_; + int64_t *typePtr = (int64_t *)&storage[field->description_->offset]; + *typePtr = value; + // proto2: any value counts as having been set; proto3, it + // has to be a non zero value or be in a oneof. + BOOL hasValue = ((syntax == GPBFileSyntaxProto2) + || (value != (int64_t)0) + || (field->containingOneof_ != NULL)); + GPBSetHasIvarField(self, field, hasValue); + GPBBecomeVisibleToAutocreator(self); +} + +//%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(UInt64, uint64_t) +// This block of code is generated, do not edit it directly. + +uint64_t GPBGetMessageUInt64Field(GPBMessage *self, + GPBFieldDescriptor *field) { + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + uint64_t *typePtr = (uint64_t *)&storage[field->description_->offset]; + return *typePtr; + } else { + return field.defaultValue.valueUInt64; + } +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageUInt64Field(GPBMessage *self, + GPBFieldDescriptor *field, + uint64_t value) { + if (self == nil || field == nil) return; + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetUInt64IvarWithFieldInternal(self, field, value, syntax); +} + +void GPBSetUInt64IvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + uint64_t value, + GPBFileSyntax syntax) { + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); + } + NSCAssert(self->messageStorage_ != NULL, + @"%@: All messages should have storage (from init)", + [self class]); +#if defined(__clang_analyzer__) + if (self->messageStorage_ == NULL) return; +#endif + uint8_t *storage = (uint8_t *)self->messageStorage_; + uint64_t *typePtr = (uint64_t *)&storage[field->description_->offset]; + *typePtr = value; + // proto2: any value counts as having been set; proto3, it + // has to be a non zero value or be in a oneof. + BOOL hasValue = ((syntax == GPBFileSyntaxProto2) + || (value != (uint64_t)0) + || (field->containingOneof_ != NULL)); + GPBSetHasIvarField(self, field, hasValue); + GPBBecomeVisibleToAutocreator(self); +} + +//%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(Float, float) +// This block of code is generated, do not edit it directly. + +float GPBGetMessageFloatField(GPBMessage *self, + GPBFieldDescriptor *field) { + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + float *typePtr = (float *)&storage[field->description_->offset]; + return *typePtr; + } else { + return field.defaultValue.valueFloat; + } +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageFloatField(GPBMessage *self, + GPBFieldDescriptor *field, + float value) { + if (self == nil || field == nil) return; + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetFloatIvarWithFieldInternal(self, field, value, syntax); +} + +void GPBSetFloatIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + float value, + GPBFileSyntax syntax) { + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); + } + NSCAssert(self->messageStorage_ != NULL, + @"%@: All messages should have storage (from init)", + [self class]); +#if defined(__clang_analyzer__) + if (self->messageStorage_ == NULL) return; +#endif + uint8_t *storage = (uint8_t *)self->messageStorage_; + float *typePtr = (float *)&storage[field->description_->offset]; + *typePtr = value; + // proto2: any value counts as having been set; proto3, it + // has to be a non zero value or be in a oneof. + BOOL hasValue = ((syntax == GPBFileSyntaxProto2) + || (value != (float)0) + || (field->containingOneof_ != NULL)); + GPBSetHasIvarField(self, field, hasValue); + GPBBecomeVisibleToAutocreator(self); +} + +//%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(Double, double) +// This block of code is generated, do not edit it directly. + +double GPBGetMessageDoubleField(GPBMessage *self, + GPBFieldDescriptor *field) { + if (GPBGetHasIvarField(self, field)) { + uint8_t *storage = (uint8_t *)self->messageStorage_; + double *typePtr = (double *)&storage[field->description_->offset]; + return *typePtr; + } else { + return field.defaultValue.valueDouble; + } +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageDoubleField(GPBMessage *self, + GPBFieldDescriptor *field, + double value) { + if (self == nil || field == nil) return; + GPBFileSyntax syntax = [self descriptor].file.syntax; + GPBSetDoubleIvarWithFieldInternal(self, field, value, syntax); +} + +void GPBSetDoubleIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + double value, + GPBFileSyntax syntax) { + GPBOneofDescriptor *oneof = field->containingOneof_; + if (oneof) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBMaybeClearOneof(self, oneof, fieldDesc->hasIndex, fieldDesc->number); + } + NSCAssert(self->messageStorage_ != NULL, + @"%@: All messages should have storage (from init)", + [self class]); +#if defined(__clang_analyzer__) + if (self->messageStorage_ == NULL) return; +#endif + uint8_t *storage = (uint8_t *)self->messageStorage_; + double *typePtr = (double *)&storage[field->description_->offset]; + *typePtr = value; + // proto2: any value counts as having been set; proto3, it + // has to be a non zero value or be in a oneof. + BOOL hasValue = ((syntax == GPBFileSyntaxProto2) + || (value != (double)0) + || (field->containingOneof_ != NULL)); + GPBSetHasIvarField(self, field, hasValue); + GPBBecomeVisibleToAutocreator(self); +} + +//%PDDM-EXPAND-END (6 expansions) + +// Aliases are function calls that are virtually the same. + +//%PDDM-EXPAND IVAR_ALIAS_DEFN_OBJECT(String, NSString) +// This block of code is generated, do not edit it directly. + +// Only exists for public api, no core code should use this. +NSString *GPBGetMessageStringField(GPBMessage *self, + GPBFieldDescriptor *field) { + return (NSString *)GPBGetObjectIvarWithField(self, field); +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageStringField(GPBMessage *self, + GPBFieldDescriptor *field, + NSString *value) { + GPBSetObjectIvarWithField(self, field, (id)value); +} + +//%PDDM-EXPAND IVAR_ALIAS_DEFN_OBJECT(Bytes, NSData) +// This block of code is generated, do not edit it directly. + +// Only exists for public api, no core code should use this. +NSData *GPBGetMessageBytesField(GPBMessage *self, + GPBFieldDescriptor *field) { + return (NSData *)GPBGetObjectIvarWithField(self, field); +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageBytesField(GPBMessage *self, + GPBFieldDescriptor *field, + NSData *value) { + GPBSetObjectIvarWithField(self, field, (id)value); +} + +//%PDDM-EXPAND IVAR_ALIAS_DEFN_OBJECT(Message, GPBMessage) +// This block of code is generated, do not edit it directly. + +// Only exists for public api, no core code should use this. +GPBMessage *GPBGetMessageMessageField(GPBMessage *self, + GPBFieldDescriptor *field) { + return (GPBMessage *)GPBGetObjectIvarWithField(self, field); +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageMessageField(GPBMessage *self, + GPBFieldDescriptor *field, + GPBMessage *value) { + GPBSetObjectIvarWithField(self, field, (id)value); +} + +//%PDDM-EXPAND IVAR_ALIAS_DEFN_OBJECT(Group, GPBMessage) +// This block of code is generated, do not edit it directly. + +// Only exists for public api, no core code should use this. +GPBMessage *GPBGetMessageGroupField(GPBMessage *self, + GPBFieldDescriptor *field) { + return (GPBMessage *)GPBGetObjectIvarWithField(self, field); +} + +// Only exists for public api, no core code should use this. +void GPBSetMessageGroupField(GPBMessage *self, + GPBFieldDescriptor *field, + GPBMessage *value) { + GPBSetObjectIvarWithField(self, field, (id)value); +} + +//%PDDM-EXPAND-END (4 expansions) + +// GPBGetMessageRepeatedField is defined in GPBMessage.m + +// Only exists for public api, no core code should use this. +void GPBSetMessageRepeatedField(GPBMessage *self, GPBFieldDescriptor *field, id array) { +#if defined(DEBUG) && DEBUG + if (field.fieldType != GPBFieldTypeRepeated) { + [NSException raise:NSInvalidArgumentException + format:@"%@.%@ is not a repeated field.", + [self class], field.name]; + } + Class expectedClass = Nil; + switch (GPBGetFieldDataType(field)) { + case GPBDataTypeBool: + expectedClass = [GPBBoolArray class]; + break; + case GPBDataTypeSFixed32: + case GPBDataTypeInt32: + case GPBDataTypeSInt32: + expectedClass = [GPBInt32Array class]; + break; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + expectedClass = [GPBUInt32Array class]; + break; + case GPBDataTypeSFixed64: + case GPBDataTypeInt64: + case GPBDataTypeSInt64: + expectedClass = [GPBInt64Array class]; + break; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + expectedClass = [GPBUInt64Array class]; + break; + case GPBDataTypeFloat: + expectedClass = [GPBFloatArray class]; + break; + case GPBDataTypeDouble: + expectedClass = [GPBDoubleArray class]; + break; + case GPBDataTypeBytes: + case GPBDataTypeString: + case GPBDataTypeMessage: + case GPBDataTypeGroup: + expectedClass = [NSMutableArray class]; + break; + case GPBDataTypeEnum: + expectedClass = [GPBEnumArray class]; + break; + } + if (array && ![array isKindOfClass:expectedClass]) { + [NSException raise:NSInvalidArgumentException + format:@"%@.%@: Expected %@ object, got %@.", + [self class], field.name, expectedClass, [array class]]; + } +#endif + GPBSetObjectIvarWithField(self, field, array); +} + +#if defined(DEBUG) && DEBUG +static NSString *TypeToStr(GPBDataType dataType) { + switch (dataType) { + case GPBDataTypeBool: + return @"Bool"; + case GPBDataTypeSFixed32: + case GPBDataTypeInt32: + case GPBDataTypeSInt32: + return @"Int32"; + case GPBDataTypeFixed32: + case GPBDataTypeUInt32: + return @"UInt32"; + case GPBDataTypeSFixed64: + case GPBDataTypeInt64: + case GPBDataTypeSInt64: + return @"Int64"; + case GPBDataTypeFixed64: + case GPBDataTypeUInt64: + return @"UInt64"; + case GPBDataTypeFloat: + return @"Float"; + case GPBDataTypeDouble: + return @"Double"; + case GPBDataTypeBytes: + case GPBDataTypeString: + case GPBDataTypeMessage: + case GPBDataTypeGroup: + return @"Object"; + case GPBDataTypeEnum: + return @"Bool"; + } +} +#endif + +// GPBGetMessageMapField is defined in GPBMessage.m + +// Only exists for public api, no core code should use this. +void GPBSetMessageMapField(GPBMessage *self, GPBFieldDescriptor *field, + id dictionary) { +#if defined(DEBUG) && DEBUG + if (field.fieldType != GPBFieldTypeMap) { + [NSException raise:NSInvalidArgumentException + format:@"%@.%@ is not a map<> field.", + [self class], field.name]; + } + if (dictionary) { + GPBDataType keyDataType = field.mapKeyDataType; + GPBDataType valueDataType = GPBGetFieldDataType(field); + NSString *keyStr = TypeToStr(keyDataType); + NSString *valueStr = TypeToStr(valueDataType); + if (keyDataType == GPBDataTypeString) { + keyStr = @"String"; + } + Class expectedClass = Nil; + if ((keyDataType == GPBDataTypeString) && + GPBDataTypeIsObject(valueDataType)) { + expectedClass = [NSMutableDictionary class]; + } else { + NSString *className = + [NSString stringWithFormat:@"GPB%@%@Dictionary", keyStr, valueStr]; + expectedClass = NSClassFromString(className); + NSCAssert(expectedClass, @"Missing a class (%@)?", expectedClass); + } + if (![dictionary isKindOfClass:expectedClass]) { + [NSException raise:NSInvalidArgumentException + format:@"%@.%@: Expected %@ object, got %@.", + [self class], field.name, expectedClass, + [dictionary class]]; + } + } +#endif + GPBSetObjectIvarWithField(self, field, dictionary); +} + +#pragma mark - Misc Dynamic Runtime Utils + +const char *GPBMessageEncodingForSelector(SEL selector, BOOL instanceSel) { + Protocol *protocol = + objc_getProtocol(GPBStringifySymbol(GPBMessageSignatureProtocol)); + struct objc_method_description description = + protocol_getMethodDescription(protocol, selector, NO, instanceSel); + return description.types; +} + +#pragma mark - Text Format Support + +static void AppendStringEscaped(NSString *toPrint, NSMutableString *destStr) { + [destStr appendString:@"\""]; + NSUInteger len = [toPrint length]; + for (NSUInteger i = 0; i < len; ++i) { + unichar aChar = [toPrint characterAtIndex:i]; + switch (aChar) { + case '\n': [destStr appendString:@"\\n"]; break; + case '\r': [destStr appendString:@"\\r"]; break; + case '\t': [destStr appendString:@"\\t"]; break; + case '\"': [destStr appendString:@"\\\""]; break; + case '\'': [destStr appendString:@"\\\'"]; break; + case '\\': [destStr appendString:@"\\\\"]; break; + default: + // This differs slightly from the C++ code in that the C++ doesn't + // generate UTF8; it looks at the string in UTF8, but escapes every + // byte > 0x7E. + if (aChar < 0x20) { + [destStr appendFormat:@"\\%d%d%d", + (aChar / 64), ((aChar % 64) / 8), (aChar % 8)]; + } else { + [destStr appendFormat:@"%C", aChar]; + } + break; + } + } + [destStr appendString:@"\""]; +} + +static void AppendBufferAsString(NSData *buffer, NSMutableString *destStr) { + const char *src = (const char *)[buffer bytes]; + size_t srcLen = [buffer length]; + [destStr appendString:@"\""]; + for (const char *srcEnd = src + srcLen; src < srcEnd; src++) { + switch (*src) { + case '\n': [destStr appendString:@"\\n"]; break; + case '\r': [destStr appendString:@"\\r"]; break; + case '\t': [destStr appendString:@"\\t"]; break; + case '\"': [destStr appendString:@"\\\""]; break; + case '\'': [destStr appendString:@"\\\'"]; break; + case '\\': [destStr appendString:@"\\\\"]; break; + default: + if (isprint(*src)) { + [destStr appendFormat:@"%c", *src]; + } else { + // NOTE: doing hex means you have to worry about the letter after + // the hex being another hex char and forcing that to be escaped, so + // use octal to keep it simple. + [destStr appendFormat:@"\\%03o", (uint8_t)(*src)]; + } + break; + } + } + [destStr appendString:@"\""]; +} + +static void AppendTextFormatForMapMessageField( + id map, GPBFieldDescriptor *field, NSMutableString *toStr, + NSString *lineIndent, NSString *fieldName, NSString *lineEnding) { + GPBDataType keyDataType = field.mapKeyDataType; + GPBDataType valueDataType = GPBGetFieldDataType(field); + BOOL isMessageValue = GPBDataTypeIsMessage(valueDataType); + + NSString *msgStartFirst = + [NSString stringWithFormat:@"%@%@ {%@\n", lineIndent, fieldName, lineEnding]; + NSString *msgStart = + [NSString stringWithFormat:@"%@%@ {\n", lineIndent, fieldName]; + NSString *msgEnd = [NSString stringWithFormat:@"%@}\n", lineIndent]; + + NSString *keyLine = [NSString stringWithFormat:@"%@ key: ", lineIndent]; + NSString *valueLine = [NSString stringWithFormat:@"%@ value%s ", lineIndent, + (isMessageValue ? "" : ":")]; + + __block BOOL isFirst = YES; + + if ((keyDataType == GPBDataTypeString) && + GPBDataTypeIsObject(valueDataType)) { + // map is an NSDictionary. + NSDictionary *dict = map; + [dict enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) { + #pragma unused(stop) + [toStr appendString:(isFirst ? msgStartFirst : msgStart)]; + isFirst = NO; + + [toStr appendString:keyLine]; + AppendStringEscaped(key, toStr); + [toStr appendString:@"\n"]; + + [toStr appendString:valueLine]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" + switch (valueDataType) { + case GPBDataTypeString: + AppendStringEscaped(value, toStr); + break; + + case GPBDataTypeBytes: + AppendBufferAsString(value, toStr); + break; + + case GPBDataTypeMessage: + [toStr appendString:@"{\n"]; + NSString *subIndent = [lineIndent stringByAppendingString:@" "]; + AppendTextFormatForMessage(value, toStr, subIndent); + [toStr appendFormat:@"%@ }", lineIndent]; + break; + + default: + NSCAssert(NO, @"Can't happen"); + break; + } +#pragma clang diagnostic pop + [toStr appendString:@"\n"]; + + [toStr appendString:msgEnd]; + }]; + } else { + // map is one of the GPB*Dictionary classes, type doesn't matter. + GPBInt32Int32Dictionary *dict = map; + [dict enumerateForTextFormat:^(id keyObj, id valueObj) { + [toStr appendString:(isFirst ? msgStartFirst : msgStart)]; + isFirst = NO; + + // Key always is a NSString. + if (keyDataType == GPBDataTypeString) { + [toStr appendString:keyLine]; + AppendStringEscaped(keyObj, toStr); + [toStr appendString:@"\n"]; + } else { + [toStr appendFormat:@"%@%@\n", keyLine, keyObj]; + } + + [toStr appendString:valueLine]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" + switch (valueDataType) { + case GPBDataTypeString: + AppendStringEscaped(valueObj, toStr); + break; + + case GPBDataTypeBytes: + AppendBufferAsString(valueObj, toStr); + break; + + case GPBDataTypeMessage: + [toStr appendString:@"{\n"]; + NSString *subIndent = [lineIndent stringByAppendingString:@" "]; + AppendTextFormatForMessage(valueObj, toStr, subIndent); + [toStr appendFormat:@"%@ }", lineIndent]; + break; + + case GPBDataTypeEnum: { + int32_t enumValue = [valueObj intValue]; + NSString *valueStr = nil; + GPBEnumDescriptor *descriptor = field.enumDescriptor; + if (descriptor) { + valueStr = [descriptor textFormatNameForValue:enumValue]; + } + if (valueStr) { + [toStr appendString:valueStr]; + } else { + [toStr appendFormat:@"%d", enumValue]; + } + break; + } + + default: + NSCAssert(valueDataType != GPBDataTypeGroup, @"Can't happen"); + // Everything else is a NSString. + [toStr appendString:valueObj]; + break; + } +#pragma clang diagnostic pop + [toStr appendString:@"\n"]; + + [toStr appendString:msgEnd]; + }]; + } +} + +static void AppendTextFormatForMessageField(GPBMessage *message, + GPBFieldDescriptor *field, + NSMutableString *toStr, + NSString *lineIndent) { + id arrayOrMap; + NSUInteger count; + GPBFieldType fieldType = field.fieldType; + switch (fieldType) { + case GPBFieldTypeSingle: + arrayOrMap = nil; + count = (GPBGetHasIvarField(message, field) ? 1 : 0); + break; + + case GPBFieldTypeRepeated: + // Will be NSArray or GPB*Array, type doesn't matter, they both + // implement count. + arrayOrMap = GPBGetObjectIvarWithFieldNoAutocreate(message, field); + count = [(NSArray *)arrayOrMap count]; + break; + + case GPBFieldTypeMap: { + // Will be GPB*Dictionary or NSMutableDictionary, type doesn't matter, + // they both implement count. + arrayOrMap = GPBGetObjectIvarWithFieldNoAutocreate(message, field); + count = [(NSDictionary *)arrayOrMap count]; + break; + } + } + + if (count == 0) { + // Nothing to print, out of here. + return; + } + + NSString *lineEnding = @""; + + // If the name can't be reversed or support for extra info was turned off, + // this can return nil. + NSString *fieldName = [field textFormatName]; + if ([fieldName length] == 0) { + fieldName = [NSString stringWithFormat:@"%u", GPBFieldNumber(field)]; + // If there is only one entry, put the objc name as a comment, other wise + // add it before the repeated values. + if (count > 1) { + [toStr appendFormat:@"%@# %@\n", lineIndent, field.name]; + } else { + lineEnding = [NSString stringWithFormat:@" # %@", field.name]; + } + } + + if (fieldType == GPBFieldTypeMap) { + AppendTextFormatForMapMessageField(arrayOrMap, field, toStr, lineIndent, + fieldName, lineEnding); + return; + } + + id array = arrayOrMap; + const BOOL isRepeated = (array != nil); + + GPBDataType fieldDataType = GPBGetFieldDataType(field); + BOOL isMessageField = GPBDataTypeIsMessage(fieldDataType); + for (NSUInteger j = 0; j < count; ++j) { + // Start the line. + [toStr appendFormat:@"%@%@%s ", lineIndent, fieldName, + (isMessageField ? "" : ":")]; + + // The value. + switch (fieldDataType) { +#define FIELD_CASE(GPBDATATYPE, CTYPE, REAL_TYPE, ...) \ + case GPBDataType##GPBDATATYPE: { \ + CTYPE v = (isRepeated ? [(GPB##REAL_TYPE##Array *)array valueAtIndex:j] \ + : GPBGetMessage##REAL_TYPE##Field(message, field)); \ + [toStr appendFormat:__VA_ARGS__, v]; \ + break; \ + } + + FIELD_CASE(Int32, int32_t, Int32, @"%d") + FIELD_CASE(SInt32, int32_t, Int32, @"%d") + FIELD_CASE(SFixed32, int32_t, Int32, @"%d") + FIELD_CASE(UInt32, uint32_t, UInt32, @"%u") + FIELD_CASE(Fixed32, uint32_t, UInt32, @"%u") + FIELD_CASE(Int64, int64_t, Int64, @"%lld") + FIELD_CASE(SInt64, int64_t, Int64, @"%lld") + FIELD_CASE(SFixed64, int64_t, Int64, @"%lld") + FIELD_CASE(UInt64, uint64_t, UInt64, @"%llu") + FIELD_CASE(Fixed64, uint64_t, UInt64, @"%llu") + FIELD_CASE(Float, float, Float, @"%.*g", FLT_DIG) + FIELD_CASE(Double, double, Double, @"%.*lg", DBL_DIG) + +#undef FIELD_CASE + + case GPBDataTypeEnum: { + int32_t v = (isRepeated ? [(GPBEnumArray *)array rawValueAtIndex:j] + : GPBGetMessageInt32Field(message, field)); + NSString *valueStr = nil; + GPBEnumDescriptor *descriptor = field.enumDescriptor; + if (descriptor) { + valueStr = [descriptor textFormatNameForValue:v]; + } + if (valueStr) { + [toStr appendString:valueStr]; + } else { + [toStr appendFormat:@"%d", v]; + } + break; + } + + case GPBDataTypeBool: { + BOOL v = (isRepeated ? [(GPBBoolArray *)array valueAtIndex:j] + : GPBGetMessageBoolField(message, field)); + [toStr appendString:(v ? @"true" : @"false")]; + break; + } + + case GPBDataTypeString: { + NSString *v = (isRepeated ? [(NSArray *)array objectAtIndex:j] + : GPBGetMessageStringField(message, field)); + AppendStringEscaped(v, toStr); + break; + } + + case GPBDataTypeBytes: { + NSData *v = (isRepeated ? [(NSArray *)array objectAtIndex:j] + : GPBGetMessageBytesField(message, field)); + AppendBufferAsString(v, toStr); + break; + } + + case GPBDataTypeGroup: + case GPBDataTypeMessage: { + GPBMessage *v = + (isRepeated ? [(NSArray *)array objectAtIndex:j] + : GPBGetObjectIvarWithField(message, field)); + [toStr appendFormat:@"{%@\n", lineEnding]; + NSString *subIndent = [lineIndent stringByAppendingString:@" "]; + AppendTextFormatForMessage(v, toStr, subIndent); + [toStr appendFormat:@"%@}", lineIndent]; + lineEnding = @""; + break; + } + + } // switch(fieldDataType) + + // End the line. + [toStr appendFormat:@"%@\n", lineEnding]; + + } // for(count) +} + +static void AppendTextFormatForMessageExtensionRange(GPBMessage *message, + NSArray *activeExtensions, + GPBExtensionRange range, + NSMutableString *toStr, + NSString *lineIndent) { + uint32_t start = range.start; + uint32_t end = range.end; + for (GPBExtensionDescriptor *extension in activeExtensions) { + uint32_t fieldNumber = extension.fieldNumber; + if (fieldNumber < start) { + // Not there yet. + continue; + } + if (fieldNumber > end) { + // Done. + break; + } + + id rawExtValue = [message getExtension:extension]; + BOOL isRepeated = extension.isRepeated; + + NSUInteger numValues = 1; + NSString *lineEnding = @""; + if (isRepeated) { + numValues = [(NSArray *)rawExtValue count]; + } + + NSString *singletonName = extension.singletonName; + if (numValues == 1) { + lineEnding = [NSString stringWithFormat:@" # [%@]", singletonName]; + } else { + [toStr appendFormat:@"%@# [%@]\n", lineIndent, singletonName]; + } + + GPBDataType extDataType = extension.dataType; + for (NSUInteger j = 0; j < numValues; ++j) { + id curValue = (isRepeated ? [rawExtValue objectAtIndex:j] : rawExtValue); + + // Start the line. + [toStr appendFormat:@"%@%u%s ", lineIndent, fieldNumber, + (GPBDataTypeIsMessage(extDataType) ? "" : ":")]; + + // The value. + switch (extDataType) { +#define FIELD_CASE(GPBDATATYPE, CTYPE, NUMSELECTOR, ...) \ + case GPBDataType##GPBDATATYPE: { \ + CTYPE v = [(NSNumber *)curValue NUMSELECTOR]; \ + [toStr appendFormat:__VA_ARGS__, v]; \ + break; \ + } + + FIELD_CASE(Int32, int32_t, intValue, @"%d") + FIELD_CASE(SInt32, int32_t, intValue, @"%d") + FIELD_CASE(SFixed32, int32_t, unsignedIntValue, @"%d") + FIELD_CASE(UInt32, uint32_t, unsignedIntValue, @"%u") + FIELD_CASE(Fixed32, uint32_t, unsignedIntValue, @"%u") + FIELD_CASE(Int64, int64_t, longLongValue, @"%lld") + FIELD_CASE(SInt64, int64_t, longLongValue, @"%lld") + FIELD_CASE(SFixed64, int64_t, longLongValue, @"%lld") + FIELD_CASE(UInt64, uint64_t, unsignedLongLongValue, @"%llu") + FIELD_CASE(Fixed64, uint64_t, unsignedLongLongValue, @"%llu") + FIELD_CASE(Float, float, floatValue, @"%.*g", FLT_DIG) + FIELD_CASE(Double, double, doubleValue, @"%.*lg", DBL_DIG) + // TODO: Add a comment with the enum name from enum descriptors + // (might not be real value, so leave it as a comment, ObjC compiler + // name mangles differently). Doesn't look like we actually generate + // an enum descriptor reference like we do for normal fields, so this + // will take a compiler change. + FIELD_CASE(Enum, int32_t, intValue, @"%d") + +#undef FIELD_CASE + + case GPBDataTypeBool: + [toStr appendString:([(NSNumber *)curValue boolValue] ? @"true" + : @"false")]; + break; + + case GPBDataTypeString: + AppendStringEscaped(curValue, toStr); + break; + + case GPBDataTypeBytes: + AppendBufferAsString((NSData *)curValue, toStr); + break; + + case GPBDataTypeGroup: + case GPBDataTypeMessage: { + [toStr appendFormat:@"{%@\n", lineEnding]; + NSString *subIndent = [lineIndent stringByAppendingString:@" "]; + AppendTextFormatForMessage(curValue, toStr, subIndent); + [toStr appendFormat:@"%@}", lineIndent]; + lineEnding = @""; + break; + } + + } // switch(extDataType) + + } // for(numValues) + + // End the line. + [toStr appendFormat:@"%@\n", lineEnding]; + + } // for..in(activeExtensions) +} + +static void AppendTextFormatForMessage(GPBMessage *message, + NSMutableString *toStr, + NSString *lineIndent) { + GPBDescriptor *descriptor = [message descriptor]; + NSArray *fieldsArray = descriptor->fields_; + NSUInteger fieldCount = fieldsArray.count; + const GPBExtensionRange *extensionRanges = descriptor.extensionRanges; + NSUInteger extensionRangesCount = descriptor.extensionRangesCount; + NSArray *activeExtensions = [[message extensionsCurrentlySet] + sortedArrayUsingSelector:@selector(compareByFieldNumber:)]; + for (NSUInteger i = 0, j = 0; i < fieldCount || j < extensionRangesCount;) { + if (i == fieldCount) { + AppendTextFormatForMessageExtensionRange( + message, activeExtensions, extensionRanges[j++], toStr, lineIndent); + } else if (j == extensionRangesCount || + GPBFieldNumber(fieldsArray[i]) < extensionRanges[j].start) { + AppendTextFormatForMessageField(message, fieldsArray[i++], toStr, + lineIndent); + } else { + AppendTextFormatForMessageExtensionRange( + message, activeExtensions, extensionRanges[j++], toStr, lineIndent); + } + } + + NSString *unknownFieldsStr = + GPBTextFormatForUnknownFieldSet(message.unknownFields, lineIndent); + if ([unknownFieldsStr length] > 0) { + [toStr appendFormat:@"%@# --- Unknown fields ---\n", lineIndent]; + [toStr appendString:unknownFieldsStr]; + } +} + +NSString *GPBTextFormatForMessage(GPBMessage *message, NSString *lineIndent) { + if (message == nil) return @""; + if (lineIndent == nil) lineIndent = @""; + + NSMutableString *buildString = [NSMutableString string]; + AppendTextFormatForMessage(message, buildString, lineIndent); + return buildString; +} + +NSString *GPBTextFormatForUnknownFieldSet(GPBUnknownFieldSet *unknownSet, + NSString *lineIndent) { + if (unknownSet == nil) return @""; + if (lineIndent == nil) lineIndent = @""; + + NSMutableString *result = [NSMutableString string]; + for (GPBUnknownField *field in [unknownSet sortedFields]) { + int32_t fieldNumber = [field number]; + +#define PRINT_LOOP(PROPNAME, CTYPE, FORMAT) \ + [field.PROPNAME \ + enumerateValuesWithBlock:^(CTYPE value, NSUInteger idx, BOOL * stop) { \ + _Pragma("unused(idx, stop)"); \ + [result \ + appendFormat:@"%@%d: " #FORMAT "\n", lineIndent, fieldNumber, value]; \ + }]; + + PRINT_LOOP(varintList, uint64_t, %llu); + PRINT_LOOP(fixed32List, uint32_t, 0x%X); + PRINT_LOOP(fixed64List, uint64_t, 0x%llX); + +#undef PRINT_LOOP + + // NOTE: C++ version of TextFormat tries to parse this as a message + // and print that if it succeeds. + for (NSData *data in field.lengthDelimitedList) { + [result appendFormat:@"%@%d: ", lineIndent, fieldNumber]; + AppendBufferAsString(data, result); + [result appendString:@"\n"]; + } + + for (GPBUnknownFieldSet *subUnknownSet in field.groupList) { + [result appendFormat:@"%@%d: {\n", lineIndent, fieldNumber]; + NSString *subIndent = [lineIndent stringByAppendingString:@" "]; + NSString *subUnknwonSetStr = + GPBTextFormatForUnknownFieldSet(subUnknownSet, subIndent); + [result appendString:subUnknwonSetStr]; + [result appendFormat:@"%@}\n", lineIndent]; + } + } + return result; +} + +// Helpers to decode a varint. Not using GPBCodedInputStream version because +// that needs a state object, and we don't want to create an input stream out +// of the data. +GPB_INLINE int8_t ReadRawByteFromData(const uint8_t **data) { + int8_t result = *((int8_t *)(*data)); + ++(*data); + return result; +} + +static int32_t ReadRawVarint32FromData(const uint8_t **data) { + int8_t tmp = ReadRawByteFromData(data); + if (tmp >= 0) { + return tmp; + } + int32_t result = tmp & 0x7f; + if ((tmp = ReadRawByteFromData(data)) >= 0) { + result |= tmp << 7; + } else { + result |= (tmp & 0x7f) << 7; + if ((tmp = ReadRawByteFromData(data)) >= 0) { + result |= tmp << 14; + } else { + result |= (tmp & 0x7f) << 14; + if ((tmp = ReadRawByteFromData(data)) >= 0) { + result |= tmp << 21; + } else { + result |= (tmp & 0x7f) << 21; + result |= (tmp = ReadRawByteFromData(data)) << 28; + if (tmp < 0) { + // Discard upper 32 bits. + for (int i = 0; i < 5; i++) { + if (ReadRawByteFromData(data) >= 0) { + return result; + } + } + [NSException raise:NSParseErrorException + format:@"Unable to read varint32"]; + } + } + } + } + return result; +} + +NSString *GPBDecodeTextFormatName(const uint8_t *decodeData, int32_t key, + NSString *inputStr) { + // decodData form: + // varint32: num entries + // for each entry: + // varint32: key + // bytes*: decode data + // + // decode data one of two forms: + // 1: a \0 followed by the string followed by an \0 + // 2: bytecodes to transform an input into the right thing, ending with \0 + // + // the bytes codes are of the form: + // 0xabbccccc + // 0x0 (all zeros), end. + // a - if set, add an underscore + // bb - 00 ccccc bytes as is + // bb - 10 ccccc upper first, as is on rest, ccccc byte total + // bb - 01 ccccc lower first, as is on rest, ccccc byte total + // bb - 11 ccccc all upper, ccccc byte total + + if (!decodeData || !inputStr) { + return nil; + } + + // Find key + const uint8_t *scan = decodeData; + int32_t numEntries = ReadRawVarint32FromData(&scan); + BOOL foundKey = NO; + while (!foundKey && (numEntries > 0)) { + --numEntries; + int32_t dataKey = ReadRawVarint32FromData(&scan); + if (dataKey == key) { + foundKey = YES; + } else { + // If it is a inlined string, it will start with \0; if it is bytecode it + // will start with a code. So advance one (skipping the inline string + // marker), and then loop until reaching the end marker (\0). + ++scan; + while (*scan != 0) ++scan; + // Now move past the end marker. + ++scan; + } + } + + if (!foundKey) { + return nil; + } + + // Decode + + if (*scan == 0) { + // Inline string. Move over the marker, and NSString can take it as + // UTF8. + ++scan; + NSString *result = [NSString stringWithUTF8String:(const char *)scan]; + return result; + } + + NSMutableString *result = + [NSMutableString stringWithCapacity:[inputStr length]]; + + const uint8_t kAddUnderscore = 0b10000000; + const uint8_t kOpMask = 0b01100000; + // const uint8_t kOpAsIs = 0b00000000; + const uint8_t kOpFirstUpper = 0b01000000; + const uint8_t kOpFirstLower = 0b00100000; + const uint8_t kOpAllUpper = 0b01100000; + const uint8_t kSegmentLenMask = 0b00011111; + + NSInteger i = 0; + for (; *scan != 0; ++scan) { + if (*scan & kAddUnderscore) { + [result appendString:@"_"]; + } + int segmentLen = *scan & kSegmentLenMask; + uint8_t decodeOp = *scan & kOpMask; + + // Do op specific handling of the first character. + if (decodeOp == kOpFirstUpper) { + unichar c = [inputStr characterAtIndex:i]; + [result appendFormat:@"%c", toupper((char)c)]; + ++i; + --segmentLen; + } else if (decodeOp == kOpFirstLower) { + unichar c = [inputStr characterAtIndex:i]; + [result appendFormat:@"%c", tolower((char)c)]; + ++i; + --segmentLen; + } + // else op == kOpAsIs || op == kOpAllUpper + + // Now pull over the rest of the length for this segment. + for (int x = 0; x < segmentLen; ++x) { + unichar c = [inputStr characterAtIndex:(i + x)]; + if (decodeOp == kOpAllUpper) { + [result appendFormat:@"%c", toupper((char)c)]; + } else { + [result appendFormat:@"%C", c]; + } + } + i += segmentLen; + } + + return result; +} + +#pragma clang diagnostic pop + +BOOL GPBClassHasSel(Class aClass, SEL sel) { + // NOTE: We have to use class_copyMethodList, all other runtime method + // lookups actually also resolve the method implementation and this + // is called from within those methods. + + BOOL result = NO; + unsigned int methodCount = 0; + Method *methodList = class_copyMethodList(aClass, &methodCount); + for (unsigned int i = 0; i < methodCount; ++i) { + SEL methodSelector = method_getName(methodList[i]); + if (methodSelector == sel) { + result = YES; + break; + } + } + free(methodList); + return result; +} + +#pragma mark - GPBMessageSignatureProtocol + +// A series of selectors that are used solely to get @encoding values +// for them by the dynamic protobuf runtime code. An object using the protocol +// needs to be declared for the protocol to be valid at runtime. +@interface GPBMessageSignatureProtocol : NSObject<GPBMessageSignatureProtocol> +@end +@implementation GPBMessageSignatureProtocol +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities_PackagePrivate.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities_PackagePrivate.h new file mode 100644 index 00000000..16859d48 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBUtilities_PackagePrivate.h @@ -0,0 +1,350 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +#import "GPBUtilities.h" + +#import "GPBDescriptor_PackagePrivate.h" + +// Macros for stringifying library symbols. These are used in the generated +// PB descriptor classes wherever a library symbol name is represented as a +// string. See README.google for more information. +#define GPBStringify(S) #S +#define GPBStringifySymbol(S) GPBStringify(S) + +#define GPBNSStringify(S) @#S +#define GPBNSStringifySymbol(S) GPBNSStringify(S) + +// Constant to internally mark when there is no has bit. +#define GPBNoHasBit INT32_MAX + +CF_EXTERN_C_BEGIN + +// These two are used to inject a runtime check for version mismatch into the +// generated sources to make sure they are linked with a supporting runtime. +void GPBCheckRuntimeVersionSupport(int32_t objcRuntimeVersion); +GPB_INLINE void GPB_DEBUG_CHECK_RUNTIME_VERSIONS() { + // NOTE: By being inline here, this captures the value from the library's + // headers at the time the generated code was compiled. +#if defined(DEBUG) && DEBUG + GPBCheckRuntimeVersionSupport(GOOGLE_PROTOBUF_OBJC_VERSION); +#endif +} + +// Legacy version of the checks, remove when GOOGLE_PROTOBUF_OBJC_GEN_VERSION +// goes away (see more info in GPBBootstrap.h). +void GPBCheckRuntimeVersionInternal(int32_t version); +GPB_INLINE void GPBDebugCheckRuntimeVersion() { +#if defined(DEBUG) && DEBUG + GPBCheckRuntimeVersionInternal(GOOGLE_PROTOBUF_OBJC_GEN_VERSION); +#endif +} + +// Conversion functions for de/serializing floating point types. + +GPB_INLINE int64_t GPBConvertDoubleToInt64(double v) { + union { double f; int64_t i; } u; + u.f = v; + return u.i; +} + +GPB_INLINE int32_t GPBConvertFloatToInt32(float v) { + union { float f; int32_t i; } u; + u.f = v; + return u.i; +} + +GPB_INLINE double GPBConvertInt64ToDouble(int64_t v) { + union { double f; int64_t i; } u; + u.i = v; + return u.f; +} + +GPB_INLINE float GPBConvertInt32ToFloat(int32_t v) { + union { float f; int32_t i; } u; + u.i = v; + return u.f; +} + +GPB_INLINE int32_t GPBLogicalRightShift32(int32_t value, int32_t spaces) { + return (int32_t)((uint32_t)(value) >> spaces); +} + +GPB_INLINE int64_t GPBLogicalRightShift64(int64_t value, int32_t spaces) { + return (int64_t)((uint64_t)(value) >> spaces); +} + +// Decode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers +// into values that can be efficiently encoded with varint. (Otherwise, +// negative values must be sign-extended to 64 bits to be varint encoded, +// thus always taking 10 bytes on the wire.) +GPB_INLINE int32_t GPBDecodeZigZag32(uint32_t n) { + return (int32_t)(GPBLogicalRightShift32((int32_t)n, 1) ^ -((int32_t)(n) & 1)); +} + +// Decode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers +// into values that can be efficiently encoded with varint. (Otherwise, +// negative values must be sign-extended to 64 bits to be varint encoded, +// thus always taking 10 bytes on the wire.) +GPB_INLINE int64_t GPBDecodeZigZag64(uint64_t n) { + return (int64_t)(GPBLogicalRightShift64((int64_t)n, 1) ^ -((int64_t)(n) & 1)); +} + +// Encode a ZigZag-encoded 32-bit value. ZigZag encodes signed integers +// into values that can be efficiently encoded with varint. (Otherwise, +// negative values must be sign-extended to 64 bits to be varint encoded, +// thus always taking 10 bytes on the wire.) +GPB_INLINE uint32_t GPBEncodeZigZag32(int32_t n) { + // Note: the right-shift must be arithmetic + return (uint32_t)((n << 1) ^ (n >> 31)); +} + +// Encode a ZigZag-encoded 64-bit value. ZigZag encodes signed integers +// into values that can be efficiently encoded with varint. (Otherwise, +// negative values must be sign-extended to 64 bits to be varint encoded, +// thus always taking 10 bytes on the wire.) +GPB_INLINE uint64_t GPBEncodeZigZag64(int64_t n) { + // Note: the right-shift must be arithmetic + return (uint64_t)((n << 1) ^ (n >> 63)); +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +GPB_INLINE BOOL GPBDataTypeIsObject(GPBDataType type) { + switch (type) { + case GPBDataTypeBytes: + case GPBDataTypeString: + case GPBDataTypeMessage: + case GPBDataTypeGroup: + return YES; + default: + return NO; + } +} + +GPB_INLINE BOOL GPBDataTypeIsMessage(GPBDataType type) { + switch (type) { + case GPBDataTypeMessage: + case GPBDataTypeGroup: + return YES; + default: + return NO; + } +} + +GPB_INLINE BOOL GPBFieldDataTypeIsMessage(GPBFieldDescriptor *field) { + return GPBDataTypeIsMessage(field->description_->dataType); +} + +GPB_INLINE BOOL GPBFieldDataTypeIsObject(GPBFieldDescriptor *field) { + return GPBDataTypeIsObject(field->description_->dataType); +} + +GPB_INLINE BOOL GPBExtensionIsMessage(GPBExtensionDescriptor *ext) { + return GPBDataTypeIsMessage(ext->description_->dataType); +} + +// The field is an array/map or it has an object value. +GPB_INLINE BOOL GPBFieldStoresObject(GPBFieldDescriptor *field) { + GPBMessageFieldDescription *desc = field->description_; + if ((desc->flags & (GPBFieldRepeated | GPBFieldMapKeyMask)) != 0) { + return YES; + } + return GPBDataTypeIsObject(desc->dataType); +} + +BOOL GPBGetHasIvar(GPBMessage *self, int32_t index, uint32_t fieldNumber); +void GPBSetHasIvar(GPBMessage *self, int32_t idx, uint32_t fieldNumber, + BOOL value); +uint32_t GPBGetHasOneof(GPBMessage *self, int32_t index); + +GPB_INLINE BOOL +GPBGetHasIvarField(GPBMessage *self, GPBFieldDescriptor *field) { + GPBMessageFieldDescription *fieldDesc = field->description_; + return GPBGetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number); +} +GPB_INLINE void GPBSetHasIvarField(GPBMessage *self, GPBFieldDescriptor *field, + BOOL value) { + GPBMessageFieldDescription *fieldDesc = field->description_; + GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, value); +} + +void GPBMaybeClearOneof(GPBMessage *self, GPBOneofDescriptor *oneof, + int32_t oneofHasIndex, uint32_t fieldNumberNotToClear); + +#pragma clang diagnostic pop + +//%PDDM-DEFINE GPB_IVAR_SET_DECL(NAME, TYPE) +//%void GPBSet##NAME##IvarWithFieldInternal(GPBMessage *self, +//% NAME$S GPBFieldDescriptor *field, +//% NAME$S TYPE value, +//% NAME$S GPBFileSyntax syntax); +//%PDDM-EXPAND GPB_IVAR_SET_DECL(Bool, BOOL) +// This block of code is generated, do not edit it directly. + +void GPBSetBoolIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + BOOL value, + GPBFileSyntax syntax); +//%PDDM-EXPAND GPB_IVAR_SET_DECL(Int32, int32_t) +// This block of code is generated, do not edit it directly. + +void GPBSetInt32IvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + int32_t value, + GPBFileSyntax syntax); +//%PDDM-EXPAND GPB_IVAR_SET_DECL(UInt32, uint32_t) +// This block of code is generated, do not edit it directly. + +void GPBSetUInt32IvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + uint32_t value, + GPBFileSyntax syntax); +//%PDDM-EXPAND GPB_IVAR_SET_DECL(Int64, int64_t) +// This block of code is generated, do not edit it directly. + +void GPBSetInt64IvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + int64_t value, + GPBFileSyntax syntax); +//%PDDM-EXPAND GPB_IVAR_SET_DECL(UInt64, uint64_t) +// This block of code is generated, do not edit it directly. + +void GPBSetUInt64IvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + uint64_t value, + GPBFileSyntax syntax); +//%PDDM-EXPAND GPB_IVAR_SET_DECL(Float, float) +// This block of code is generated, do not edit it directly. + +void GPBSetFloatIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + float value, + GPBFileSyntax syntax); +//%PDDM-EXPAND GPB_IVAR_SET_DECL(Double, double) +// This block of code is generated, do not edit it directly. + +void GPBSetDoubleIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + double value, + GPBFileSyntax syntax); +//%PDDM-EXPAND GPB_IVAR_SET_DECL(Enum, int32_t) +// This block of code is generated, do not edit it directly. + +void GPBSetEnumIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + int32_t value, + GPBFileSyntax syntax); +//%PDDM-EXPAND-END (8 expansions) + +int32_t GPBGetEnumIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + GPBFileSyntax syntax); + +id GPBGetObjectIvarWithField(GPBMessage *self, GPBFieldDescriptor *field); + +void GPBSetObjectIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, id value, + GPBFileSyntax syntax); +void GPBSetRetainedObjectIvarWithFieldInternal(GPBMessage *self, + GPBFieldDescriptor *field, + id __attribute__((ns_consumed)) + value, + GPBFileSyntax syntax); + +// GPBGetObjectIvarWithField will automatically create the field (message) if +// it doesn't exist. GPBGetObjectIvarWithFieldNoAutocreate will return nil. +id GPBGetObjectIvarWithFieldNoAutocreate(GPBMessage *self, + GPBFieldDescriptor *field); + +void GPBSetAutocreatedRetainedObjectIvarWithField( + GPBMessage *self, GPBFieldDescriptor *field, + id __attribute__((ns_consumed)) value); + +// Clears and releases the autocreated message ivar, if it's autocreated. If +// it's not set as autocreated, this method does nothing. +void GPBClearAutocreatedMessageIvarWithField(GPBMessage *self, + GPBFieldDescriptor *field); + +// Returns an Objective C encoding for |selector|. |instanceSel| should be +// YES if it's an instance selector (as opposed to a class selector). +// |selector| must be a selector from MessageSignatureProtocol. +const char *GPBMessageEncodingForSelector(SEL selector, BOOL instanceSel); + +// Helper for text format name encoding. +// decodeData is the data describing the sepecial decodes. +// key and inputString are the input that needs decoding. +NSString *GPBDecodeTextFormatName(const uint8_t *decodeData, int32_t key, + NSString *inputString); + +// A series of selectors that are used solely to get @encoding values +// for them by the dynamic protobuf runtime code. See +// GPBMessageEncodingForSelector for details. +@protocol GPBMessageSignatureProtocol +@optional + +#define GPB_MESSAGE_SIGNATURE_ENTRY(TYPE, NAME) \ + -(TYPE)get##NAME; \ + -(void)set##NAME : (TYPE)value; \ + -(TYPE)get##NAME##AtIndex : (NSUInteger)index; + +GPB_MESSAGE_SIGNATURE_ENTRY(BOOL, Bool) +GPB_MESSAGE_SIGNATURE_ENTRY(uint32_t, Fixed32) +GPB_MESSAGE_SIGNATURE_ENTRY(int32_t, SFixed32) +GPB_MESSAGE_SIGNATURE_ENTRY(float, Float) +GPB_MESSAGE_SIGNATURE_ENTRY(uint64_t, Fixed64) +GPB_MESSAGE_SIGNATURE_ENTRY(int64_t, SFixed64) +GPB_MESSAGE_SIGNATURE_ENTRY(double, Double) +GPB_MESSAGE_SIGNATURE_ENTRY(int32_t, Int32) +GPB_MESSAGE_SIGNATURE_ENTRY(int64_t, Int64) +GPB_MESSAGE_SIGNATURE_ENTRY(int32_t, SInt32) +GPB_MESSAGE_SIGNATURE_ENTRY(int64_t, SInt64) +GPB_MESSAGE_SIGNATURE_ENTRY(uint32_t, UInt32) +GPB_MESSAGE_SIGNATURE_ENTRY(uint64_t, UInt64) +GPB_MESSAGE_SIGNATURE_ENTRY(NSData *, Bytes) +GPB_MESSAGE_SIGNATURE_ENTRY(NSString *, String) +GPB_MESSAGE_SIGNATURE_ENTRY(GPBMessage *, Message) +GPB_MESSAGE_SIGNATURE_ENTRY(GPBMessage *, Group) +GPB_MESSAGE_SIGNATURE_ENTRY(int32_t, Enum) + +#undef GPB_MESSAGE_SIGNATURE_ENTRY + +- (id)getArray; +- (NSUInteger)getArrayCount; +- (void)setArray:(NSArray *)array; ++ (id)getClassValue; +@end + +BOOL GPBClassHasSel(Class aClass, SEL sel); + +CF_EXTERN_C_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWellKnownTypes.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWellKnownTypes.h new file mode 100644 index 00000000..04df4178 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWellKnownTypes.h @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import <Foundation/Foundation.h> + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Any.pbobjc.h> + #import <Protobuf/Duration.pbobjc.h> + #import <Protobuf/Timestamp.pbobjc.h> +#else + #import "google/protobuf/Any.pbobjc.h" + #import "google/protobuf/Duration.pbobjc.h" + #import "google/protobuf/Timestamp.pbobjc.h" +#endif + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - Errors + +/** NSError domain used for errors. */ +extern NSString *const GPBWellKnownTypesErrorDomain; + +/** Error code for NSError with GPBWellKnownTypesErrorDomain. */ +typedef NS_ENUM(NSInteger, GPBWellKnownTypesErrorCode) { + /** The type_url could not be computed for the requested GPBMessage class. */ + GPBWellKnownTypesErrorCodeFailedToComputeTypeURL = -100, + /** type_url in a Any doesn’t match that of the requested GPBMessage class. */ + GPBWellKnownTypesErrorCodeTypeURLMismatch = -101, +}; + +#pragma mark - GPBTimestamp + +/** + * Category for GPBTimestamp to work with standard Foundation time/date types. + **/ +@interface GPBTimestamp (GBPWellKnownTypes) + +/** The NSDate representation of this GPBTimestamp. */ +@property(nonatomic, readwrite, strong) NSDate *date; + +/** + * The NSTimeInterval representation of this GPBTimestamp. + * + * @note: Not all second/nanos combinations can be represented in a + * NSTimeInterval, so getting this could be a lossy transform. + **/ +@property(nonatomic, readwrite) NSTimeInterval timeIntervalSince1970; + +/** + * Initializes a GPBTimestamp with the given NSDate. + * + * @param date The date to configure the GPBTimestamp with. + * + * @return A newly initialized GPBTimestamp. + **/ +- (instancetype)initWithDate:(NSDate *)date; + +/** + * Initializes a GPBTimestamp with the given NSTimeInterval. + * + * @param timeIntervalSince1970 Time interval to configure the GPBTimestamp with. + * + * @return A newly initialized GPBTimestamp. + **/ +- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970; + +@end + +#pragma mark - GPBDuration + +/** + * Category for GPBDuration to work with standard Foundation time type. + **/ +@interface GPBDuration (GBPWellKnownTypes) + +/** + * The NSTimeInterval representation of this GPBDuration. + * + * @note: Not all second/nanos combinations can be represented in a + * NSTimeInterval, so getting this could be a lossy transform. + **/ +@property(nonatomic, readwrite) NSTimeInterval timeInterval; + +/** + * Initializes a GPBDuration with the given NSTimeInterval. + * + * @param timeInterval Time interval to configure the GPBDuration with. + * + * @return A newly initialized GPBDuration. + **/ +- (instancetype)initWithTimeInterval:(NSTimeInterval)timeInterval; + +// These next two methods are deprecated because GBPDuration has no need of a +// "base" time. The older methods were about symmetry with GBPTimestamp, but +// the unix epoch usage is too confusing. + +/** Deprecated, use timeInterval instead. */ +@property(nonatomic, readwrite) NSTimeInterval timeIntervalSince1970 + __attribute__((deprecated("Use timeInterval"))); +/** Deprecated, use initWithTimeInterval: instead. */ +- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970 + __attribute__((deprecated("Use initWithTimeInterval:"))); + +@end + +#pragma mark - GPBAny + +/** + * Category for GPBAny to help work with the message within the object. + **/ +@interface GPBAny (GBPWellKnownTypes) + +/** + * Convenience method to create a GPBAny containing the serialized message. + * This uses type.googleapis.com/ as the type_url's prefix. + * + * @param message The message to be packed into the GPBAny. + * @param errorPtr Pointer to an error that will be populated if something goes + * wrong. + * + * @return A newly configured GPBAny with the given message, or nil on failure. + */ ++ (nullable instancetype)anyWithMessage:(nonnull GPBMessage *)message + error:(NSError **)errorPtr; + +/** + * Convenience method to create a GPBAny containing the serialized message. + * + * @param message The message to be packed into the GPBAny. + * @param typeURLPrefix The URL prefix to apply for type_url. + * @param errorPtr Pointer to an error that will be populated if something + * goes wrong. + * + * @return A newly configured GPBAny with the given message, or nil on failure. + */ ++ (nullable instancetype)anyWithMessage:(nonnull GPBMessage *)message + typeURLPrefix:(nonnull NSString *)typeURLPrefix + error:(NSError **)errorPtr; + +/** + * Initializes a GPBAny to contain the serialized message. This uses + * type.googleapis.com/ as the type_url's prefix. + * + * @param message The message to be packed into the GPBAny. + * @param errorPtr Pointer to an error that will be populated if something goes + * wrong. + * + * @return A newly configured GPBAny with the given message, or nil on failure. + */ +- (nullable instancetype)initWithMessage:(nonnull GPBMessage *)message + error:(NSError **)errorPtr; + +/** + * Initializes a GPBAny to contain the serialized message. + * + * @param message The message to be packed into the GPBAny. + * @param typeURLPrefix The URL prefix to apply for type_url. + * @param errorPtr Pointer to an error that will be populated if something + * goes wrong. + * + * @return A newly configured GPBAny with the given message, or nil on failure. + */ +- (nullable instancetype)initWithMessage:(nonnull GPBMessage *)message + typeURLPrefix:(nonnull NSString *)typeURLPrefix + error:(NSError **)errorPtr; + +/** + * Packs the serialized message into this GPBAny. This uses + * type.googleapis.com/ as the type_url's prefix. + * + * @param message The message to be packed into the GPBAny. + * @param errorPtr Pointer to an error that will be populated if something goes + * wrong. + * + * @return Whether the packing was successful or not. + */ +- (BOOL)packWithMessage:(nonnull GPBMessage *)message + error:(NSError **)errorPtr; + +/** + * Packs the serialized message into this GPBAny. + * + * @param message The message to be packed into the GPBAny. + * @param typeURLPrefix The URL prefix to apply for type_url. + * @param errorPtr Pointer to an error that will be populated if something + * goes wrong. + * + * @return Whether the packing was successful or not. + */ +- (BOOL)packWithMessage:(nonnull GPBMessage *)message + typeURLPrefix:(nonnull NSString *)typeURLPrefix + error:(NSError **)errorPtr; + +/** + * Unpacks the serialized message as if it was an instance of the given class. + * + * @note When checking type_url, the base URL is not checked, only the fully + * qualified name. + * + * @param messageClass The class to use to deserialize the contained message. + * @param errorPtr Pointer to an error that will be populated if something + * goes wrong. + * + * @return An instance of the given class populated with the contained data, or + * nil on failure. + */ +- (nullable GPBMessage *)unpackMessageClass:(Class)messageClass + error:(NSError **)errorPtr; + +@end + +NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWellKnownTypes.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWellKnownTypes.m new file mode 100644 index 00000000..2808afeb --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWellKnownTypes.m @@ -0,0 +1,272 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2015 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Importing sources here to force the linker to include our category methods in +// the static library. If these were compiled separately, the category methods +// below would be stripped by the linker. + +#import "GPBWellKnownTypes.h" + +#import "GPBUtilities_PackagePrivate.h" + +NSString *const GPBWellKnownTypesErrorDomain = + GPBNSStringifySymbol(GPBWellKnownTypesErrorDomain); + +static NSString *kTypePrefixGoogleApisCom = @"type.googleapis.com/"; + +static NSTimeInterval TimeIntervalFromSecondsAndNanos(int64_t seconds, + int32_t nanos) { + return seconds + (NSTimeInterval)nanos / 1e9; +} + +static int32_t SecondsAndNanosFromTimeInterval(NSTimeInterval time, + int64_t *outSeconds, + BOOL nanosMustBePositive) { + NSTimeInterval seconds; + NSTimeInterval nanos = modf(time, &seconds); + + if (nanosMustBePositive && (nanos < 0)) { + // Per Timestamp.proto, nanos is non-negative and "Negative second values with + // fractions must still have non-negative nanos values that count forward in + // time. Must be from 0 to 999,999,999 inclusive." + --seconds; + nanos = 1.0 + nanos; + } + + nanos *= 1e9; + *outSeconds = (int64_t)seconds; + return (int32_t)nanos; +} + +static NSString *BuildTypeURL(NSString *typeURLPrefix, NSString *fullName) { + if (typeURLPrefix.length == 0) { + return fullName; + } + + if ([typeURLPrefix hasSuffix:@"/"]) { + return [typeURLPrefix stringByAppendingString:fullName]; + } + + return [NSString stringWithFormat:@"%@/%@", typeURLPrefix, fullName]; +} + +static NSString *ParseTypeFromURL(NSString *typeURLString) { + NSRange range = [typeURLString rangeOfString:@"/" options:NSBackwardsSearch]; + if ((range.location == NSNotFound) || + (NSMaxRange(range) == typeURLString.length)) { + return nil; + } + NSString *result = [typeURLString substringFromIndex:range.location + 1]; + return result; +} + +#pragma mark - GPBTimestamp + +@implementation GPBTimestamp (GBPWellKnownTypes) + +- (instancetype)initWithDate:(NSDate *)date { + return [self initWithTimeIntervalSince1970:date.timeIntervalSince1970]; +} + +- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970 { + if ((self = [super init])) { + int64_t seconds; + int32_t nanos = SecondsAndNanosFromTimeInterval( + timeIntervalSince1970, &seconds, YES); + self.seconds = seconds; + self.nanos = nanos; + } + return self; +} + +- (NSDate *)date { + return [NSDate dateWithTimeIntervalSince1970:self.timeIntervalSince1970]; +} + +- (void)setDate:(NSDate *)date { + self.timeIntervalSince1970 = date.timeIntervalSince1970; +} + +- (NSTimeInterval)timeIntervalSince1970 { + return TimeIntervalFromSecondsAndNanos(self.seconds, self.nanos); +} + +- (void)setTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970 { + int64_t seconds; + int32_t nanos = + SecondsAndNanosFromTimeInterval(timeIntervalSince1970, &seconds, YES); + self.seconds = seconds; + self.nanos = nanos; +} + +@end + +#pragma mark - GPBDuration + +@implementation GPBDuration (GBPWellKnownTypes) + +- (instancetype)initWithTimeInterval:(NSTimeInterval)timeInterval { + if ((self = [super init])) { + int64_t seconds; + int32_t nanos = SecondsAndNanosFromTimeInterval( + timeInterval, &seconds, NO); + self.seconds = seconds; + self.nanos = nanos; + } + return self; +} + +- (instancetype)initWithTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970 { + return [self initWithTimeInterval:timeIntervalSince1970]; +} + +- (NSTimeInterval)timeInterval { + return TimeIntervalFromSecondsAndNanos(self.seconds, self.nanos); +} + +- (void)setTimeInterval:(NSTimeInterval)timeInterval { + int64_t seconds; + int32_t nanos = + SecondsAndNanosFromTimeInterval(timeInterval, &seconds, NO); + self.seconds = seconds; + self.nanos = nanos; +} + +- (NSTimeInterval)timeIntervalSince1970 { + return self.timeInterval; +} + +- (void)setTimeIntervalSince1970:(NSTimeInterval)timeIntervalSince1970 { + self.timeInterval = timeIntervalSince1970; +} + +@end + +#pragma mark - GPBAny + +@implementation GPBAny (GBPWellKnownTypes) + ++ (instancetype)anyWithMessage:(GPBMessage *)message + error:(NSError **)errorPtr { + return [self anyWithMessage:message + typeURLPrefix:kTypePrefixGoogleApisCom + error:errorPtr]; +} + ++ (instancetype)anyWithMessage:(GPBMessage *)message + typeURLPrefix:(NSString *)typeURLPrefix + error:(NSError **)errorPtr { + return [[[self alloc] initWithMessage:message + typeURLPrefix:typeURLPrefix + error:errorPtr] autorelease]; +} + +- (instancetype)initWithMessage:(GPBMessage *)message + error:(NSError **)errorPtr { + return [self initWithMessage:message + typeURLPrefix:kTypePrefixGoogleApisCom + error:errorPtr]; +} + +- (instancetype)initWithMessage:(GPBMessage *)message + typeURLPrefix:(NSString *)typeURLPrefix + error:(NSError **)errorPtr { + self = [self init]; + if (self) { + if (![self packWithMessage:message + typeURLPrefix:typeURLPrefix + error:errorPtr]) { + [self release]; + self = nil; + } + } + return self; +} + +- (BOOL)packWithMessage:(GPBMessage *)message + error:(NSError **)errorPtr { + return [self packWithMessage:message + typeURLPrefix:kTypePrefixGoogleApisCom + error:errorPtr]; +} + +- (BOOL)packWithMessage:(GPBMessage *)message + typeURLPrefix:(NSString *)typeURLPrefix + error:(NSError **)errorPtr { + NSString *fullName = [message descriptor].fullName; + if (fullName.length == 0) { + if (errorPtr) { + *errorPtr = + [NSError errorWithDomain:GPBWellKnownTypesErrorDomain + code:GPBWellKnownTypesErrorCodeFailedToComputeTypeURL + userInfo:nil]; + } + return NO; + } + if (errorPtr) { + *errorPtr = nil; + } + self.typeURL = BuildTypeURL(typeURLPrefix, fullName); + self.value = message.data; + return YES; +} + +- (GPBMessage *)unpackMessageClass:(Class)messageClass + error:(NSError **)errorPtr { + NSString *fullName = [messageClass descriptor].fullName; + if (fullName.length == 0) { + if (errorPtr) { + *errorPtr = + [NSError errorWithDomain:GPBWellKnownTypesErrorDomain + code:GPBWellKnownTypesErrorCodeFailedToComputeTypeURL + userInfo:nil]; + } + return nil; + } + + NSString *expectedFullName = ParseTypeFromURL(self.typeURL); + if ((expectedFullName == nil) || ![expectedFullName isEqual:fullName]) { + if (errorPtr) { + *errorPtr = + [NSError errorWithDomain:GPBWellKnownTypesErrorDomain + code:GPBWellKnownTypesErrorCodeTypeURLMismatch + userInfo:nil]; + } + return nil; + } + + // Any is proto3, which means no extensions, so this assumes anything put + // within an any also won't need extensions. A second helper could be added + // if needed. + return [messageClass parseFromData:self.value + error:errorPtr]; +} + +@end diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWireFormat.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWireFormat.h new file mode 100644 index 00000000..c5941a38 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWireFormat.h @@ -0,0 +1,73 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBRuntimeTypes.h" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +typedef enum { + GPBWireFormatVarint = 0, + GPBWireFormatFixed64 = 1, + GPBWireFormatLengthDelimited = 2, + GPBWireFormatStartGroup = 3, + GPBWireFormatEndGroup = 4, + GPBWireFormatFixed32 = 5, +} GPBWireFormat; + +enum { + GPBWireFormatMessageSetItem = 1, + GPBWireFormatMessageSetTypeId = 2, + GPBWireFormatMessageSetMessage = 3 +}; + +uint32_t GPBWireFormatMakeTag(uint32_t fieldNumber, GPBWireFormat wireType) + __attribute__((const)); +GPBWireFormat GPBWireFormatGetTagWireType(uint32_t tag) __attribute__((const)); +uint32_t GPBWireFormatGetTagFieldNumber(uint32_t tag) __attribute__((const)); +BOOL GPBWireFormatIsValidTag(uint32_t tag) __attribute__((const)); + +GPBWireFormat GPBWireFormatForType(GPBDataType dataType, BOOL isPacked) + __attribute__((const)); + +#define GPBWireFormatMessageSetItemTag \ + (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatStartGroup)) +#define GPBWireFormatMessageSetItemEndTag \ + (GPBWireFormatMakeTag(GPBWireFormatMessageSetItem, GPBWireFormatEndGroup)) +#define GPBWireFormatMessageSetTypeIdTag \ + (GPBWireFormatMakeTag(GPBWireFormatMessageSetTypeId, GPBWireFormatVarint)) +#define GPBWireFormatMessageSetMessageTag \ + (GPBWireFormatMakeTag(GPBWireFormatMessageSetMessage, \ + GPBWireFormatLengthDelimited)) + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWireFormat.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWireFormat.m new file mode 100644 index 00000000..860a339f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/GPBWireFormat.m @@ -0,0 +1,85 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#import "GPBWireFormat.h" + +#import "GPBUtilities_PackagePrivate.h" + +enum { + GPBWireFormatTagTypeBits = 3, + GPBWireFormatTagTypeMask = 7 /* = (1 << GPBWireFormatTagTypeBits) - 1 */, +}; + +uint32_t GPBWireFormatMakeTag(uint32_t fieldNumber, GPBWireFormat wireType) { + return (fieldNumber << GPBWireFormatTagTypeBits) | wireType; +} + +GPBWireFormat GPBWireFormatGetTagWireType(uint32_t tag) { + return (GPBWireFormat)(tag & GPBWireFormatTagTypeMask); +} + +uint32_t GPBWireFormatGetTagFieldNumber(uint32_t tag) { + return GPBLogicalRightShift32(tag, GPBWireFormatTagTypeBits); +} + +BOOL GPBWireFormatIsValidTag(uint32_t tag) { + uint32_t formatBits = (tag & GPBWireFormatTagTypeMask); + // The valid GPBWireFormat* values are 0-5, anything else is not a valid tag. + BOOL result = (formatBits <= 5); + return result; +} + +GPBWireFormat GPBWireFormatForType(GPBDataType type, BOOL isPacked) { + if (isPacked) { + return GPBWireFormatLengthDelimited; + } + + static const GPBWireFormat format[GPBDataType_Count] = { + GPBWireFormatVarint, // GPBDataTypeBool + GPBWireFormatFixed32, // GPBDataTypeFixed32 + GPBWireFormatFixed32, // GPBDataTypeSFixed32 + GPBWireFormatFixed32, // GPBDataTypeFloat + GPBWireFormatFixed64, // GPBDataTypeFixed64 + GPBWireFormatFixed64, // GPBDataTypeSFixed64 + GPBWireFormatFixed64, // GPBDataTypeDouble + GPBWireFormatVarint, // GPBDataTypeInt32 + GPBWireFormatVarint, // GPBDataTypeInt64 + GPBWireFormatVarint, // GPBDataTypeSInt32 + GPBWireFormatVarint, // GPBDataTypeSInt64 + GPBWireFormatVarint, // GPBDataTypeUInt32 + GPBWireFormatVarint, // GPBDataTypeUInt64 + GPBWireFormatLengthDelimited, // GPBDataTypeBytes + GPBWireFormatLengthDelimited, // GPBDataTypeString + GPBWireFormatLengthDelimited, // GPBDataTypeMessage + GPBWireFormatStartGroup, // GPBDataTypeGroup + GPBWireFormatVarint // GPBDataTypeEnum + }; + return format[type]; +} diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Any.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Any.pbobjc.h new file mode 100644 index 00000000..d236e4b2 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Any.pbobjc.h @@ -0,0 +1,163 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/any.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GPBAnyRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBAnyRoot : GPBRootObject +@end + +#pragma mark - GPBAny + +typedef GPB_ENUM(GPBAny_FieldNumber) { + GPBAny_FieldNumber_TypeURL = 1, + GPBAny_FieldNumber_Value = 2, +}; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `\@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "\@type": "type.googleapis.com/google.profile.Person", + * "firstName": <string>, + * "lastName": <string> + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `\@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "\@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + **/ +@interface GPBAny : GPBMessage + +/** + * A URL/resource name whose content describes the type of the + * serialized protocol buffer message. + * + * For URLs which use the scheme `http`, `https`, or no scheme, the + * following restrictions and interpretations apply: + * + * * If no scheme is provided, `https` is assumed. + * * The last segment of the URL's path must represent the fully + * qualified name of the type (as in `path/google.protobuf.Duration`). + * The name should be in a canonical form (e.g., leading "." is + * not accepted). + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL; + +/** Must be a valid serialized protocol buffer of the above specified type. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *value; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Any.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Any.pbobjc.m new file mode 100644 index 00000000..d210643f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Any.pbobjc.m @@ -0,0 +1,112 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/any.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Any.pbobjc.h> +#else + #import "google/protobuf/Any.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBAnyRoot + +@implementation GPBAnyRoot + +// No extensions in the file and no imports, so no need to generate +// +extensionRegistry. + +@end + +#pragma mark - GPBAnyRoot_FileDescriptor + +static GPBFileDescriptor *GPBAnyRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GPBAny + +@implementation GPBAny + +@dynamic typeURL; +@dynamic value; + +typedef struct GPBAny__storage_ { + uint32_t _has_storage_[1]; + NSString *typeURL; + NSData *value; +} GPBAny__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "typeURL", + .dataTypeSpecific.className = NULL, + .number = GPBAny_FieldNumber_TypeURL, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBAny__storage_, typeURL), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom), + .dataType = GPBDataTypeString, + }, + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBAny_FieldNumber_Value, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBAny__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBAny class] + rootClass:[GPBAnyRoot class] + file:GPBAnyRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBAny__storage_) + flags:GPBDescriptorInitializationFlag_None]; +#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS + static const char *extraTextFormatInfo = + "\001\001\004\241!!\000"; + [localDescriptor setupExtraTextInfo:extraTextFormatInfo]; +#endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Api.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Api.pbobjc.h new file mode 100644 index 00000000..742a8122 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Api.pbobjc.h @@ -0,0 +1,299 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/api.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +@class GPBMethod; +@class GPBMixin; +@class GPBOption; +@class GPBSourceContext; +GPB_ENUM_FWD_DECLARE(GPBSyntax); + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GPBApiRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBApiRoot : GPBRootObject +@end + +#pragma mark - GPBApi + +typedef GPB_ENUM(GPBApi_FieldNumber) { + GPBApi_FieldNumber_Name = 1, + GPBApi_FieldNumber_MethodsArray = 2, + GPBApi_FieldNumber_OptionsArray = 3, + GPBApi_FieldNumber_Version = 4, + GPBApi_FieldNumber_SourceContext = 5, + GPBApi_FieldNumber_MixinsArray = 6, + GPBApi_FieldNumber_Syntax = 7, +}; + +/** + * Api is a light-weight descriptor for a protocol buffer service. + **/ +@interface GPBApi : GPBMessage + +/** + * The fully qualified name of this api, including package name + * followed by the api's simple name. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** The methods of this api, in unspecified order. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBMethod*> *methodsArray; +/** The number of items in @c methodsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger methodsArray_Count; + +/** Any metadata attached to the API. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray; +/** The number of items in @c optionsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger optionsArray_Count; + +/** + * A version string for this api. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version + * is omitted, it defaults to zero. If the entire version field is + * empty, the major version is derived from the package name, as + * outlined below. If the field is not empty, the version in the + * package name will be verified to be consistent with what is + * provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * API, which must end in `v<major-version>`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, none-GA apis. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *version; + +/** + * Source context for the protocol buffer service represented by this + * message. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBSourceContext *sourceContext; +/** Test to see if @c sourceContext has been set. */ +@property(nonatomic, readwrite) BOOL hasSourceContext; + +/** Included APIs. See [Mixin][]. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBMixin*> *mixinsArray; +/** The number of items in @c mixinsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger mixinsArray_Count; + +/** The source syntax of the service. */ +@property(nonatomic, readwrite) enum GPBSyntax syntax; + +@end + +/** + * Fetches the raw value of a @c GPBApi's @c syntax property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GPBApi_Syntax_RawValue(GPBApi *message); +/** + * Sets the raw value of an @c GPBApi's @c syntax property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGPBApi_Syntax_RawValue(GPBApi *message, int32_t value); + +#pragma mark - GPBMethod + +typedef GPB_ENUM(GPBMethod_FieldNumber) { + GPBMethod_FieldNumber_Name = 1, + GPBMethod_FieldNumber_RequestTypeURL = 2, + GPBMethod_FieldNumber_RequestStreaming = 3, + GPBMethod_FieldNumber_ResponseTypeURL = 4, + GPBMethod_FieldNumber_ResponseStreaming = 5, + GPBMethod_FieldNumber_OptionsArray = 6, + GPBMethod_FieldNumber_Syntax = 7, +}; + +/** + * Method represents a method of an api. + **/ +@interface GPBMethod : GPBMessage + +/** The simple name of this method. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** A URL of the input message type. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *requestTypeURL; + +/** If true, the request is streamed. */ +@property(nonatomic, readwrite) BOOL requestStreaming; + +/** The URL of the output message type. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *responseTypeURL; + +/** If true, the response is streamed. */ +@property(nonatomic, readwrite) BOOL responseStreaming; + +/** Any metadata attached to the method. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray; +/** The number of items in @c optionsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger optionsArray_Count; + +/** The source syntax of this method. */ +@property(nonatomic, readwrite) enum GPBSyntax syntax; + +@end + +/** + * Fetches the raw value of a @c GPBMethod's @c syntax property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GPBMethod_Syntax_RawValue(GPBMethod *message); +/** + * Sets the raw value of an @c GPBMethod's @c syntax property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGPBMethod_Syntax_RawValue(GPBMethod *message, int32_t value); + +#pragma mark - GPBMixin + +typedef GPB_ENUM(GPBMixin_FieldNumber) { + GPBMixin_FieldNumber_Name = 1, + GPBMixin_FieldNumber_Root = 2, +}; + +/** + * Declares an API to be included in this API. The including API must + * redeclare all the methods from the included API, but documentation + * and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including API plus the [root][] path if specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + **/ +@interface GPBMixin : GPBMessage + +/** The fully qualified name of the API which is included. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *root; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Api.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Api.pbobjc.m new file mode 100644 index 00000000..58b47157 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Api.pbobjc.m @@ -0,0 +1,356 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/api.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Api.pbobjc.h> + #import <Protobuf/SourceContext.pbobjc.h> + #import <Protobuf/Type.pbobjc.h> +#else + #import "google/protobuf/Api.pbobjc.h" + #import "google/protobuf/SourceContext.pbobjc.h" + #import "google/protobuf/Type.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBApiRoot + +@implementation GPBApiRoot + +// No extensions in the file and none of the imports (direct or indirect) +// defined extensions, so no need to generate +extensionRegistry. + +@end + +#pragma mark - GPBApiRoot_FileDescriptor + +static GPBFileDescriptor *GPBApiRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GPBApi + +@implementation GPBApi + +@dynamic name; +@dynamic methodsArray, methodsArray_Count; +@dynamic optionsArray, optionsArray_Count; +@dynamic version; +@dynamic hasSourceContext, sourceContext; +@dynamic mixinsArray, mixinsArray_Count; +@dynamic syntax; + +typedef struct GPBApi__storage_ { + uint32_t _has_storage_[1]; + GPBSyntax syntax; + NSString *name; + NSMutableArray *methodsArray; + NSMutableArray *optionsArray; + NSString *version; + GPBSourceContext *sourceContext; + NSMutableArray *mixinsArray; +} GPBApi__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "name", + .dataTypeSpecific.className = NULL, + .number = GPBApi_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBApi__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "methodsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBMethod), + .number = GPBApi_FieldNumber_MethodsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBApi__storage_, methodsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "optionsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), + .number = GPBApi_FieldNumber_OptionsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBApi__storage_, optionsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "version", + .dataTypeSpecific.className = NULL, + .number = GPBApi_FieldNumber_Version, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBApi__storage_, version), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "sourceContext", + .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext), + .number = GPBApi_FieldNumber_SourceContext, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GPBApi__storage_, sourceContext), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "mixinsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBMixin), + .number = GPBApi_FieldNumber_MixinsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBApi__storage_, mixinsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "syntax", + .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor, + .number = GPBApi_FieldNumber_Syntax, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GPBApi__storage_, syntax), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBApi class] + rootClass:[GPBApiRoot class] + file:GPBApiRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBApi__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GPBApi_Syntax_RawValue(GPBApi *message) { + GPBDescriptor *descriptor = [GPBApi descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBApi_FieldNumber_Syntax]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGPBApi_Syntax_RawValue(GPBApi *message, int32_t value) { + GPBDescriptor *descriptor = [GPBApi descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBApi_FieldNumber_Syntax]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - GPBMethod + +@implementation GPBMethod + +@dynamic name; +@dynamic requestTypeURL; +@dynamic requestStreaming; +@dynamic responseTypeURL; +@dynamic responseStreaming; +@dynamic optionsArray, optionsArray_Count; +@dynamic syntax; + +typedef struct GPBMethod__storage_ { + uint32_t _has_storage_[1]; + GPBSyntax syntax; + NSString *name; + NSString *requestTypeURL; + NSString *responseTypeURL; + NSMutableArray *optionsArray; +} GPBMethod__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "name", + .dataTypeSpecific.className = NULL, + .number = GPBMethod_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBMethod__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "requestTypeURL", + .dataTypeSpecific.className = NULL, + .number = GPBMethod_FieldNumber_RequestTypeURL, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBMethod__storage_, requestTypeURL), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom), + .dataType = GPBDataTypeString, + }, + { + .name = "requestStreaming", + .dataTypeSpecific.className = NULL, + .number = GPBMethod_FieldNumber_RequestStreaming, + .hasIndex = 2, + .offset = 3, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + { + .name = "responseTypeURL", + .dataTypeSpecific.className = NULL, + .number = GPBMethod_FieldNumber_ResponseTypeURL, + .hasIndex = 4, + .offset = (uint32_t)offsetof(GPBMethod__storage_, responseTypeURL), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom), + .dataType = GPBDataTypeString, + }, + { + .name = "responseStreaming", + .dataTypeSpecific.className = NULL, + .number = GPBMethod_FieldNumber_ResponseStreaming, + .hasIndex = 5, + .offset = 6, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + { + .name = "optionsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), + .number = GPBMethod_FieldNumber_OptionsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBMethod__storage_, optionsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "syntax", + .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor, + .number = GPBMethod_FieldNumber_Syntax, + .hasIndex = 7, + .offset = (uint32_t)offsetof(GPBMethod__storage_, syntax), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBMethod class] + rootClass:[GPBApiRoot class] + file:GPBApiRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBMethod__storage_) + flags:GPBDescriptorInitializationFlag_None]; +#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS + static const char *extraTextFormatInfo = + "\002\002\007\244\241!!\000\004\010\244\241!!\000"; + [localDescriptor setupExtraTextInfo:extraTextFormatInfo]; +#endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GPBMethod_Syntax_RawValue(GPBMethod *message) { + GPBDescriptor *descriptor = [GPBMethod descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBMethod_FieldNumber_Syntax]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGPBMethod_Syntax_RawValue(GPBMethod *message, int32_t value) { + GPBDescriptor *descriptor = [GPBMethod descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBMethod_FieldNumber_Syntax]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - GPBMixin + +@implementation GPBMixin + +@dynamic name; +@dynamic root; + +typedef struct GPBMixin__storage_ { + uint32_t _has_storage_[1]; + NSString *name; + NSString *root; +} GPBMixin__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "name", + .dataTypeSpecific.className = NULL, + .number = GPBMixin_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBMixin__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "root", + .dataTypeSpecific.className = NULL, + .number = GPBMixin_FieldNumber_Root, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBMixin__storage_, root), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBMixin class] + rootClass:[GPBApiRoot class] + file:GPBApiRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBMixin__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Duration.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Duration.pbobjc.h new file mode 100644 index 00000000..d9a388ac --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Duration.pbobjc.h @@ -0,0 +1,141 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/duration.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GPBDurationRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBDurationRoot : GPBRootObject +@end + +#pragma mark - GPBDuration + +typedef GPB_ENUM(GPBDuration_FieldNumber) { + GPBDuration_FieldNumber_Seconds = 1, + GPBDuration_FieldNumber_Nanos = 2, +}; + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (durations.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + **/ +@interface GPBDuration : GPBMessage + +/** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + **/ +@property(nonatomic, readwrite) int64_t seconds; + +/** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + **/ +@property(nonatomic, readwrite) int32_t nanos; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Duration.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Duration.pbobjc.m new file mode 100644 index 00000000..bafb64a0 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Duration.pbobjc.m @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/duration.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Duration.pbobjc.h> +#else + #import "google/protobuf/Duration.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBDurationRoot + +@implementation GPBDurationRoot + +// No extensions in the file and no imports, so no need to generate +// +extensionRegistry. + +@end + +#pragma mark - GPBDurationRoot_FileDescriptor + +static GPBFileDescriptor *GPBDurationRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GPBDuration + +@implementation GPBDuration + +@dynamic seconds; +@dynamic nanos; + +typedef struct GPBDuration__storage_ { + uint32_t _has_storage_[1]; + int32_t nanos; + int64_t seconds; +} GPBDuration__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "seconds", + .dataTypeSpecific.className = NULL, + .number = GPBDuration_FieldNumber_Seconds, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBDuration__storage_, seconds), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt64, + }, + { + .name = "nanos", + .dataTypeSpecific.className = NULL, + .number = GPBDuration_FieldNumber_Nanos, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBDuration__storage_, nanos), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBDuration class] + rootClass:[GPBDurationRoot class] + file:GPBDurationRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBDuration__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Empty.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Empty.pbobjc.h new file mode 100644 index 00000000..bd49cfdb --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Empty.pbobjc.h @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/empty.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GPBEmptyRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBEmptyRoot : GPBRootObject +@end + +#pragma mark - GPBEmpty + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + **/ +@interface GPBEmpty : GPBMessage + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Empty.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Empty.pbobjc.m new file mode 100644 index 00000000..506b500e --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Empty.pbobjc.m @@ -0,0 +1,83 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/empty.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Empty.pbobjc.h> +#else + #import "google/protobuf/Empty.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBEmptyRoot + +@implementation GPBEmptyRoot + +// No extensions in the file and no imports, so no need to generate +// +extensionRegistry. + +@end + +#pragma mark - GPBEmptyRoot_FileDescriptor + +static GPBFileDescriptor *GPBEmptyRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GPBEmpty + +@implementation GPBEmpty + + +typedef struct GPBEmpty__storage_ { + uint32_t _has_storage_[1]; +} GPBEmpty__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEmpty class] + rootClass:[GPBEmptyRoot class] + file:GPBEmptyRoot_FileDescriptor() + fields:NULL + fieldCount:0 + storageSize:sizeof(GPBEmpty__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/FieldMask.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/FieldMask.pbobjc.h new file mode 100644 index 00000000..07e60818 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/FieldMask.pbobjc.h @@ -0,0 +1,271 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/field_mask.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GPBFieldMaskRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBFieldMaskRoot : GPBRootObject +@end + +#pragma mark - GPBFieldMask + +typedef GPB_ENUM(GPBFieldMask_FieldNumber) { + GPBFieldMask_FieldNumber_PathsArray = 1, +}; + +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, the existing + * repeated values in the target resource will be overwritten by the new values. + * Note that a repeated field is only allowed in the last position of a `paths` + * string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then the existing sub-message in the target resource is + * overwritten. Given the target message: + * + * f { + * b { + * d : 1 + * x : 2 + * } + * c : 1 + * } + * + * And an update message: + * + * f { + * b { + * d : 10 + * } + * } + * + * then if the field mask is: + * + * paths: "f.b" + * + * then the result will be: + * + * f { + * b { + * d : 10 + * } + * c : 1 + * } + * + * However, if the update mask was: + * + * paths: "f.b.d" + * + * then the result would be: + * + * f { + * b { + * d : 10 + * x : 2 + * } + * c : 1 + * } + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + **/ +@interface GPBFieldMask : GPBMessage + +/** The set of field mask paths. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *pathsArray; +/** The number of items in @c pathsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger pathsArray_Count; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/FieldMask.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/FieldMask.pbobjc.m new file mode 100644 index 00000000..b0915af4 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/FieldMask.pbobjc.m @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/field_mask.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/FieldMask.pbobjc.h> +#else + #import "google/protobuf/FieldMask.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBFieldMaskRoot + +@implementation GPBFieldMaskRoot + +// No extensions in the file and no imports, so no need to generate +// +extensionRegistry. + +@end + +#pragma mark - GPBFieldMaskRoot_FileDescriptor + +static GPBFileDescriptor *GPBFieldMaskRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GPBFieldMask + +@implementation GPBFieldMask + +@dynamic pathsArray, pathsArray_Count; + +typedef struct GPBFieldMask__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *pathsArray; +} GPBFieldMask__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "pathsArray", + .dataTypeSpecific.className = NULL, + .number = GPBFieldMask_FieldNumber_PathsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBFieldMask__storage_, pathsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFieldMask class] + rootClass:[GPBFieldMaskRoot class] + file:GPBFieldMaskRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBFieldMask__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/SourceContext.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/SourceContext.pbobjc.h new file mode 100644 index 00000000..799d190a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/SourceContext.pbobjc.h @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/source_context.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GPBSourceContextRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBSourceContextRoot : GPBRootObject +@end + +#pragma mark - GPBSourceContext + +typedef GPB_ENUM(GPBSourceContext_FieldNumber) { + GPBSourceContext_FieldNumber_FileName = 1, +}; + +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + **/ +@interface GPBSourceContext : GPBMessage + +/** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *fileName; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/SourceContext.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/SourceContext.pbobjc.m new file mode 100644 index 00000000..83bfa346 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/SourceContext.pbobjc.m @@ -0,0 +1,96 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/source_context.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/SourceContext.pbobjc.h> +#else + #import "google/protobuf/SourceContext.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBSourceContextRoot + +@implementation GPBSourceContextRoot + +// No extensions in the file and no imports, so no need to generate +// +extensionRegistry. + +@end + +#pragma mark - GPBSourceContextRoot_FileDescriptor + +static GPBFileDescriptor *GPBSourceContextRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GPBSourceContext + +@implementation GPBSourceContext + +@dynamic fileName; + +typedef struct GPBSourceContext__storage_ { + uint32_t _has_storage_[1]; + NSString *fileName; +} GPBSourceContext__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "fileName", + .dataTypeSpecific.className = NULL, + .number = GPBSourceContext_FieldNumber_FileName, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBSourceContext__storage_, fileName), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBSourceContext class] + rootClass:[GPBSourceContextRoot class] + file:GPBSourceContextRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBSourceContext__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Struct.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Struct.pbobjc.h new file mode 100644 index 00000000..3fc80caa --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Struct.pbobjc.h @@ -0,0 +1,200 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/struct.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +@class GPBListValue; +@class GPBStruct; +@class GPBValue; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - Enum GPBNullValue + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + **/ +typedef GPB_ENUM(GPBNullValue) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GPBNullValue_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Null value. */ + GPBNullValue_NullValue = 0, +}; + +GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GPBNullValue_IsValidValue(int32_t value); + +#pragma mark - GPBStructRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBStructRoot : GPBRootObject +@end + +#pragma mark - GPBStruct + +typedef GPB_ENUM(GPBStruct_FieldNumber) { + GPBStruct_FieldNumber_Fields = 1, +}; + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + **/ +@interface GPBStruct : GPBMessage + +/** Unordered map of dynamically typed values. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary<NSString*, GPBValue*> *fields; +/** The number of items in @c fields without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger fields_Count; + +@end + +#pragma mark - GPBValue + +typedef GPB_ENUM(GPBValue_FieldNumber) { + GPBValue_FieldNumber_NullValue = 1, + GPBValue_FieldNumber_NumberValue = 2, + GPBValue_FieldNumber_StringValue = 3, + GPBValue_FieldNumber_BoolValue = 4, + GPBValue_FieldNumber_StructValue = 5, + GPBValue_FieldNumber_ListValue = 6, +}; + +typedef GPB_ENUM(GPBValue_Kind_OneOfCase) { + GPBValue_Kind_OneOfCase_GPBUnsetOneOfCase = 0, + GPBValue_Kind_OneOfCase_NullValue = 1, + GPBValue_Kind_OneOfCase_NumberValue = 2, + GPBValue_Kind_OneOfCase_StringValue = 3, + GPBValue_Kind_OneOfCase_BoolValue = 4, + GPBValue_Kind_OneOfCase_StructValue = 5, + GPBValue_Kind_OneOfCase_ListValue = 6, +}; + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of that + * variants, absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + **/ +@interface GPBValue : GPBMessage + +/** The kind of value. */ +@property(nonatomic, readonly) GPBValue_Kind_OneOfCase kindOneOfCase; + +/** Represents a null value. */ +@property(nonatomic, readwrite) GPBNullValue nullValue; + +/** Represents a double value. */ +@property(nonatomic, readwrite) double numberValue; + +/** Represents a string value. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *stringValue; + +/** Represents a boolean value. */ +@property(nonatomic, readwrite) BOOL boolValue; + +/** Represents a structured value. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBStruct *structValue; + +/** Represents a repeated `Value`. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBListValue *listValue; + +@end + +/** + * Fetches the raw value of a @c GPBValue's @c nullValue property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GPBValue_NullValue_RawValue(GPBValue *message); +/** + * Sets the raw value of an @c GPBValue's @c nullValue property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value); + +/** + * Clears whatever value was set for the oneof 'kind'. + **/ +void GPBValue_ClearKindOneOfCase(GPBValue *message); + +#pragma mark - GPBListValue + +typedef GPB_ENUM(GPBListValue_FieldNumber) { + GPBListValue_FieldNumber_ValuesArray = 1, +}; + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + **/ +@interface GPBListValue : GPBMessage + +/** Repeated field of dynamically typed values. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBValue*> *valuesArray; +/** The number of items in @c valuesArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger valuesArray_Count; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Struct.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Struct.pbobjc.m new file mode 100644 index 00000000..f36ec582 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Struct.pbobjc.m @@ -0,0 +1,293 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/struct.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Struct.pbobjc.h> +#else + #import "google/protobuf/Struct.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#pragma clang diagnostic ignored "-Wdirect-ivar-access" + +#pragma mark - GPBStructRoot + +@implementation GPBStructRoot + +// No extensions in the file and no imports, so no need to generate +// +extensionRegistry. + +@end + +#pragma mark - GPBStructRoot_FileDescriptor + +static GPBFileDescriptor *GPBStructRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - Enum GPBNullValue + +GPBEnumDescriptor *GPBNullValue_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "NullValue\000"; + static const int32_t values[] = { + GPBNullValue_NullValue, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBNullValue) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GPBNullValue_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GPBNullValue_IsValidValue(int32_t value__) { + switch (value__) { + case GPBNullValue_NullValue: + return YES; + default: + return NO; + } +} + +#pragma mark - GPBStruct + +@implementation GPBStruct + +@dynamic fields, fields_Count; + +typedef struct GPBStruct__storage_ { + uint32_t _has_storage_[1]; + NSMutableDictionary *fields; +} GPBStruct__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "fields", + .dataTypeSpecific.className = GPBStringifySymbol(GPBValue), + .number = GPBStruct_FieldNumber_Fields, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBStruct__storage_, fields), + .flags = GPBFieldMapKeyString, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBStruct class] + rootClass:[GPBStructRoot class] + file:GPBStructRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBStruct__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBValue + +@implementation GPBValue + +@dynamic kindOneOfCase; +@dynamic nullValue; +@dynamic numberValue; +@dynamic stringValue; +@dynamic boolValue; +@dynamic structValue; +@dynamic listValue; + +typedef struct GPBValue__storage_ { + uint32_t _has_storage_[2]; + GPBNullValue nullValue; + NSString *stringValue; + GPBStruct *structValue; + GPBListValue *listValue; + double numberValue; +} GPBValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "nullValue", + .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor, + .number = GPBValue_FieldNumber_NullValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GPBValue__storage_, nullValue), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "numberValue", + .dataTypeSpecific.className = NULL, + .number = GPBValue_FieldNumber_NumberValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GPBValue__storage_, numberValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeDouble, + }, + { + .name = "stringValue", + .dataTypeSpecific.className = NULL, + .number = GPBValue_FieldNumber_StringValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GPBValue__storage_, stringValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "boolValue", + .dataTypeSpecific.className = NULL, + .number = GPBValue_FieldNumber_BoolValue, + .hasIndex = -1, + .offset = 0, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + { + .name = "structValue", + .dataTypeSpecific.className = GPBStringifySymbol(GPBStruct), + .number = GPBValue_FieldNumber_StructValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GPBValue__storage_, structValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "listValue", + .dataTypeSpecific.className = GPBStringifySymbol(GPBListValue), + .number = GPBValue_FieldNumber_ListValue, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GPBValue__storage_, listValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBValue class] + rootClass:[GPBStructRoot class] + file:GPBStructRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + static const char *oneofs[] = { + "kind", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GPBValue_NullValue_RawValue(GPBValue *message) { + GPBDescriptor *descriptor = [GPBValue descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGPBValue_NullValue_RawValue(GPBValue *message, int32_t value) { + GPBDescriptor *descriptor = [GPBValue descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBValue_FieldNumber_NullValue]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +void GPBValue_ClearKindOneOfCase(GPBValue *message) { + GPBDescriptor *descriptor = [message descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBMaybeClearOneof(message, oneof, -1, 0); +} +#pragma mark - GPBListValue + +@implementation GPBListValue + +@dynamic valuesArray, valuesArray_Count; + +typedef struct GPBListValue__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *valuesArray; +} GPBListValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "valuesArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBValue), + .number = GPBListValue_FieldNumber_ValuesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBListValue__storage_, valuesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBListValue class] + rootClass:[GPBStructRoot class] + file:GPBStructRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBListValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Timestamp.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Timestamp.pbobjc.h new file mode 100644 index 00000000..5d74bd32 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Timestamp.pbobjc.h @@ -0,0 +1,157 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/timestamp.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GPBTimestampRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBTimestampRoot : GPBRootObject +@end + +#pragma mark - GPBTimestamp + +typedef GPB_ENUM(GPBTimestamp_FieldNumber) { + GPBTimestamp_FieldNumber_Seconds = 1, + GPBTimestamp_FieldNumber_Nanos = 2, +}; + +/** + * A Timestamp represents a point in time independent of any time zone + * or calendar, represented as seconds and fractions of seconds at + * nanosecond resolution in UTC Epoch time. It is encoded using the + * Proleptic Gregorian Calendar which extends the Gregorian calendar + * backwards to year one. It is encoded assuming all minutes are 60 + * seconds long, i.e. leap seconds are "smeared" so that no leap second + * table is needed for interpretation. Range is from + * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. + * By restricting to that range, we ensure that we can convert to + * and from RFC 3339 date strings. + * See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required, though only UTC (as indicated by "Z") is presently supported. + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one + * can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) + * to obtain a formatter capable of generating timestamps in this format. + **/ +@interface GPBTimestamp : GPBMessage + +/** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + **/ +@property(nonatomic, readwrite) int64_t seconds; + +/** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + **/ +@property(nonatomic, readwrite) int32_t nanos; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Timestamp.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Timestamp.pbobjc.m new file mode 100644 index 00000000..4ab159fb --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Timestamp.pbobjc.m @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/timestamp.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Timestamp.pbobjc.h> +#else + #import "google/protobuf/Timestamp.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBTimestampRoot + +@implementation GPBTimestampRoot + +// No extensions in the file and no imports, so no need to generate +// +extensionRegistry. + +@end + +#pragma mark - GPBTimestampRoot_FileDescriptor + +static GPBFileDescriptor *GPBTimestampRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GPBTimestamp + +@implementation GPBTimestamp + +@dynamic seconds; +@dynamic nanos; + +typedef struct GPBTimestamp__storage_ { + uint32_t _has_storage_[1]; + int32_t nanos; + int64_t seconds; +} GPBTimestamp__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "seconds", + .dataTypeSpecific.className = NULL, + .number = GPBTimestamp_FieldNumber_Seconds, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBTimestamp__storage_, seconds), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt64, + }, + { + .name = "nanos", + .dataTypeSpecific.className = NULL, + .number = GPBTimestamp_FieldNumber_Nanos, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBTimestamp__storage_, nanos), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBTimestamp class] + rootClass:[GPBTimestampRoot class] + file:GPBTimestampRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBTimestamp__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Type.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Type.pbobjc.h new file mode 100644 index 00000000..17986970 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Type.pbobjc.h @@ -0,0 +1,440 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/type.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +@class GPBAny; +@class GPBEnumValue; +@class GPBField; +@class GPBOption; +@class GPBSourceContext; + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - Enum GPBSyntax + +/** The syntax in which a protocol buffer element is defined. */ +typedef GPB_ENUM(GPBSyntax) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GPBSyntax_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Syntax `proto2`. */ + GPBSyntax_SyntaxProto2 = 0, + + /** Syntax `proto3`. */ + GPBSyntax_SyntaxProto3 = 1, +}; + +GPBEnumDescriptor *GPBSyntax_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GPBSyntax_IsValidValue(int32_t value); + +#pragma mark - Enum GPBField_Kind + +/** Basic field types. */ +typedef GPB_ENUM(GPBField_Kind) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GPBField_Kind_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** Field type unknown. */ + GPBField_Kind_TypeUnknown = 0, + + /** Field type double. */ + GPBField_Kind_TypeDouble = 1, + + /** Field type float. */ + GPBField_Kind_TypeFloat = 2, + + /** Field type int64. */ + GPBField_Kind_TypeInt64 = 3, + + /** Field type uint64. */ + GPBField_Kind_TypeUint64 = 4, + + /** Field type int32. */ + GPBField_Kind_TypeInt32 = 5, + + /** Field type fixed64. */ + GPBField_Kind_TypeFixed64 = 6, + + /** Field type fixed32. */ + GPBField_Kind_TypeFixed32 = 7, + + /** Field type bool. */ + GPBField_Kind_TypeBool = 8, + + /** Field type string. */ + GPBField_Kind_TypeString = 9, + + /** Field type group. Proto2 syntax only, and deprecated. */ + GPBField_Kind_TypeGroup = 10, + + /** Field type message. */ + GPBField_Kind_TypeMessage = 11, + + /** Field type bytes. */ + GPBField_Kind_TypeBytes = 12, + + /** Field type uint32. */ + GPBField_Kind_TypeUint32 = 13, + + /** Field type enum. */ + GPBField_Kind_TypeEnum = 14, + + /** Field type sfixed32. */ + GPBField_Kind_TypeSfixed32 = 15, + + /** Field type sfixed64. */ + GPBField_Kind_TypeSfixed64 = 16, + + /** Field type sint32. */ + GPBField_Kind_TypeSint32 = 17, + + /** Field type sint64. */ + GPBField_Kind_TypeSint64 = 18, +}; + +GPBEnumDescriptor *GPBField_Kind_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GPBField_Kind_IsValidValue(int32_t value); + +#pragma mark - Enum GPBField_Cardinality + +/** Whether a field is optional, required, or repeated. */ +typedef GPB_ENUM(GPBField_Cardinality) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GPBField_Cardinality_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + /** For fields with unknown cardinality. */ + GPBField_Cardinality_CardinalityUnknown = 0, + + /** For optional fields. */ + GPBField_Cardinality_CardinalityOptional = 1, + + /** For required fields. Proto2 syntax only. */ + GPBField_Cardinality_CardinalityRequired = 2, + + /** For repeated fields. */ + GPBField_Cardinality_CardinalityRepeated = 3, +}; + +GPBEnumDescriptor *GPBField_Cardinality_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GPBField_Cardinality_IsValidValue(int32_t value); + +#pragma mark - GPBTypeRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBTypeRoot : GPBRootObject +@end + +#pragma mark - GPBType + +typedef GPB_ENUM(GPBType_FieldNumber) { + GPBType_FieldNumber_Name = 1, + GPBType_FieldNumber_FieldsArray = 2, + GPBType_FieldNumber_OneofsArray = 3, + GPBType_FieldNumber_OptionsArray = 4, + GPBType_FieldNumber_SourceContext = 5, + GPBType_FieldNumber_Syntax = 6, +}; + +/** + * A protocol buffer message type. + **/ +@interface GPBType : GPBMessage + +/** The fully qualified message name. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** The list of fields. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBField*> *fieldsArray; +/** The number of items in @c fieldsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger fieldsArray_Count; + +/** The list of types appearing in `oneof` definitions in this type. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<NSString*> *oneofsArray; +/** The number of items in @c oneofsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger oneofsArray_Count; + +/** The protocol buffer options. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray; +/** The number of items in @c optionsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger optionsArray_Count; + +/** The source context. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBSourceContext *sourceContext; +/** Test to see if @c sourceContext has been set. */ +@property(nonatomic, readwrite) BOOL hasSourceContext; + +/** The source syntax. */ +@property(nonatomic, readwrite) GPBSyntax syntax; + +@end + +/** + * Fetches the raw value of a @c GPBType's @c syntax property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GPBType_Syntax_RawValue(GPBType *message); +/** + * Sets the raw value of an @c GPBType's @c syntax property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGPBType_Syntax_RawValue(GPBType *message, int32_t value); + +#pragma mark - GPBField + +typedef GPB_ENUM(GPBField_FieldNumber) { + GPBField_FieldNumber_Kind = 1, + GPBField_FieldNumber_Cardinality = 2, + GPBField_FieldNumber_Number = 3, + GPBField_FieldNumber_Name = 4, + GPBField_FieldNumber_TypeURL = 6, + GPBField_FieldNumber_OneofIndex = 7, + GPBField_FieldNumber_Packed = 8, + GPBField_FieldNumber_OptionsArray = 9, + GPBField_FieldNumber_JsonName = 10, + GPBField_FieldNumber_DefaultValue = 11, +}; + +/** + * A single field of a message type. + **/ +@interface GPBField : GPBMessage + +/** The field type. */ +@property(nonatomic, readwrite) GPBField_Kind kind; + +/** The field cardinality. */ +@property(nonatomic, readwrite) GPBField_Cardinality cardinality; + +/** The field number. */ +@property(nonatomic, readwrite) int32_t number; + +/** The field name. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *typeURL; + +/** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + **/ +@property(nonatomic, readwrite) int32_t oneofIndex; + +/** Whether to use alternative packed wire representation. */ +@property(nonatomic, readwrite) BOOL packed; + +/** The protocol buffer options. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray; +/** The number of items in @c optionsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger optionsArray_Count; + +/** The field JSON name. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *jsonName; + +/** The string value of the default value of this field. Proto2 syntax only. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *defaultValue; + +@end + +/** + * Fetches the raw value of a @c GPBField's @c kind property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GPBField_Kind_RawValue(GPBField *message); +/** + * Sets the raw value of an @c GPBField's @c kind property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGPBField_Kind_RawValue(GPBField *message, int32_t value); + +/** + * Fetches the raw value of a @c GPBField's @c cardinality property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GPBField_Cardinality_RawValue(GPBField *message); +/** + * Sets the raw value of an @c GPBField's @c cardinality property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGPBField_Cardinality_RawValue(GPBField *message, int32_t value); + +#pragma mark - GPBEnum + +typedef GPB_ENUM(GPBEnum_FieldNumber) { + GPBEnum_FieldNumber_Name = 1, + GPBEnum_FieldNumber_EnumvalueArray = 2, + GPBEnum_FieldNumber_OptionsArray = 3, + GPBEnum_FieldNumber_SourceContext = 4, + GPBEnum_FieldNumber_Syntax = 5, +}; + +/** + * Enum type definition. + **/ +@interface GPBEnum : GPBMessage + +/** Enum type name. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** Enum value definitions. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBEnumValue*> *enumvalueArray; +/** The number of items in @c enumvalueArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger enumvalueArray_Count; + +/** Protocol buffer options. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray; +/** The number of items in @c optionsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger optionsArray_Count; + +/** The source context. */ +@property(nonatomic, readwrite, strong, null_resettable) GPBSourceContext *sourceContext; +/** Test to see if @c sourceContext has been set. */ +@property(nonatomic, readwrite) BOOL hasSourceContext; + +/** The source syntax. */ +@property(nonatomic, readwrite) GPBSyntax syntax; + +@end + +/** + * Fetches the raw value of a @c GPBEnum's @c syntax property, even + * if the value was not defined by the enum at the time the code was generated. + **/ +int32_t GPBEnum_Syntax_RawValue(GPBEnum *message); +/** + * Sets the raw value of an @c GPBEnum's @c syntax property, allowing + * it to be set to a value that was not defined by the enum at the time the code + * was generated. + **/ +void SetGPBEnum_Syntax_RawValue(GPBEnum *message, int32_t value); + +#pragma mark - GPBEnumValue + +typedef GPB_ENUM(GPBEnumValue_FieldNumber) { + GPBEnumValue_FieldNumber_Name = 1, + GPBEnumValue_FieldNumber_Number = 2, + GPBEnumValue_FieldNumber_OptionsArray = 3, +}; + +/** + * Enum value definition. + **/ +@interface GPBEnumValue : GPBMessage + +/** Enum value name. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** Enum value number. */ +@property(nonatomic, readwrite) int32_t number; + +/** Protocol buffer options. */ +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray<GPBOption*> *optionsArray; +/** The number of items in @c optionsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger optionsArray_Count; + +@end + +#pragma mark - GPBOption + +typedef GPB_ENUM(GPBOption_FieldNumber) { + GPBOption_FieldNumber_Name = 1, + GPBOption_FieldNumber_Value = 2, +}; + +/** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + **/ +@interface GPBOption : GPBMessage + +/** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + **/ +@property(nonatomic, readwrite, copy, null_resettable) NSString *name; + +/** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + **/ +@property(nonatomic, readwrite, strong, null_resettable) GPBAny *value; +/** Test to see if @c value has been set. */ +@property(nonatomic, readwrite) BOOL hasValue; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Type.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Type.pbobjc.m new file mode 100644 index 00000000..7a949388 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Type.pbobjc.m @@ -0,0 +1,701 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/type.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Type.pbobjc.h> + #import <Protobuf/Any.pbobjc.h> + #import <Protobuf/SourceContext.pbobjc.h> +#else + #import "google/protobuf/Type.pbobjc.h" + #import "google/protobuf/Any.pbobjc.h" + #import "google/protobuf/SourceContext.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBTypeRoot + +@implementation GPBTypeRoot + +// No extensions in the file and none of the imports (direct or indirect) +// defined extensions, so no need to generate +extensionRegistry. + +@end + +#pragma mark - GPBTypeRoot_FileDescriptor + +static GPBFileDescriptor *GPBTypeRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - Enum GPBSyntax + +GPBEnumDescriptor *GPBSyntax_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "SyntaxProto2\000SyntaxProto3\000"; + static const int32_t values[] = { + GPBSyntax_SyntaxProto2, + GPBSyntax_SyntaxProto3, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBSyntax) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GPBSyntax_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GPBSyntax_IsValidValue(int32_t value__) { + switch (value__) { + case GPBSyntax_SyntaxProto2: + case GPBSyntax_SyntaxProto3: + return YES; + default: + return NO; + } +} + +#pragma mark - GPBType + +@implementation GPBType + +@dynamic name; +@dynamic fieldsArray, fieldsArray_Count; +@dynamic oneofsArray, oneofsArray_Count; +@dynamic optionsArray, optionsArray_Count; +@dynamic hasSourceContext, sourceContext; +@dynamic syntax; + +typedef struct GPBType__storage_ { + uint32_t _has_storage_[1]; + GPBSyntax syntax; + NSString *name; + NSMutableArray *fieldsArray; + NSMutableArray *oneofsArray; + NSMutableArray *optionsArray; + GPBSourceContext *sourceContext; +} GPBType__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "name", + .dataTypeSpecific.className = NULL, + .number = GPBType_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBType__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "fieldsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBField), + .number = GPBType_FieldNumber_FieldsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBType__storage_, fieldsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "oneofsArray", + .dataTypeSpecific.className = NULL, + .number = GPBType_FieldNumber_OneofsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBType__storage_, oneofsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeString, + }, + { + .name = "optionsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), + .number = GPBType_FieldNumber_OptionsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBType__storage_, optionsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "sourceContext", + .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext), + .number = GPBType_FieldNumber_SourceContext, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBType__storage_, sourceContext), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "syntax", + .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor, + .number = GPBType_FieldNumber_Syntax, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GPBType__storage_, syntax), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBType class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBType__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GPBType_Syntax_RawValue(GPBType *message) { + GPBDescriptor *descriptor = [GPBType descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBType_FieldNumber_Syntax]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGPBType_Syntax_RawValue(GPBType *message, int32_t value) { + GPBDescriptor *descriptor = [GPBType descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBType_FieldNumber_Syntax]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - GPBField + +@implementation GPBField + +@dynamic kind; +@dynamic cardinality; +@dynamic number; +@dynamic name; +@dynamic typeURL; +@dynamic oneofIndex; +@dynamic packed; +@dynamic optionsArray, optionsArray_Count; +@dynamic jsonName; +@dynamic defaultValue; + +typedef struct GPBField__storage_ { + uint32_t _has_storage_[1]; + GPBField_Kind kind; + GPBField_Cardinality cardinality; + int32_t number; + int32_t oneofIndex; + NSString *name; + NSString *typeURL; + NSMutableArray *optionsArray; + NSString *jsonName; + NSString *defaultValue; +} GPBField__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "kind", + .dataTypeSpecific.enumDescFunc = GPBField_Kind_EnumDescriptor, + .number = GPBField_FieldNumber_Kind, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBField__storage_, kind), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "cardinality", + .dataTypeSpecific.enumDescFunc = GPBField_Cardinality_EnumDescriptor, + .number = GPBField_FieldNumber_Cardinality, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBField__storage_, cardinality), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + { + .name = "number", + .dataTypeSpecific.className = NULL, + .number = GPBField_FieldNumber_Number, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GPBField__storage_, number), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "name", + .dataTypeSpecific.className = NULL, + .number = GPBField_FieldNumber_Name, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GPBField__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "typeURL", + .dataTypeSpecific.className = NULL, + .number = GPBField_FieldNumber_TypeURL, + .hasIndex = 4, + .offset = (uint32_t)offsetof(GPBField__storage_, typeURL), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom), + .dataType = GPBDataTypeString, + }, + { + .name = "oneofIndex", + .dataTypeSpecific.className = NULL, + .number = GPBField_FieldNumber_OneofIndex, + .hasIndex = 5, + .offset = (uint32_t)offsetof(GPBField__storage_, oneofIndex), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "packed", + .dataTypeSpecific.className = NULL, + .number = GPBField_FieldNumber_Packed, + .hasIndex = 6, + .offset = 7, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + { + .name = "optionsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), + .number = GPBField_FieldNumber_OptionsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBField__storage_, optionsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "jsonName", + .dataTypeSpecific.className = NULL, + .number = GPBField_FieldNumber_JsonName, + .hasIndex = 8, + .offset = (uint32_t)offsetof(GPBField__storage_, jsonName), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "defaultValue", + .dataTypeSpecific.className = NULL, + .number = GPBField_FieldNumber_DefaultValue, + .hasIndex = 9, + .offset = (uint32_t)offsetof(GPBField__storage_, defaultValue), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBField class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBField__storage_) + flags:GPBDescriptorInitializationFlag_None]; +#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS + static const char *extraTextFormatInfo = + "\001\006\004\241!!\000"; + [localDescriptor setupExtraTextInfo:extraTextFormatInfo]; +#endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GPBField_Kind_RawValue(GPBField *message) { + GPBDescriptor *descriptor = [GPBField descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Kind]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGPBField_Kind_RawValue(GPBField *message, int32_t value) { + GPBDescriptor *descriptor = [GPBField descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Kind]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +int32_t GPBField_Cardinality_RawValue(GPBField *message) { + GPBDescriptor *descriptor = [GPBField descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Cardinality]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGPBField_Cardinality_RawValue(GPBField *message, int32_t value) { + GPBDescriptor *descriptor = [GPBField descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBField_FieldNumber_Cardinality]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - Enum GPBField_Kind + +GPBEnumDescriptor *GPBField_Kind_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "TypeUnknown\000TypeDouble\000TypeFloat\000TypeInt" + "64\000TypeUint64\000TypeInt32\000TypeFixed64\000Type" + "Fixed32\000TypeBool\000TypeString\000TypeGroup\000Ty" + "peMessage\000TypeBytes\000TypeUint32\000TypeEnum\000" + "TypeSfixed32\000TypeSfixed64\000TypeSint32\000Typ" + "eSint64\000"; + static const int32_t values[] = { + GPBField_Kind_TypeUnknown, + GPBField_Kind_TypeDouble, + GPBField_Kind_TypeFloat, + GPBField_Kind_TypeInt64, + GPBField_Kind_TypeUint64, + GPBField_Kind_TypeInt32, + GPBField_Kind_TypeFixed64, + GPBField_Kind_TypeFixed32, + GPBField_Kind_TypeBool, + GPBField_Kind_TypeString, + GPBField_Kind_TypeGroup, + GPBField_Kind_TypeMessage, + GPBField_Kind_TypeBytes, + GPBField_Kind_TypeUint32, + GPBField_Kind_TypeEnum, + GPBField_Kind_TypeSfixed32, + GPBField_Kind_TypeSfixed64, + GPBField_Kind_TypeSint32, + GPBField_Kind_TypeSint64, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBField_Kind) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GPBField_Kind_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GPBField_Kind_IsValidValue(int32_t value__) { + switch (value__) { + case GPBField_Kind_TypeUnknown: + case GPBField_Kind_TypeDouble: + case GPBField_Kind_TypeFloat: + case GPBField_Kind_TypeInt64: + case GPBField_Kind_TypeUint64: + case GPBField_Kind_TypeInt32: + case GPBField_Kind_TypeFixed64: + case GPBField_Kind_TypeFixed32: + case GPBField_Kind_TypeBool: + case GPBField_Kind_TypeString: + case GPBField_Kind_TypeGroup: + case GPBField_Kind_TypeMessage: + case GPBField_Kind_TypeBytes: + case GPBField_Kind_TypeUint32: + case GPBField_Kind_TypeEnum: + case GPBField_Kind_TypeSfixed32: + case GPBField_Kind_TypeSfixed64: + case GPBField_Kind_TypeSint32: + case GPBField_Kind_TypeSint64: + return YES; + default: + return NO; + } +} + +#pragma mark - Enum GPBField_Cardinality + +GPBEnumDescriptor *GPBField_Cardinality_EnumDescriptor(void) { + static GPBEnumDescriptor *descriptor = NULL; + if (!descriptor) { + static const char *valueNames = + "CardinalityUnknown\000CardinalityOptional\000C" + "ardinalityRequired\000CardinalityRepeated\000"; + static const int32_t values[] = { + GPBField_Cardinality_CardinalityUnknown, + GPBField_Cardinality_CardinalityOptional, + GPBField_Cardinality_CardinalityRequired, + GPBField_Cardinality_CardinalityRepeated, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GPBField_Cardinality) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GPBField_Cardinality_IsValidValue]; + if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GPBField_Cardinality_IsValidValue(int32_t value__) { + switch (value__) { + case GPBField_Cardinality_CardinalityUnknown: + case GPBField_Cardinality_CardinalityOptional: + case GPBField_Cardinality_CardinalityRequired: + case GPBField_Cardinality_CardinalityRepeated: + return YES; + default: + return NO; + } +} + +#pragma mark - GPBEnum + +@implementation GPBEnum + +@dynamic name; +@dynamic enumvalueArray, enumvalueArray_Count; +@dynamic optionsArray, optionsArray_Count; +@dynamic hasSourceContext, sourceContext; +@dynamic syntax; + +typedef struct GPBEnum__storage_ { + uint32_t _has_storage_[1]; + GPBSyntax syntax; + NSString *name; + NSMutableArray *enumvalueArray; + NSMutableArray *optionsArray; + GPBSourceContext *sourceContext; +} GPBEnum__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "name", + .dataTypeSpecific.className = NULL, + .number = GPBEnum_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBEnum__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "enumvalueArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBEnumValue), + .number = GPBEnum_FieldNumber_EnumvalueArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBEnum__storage_, enumvalueArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "optionsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), + .number = GPBEnum_FieldNumber_OptionsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBEnum__storage_, optionsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + { + .name = "sourceContext", + .dataTypeSpecific.className = GPBStringifySymbol(GPBSourceContext), + .number = GPBEnum_FieldNumber_SourceContext, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBEnum__storage_, sourceContext), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "syntax", + .dataTypeSpecific.enumDescFunc = GPBSyntax_EnumDescriptor, + .number = GPBEnum_FieldNumber_Syntax, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GPBEnum__storage_, syntax), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEnum class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBEnum__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +int32_t GPBEnum_Syntax_RawValue(GPBEnum *message) { + GPBDescriptor *descriptor = [GPBEnum descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBEnum_FieldNumber_Syntax]; + return GPBGetMessageInt32Field(message, field); +} + +void SetGPBEnum_Syntax_RawValue(GPBEnum *message, int32_t value) { + GPBDescriptor *descriptor = [GPBEnum descriptor]; + GPBFieldDescriptor *field = [descriptor fieldWithNumber:GPBEnum_FieldNumber_Syntax]; + GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); +} + +#pragma mark - GPBEnumValue + +@implementation GPBEnumValue + +@dynamic name; +@dynamic number; +@dynamic optionsArray, optionsArray_Count; + +typedef struct GPBEnumValue__storage_ { + uint32_t _has_storage_[1]; + int32_t number; + NSString *name; + NSMutableArray *optionsArray; +} GPBEnumValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "name", + .dataTypeSpecific.className = NULL, + .number = GPBEnumValue_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBEnumValue__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "number", + .dataTypeSpecific.className = NULL, + .number = GPBEnumValue_FieldNumber_Number, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBEnumValue__storage_, number), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + { + .name = "optionsArray", + .dataTypeSpecific.className = GPBStringifySymbol(GPBOption), + .number = GPBEnumValue_FieldNumber_OptionsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GPBEnumValue__storage_, optionsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBEnumValue class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBEnumValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBOption + +@implementation GPBOption + +@dynamic name; +@dynamic hasValue, value; + +typedef struct GPBOption__storage_ { + uint32_t _has_storage_[1]; + NSString *name; + GPBAny *value; +} GPBOption__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "name", + .dataTypeSpecific.className = NULL, + .number = GPBOption_FieldNumber_Name, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBOption__storage_, name), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + { + .name = "value", + .dataTypeSpecific.className = GPBStringifySymbol(GPBAny), + .number = GPBOption_FieldNumber_Value, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GPBOption__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBOption class] + rootClass:[GPBTypeRoot class] + file:GPBTypeRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBOption__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Wrappers.pbobjc.h b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Wrappers.pbobjc.h new file mode 100644 index 00000000..3cb9fe77 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Wrappers.pbobjc.h @@ -0,0 +1,215 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/wrappers.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers.h> +#else + #import "GPBProtocolBuffers.h" +#endif + +#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 +#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. +#endif +#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION +#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. +#endif + +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +CF_EXTERN_C_BEGIN + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - GPBWrappersRoot + +/** + * Exposes the extension registry for this file. + * + * The base class provides: + * @code + * + (GPBExtensionRegistry *)extensionRegistry; + * @endcode + * which is a @c GPBExtensionRegistry that includes all the extensions defined by + * this file and all files that it depends on. + **/ +@interface GPBWrappersRoot : GPBRootObject +@end + +#pragma mark - GPBDoubleValue + +typedef GPB_ENUM(GPBDoubleValue_FieldNumber) { + GPBDoubleValue_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `double`. + * + * The JSON representation for `DoubleValue` is JSON number. + **/ +@interface GPBDoubleValue : GPBMessage + +/** The double value. */ +@property(nonatomic, readwrite) double value; + +@end + +#pragma mark - GPBFloatValue + +typedef GPB_ENUM(GPBFloatValue_FieldNumber) { + GPBFloatValue_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `float`. + * + * The JSON representation for `FloatValue` is JSON number. + **/ +@interface GPBFloatValue : GPBMessage + +/** The float value. */ +@property(nonatomic, readwrite) float value; + +@end + +#pragma mark - GPBInt64Value + +typedef GPB_ENUM(GPBInt64Value_FieldNumber) { + GPBInt64Value_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `int64`. + * + * The JSON representation for `Int64Value` is JSON string. + **/ +@interface GPBInt64Value : GPBMessage + +/** The int64 value. */ +@property(nonatomic, readwrite) int64_t value; + +@end + +#pragma mark - GPBUInt64Value + +typedef GPB_ENUM(GPBUInt64Value_FieldNumber) { + GPBUInt64Value_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `uint64`. + * + * The JSON representation for `UInt64Value` is JSON string. + **/ +@interface GPBUInt64Value : GPBMessage + +/** The uint64 value. */ +@property(nonatomic, readwrite) uint64_t value; + +@end + +#pragma mark - GPBInt32Value + +typedef GPB_ENUM(GPBInt32Value_FieldNumber) { + GPBInt32Value_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `int32`. + * + * The JSON representation for `Int32Value` is JSON number. + **/ +@interface GPBInt32Value : GPBMessage + +/** The int32 value. */ +@property(nonatomic, readwrite) int32_t value; + +@end + +#pragma mark - GPBUInt32Value + +typedef GPB_ENUM(GPBUInt32Value_FieldNumber) { + GPBUInt32Value_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `uint32`. + * + * The JSON representation for `UInt32Value` is JSON number. + **/ +@interface GPBUInt32Value : GPBMessage + +/** The uint32 value. */ +@property(nonatomic, readwrite) uint32_t value; + +@end + +#pragma mark - GPBBoolValue + +typedef GPB_ENUM(GPBBoolValue_FieldNumber) { + GPBBoolValue_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `bool`. + * + * The JSON representation for `BoolValue` is JSON `true` and `false`. + **/ +@interface GPBBoolValue : GPBMessage + +/** The bool value. */ +@property(nonatomic, readwrite) BOOL value; + +@end + +#pragma mark - GPBStringValue + +typedef GPB_ENUM(GPBStringValue_FieldNumber) { + GPBStringValue_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `string`. + * + * The JSON representation for `StringValue` is JSON string. + **/ +@interface GPBStringValue : GPBMessage + +/** The string value. */ +@property(nonatomic, readwrite, copy, null_resettable) NSString *value; + +@end + +#pragma mark - GPBBytesValue + +typedef GPB_ENUM(GPBBytesValue_FieldNumber) { + GPBBytesValue_FieldNumber_Value = 1, +}; + +/** + * Wrapper message for `bytes`. + * + * The JSON representation for `BytesValue` is JSON string. + **/ +@interface GPBBytesValue : GPBMessage + +/** The bytes value. */ +@property(nonatomic, readwrite, copy, null_resettable) NSData *value; + +@end + +NS_ASSUME_NONNULL_END + +CF_EXTERN_C_END + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Wrappers.pbobjc.m b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Wrappers.pbobjc.m new file mode 100644 index 00000000..5479eb12 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Protobuf/objectivec/google/protobuf/Wrappers.pbobjc.m @@ -0,0 +1,439 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/wrappers.proto + +// This CPP symbol can be defined to use imports that match up to the framework +// imports needed when using CocoaPods. +#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) + #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/GPBProtocolBuffers_RuntimeSupport.h> +#else + #import "GPBProtocolBuffers_RuntimeSupport.h" +#endif + +#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import <Protobuf/Wrappers.pbobjc.h> +#else + #import "google/protobuf/Wrappers.pbobjc.h" +#endif +// @@protoc_insertion_point(imports) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + +#pragma mark - GPBWrappersRoot + +@implementation GPBWrappersRoot + +// No extensions in the file and no imports, so no need to generate +// +extensionRegistry. + +@end + +#pragma mark - GPBWrappersRoot_FileDescriptor + +static GPBFileDescriptor *GPBWrappersRoot_FileDescriptor(void) { + // This is called by +initialize so there is no need to worry + // about thread safety of the singleton. + static GPBFileDescriptor *descriptor = NULL; + if (!descriptor) { + GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); + descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.protobuf" + objcPrefix:@"GPB" + syntax:GPBFileSyntaxProto3]; + } + return descriptor; +} + +#pragma mark - GPBDoubleValue + +@implementation GPBDoubleValue + +@dynamic value; + +typedef struct GPBDoubleValue__storage_ { + uint32_t _has_storage_[1]; + double value; +} GPBDoubleValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBDoubleValue_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBDoubleValue__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeDouble, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBDoubleValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBDoubleValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBFloatValue + +@implementation GPBFloatValue + +@dynamic value; + +typedef struct GPBFloatValue__storage_ { + uint32_t _has_storage_[1]; + float value; +} GPBFloatValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBFloatValue_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBFloatValue__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeFloat, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBFloatValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBFloatValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBInt64Value + +@implementation GPBInt64Value + +@dynamic value; + +typedef struct GPBInt64Value__storage_ { + uint32_t _has_storage_[1]; + int64_t value; +} GPBInt64Value__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBInt64Value_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBInt64Value__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt64, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBInt64Value class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBInt64Value__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBUInt64Value + +@implementation GPBUInt64Value + +@dynamic value; + +typedef struct GPBUInt64Value__storage_ { + uint32_t _has_storage_[1]; + uint64_t value; +} GPBUInt64Value__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBUInt64Value_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBUInt64Value__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeUInt64, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBUInt64Value class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBUInt64Value__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBInt32Value + +@implementation GPBInt32Value + +@dynamic value; + +typedef struct GPBInt32Value__storage_ { + uint32_t _has_storage_[1]; + int32_t value; +} GPBInt32Value__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBInt32Value_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBInt32Value__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBInt32Value class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBInt32Value__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBUInt32Value + +@implementation GPBUInt32Value + +@dynamic value; + +typedef struct GPBUInt32Value__storage_ { + uint32_t _has_storage_[1]; + uint32_t value; +} GPBUInt32Value__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBUInt32Value_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBUInt32Value__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeUInt32, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBUInt32Value class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBUInt32Value__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBBoolValue + +@implementation GPBBoolValue + +@dynamic value; + +typedef struct GPBBoolValue__storage_ { + uint32_t _has_storage_[1]; +} GPBBoolValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBBoolValue_FieldNumber_Value, + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBBoolValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBBoolValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBStringValue + +@implementation GPBStringValue + +@dynamic value; + +typedef struct GPBStringValue__storage_ { + uint32_t _has_storage_[1]; + NSString *value; +} GPBStringValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBStringValue_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBStringValue__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeString, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBStringValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBStringValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GPBBytesValue + +@implementation GPBBytesValue + +@dynamic value; + +typedef struct GPBBytesValue__storage_ { + uint32_t _has_storage_[1]; + NSData *value; +} GPBBytesValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.className = NULL, + .number = GPBBytesValue_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GPBBytesValue__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GPBBytesValue class] + rootClass:[GPBWrappersRoot class] + file:GPBWrappersRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GPBBytesValue__storage_) + flags:GPBDescriptorInitializationFlag_None]; + NSAssert(descriptor == nil, @"Startup recursed!"); + descriptor = localDescriptor; + } + return descriptor; +} + +@end + + +#pragma clang diagnostic pop + +// @@protoc_insertion_point(global_scope) diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-dummy.m b/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-dummy.m new file mode 100644 index 00000000..9e35ec0f --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-dummy.m @@ -0,0 +1,5 @@ +#import <Foundation/Foundation.h> +@interface PodsDummy_GoogleToolboxForMac : NSObject +@end +@implementation PodsDummy_GoogleToolboxForMac +@end diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch b/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch new file mode 100644 index 00000000..beb2a244 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import <UIKit/UIKit.h> +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.xcconfig b/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.xcconfig new file mode 100644 index 00000000..02971f0a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/GoogleToolboxForMac/GoogleToolboxForMac.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/GoogleToolboxForMac +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/GoogleToolboxForMac" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/FirebaseMessaging" "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/nanopb" +OTHER_LDFLAGS = -l"z" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/GoogleToolboxForMac +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-acknowledgements.markdown b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-acknowledgements.markdown deleted file mode 100644 index c07bb6cb..00000000 --- a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-acknowledgements.markdown +++ /dev/null @@ -1,27 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## GGLInstanceID - -Copyright 2015 Google Inc. - -## GoogleCloudMessaging - -Copyright 2015 Google Inc. - -## GoogleIPhoneUtilities - -Copyright 2015 Google Inc. - -## GoogleInterchangeUtilities - -Copyright 2016 Google - -## GoogleSymbolUtilities - -Copyright 2016 Google - -## GoogleUtilities - -Copyright 2016 Google -Generated by CocoaPods - https://cocoapods.org diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-acknowledgements.plist b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-acknowledgements.plist deleted file mode 100644 index bf288035..00000000 --- a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-acknowledgements.plist +++ /dev/null @@ -1,89 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>PreferenceSpecifiers</key> - <array> - <dict> - <key>FooterText</key> - <string>This application makes use of the following third party libraries:</string> - <key>Title</key> - <string>Acknowledgements</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string>Copyright 2015 Google Inc.</string> - <key>License</key> - <string>Copyright</string> - <key>Title</key> - <string>GGLInstanceID</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string>Copyright 2015 Google Inc.</string> - <key>License</key> - <string>Copyright</string> - <key>Title</key> - <string>GoogleCloudMessaging</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string>Copyright 2015 Google Inc.</string> - <key>License</key> - <string>Copyright</string> - <key>Title</key> - <string>GoogleIPhoneUtilities</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string>Copyright 2016 Google</string> - <key>License</key> - <string>Copyright</string> - <key>Title</key> - <string>GoogleInterchangeUtilities</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string>Copyright 2016 Google</string> - <key>License</key> - <string>Copyright</string> - <key>Title</key> - <string>GoogleSymbolUtilities</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string>Copyright 2016 Google</string> - <key>License</key> - <string>Copyright</string> - <key>Title</key> - <string>GoogleUtilities</string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - <dict> - <key>FooterText</key> - <string>Generated by CocoaPods - https://cocoapods.org</string> - <key>Title</key> - <string></string> - <key>Type</key> - <string>PSGroupSpecifier</string> - </dict> - </array> - <key>StringsTable</key> - <string>Acknowledgements</string> - <key>Title</key> - <string>Acknowledgements</string> -</dict> -</plist> diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-dummy.m b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-dummy.m deleted file mode 100644 index d7c71b29..00000000 --- a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import <Foundation/Foundation.h> -@interface PodsDummy_Pods_Stone_Island : NSObject -@end -@implementation PodsDummy_Pods_Stone_Island -@end diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island.debug.xcconfig b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island.debug.xcconfig deleted file mode 100644 index fcb5941f..00000000 --- a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island.debug.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/GoogleIPhoneUtilities/Frameworks" "${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks/frameworks" "${PODS_ROOT}/GoogleSymbolUtilities/Frameworks/frameworks" "${PODS_ROOT}/GoogleUtilities/Frameworks/frameworks" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/GGLInstanceID" "${PODS_ROOT}/Headers/Public/GoogleCloudMessaging" "${PODS_ROOT}/Headers/Public/GoogleIPhoneUtilities" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities" -LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/GGLInstanceID/Libraries" $(inherited) "${PODS_ROOT}/GoogleCloudMessaging/Libraries" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/GGLInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleCloudMessaging" -isystem "${PODS_ROOT}/Headers/Public/GoogleIPhoneUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities" -OTHER_LDFLAGS = $(inherited) -ObjC -l"GGLInstanceIDLib" -l"GcmLib" -l"sqlite3" -l"z" -framework "AddressBook" -framework "CoreGraphics" -framework "GoogleIPhoneUtilities" -framework "GoogleInterchangeUtilities" -framework "GoogleSymbolUtilities" -framework "GoogleUtilities" -framework "SystemConfiguration" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island.release.xcconfig b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island.release.xcconfig deleted file mode 100644 index fcb5941f..00000000 --- a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island.release.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/GoogleIPhoneUtilities/Frameworks" "${PODS_ROOT}/GoogleInterchangeUtilities/Frameworks/frameworks" "${PODS_ROOT}/GoogleSymbolUtilities/Frameworks/frameworks" "${PODS_ROOT}/GoogleUtilities/Frameworks/frameworks" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/GGLInstanceID" "${PODS_ROOT}/Headers/Public/GoogleCloudMessaging" "${PODS_ROOT}/Headers/Public/GoogleIPhoneUtilities" "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" "${PODS_ROOT}/Headers/Public/GoogleUtilities" -LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/GGLInstanceID/Libraries" $(inherited) "${PODS_ROOT}/GoogleCloudMessaging/Libraries" -OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/GGLInstanceID" -isystem "${PODS_ROOT}/Headers/Public/GoogleCloudMessaging" -isystem "${PODS_ROOT}/Headers/Public/GoogleIPhoneUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleInterchangeUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleSymbolUtilities" -isystem "${PODS_ROOT}/Headers/Public/GoogleUtilities" -OTHER_LDFLAGS = $(inherited) -ObjC -l"GGLInstanceIDLib" -l"GcmLib" -l"sqlite3" -l"z" -framework "AddressBook" -framework "CoreGraphics" -framework "GoogleIPhoneUtilities" -framework "GoogleInterchangeUtilities" -framework "GoogleSymbolUtilities" -framework "GoogleUtilities" -framework "SystemConfiguration" -PODS_BUILD_DIR = $BUILD_DIR -PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) -PODS_ROOT = ${SRCROOT}/Pods diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-acknowledgements.markdown b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-acknowledgements.markdown new file mode 100644 index 00000000..749bcc29 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-acknowledgements.markdown @@ -0,0 +1,295 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## FirebaseAnalytics + +Copyright 2017 Google + +## FirebaseCore + +Copyright 2017 Google + +## FirebaseInstanceID + +Copyright 2017 Google + +## FirebaseMessaging + +Copyright 2017 Google + +## GoogleToolboxForMac + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +## Protobuf + +This license applies to all parts of Protocol Buffers except the following: + + - Atomicops support for generic gcc, located in + src/google/protobuf/stubs/atomicops_internals_generic_gcc.h. + This file is copyrighted by Red Hat Inc. + + - Atomicops support for AIX/POWER, located in + src/google/protobuf/stubs/atomicops_internals_power.h. + This file is copyrighted by Bloomberg Finance LP. + +Copyright 2014, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + + +## nanopb + +Copyright (c) 2011 Petteri Aimonen <jpa at nanopb.mail.kapsi.fi> + +This software is provided 'as-is', without any express or +implied warranty. In no event will the authors be held liable +for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. + +Generated by CocoaPods - https://cocoapods.org diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-acknowledgements.plist b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-acknowledgements.plist new file mode 100644 index 00000000..2e620ed1 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-acknowledgements.plist @@ -0,0 +1,363 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>PreferenceSpecifiers</key> + <array> + <dict> + <key>FooterText</key> + <string>This application makes use of the following third party libraries:</string> + <key>Title</key> + <string>Acknowledgements</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string>Copyright 2017 Google</string> + <key>License</key> + <string>Copyright</string> + <key>Title</key> + <string>FirebaseAnalytics</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string>Copyright 2017 Google</string> + <key>License</key> + <string>Copyright</string> + <key>Title</key> + <string>FirebaseCore</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string>Copyright 2017 Google</string> + <key>License</key> + <string>Copyright</string> + <key>Title</key> + <string>FirebaseInstanceID</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string>Copyright 2017 Google</string> + <key>License</key> + <string>Copyright</string> + <key>Title</key> + <string>FirebaseMessaging</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string> + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +</string> + <key>License</key> + <string>Apache</string> + <key>Title</key> + <string>GoogleToolboxForMac</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string>This license applies to all parts of Protocol Buffers except the following: + + - Atomicops support for generic gcc, located in + src/google/protobuf/stubs/atomicops_internals_generic_gcc.h. + This file is copyrighted by Red Hat Inc. + + - Atomicops support for AIX/POWER, located in + src/google/protobuf/stubs/atomicops_internals_power.h. + This file is copyrighted by Bloomberg Finance LP. + +Copyright 2014, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. +</string> + <key>License</key> + <string>3-Clause BSD License</string> + <key>Title</key> + <string>Protobuf</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string>Copyright (c) 2011 Petteri Aimonen <jpa at nanopb.mail.kapsi.fi> + +This software is provided 'as-is', without any express or +implied warranty. In no event will the authors be held liable +for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. +</string> + <key>License</key> + <string>zlib</string> + <key>Title</key> + <string>nanopb</string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + <dict> + <key>FooterText</key> + <string>Generated by CocoaPods - https://cocoapods.org</string> + <key>Title</key> + <string></string> + <key>Type</key> + <string>PSGroupSpecifier</string> + </dict> + </array> + <key>StringsTable</key> + <string>Acknowledgements</string> + <key>Title</key> + <string>Acknowledgements</string> +</dict> +</plist> diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-dummy.m b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-dummy.m new file mode 100644 index 00000000..9d2bce04 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-dummy.m @@ -0,0 +1,5 @@ +#import <Foundation/Foundation.h> +@interface PodsDummy_Pods_StoneIsland : NSObject +@end +@implementation PodsDummy_Pods_StoneIsland +@end diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-frameworks.sh b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-frameworks.sh index 0f29f13c..0f29f13c 100755 --- a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-frameworks.sh +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-frameworks.sh diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-resources.sh b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-resources.sh index 4602c68a..4602c68a 100755 --- a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-resources.sh +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-resources.sh diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland.debug.xcconfig b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland.debug.xcconfig new file mode 100644 index 00000000..a59d208b --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland.debug.xcconfig @@ -0,0 +1,9 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseCore/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" "${PODS_ROOT}/FirebaseMessaging/Frameworks" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/FirebaseMessaging" "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/nanopb" +LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/GoogleToolboxForMac" "$PODS_CONFIGURATION_BUILD_DIR/Protobuf" "$PODS_CONFIGURATION_BUILD_DIR/nanopb" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseCore" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/FirebaseMessaging" -isystem "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" -isystem "${PODS_ROOT}/Headers/Public/Protobuf" -isystem "${PODS_ROOT}/Headers/Public/nanopb" +OTHER_LDFLAGS = $(inherited) -ObjC -l"GoogleToolboxForMac" -l"Protobuf" -l"c++" -l"nanopb" -l"sqlite3" -l"z" -framework "AddressBook" -framework "FirebaseAnalytics" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseInstanceID" -framework "FirebaseMessaging" -framework "FirebaseNanoPB" -framework "StoreKit" -framework "SystemConfiguration" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT}/Pods diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland.release.xcconfig b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland.release.xcconfig new file mode 100644 index 00000000..a59d208b --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland.release.xcconfig @@ -0,0 +1,9 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseCore/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" "${PODS_ROOT}/FirebaseMessaging/Frameworks" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/FirebaseMessaging" "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/nanopb" +LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/GoogleToolboxForMac" "$PODS_CONFIGURATION_BUILD_DIR/Protobuf" "$PODS_CONFIGURATION_BUILD_DIR/nanopb" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseCore" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/FirebaseMessaging" -isystem "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" -isystem "${PODS_ROOT}/Headers/Public/Protobuf" -isystem "${PODS_ROOT}/Headers/Public/nanopb" +OTHER_LDFLAGS = $(inherited) -ObjC -l"GoogleToolboxForMac" -l"Protobuf" -l"c++" -l"nanopb" -l"sqlite3" -l"z" -framework "AddressBook" -framework "FirebaseAnalytics" -framework "FirebaseCore" -framework "FirebaseCoreDiagnostics" -framework "FirebaseInstanceID" -framework "FirebaseMessaging" -framework "FirebaseNanoPB" -framework "StoreKit" -framework "SystemConfiguration" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT}/Pods diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf-dummy.m b/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf-dummy.m new file mode 100644 index 00000000..e0f0a337 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf-dummy.m @@ -0,0 +1,5 @@ +#import <Foundation/Foundation.h> +@interface PodsDummy_Protobuf : NSObject +@end +@implementation PodsDummy_Protobuf +@end diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf-prefix.pch b/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf-prefix.pch new file mode 100644 index 00000000..beb2a244 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import <UIKit/UIKit.h> +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf.xcconfig b/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf.xcconfig new file mode 100644 index 00000000..698e3f2a --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/Protobuf/Protobuf.xcconfig @@ -0,0 +1,9 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Protobuf +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Protobuf" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/FirebaseMessaging" "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/nanopb" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Protobuf +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb-dummy.m b/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb-dummy.m new file mode 100644 index 00000000..b3fa5956 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb-dummy.m @@ -0,0 +1,5 @@ +#import <Foundation/Foundation.h> +@interface PodsDummy_nanopb : NSObject +@end +@implementation PodsDummy_nanopb +@end diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb-prefix.pch b/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb-prefix.pch new file mode 100644 index 00000000..beb2a244 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import <UIKit/UIKit.h> +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb.xcconfig b/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb.xcconfig new file mode 100644 index 00000000..41e216e7 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/Target Support Files/nanopb/nanopb.xcconfig @@ -0,0 +1,9 @@ +CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/nanopb +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/nanopb" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/FirebaseMessaging" "${PODS_ROOT}/Headers/Public/GoogleToolboxForMac" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/nanopb" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/nanopb +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/StoneIsland/platforms/ios/Pods/nanopb/LICENSE.txt b/StoneIsland/platforms/ios/Pods/nanopb/LICENSE.txt new file mode 100644 index 00000000..d11c9af1 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2011 Petteri Aimonen <jpa at nanopb.mail.kapsi.fi> + +This software is provided 'as-is', without any express or +implied warranty. In no event will the authors be held liable +for any damages arising from the use of this software. + +Permission is granted to anyone to use this software for any +purpose, including commercial applications, and to alter it and +redistribute it freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you use + this software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and + must not be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source + distribution. diff --git a/StoneIsland/platforms/ios/Pods/nanopb/README.md b/StoneIsland/platforms/ios/Pods/nanopb/README.md new file mode 100644 index 00000000..07860f06 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/README.md @@ -0,0 +1,71 @@ +Nanopb - Protocol Buffers for Embedded Systems +============================================== + +[](https://travis-ci.org/nanopb/nanopb) + +Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is +especially suitable for use in microcontrollers, but fits any memory +restricted system. + +* **Homepage:** https://jpa.kapsi.fi/nanopb/ +* **Documentation:** https://jpa.kapsi.fi/nanopb/docs/ +* **Downloads:** https://jpa.kapsi.fi/nanopb/download/ +* **Forum:** https://groups.google.com/forum/#!forum/nanopb + + + +Using the nanopb library +------------------------ +To use the nanopb library, you need to do two things: + +1. Compile your .proto files for nanopb, using protoc. +2. Include pb_encode.c, pb_decode.c and pb_common.c in your project. + +The easiest way to get started is to study the project in "examples/simple". +It contains a Makefile, which should work directly under most Linux systems. +However, for any other kind of build system, see the manual steps in +README.txt in that folder. + + + +Using the Protocol Buffers compiler (protoc) +-------------------------------------------- +The nanopb generator is implemented as a plugin for the Google's own protoc +compiler. This has the advantage that there is no need to reimplement the +basic parsing of .proto files. However, it does mean that you need the +Google's protobuf library in order to run the generator. + +If you have downloaded a binary package for nanopb (either Windows, Linux or +Mac OS X version), the 'protoc' binary is included in the 'generator-bin' +folder. In this case, you are ready to go. Simply run this command: + + generator-bin/protoc --nanopb_out=. myprotocol.proto + +However, if you are using a git checkout or a plain source distribution, you +need to provide your own version of protoc and the Google's protobuf library. +On Linux, the necessary packages are protobuf-compiler and python-protobuf. +On Windows, you can either build Google's protobuf library from source or use +one of the binary distributions of it. In either case, if you use a separate +protoc, you need to manually give the path to nanopb generator: + + protoc --plugin=protoc-gen-nanopb=nanopb/generator/protoc-gen-nanopb ... + + + +Running the tests +----------------- +If you want to perform further development of the nanopb core, or to verify +its functionality using your compiler and platform, you'll want to run the +test suite. The build rules for the test suite are implemented using Scons, +so you need to have that installed. To run the tests: + + cd tests + scons + +This will show the progress of various test cases. If the output does not +end in an error, the test cases were successful. + +Note: Mac OS X by default aliases 'clang' as 'gcc', while not actually +supporting the same command line options as gcc does. To run tests on +Mac OS X, use: "scons CC=clang CXX=clang". Same way can be used to run +tests with different compilers on any platform. diff --git a/StoneIsland/platforms/ios/Pods/nanopb/pb.h b/StoneIsland/platforms/ios/Pods/nanopb/pb.h new file mode 100644 index 00000000..bf05a63c --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/pb.h @@ -0,0 +1,583 @@ +/* Common parts of the nanopb library. Most of these are quite low-level + * stuff. For the high-level interface, see pb_encode.h and pb_decode.h. + */ + +#ifndef PB_H_INCLUDED +#define PB_H_INCLUDED + +/***************************************************************** + * Nanopb compilation time options. You can change these here by * + * uncommenting the lines, or on the compiler command line. * + *****************************************************************/ + +/* Enable support for dynamically allocated fields */ +/* #define PB_ENABLE_MALLOC 1 */ + +/* Define this if your CPU / compiler combination does not support + * unaligned memory access to packed structures. */ +/* #define PB_NO_PACKED_STRUCTS 1 */ + +/* Increase the number of required fields that are tracked. + * A compiler warning will tell if you need this. */ +/* #define PB_MAX_REQUIRED_FIELDS 256 */ + +/* Add support for tag numbers > 255 and fields larger than 255 bytes. */ +/* #define PB_FIELD_16BIT 1 */ + +/* Add support for tag numbers > 65536 and fields larger than 65536 bytes. */ +/* #define PB_FIELD_32BIT 1 */ + +/* Disable support for error messages in order to save some code space. */ +/* #define PB_NO_ERRMSG 1 */ + +/* Disable support for custom streams (support only memory buffers). */ +/* #define PB_BUFFER_ONLY 1 */ + +/* Switch back to the old-style callback function signature. + * This was the default until nanopb-0.2.1. */ +/* #define PB_OLD_CALLBACK_STYLE */ + + +/****************************************************************** + * You usually don't need to change anything below this line. * + * Feel free to look around and use the defined macros, though. * + ******************************************************************/ + + +/* Version of the nanopb library. Just in case you want to check it in + * your own program. */ +#define NANOPB_VERSION nanopb-0.3.8 + +/* Include all the system headers needed by nanopb. You will need the + * definitions of the following: + * - strlen, memcpy, memset functions + * - [u]int_least8_t, uint_fast8_t, [u]int_least16_t, [u]int32_t, [u]int64_t + * - size_t + * - bool + * + * If you don't have the standard header files, you can instead provide + * a custom header that defines or includes all this. In that case, + * define PB_SYSTEM_HEADER to the path of this file. + */ +#ifdef PB_SYSTEM_HEADER +#include PB_SYSTEM_HEADER +#else +#include <stdint.h> +#include <stddef.h> +#include <stdbool.h> +#include <string.h> + +#ifdef PB_ENABLE_MALLOC +#include <stdlib.h> +#endif +#endif + +/* Macro for defining packed structures (compiler dependent). + * This just reduces memory requirements, but is not required. + */ +#if defined(PB_NO_PACKED_STRUCTS) + /* Disable struct packing */ +# define PB_PACKED_STRUCT_START +# define PB_PACKED_STRUCT_END +# define pb_packed +#elif defined(__GNUC__) || defined(__clang__) + /* For GCC and clang */ +# define PB_PACKED_STRUCT_START +# define PB_PACKED_STRUCT_END +# define pb_packed __attribute__((packed)) +#elif defined(__ICCARM__) || defined(__CC_ARM) + /* For IAR ARM and Keil MDK-ARM compilers */ +# define PB_PACKED_STRUCT_START _Pragma("pack(push, 1)") +# define PB_PACKED_STRUCT_END _Pragma("pack(pop)") +# define pb_packed +#elif defined(_MSC_VER) && (_MSC_VER >= 1500) + /* For Microsoft Visual C++ */ +# define PB_PACKED_STRUCT_START __pragma(pack(push, 1)) +# define PB_PACKED_STRUCT_END __pragma(pack(pop)) +# define pb_packed +#else + /* Unknown compiler */ +# define PB_PACKED_STRUCT_START +# define PB_PACKED_STRUCT_END +# define pb_packed +#endif + +/* Handly macro for suppressing unreferenced-parameter compiler warnings. */ +#ifndef PB_UNUSED +#define PB_UNUSED(x) (void)(x) +#endif + +/* Compile-time assertion, used for checking compatible compilation options. + * If this does not work properly on your compiler, use + * #define PB_NO_STATIC_ASSERT to disable it. + * + * But before doing that, check carefully the error message / place where it + * comes from to see if the error has a real cause. Unfortunately the error + * message is not always very clear to read, but you can see the reason better + * in the place where the PB_STATIC_ASSERT macro was called. + */ +#ifndef PB_NO_STATIC_ASSERT +#ifndef PB_STATIC_ASSERT +#define PB_STATIC_ASSERT(COND,MSG) typedef char PB_STATIC_ASSERT_MSG(MSG, __LINE__, __COUNTER__)[(COND)?1:-1]; +#define PB_STATIC_ASSERT_MSG(MSG, LINE, COUNTER) PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) +#define PB_STATIC_ASSERT_MSG_(MSG, LINE, COUNTER) pb_static_assertion_##MSG##LINE##COUNTER +#endif +#else +#define PB_STATIC_ASSERT(COND,MSG) +#endif + +/* Number of required fields to keep track of. */ +#ifndef PB_MAX_REQUIRED_FIELDS +#define PB_MAX_REQUIRED_FIELDS 64 +#endif + +#if PB_MAX_REQUIRED_FIELDS < 64 +#error You should not lower PB_MAX_REQUIRED_FIELDS from the default value (64). +#endif + +/* List of possible field types. These are used in the autogenerated code. + * Least-significant 4 bits tell the scalar type + * Most-significant 4 bits specify repeated/required/packed etc. + */ + +typedef uint_least8_t pb_type_t; + +/**** Field data types ****/ + +/* Numeric types */ +#define PB_LTYPE_VARINT 0x00 /* int32, int64, enum, bool */ +#define PB_LTYPE_UVARINT 0x01 /* uint32, uint64 */ +#define PB_LTYPE_SVARINT 0x02 /* sint32, sint64 */ +#define PB_LTYPE_FIXED32 0x03 /* fixed32, sfixed32, float */ +#define PB_LTYPE_FIXED64 0x04 /* fixed64, sfixed64, double */ + +/* Marker for last packable field type. */ +#define PB_LTYPE_LAST_PACKABLE 0x04 + +/* Byte array with pre-allocated buffer. + * data_size is the length of the allocated PB_BYTES_ARRAY structure. */ +#define PB_LTYPE_BYTES 0x05 + +/* String with pre-allocated buffer. + * data_size is the maximum length. */ +#define PB_LTYPE_STRING 0x06 + +/* Submessage + * submsg_fields is pointer to field descriptions */ +#define PB_LTYPE_SUBMESSAGE 0x07 + +/* Extension pseudo-field + * The field contains a pointer to pb_extension_t */ +#define PB_LTYPE_EXTENSION 0x08 + +/* Byte array with inline, pre-allocated byffer. + * data_size is the length of the inline, allocated buffer. + * This differs from PB_LTYPE_BYTES by defining the element as + * pb_byte_t[data_size] rather than pb_bytes_array_t. */ +#define PB_LTYPE_FIXED_LENGTH_BYTES 0x09 + +/* Number of declared LTYPES */ +#define PB_LTYPES_COUNT 0x0A +#define PB_LTYPE_MASK 0x0F + +/**** Field repetition rules ****/ + +#define PB_HTYPE_REQUIRED 0x00 +#define PB_HTYPE_OPTIONAL 0x10 +#define PB_HTYPE_REPEATED 0x20 +#define PB_HTYPE_ONEOF 0x30 +#define PB_HTYPE_MASK 0x30 + +/**** Field allocation types ****/ + +#define PB_ATYPE_STATIC 0x00 +#define PB_ATYPE_POINTER 0x80 +#define PB_ATYPE_CALLBACK 0x40 +#define PB_ATYPE_MASK 0xC0 + +#define PB_ATYPE(x) ((x) & PB_ATYPE_MASK) +#define PB_HTYPE(x) ((x) & PB_HTYPE_MASK) +#define PB_LTYPE(x) ((x) & PB_LTYPE_MASK) + +/* Data type used for storing sizes of struct fields + * and array counts. + */ +#if defined(PB_FIELD_32BIT) + typedef uint32_t pb_size_t; + typedef int32_t pb_ssize_t; +#elif defined(PB_FIELD_16BIT) + typedef uint_least16_t pb_size_t; + typedef int_least16_t pb_ssize_t; +#else + typedef uint_least8_t pb_size_t; + typedef int_least8_t pb_ssize_t; +#endif +#define PB_SIZE_MAX ((pb_size_t)-1) + +/* Data type for storing encoded data and other byte streams. + * This typedef exists to support platforms where uint8_t does not exist. + * You can regard it as equivalent on uint8_t on other platforms. + */ +typedef uint_least8_t pb_byte_t; + +/* This structure is used in auto-generated constants + * to specify struct fields. + * You can change field sizes if you need structures + * larger than 256 bytes or field tags larger than 256. + * The compiler should complain if your .proto has such + * structures. Fix that by defining PB_FIELD_16BIT or + * PB_FIELD_32BIT. + */ +PB_PACKED_STRUCT_START +typedef struct pb_field_s pb_field_t; +struct pb_field_s { + pb_size_t tag; + pb_type_t type; + pb_size_t data_offset; /* Offset of field data, relative to previous field. */ + pb_ssize_t size_offset; /* Offset of array size or has-boolean, relative to data */ + pb_size_t data_size; /* Data size in bytes for a single item */ + pb_size_t array_size; /* Maximum number of entries in array */ + + /* Field definitions for submessage + * OR default value for all other non-array, non-callback types + * If null, then field will zeroed. */ + const void *ptr; +} pb_packed; +PB_PACKED_STRUCT_END + +/* Make sure that the standard integer types are of the expected sizes. + * Otherwise fixed32/fixed64 fields can break. + * + * If you get errors here, it probably means that your stdint.h is not + * correct for your platform. + */ +PB_STATIC_ASSERT(sizeof(int64_t) == 2 * sizeof(int32_t), INT64_T_WRONG_SIZE) +PB_STATIC_ASSERT(sizeof(uint64_t) == 2 * sizeof(uint32_t), UINT64_T_WRONG_SIZE) + +/* This structure is used for 'bytes' arrays. + * It has the number of bytes in the beginning, and after that an array. + * Note that actual structs used will have a different length of bytes array. + */ +#define PB_BYTES_ARRAY_T(n) struct { pb_size_t size; pb_byte_t bytes[n]; } +#define PB_BYTES_ARRAY_T_ALLOCSIZE(n) ((size_t)n + offsetof(pb_bytes_array_t, bytes)) + +struct pb_bytes_array_s { + pb_size_t size; + pb_byte_t bytes[1]; +}; +typedef struct pb_bytes_array_s pb_bytes_array_t; + +/* This structure is used for giving the callback function. + * It is stored in the message structure and filled in by the method that + * calls pb_decode. + * + * The decoding callback will be given a limited-length stream + * If the wire type was string, the length is the length of the string. + * If the wire type was a varint/fixed32/fixed64, the length is the length + * of the actual value. + * The function may be called multiple times (especially for repeated types, + * but also otherwise if the message happens to contain the field multiple + * times.) + * + * The encoding callback will receive the actual output stream. + * It should write all the data in one call, including the field tag and + * wire type. It can write multiple fields. + * + * The callback can be null if you want to skip a field. + */ +typedef struct pb_istream_s pb_istream_t; +typedef struct pb_ostream_s pb_ostream_t; +typedef struct pb_callback_s pb_callback_t; +struct pb_callback_s { +#ifdef PB_OLD_CALLBACK_STYLE + /* Deprecated since nanopb-0.2.1 */ + union { + bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void *arg); + bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, const void *arg); + } funcs; +#else + /* New function signature, which allows modifying arg contents in callback. */ + union { + bool (*decode)(pb_istream_t *stream, const pb_field_t *field, void **arg); + bool (*encode)(pb_ostream_t *stream, const pb_field_t *field, void * const *arg); + } funcs; +#endif + + /* Free arg for use by callback */ + void *arg; +}; + +/* Wire types. Library user needs these only in encoder callbacks. */ +typedef enum { + PB_WT_VARINT = 0, + PB_WT_64BIT = 1, + PB_WT_STRING = 2, + PB_WT_32BIT = 5 +} pb_wire_type_t; + +/* Structure for defining the handling of unknown/extension fields. + * Usually the pb_extension_type_t structure is automatically generated, + * while the pb_extension_t structure is created by the user. However, + * if you want to catch all unknown fields, you can also create a custom + * pb_extension_type_t with your own callback. + */ +typedef struct pb_extension_type_s pb_extension_type_t; +typedef struct pb_extension_s pb_extension_t; +struct pb_extension_type_s { + /* Called for each unknown field in the message. + * If you handle the field, read off all of its data and return true. + * If you do not handle the field, do not read anything and return true. + * If you run into an error, return false. + * Set to NULL for default handler. + */ + bool (*decode)(pb_istream_t *stream, pb_extension_t *extension, + uint32_t tag, pb_wire_type_t wire_type); + + /* Called once after all regular fields have been encoded. + * If you have something to write, do so and return true. + * If you do not have anything to write, just return true. + * If you run into an error, return false. + * Set to NULL for default handler. + */ + bool (*encode)(pb_ostream_t *stream, const pb_extension_t *extension); + + /* Free field for use by the callback. */ + const void *arg; +}; + +struct pb_extension_s { + /* Type describing the extension field. Usually you'll initialize + * this to a pointer to the automatically generated structure. */ + const pb_extension_type_t *type; + + /* Destination for the decoded data. This must match the datatype + * of the extension field. */ + void *dest; + + /* Pointer to the next extension handler, or NULL. + * If this extension does not match a field, the next handler is + * automatically called. */ + pb_extension_t *next; + + /* The decoder sets this to true if the extension was found. + * Ignored for encoding. */ + bool found; +}; + +/* Memory allocation functions to use. You can define pb_realloc and + * pb_free to custom functions if you want. */ +#ifdef PB_ENABLE_MALLOC +# ifndef pb_realloc +# define pb_realloc(ptr, size) realloc(ptr, size) +# endif +# ifndef pb_free +# define pb_free(ptr) free(ptr) +# endif +#endif + +/* This is used to inform about need to regenerate .pb.h/.pb.c files. */ +#define PB_PROTO_HEADER_VERSION 30 + +/* These macros are used to declare pb_field_t's in the constant array. */ +/* Size of a structure member, in bytes. */ +#define pb_membersize(st, m) (sizeof ((st*)0)->m) +/* Number of entries in an array. */ +#define pb_arraysize(st, m) (pb_membersize(st, m) / pb_membersize(st, m[0])) +/* Delta from start of one member to the start of another member. */ +#define pb_delta(st, m1, m2) ((int)offsetof(st, m1) - (int)offsetof(st, m2)) +/* Marks the end of the field list */ +#define PB_LAST_FIELD {0,(pb_type_t) 0,0,0,0,0,0} + +/* Macros for filling in the data_offset field */ +/* data_offset for first field in a message */ +#define PB_DATAOFFSET_FIRST(st, m1, m2) (offsetof(st, m1)) +/* data_offset for subsequent fields */ +#define PB_DATAOFFSET_OTHER(st, m1, m2) (offsetof(st, m1) - offsetof(st, m2) - pb_membersize(st, m2)) +/* data offset for subsequent fields inside an union (oneof) */ +#define PB_DATAOFFSET_UNION(st, m1, m2) (PB_SIZE_MAX) +/* Choose first/other based on m1 == m2 (deprecated, remains for backwards compatibility) */ +#define PB_DATAOFFSET_CHOOSE(st, m1, m2) (int)(offsetof(st, m1) == offsetof(st, m2) \ + ? PB_DATAOFFSET_FIRST(st, m1, m2) \ + : PB_DATAOFFSET_OTHER(st, m1, m2)) + +/* Required fields are the simplest. They just have delta (padding) from + * previous field end, and the size of the field. Pointer is used for + * submessages and default values. + */ +#define PB_REQUIRED_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_REQUIRED | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +/* Optional fields add the delta to the has_ variable. */ +#define PB_OPTIONAL_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_OPTIONAL | ltype, \ + fd, \ + pb_delta(st, has_ ## m, m), \ + pb_membersize(st, m), 0, ptr} + +#define PB_SINGULAR_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +/* Repeated fields have a _count field and also the maximum number of entries. */ +#define PB_REPEATED_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_REPEATED | ltype, \ + fd, \ + pb_delta(st, m ## _count, m), \ + pb_membersize(st, m[0]), \ + pb_arraysize(st, m), ptr} + +/* Allocated fields carry the size of the actual data, not the pointer */ +#define PB_REQUIRED_POINTER(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_REQUIRED | ltype, \ + fd, 0, pb_membersize(st, m[0]), 0, ptr} + +/* Optional fields don't need a has_ variable, as information would be redundant */ +#define PB_OPTIONAL_POINTER(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m[0]), 0, ptr} + +/* Same as optional fields*/ +#define PB_SINGULAR_POINTER(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m[0]), 0, ptr} + +/* Repeated fields have a _count field and a pointer to array of pointers */ +#define PB_REPEATED_POINTER(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_REPEATED | ltype, \ + fd, pb_delta(st, m ## _count, m), \ + pb_membersize(st, m[0]), 0, ptr} + +/* Callbacks are much like required fields except with special datatype. */ +#define PB_REQUIRED_CALLBACK(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_CALLBACK | PB_HTYPE_REQUIRED | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +#define PB_OPTIONAL_CALLBACK(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_CALLBACK | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +#define PB_SINGULAR_CALLBACK(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_CALLBACK | PB_HTYPE_OPTIONAL | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +#define PB_REPEATED_CALLBACK(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_CALLBACK | PB_HTYPE_REPEATED | ltype, \ + fd, 0, pb_membersize(st, m), 0, ptr} + +/* Optional extensions don't have the has_ field, as that would be redundant. + * Furthermore, the combination of OPTIONAL without has_ field is used + * for indicating proto3 style fields. Extensions exist in proto2 mode only, + * so they should be encoded according to proto2 rules. To avoid the conflict, + * extensions are marked as REQUIRED instead. + */ +#define PB_OPTEXT_STATIC(tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_REQUIRED | ltype, \ + 0, \ + 0, \ + pb_membersize(st, m), 0, ptr} + +#define PB_OPTEXT_POINTER(tag, st, m, fd, ltype, ptr) \ + PB_OPTIONAL_POINTER(tag, st, m, fd, ltype, ptr) + +#define PB_OPTEXT_CALLBACK(tag, st, m, fd, ltype, ptr) \ + PB_OPTIONAL_CALLBACK(tag, st, m, fd, ltype, ptr) + +/* The mapping from protobuf types to LTYPEs is done using these macros. */ +#define PB_LTYPE_MAP_BOOL PB_LTYPE_VARINT +#define PB_LTYPE_MAP_BYTES PB_LTYPE_BYTES +#define PB_LTYPE_MAP_DOUBLE PB_LTYPE_FIXED64 +#define PB_LTYPE_MAP_ENUM PB_LTYPE_VARINT +#define PB_LTYPE_MAP_UENUM PB_LTYPE_UVARINT +#define PB_LTYPE_MAP_FIXED32 PB_LTYPE_FIXED32 +#define PB_LTYPE_MAP_FIXED64 PB_LTYPE_FIXED64 +#define PB_LTYPE_MAP_FLOAT PB_LTYPE_FIXED32 +#define PB_LTYPE_MAP_INT32 PB_LTYPE_VARINT +#define PB_LTYPE_MAP_INT64 PB_LTYPE_VARINT +#define PB_LTYPE_MAP_MESSAGE PB_LTYPE_SUBMESSAGE +#define PB_LTYPE_MAP_SFIXED32 PB_LTYPE_FIXED32 +#define PB_LTYPE_MAP_SFIXED64 PB_LTYPE_FIXED64 +#define PB_LTYPE_MAP_SINT32 PB_LTYPE_SVARINT +#define PB_LTYPE_MAP_SINT64 PB_LTYPE_SVARINT +#define PB_LTYPE_MAP_STRING PB_LTYPE_STRING +#define PB_LTYPE_MAP_UINT32 PB_LTYPE_UVARINT +#define PB_LTYPE_MAP_UINT64 PB_LTYPE_UVARINT +#define PB_LTYPE_MAP_EXTENSION PB_LTYPE_EXTENSION +#define PB_LTYPE_MAP_FIXED_LENGTH_BYTES PB_LTYPE_FIXED_LENGTH_BYTES + +/* This is the actual macro used in field descriptions. + * It takes these arguments: + * - Field tag number + * - Field type: BOOL, BYTES, DOUBLE, ENUM, UENUM, FIXED32, FIXED64, + * FLOAT, INT32, INT64, MESSAGE, SFIXED32, SFIXED64 + * SINT32, SINT64, STRING, UINT32, UINT64 or EXTENSION + * - Field rules: REQUIRED, OPTIONAL or REPEATED + * - Allocation: STATIC, CALLBACK or POINTER + * - Placement: FIRST or OTHER, depending on if this is the first field in structure. + * - Message name + * - Field name + * - Previous field name (or field name again for first field) + * - Pointer to default value or submsg fields. + */ + +#define PB_FIELD(tag, type, rules, allocation, placement, message, field, prevfield, ptr) \ + PB_ ## rules ## _ ## allocation(tag, message, field, \ + PB_DATAOFFSET_ ## placement(message, field, prevfield), \ + PB_LTYPE_MAP_ ## type, ptr) + +/* Field description for oneof fields. This requires taking into account the + * union name also, that's why a separate set of macros is needed. + */ +#define PB_ONEOF_STATIC(u, tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_ONEOF | ltype, \ + fd, pb_delta(st, which_ ## u, u.m), \ + pb_membersize(st, u.m), 0, ptr} + +#define PB_ONEOF_POINTER(u, tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_ONEOF | ltype, \ + fd, pb_delta(st, which_ ## u, u.m), \ + pb_membersize(st, u.m[0]), 0, ptr} + +#define PB_ONEOF_FIELD(union_name, tag, type, rules, allocation, placement, message, field, prevfield, ptr) \ + PB_ONEOF_ ## allocation(union_name, tag, message, field, \ + PB_DATAOFFSET_ ## placement(message, union_name.field, prevfield), \ + PB_LTYPE_MAP_ ## type, ptr) + +#define PB_ANONYMOUS_ONEOF_STATIC(u, tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_STATIC | PB_HTYPE_ONEOF | ltype, \ + fd, pb_delta(st, which_ ## u, m), \ + pb_membersize(st, m), 0, ptr} + +#define PB_ANONYMOUS_ONEOF_POINTER(u, tag, st, m, fd, ltype, ptr) \ + {tag, PB_ATYPE_POINTER | PB_HTYPE_ONEOF | ltype, \ + fd, pb_delta(st, which_ ## u, m), \ + pb_membersize(st, m[0]), 0, ptr} + +#define PB_ANONYMOUS_ONEOF_FIELD(union_name, tag, type, rules, allocation, placement, message, field, prevfield, ptr) \ + PB_ANONYMOUS_ONEOF_ ## allocation(union_name, tag, message, field, \ + PB_DATAOFFSET_ ## placement(message, field, prevfield), \ + PB_LTYPE_MAP_ ## type, ptr) + +/* These macros are used for giving out error messages. + * They are mostly a debugging aid; the main error information + * is the true/false return value from functions. + * Some code space can be saved by disabling the error + * messages if not used. + * + * PB_SET_ERROR() sets the error message if none has been set yet. + * msg must be a constant string literal. + * PB_GET_ERROR() always returns a pointer to a string. + * PB_RETURN_ERROR() sets the error and returns false from current + * function. + */ +#ifdef PB_NO_ERRMSG +#define PB_SET_ERROR(stream, msg) PB_UNUSED(stream) +#define PB_GET_ERROR(stream) "(errmsg disabled)" +#else +#define PB_SET_ERROR(stream, msg) (stream->errmsg = (stream)->errmsg ? (stream)->errmsg : (msg)) +#define PB_GET_ERROR(stream) ((stream)->errmsg ? (stream)->errmsg : "(none)") +#endif + +#define PB_RETURN_ERROR(stream, msg) return PB_SET_ERROR(stream, msg), false + +#endif diff --git a/StoneIsland/platforms/ios/Pods/nanopb/pb_common.c b/StoneIsland/platforms/ios/Pods/nanopb/pb_common.c new file mode 100644 index 00000000..4fb7186b --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/pb_common.c @@ -0,0 +1,97 @@ +/* pb_common.c: Common support functions for pb_encode.c and pb_decode.c. + * + * 2014 Petteri Aimonen <jpa@kapsi.fi> + */ + +#include "pb_common.h" + +bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_field_t *fields, void *dest_struct) +{ + iter->start = fields; + iter->pos = fields; + iter->required_field_index = 0; + iter->dest_struct = dest_struct; + iter->pData = (char*)dest_struct + iter->pos->data_offset; + iter->pSize = (char*)iter->pData + iter->pos->size_offset; + + return (iter->pos->tag != 0); +} + +bool pb_field_iter_next(pb_field_iter_t *iter) +{ + const pb_field_t *prev_field = iter->pos; + + if (prev_field->tag == 0) + { + /* Handle empty message types, where the first field is already the terminator. + * In other cases, the iter->pos never points to the terminator. */ + return false; + } + + iter->pos++; + + if (iter->pos->tag == 0) + { + /* Wrapped back to beginning, reinitialize */ + (void)pb_field_iter_begin(iter, iter->start, iter->dest_struct); + return false; + } + else + { + /* Increment the pointers based on previous field size */ + size_t prev_size = prev_field->data_size; + + if (PB_HTYPE(prev_field->type) == PB_HTYPE_ONEOF && + PB_HTYPE(iter->pos->type) == PB_HTYPE_ONEOF && + iter->pos->data_offset == PB_SIZE_MAX) + { + /* Don't advance pointers inside unions */ + return true; + } + else if (PB_ATYPE(prev_field->type) == PB_ATYPE_STATIC && + PB_HTYPE(prev_field->type) == PB_HTYPE_REPEATED) + { + /* In static arrays, the data_size tells the size of a single entry and + * array_size is the number of entries */ + prev_size *= prev_field->array_size; + } + else if (PB_ATYPE(prev_field->type) == PB_ATYPE_POINTER) + { + /* Pointer fields always have a constant size in the main structure. + * The data_size only applies to the dynamically allocated area. */ + prev_size = sizeof(void*); + } + + if (PB_HTYPE(prev_field->type) == PB_HTYPE_REQUIRED) + { + /* Count the required fields, in order to check their presence in the + * decoder. */ + iter->required_field_index++; + } + + iter->pData = (char*)iter->pData + prev_size + iter->pos->data_offset; + iter->pSize = (char*)iter->pData + iter->pos->size_offset; + return true; + } +} + +bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag) +{ + const pb_field_t *start = iter->pos; + + do { + if (iter->pos->tag == tag && + PB_LTYPE(iter->pos->type) != PB_LTYPE_EXTENSION) + { + /* Found the wanted field */ + return true; + } + + (void)pb_field_iter_next(iter); + } while (iter->pos != start); + + /* Searched all the way back to start, and found nothing. */ + return false; +} + + diff --git a/StoneIsland/platforms/ios/Pods/nanopb/pb_common.h b/StoneIsland/platforms/ios/Pods/nanopb/pb_common.h new file mode 100644 index 00000000..60b3d374 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/pb_common.h @@ -0,0 +1,42 @@ +/* pb_common.h: Common support functions for pb_encode.c and pb_decode.c. + * These functions are rarely needed by applications directly. + */ + +#ifndef PB_COMMON_H_INCLUDED +#define PB_COMMON_H_INCLUDED + +#include "pb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Iterator for pb_field_t list */ +struct pb_field_iter_s { + const pb_field_t *start; /* Start of the pb_field_t array */ + const pb_field_t *pos; /* Current position of the iterator */ + unsigned required_field_index; /* Zero-based index that counts only the required fields */ + void *dest_struct; /* Pointer to start of the structure */ + void *pData; /* Pointer to current field value */ + void *pSize; /* Pointer to count/has field */ +}; +typedef struct pb_field_iter_s pb_field_iter_t; + +/* Initialize the field iterator structure to beginning. + * Returns false if the message type is empty. */ +bool pb_field_iter_begin(pb_field_iter_t *iter, const pb_field_t *fields, void *dest_struct); + +/* Advance the iterator to the next field. + * Returns false when the iterator wraps back to the first field. */ +bool pb_field_iter_next(pb_field_iter_t *iter); + +/* Advance the iterator until it points at a field with the given tag. + * Returns false if no such field exists. */ +bool pb_field_iter_find(pb_field_iter_t *iter, uint32_t tag); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif + diff --git a/StoneIsland/platforms/ios/Pods/nanopb/pb_decode.c b/StoneIsland/platforms/ios/Pods/nanopb/pb_decode.c new file mode 100644 index 00000000..e2e90caa --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/pb_decode.c @@ -0,0 +1,1379 @@ +/* pb_decode.c -- decode a protobuf using minimal resources + * + * 2011 Petteri Aimonen <jpa@kapsi.fi> + */ + +/* Use the GCC warn_unused_result attribute to check that all return values + * are propagated correctly. On other compilers and gcc before 3.4.0 just + * ignore the annotation. + */ +#if !defined(__GNUC__) || ( __GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) + #define checkreturn +#else + #define checkreturn __attribute__((warn_unused_result)) +#endif + +#include "pb.h" +#include "pb_decode.h" +#include "pb_common.h" + +/************************************** + * Declarations internal to this file * + **************************************/ + +typedef bool (*pb_decoder_t)(pb_istream_t *stream, const pb_field_t *field, void *dest) checkreturn; + +static bool checkreturn buf_read(pb_istream_t *stream, pb_byte_t *buf, size_t count); +static bool checkreturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size); +static bool checkreturn decode_static_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter); +static bool checkreturn decode_callback_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter); +static bool checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter); +static void iter_from_extension(pb_field_iter_t *iter, pb_extension_t *extension); +static bool checkreturn default_extension_decoder(pb_istream_t *stream, pb_extension_t *extension, uint32_t tag, pb_wire_type_t wire_type); +static bool checkreturn decode_extension(pb_istream_t *stream, uint32_t tag, pb_wire_type_t wire_type, pb_field_iter_t *iter); +static bool checkreturn find_extension_field(pb_field_iter_t *iter); +static void pb_field_set_to_default(pb_field_iter_t *iter); +static void pb_message_set_to_defaults(const pb_field_t fields[], void *dest_struct); +static bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_uvarint(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_svarint(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_fixed32(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_fixed64(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_bytes(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_string(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_submessage(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_dec_fixed_length_bytes(pb_istream_t *stream, const pb_field_t *field, void *dest); +static bool checkreturn pb_skip_varint(pb_istream_t *stream); +static bool checkreturn pb_skip_string(pb_istream_t *stream); + +#ifdef PB_ENABLE_MALLOC +static bool checkreturn allocate_field(pb_istream_t *stream, void *pData, size_t data_size, size_t array_size); +static bool checkreturn pb_release_union_field(pb_istream_t *stream, pb_field_iter_t *iter); +static void pb_release_single_field(const pb_field_iter_t *iter); +#endif + +/* --- Function pointers to field decoders --- + * Order in the array must match pb_action_t LTYPE numbering. + */ +static const pb_decoder_t PB_DECODERS[PB_LTYPES_COUNT] = { + &pb_dec_varint, + &pb_dec_uvarint, + &pb_dec_svarint, + &pb_dec_fixed32, + &pb_dec_fixed64, + + &pb_dec_bytes, + &pb_dec_string, + &pb_dec_submessage, + NULL, /* extensions */ + &pb_dec_fixed_length_bytes +}; + +/******************************* + * pb_istream_t implementation * + *******************************/ + +static bool checkreturn buf_read(pb_istream_t *stream, pb_byte_t *buf, size_t count) +{ + size_t i; + const pb_byte_t *source = (const pb_byte_t*)stream->state; + stream->state = (pb_byte_t*)stream->state + count; + + if (buf != NULL) + { + for (i = 0; i < count; i++) + buf[i] = source[i]; + } + + return true; +} + +bool checkreturn pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count) +{ +#ifndef PB_BUFFER_ONLY + if (buf == NULL && stream->callback != buf_read) + { + /* Skip input bytes */ + pb_byte_t tmp[16]; + while (count > 16) + { + if (!pb_read(stream, tmp, 16)) + return false; + + count -= 16; + } + + return pb_read(stream, tmp, count); + } +#endif + + if (stream->bytes_left < count) + PB_RETURN_ERROR(stream, "end-of-stream"); + +#ifndef PB_BUFFER_ONLY + if (!stream->callback(stream, buf, count)) + PB_RETURN_ERROR(stream, "io error"); +#else + if (!buf_read(stream, buf, count)) + return false; +#endif + + stream->bytes_left -= count; + return true; +} + +/* Read a single byte from input stream. buf may not be NULL. + * This is an optimization for the varint decoding. */ +static bool checkreturn pb_readbyte(pb_istream_t *stream, pb_byte_t *buf) +{ + if (stream->bytes_left == 0) + PB_RETURN_ERROR(stream, "end-of-stream"); + +#ifndef PB_BUFFER_ONLY + if (!stream->callback(stream, buf, 1)) + PB_RETURN_ERROR(stream, "io error"); +#else + *buf = *(const pb_byte_t*)stream->state; + stream->state = (pb_byte_t*)stream->state + 1; +#endif + + stream->bytes_left--; + + return true; +} + +pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t bufsize) +{ + pb_istream_t stream; + /* Cast away the const from buf without a compiler error. We are + * careful to use it only in a const manner in the callbacks. + */ + union { + void *state; + const void *c_state; + } state; +#ifdef PB_BUFFER_ONLY + stream.callback = NULL; +#else + stream.callback = &buf_read; +#endif + state.c_state = buf; + stream.state = state.state; + stream.bytes_left = bufsize; +#ifndef PB_NO_ERRMSG + stream.errmsg = NULL; +#endif + return stream; +} + +/******************** + * Helper functions * + ********************/ + +bool checkreturn pb_decode_varint32(pb_istream_t *stream, uint32_t *dest) +{ + pb_byte_t byte; + uint32_t result; + + if (!pb_readbyte(stream, &byte)) + return false; + + if ((byte & 0x80) == 0) + { + /* Quick case, 1 byte value */ + result = byte; + } + else + { + /* Multibyte case */ + uint_fast8_t bitpos = 7; + result = byte & 0x7F; + + do + { + if (bitpos >= 32) + PB_RETURN_ERROR(stream, "varint overflow"); + + if (!pb_readbyte(stream, &byte)) + return false; + + result |= (uint32_t)(byte & 0x7F) << bitpos; + bitpos = (uint_fast8_t)(bitpos + 7); + } while (byte & 0x80); + } + + *dest = result; + return true; +} + +bool checkreturn pb_decode_varint(pb_istream_t *stream, uint64_t *dest) +{ + pb_byte_t byte; + uint_fast8_t bitpos = 0; + uint64_t result = 0; + + do + { + if (bitpos >= 64) + PB_RETURN_ERROR(stream, "varint overflow"); + + if (!pb_readbyte(stream, &byte)) + return false; + + result |= (uint64_t)(byte & 0x7F) << bitpos; + bitpos = (uint_fast8_t)(bitpos + 7); + } while (byte & 0x80); + + *dest = result; + return true; +} + +bool checkreturn pb_skip_varint(pb_istream_t *stream) +{ + pb_byte_t byte; + do + { + if (!pb_read(stream, &byte, 1)) + return false; + } while (byte & 0x80); + return true; +} + +bool checkreturn pb_skip_string(pb_istream_t *stream) +{ + uint32_t length; + if (!pb_decode_varint32(stream, &length)) + return false; + + return pb_read(stream, NULL, length); +} + +bool checkreturn pb_decode_tag(pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof) +{ + uint32_t temp; + *eof = false; + *wire_type = (pb_wire_type_t) 0; + *tag = 0; + + if (!pb_decode_varint32(stream, &temp)) + { + if (stream->bytes_left == 0) + *eof = true; + + return false; + } + + if (temp == 0) + { + *eof = true; /* Special feature: allow 0-terminated messages. */ + return false; + } + + *tag = temp >> 3; + *wire_type = (pb_wire_type_t)(temp & 7); + return true; +} + +bool checkreturn pb_skip_field(pb_istream_t *stream, pb_wire_type_t wire_type) +{ + switch (wire_type) + { + case PB_WT_VARINT: return pb_skip_varint(stream); + case PB_WT_64BIT: return pb_read(stream, NULL, 8); + case PB_WT_STRING: return pb_skip_string(stream); + case PB_WT_32BIT: return pb_read(stream, NULL, 4); + default: PB_RETURN_ERROR(stream, "invalid wire_type"); + } +} + +/* Read a raw value to buffer, for the purpose of passing it to callback as + * a substream. Size is maximum size on call, and actual size on return. + */ +static bool checkreturn read_raw_value(pb_istream_t *stream, pb_wire_type_t wire_type, pb_byte_t *buf, size_t *size) +{ + size_t max_size = *size; + switch (wire_type) + { + case PB_WT_VARINT: + *size = 0; + do + { + (*size)++; + if (*size > max_size) return false; + if (!pb_read(stream, buf, 1)) return false; + } while (*buf++ & 0x80); + return true; + + case PB_WT_64BIT: + *size = 8; + return pb_read(stream, buf, 8); + + case PB_WT_32BIT: + *size = 4; + return pb_read(stream, buf, 4); + + default: PB_RETURN_ERROR(stream, "invalid wire_type"); + } +} + +/* Decode string length from stream and return a substream with limited length. + * Remember to close the substream using pb_close_string_substream(). + */ +bool checkreturn pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream) +{ + uint32_t size; + if (!pb_decode_varint32(stream, &size)) + return false; + + *substream = *stream; + if (substream->bytes_left < size) + PB_RETURN_ERROR(stream, "parent stream too short"); + + substream->bytes_left = size; + stream->bytes_left -= size; + return true; +} + +bool checkreturn pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream) +{ + if (substream->bytes_left) { + if (!pb_read(substream, NULL, substream->bytes_left)) + return false; + } + + stream->state = substream->state; + +#ifndef PB_NO_ERRMSG + stream->errmsg = substream->errmsg; +#endif + return true; +} + +/************************* + * Decode a single field * + *************************/ + +static bool checkreturn decode_static_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ + pb_type_t type; + pb_decoder_t func; + + type = iter->pos->type; + func = PB_DECODERS[PB_LTYPE(type)]; + + switch (PB_HTYPE(type)) + { + case PB_HTYPE_REQUIRED: + return func(stream, iter->pos, iter->pData); + + case PB_HTYPE_OPTIONAL: + if (iter->pSize != iter->pData) + *(bool*)iter->pSize = true; + return func(stream, iter->pos, iter->pData); + + case PB_HTYPE_REPEATED: + if (wire_type == PB_WT_STRING + && PB_LTYPE(type) <= PB_LTYPE_LAST_PACKABLE) + { + /* Packed array */ + bool status = true; + pb_size_t *size = (pb_size_t*)iter->pSize; + pb_istream_t substream; + if (!pb_make_string_substream(stream, &substream)) + return false; + + while (substream.bytes_left > 0 && *size < iter->pos->array_size) + { + void *pItem = (char*)iter->pData + iter->pos->data_size * (*size); + if (!func(&substream, iter->pos, pItem)) + { + status = false; + break; + } + (*size)++; + } + + if (substream.bytes_left != 0) + PB_RETURN_ERROR(stream, "array overflow"); + if (!pb_close_string_substream(stream, &substream)) + return false; + + return status; + } + else + { + /* Repeated field */ + pb_size_t *size = (pb_size_t*)iter->pSize; + void *pItem = (char*)iter->pData + iter->pos->data_size * (*size); + if (*size >= iter->pos->array_size) + PB_RETURN_ERROR(stream, "array overflow"); + + (*size)++; + return func(stream, iter->pos, pItem); + } + + case PB_HTYPE_ONEOF: + *(pb_size_t*)iter->pSize = iter->pos->tag; + if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE) + { + /* We memset to zero so that any callbacks are set to NULL. + * Then set any default values. */ + memset(iter->pData, 0, iter->pos->data_size); + pb_message_set_to_defaults((const pb_field_t*)iter->pos->ptr, iter->pData); + } + return func(stream, iter->pos, iter->pData); + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } +} + +#ifdef PB_ENABLE_MALLOC +/* Allocate storage for the field and store the pointer at iter->pData. + * array_size is the number of entries to reserve in an array. + * Zero size is not allowed, use pb_free() for releasing. + */ +static bool checkreturn allocate_field(pb_istream_t *stream, void *pData, size_t data_size, size_t array_size) +{ + void *ptr = *(void**)pData; + + if (data_size == 0 || array_size == 0) + PB_RETURN_ERROR(stream, "invalid size"); + + /* Check for multiplication overflows. + * This code avoids the costly division if the sizes are small enough. + * Multiplication is safe as long as only half of bits are set + * in either multiplicand. + */ + { + const size_t check_limit = (size_t)1 << (sizeof(size_t) * 4); + if (data_size >= check_limit || array_size >= check_limit) + { + const size_t size_max = (size_t)-1; + if (size_max / array_size < data_size) + { + PB_RETURN_ERROR(stream, "size too large"); + } + } + } + + /* Allocate new or expand previous allocation */ + /* Note: on failure the old pointer will remain in the structure, + * the message must be freed by caller also on error return. */ + ptr = pb_realloc(ptr, array_size * data_size); + if (ptr == NULL) + PB_RETURN_ERROR(stream, "realloc failed"); + + *(void**)pData = ptr; + return true; +} + +/* Clear a newly allocated item in case it contains a pointer, or is a submessage. */ +static void initialize_pointer_field(void *pItem, pb_field_iter_t *iter) +{ + if (PB_LTYPE(iter->pos->type) == PB_LTYPE_STRING || + PB_LTYPE(iter->pos->type) == PB_LTYPE_BYTES) + { + *(void**)pItem = NULL; + } + else if (PB_LTYPE(iter->pos->type) == PB_LTYPE_SUBMESSAGE) + { + pb_message_set_to_defaults((const pb_field_t *) iter->pos->ptr, pItem); + } +} +#endif + +static bool checkreturn decode_pointer_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ +#ifndef PB_ENABLE_MALLOC + PB_UNUSED(wire_type); + PB_UNUSED(iter); + PB_RETURN_ERROR(stream, "no malloc support"); +#else + pb_type_t type; + pb_decoder_t func; + + type = iter->pos->type; + func = PB_DECODERS[PB_LTYPE(type)]; + + switch (PB_HTYPE(type)) + { + case PB_HTYPE_REQUIRED: + case PB_HTYPE_OPTIONAL: + case PB_HTYPE_ONEOF: + if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE && + *(void**)iter->pData != NULL) + { + /* Duplicate field, have to release the old allocation first. */ + pb_release_single_field(iter); + } + + if (PB_HTYPE(type) == PB_HTYPE_ONEOF) + { + *(pb_size_t*)iter->pSize = iter->pos->tag; + } + + if (PB_LTYPE(type) == PB_LTYPE_STRING || + PB_LTYPE(type) == PB_LTYPE_BYTES) + { + return func(stream, iter->pos, iter->pData); + } + else + { + if (!allocate_field(stream, iter->pData, iter->pos->data_size, 1)) + return false; + + initialize_pointer_field(*(void**)iter->pData, iter); + return func(stream, iter->pos, *(void**)iter->pData); + } + + case PB_HTYPE_REPEATED: + if (wire_type == PB_WT_STRING + && PB_LTYPE(type) <= PB_LTYPE_LAST_PACKABLE) + { + /* Packed array, multiple items come in at once. */ + bool status = true; + pb_size_t *size = (pb_size_t*)iter->pSize; + size_t allocated_size = *size; + void *pItem; + pb_istream_t substream; + + if (!pb_make_string_substream(stream, &substream)) + return false; + + while (substream.bytes_left) + { + if ((size_t)*size + 1 > allocated_size) + { + /* Allocate more storage. This tries to guess the + * number of remaining entries. Round the division + * upwards. */ + allocated_size += (substream.bytes_left - 1) / iter->pos->data_size + 1; + + if (!allocate_field(&substream, iter->pData, iter->pos->data_size, allocated_size)) + { + status = false; + break; + } + } + + /* Decode the array entry */ + pItem = *(char**)iter->pData + iter->pos->data_size * (*size); + initialize_pointer_field(pItem, iter); + if (!func(&substream, iter->pos, pItem)) + { + status = false; + break; + } + + if (*size == PB_SIZE_MAX) + { +#ifndef PB_NO_ERRMSG + stream->errmsg = "too many array entries"; +#endif + status = false; + break; + } + + (*size)++; + } + if (!pb_close_string_substream(stream, &substream)) + return false; + + return status; + } + else + { + /* Normal repeated field, i.e. only one item at a time. */ + pb_size_t *size = (pb_size_t*)iter->pSize; + void *pItem; + + if (*size == PB_SIZE_MAX) + PB_RETURN_ERROR(stream, "too many array entries"); + + (*size)++; + if (!allocate_field(stream, iter->pData, iter->pos->data_size, *size)) + return false; + + pItem = *(char**)iter->pData + iter->pos->data_size * (*size - 1); + initialize_pointer_field(pItem, iter); + return func(stream, iter->pos, pItem); + } + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } +#endif +} + +static bool checkreturn decode_callback_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ + pb_callback_t *pCallback = (pb_callback_t*)iter->pData; + +#ifdef PB_OLD_CALLBACK_STYLE + void *arg = pCallback->arg; +#else + void **arg = &(pCallback->arg); +#endif + + if (pCallback->funcs.decode == NULL) + return pb_skip_field(stream, wire_type); + + if (wire_type == PB_WT_STRING) + { + pb_istream_t substream; + + if (!pb_make_string_substream(stream, &substream)) + return false; + + do + { + if (!pCallback->funcs.decode(&substream, iter->pos, arg)) + PB_RETURN_ERROR(stream, "callback failed"); + } while (substream.bytes_left); + + if (!pb_close_string_substream(stream, &substream)) + return false; + + return true; + } + else + { + /* Copy the single scalar value to stack. + * This is required so that we can limit the stream length, + * which in turn allows to use same callback for packed and + * not-packed fields. */ + pb_istream_t substream; + pb_byte_t buffer[10]; + size_t size = sizeof(buffer); + + if (!read_raw_value(stream, wire_type, buffer, &size)) + return false; + substream = pb_istream_from_buffer(buffer, size); + + return pCallback->funcs.decode(&substream, iter->pos, arg); + } +} + +static bool checkreturn decode_field(pb_istream_t *stream, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ +#ifdef PB_ENABLE_MALLOC + /* When decoding an oneof field, check if there is old data that must be + * released first. */ + if (PB_HTYPE(iter->pos->type) == PB_HTYPE_ONEOF) + { + if (!pb_release_union_field(stream, iter)) + return false; + } +#endif + + switch (PB_ATYPE(iter->pos->type)) + { + case PB_ATYPE_STATIC: + return decode_static_field(stream, wire_type, iter); + + case PB_ATYPE_POINTER: + return decode_pointer_field(stream, wire_type, iter); + + case PB_ATYPE_CALLBACK: + return decode_callback_field(stream, wire_type, iter); + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } +} + +static void iter_from_extension(pb_field_iter_t *iter, pb_extension_t *extension) +{ + /* Fake a field iterator for the extension field. + * It is not actually safe to advance this iterator, but decode_field + * will not even try to. */ + const pb_field_t *field = (const pb_field_t*)extension->type->arg; + (void)pb_field_iter_begin(iter, field, extension->dest); + iter->pData = extension->dest; + iter->pSize = &extension->found; + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { + /* For pointer extensions, the pointer is stored directly + * in the extension structure. This avoids having an extra + * indirection. */ + iter->pData = &extension->dest; + } +} + +/* Default handler for extension fields. Expects a pb_field_t structure + * in extension->type->arg. */ +static bool checkreturn default_extension_decoder(pb_istream_t *stream, + pb_extension_t *extension, uint32_t tag, pb_wire_type_t wire_type) +{ + const pb_field_t *field = (const pb_field_t*)extension->type->arg; + pb_field_iter_t iter; + + if (field->tag != tag) + return true; + + iter_from_extension(&iter, extension); + extension->found = true; + return decode_field(stream, wire_type, &iter); +} + +/* Try to decode an unknown field as an extension field. Tries each extension + * decoder in turn, until one of them handles the field or loop ends. */ +static bool checkreturn decode_extension(pb_istream_t *stream, + uint32_t tag, pb_wire_type_t wire_type, pb_field_iter_t *iter) +{ + pb_extension_t *extension = *(pb_extension_t* const *)iter->pData; + size_t pos = stream->bytes_left; + + while (extension != NULL && pos == stream->bytes_left) + { + bool status; + if (extension->type->decode) + status = extension->type->decode(stream, extension, tag, wire_type); + else + status = default_extension_decoder(stream, extension, tag, wire_type); + + if (!status) + return false; + + extension = extension->next; + } + + return true; +} + +/* Step through the iterator until an extension field is found or until all + * entries have been checked. There can be only one extension field per + * message. Returns false if no extension field is found. */ +static bool checkreturn find_extension_field(pb_field_iter_t *iter) +{ + const pb_field_t *start = iter->pos; + + do { + if (PB_LTYPE(iter->pos->type) == PB_LTYPE_EXTENSION) + return true; + (void)pb_field_iter_next(iter); + } while (iter->pos != start); + + return false; +} + +/* Initialize message fields to default values, recursively */ +static void pb_field_set_to_default(pb_field_iter_t *iter) +{ + pb_type_t type; + type = iter->pos->type; + + if (PB_LTYPE(type) == PB_LTYPE_EXTENSION) + { + pb_extension_t *ext = *(pb_extension_t* const *)iter->pData; + while (ext != NULL) + { + pb_field_iter_t ext_iter; + ext->found = false; + iter_from_extension(&ext_iter, ext); + pb_field_set_to_default(&ext_iter); + ext = ext->next; + } + } + else if (PB_ATYPE(type) == PB_ATYPE_STATIC) + { + bool init_data = true; + if (PB_HTYPE(type) == PB_HTYPE_OPTIONAL && iter->pSize != iter->pData) + { + /* Set has_field to false. Still initialize the optional field + * itself also. */ + *(bool*)iter->pSize = false; + } + else if (PB_HTYPE(type) == PB_HTYPE_REPEATED || + PB_HTYPE(type) == PB_HTYPE_ONEOF) + { + /* REPEATED: Set array count to 0, no need to initialize contents. + ONEOF: Set which_field to 0. */ + *(pb_size_t*)iter->pSize = 0; + init_data = false; + } + + if (init_data) + { + if (PB_LTYPE(iter->pos->type) == PB_LTYPE_SUBMESSAGE) + { + /* Initialize submessage to defaults */ + pb_message_set_to_defaults((const pb_field_t *) iter->pos->ptr, iter->pData); + } + else if (iter->pos->ptr != NULL) + { + /* Initialize to default value */ + memcpy(iter->pData, iter->pos->ptr, iter->pos->data_size); + } + else + { + /* Initialize to zeros */ + memset(iter->pData, 0, iter->pos->data_size); + } + } + } + else if (PB_ATYPE(type) == PB_ATYPE_POINTER) + { + /* Initialize the pointer to NULL. */ + *(void**)iter->pData = NULL; + + /* Initialize array count to 0. */ + if (PB_HTYPE(type) == PB_HTYPE_REPEATED || + PB_HTYPE(type) == PB_HTYPE_ONEOF) + { + *(pb_size_t*)iter->pSize = 0; + } + } + else if (PB_ATYPE(type) == PB_ATYPE_CALLBACK) + { + /* Don't overwrite callback */ + } +} + +static void pb_message_set_to_defaults(const pb_field_t fields[], void *dest_struct) +{ + pb_field_iter_t iter; + + if (!pb_field_iter_begin(&iter, fields, dest_struct)) + return; /* Empty message type */ + + do + { + pb_field_set_to_default(&iter); + } while (pb_field_iter_next(&iter)); +} + +/********************* + * Decode all fields * + *********************/ + +bool checkreturn pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct) +{ + uint32_t fields_seen[(PB_MAX_REQUIRED_FIELDS + 31) / 32] = {0, 0}; + const uint32_t allbits = ~(uint32_t)0; + uint32_t extension_range_start = 0; + pb_field_iter_t iter; + + /* Return value ignored, as empty message types will be correctly handled by + * pb_field_iter_find() anyway. */ + (void)pb_field_iter_begin(&iter, fields, dest_struct); + + while (stream->bytes_left) + { + uint32_t tag; + pb_wire_type_t wire_type; + bool eof; + + if (!pb_decode_tag(stream, &wire_type, &tag, &eof)) + { + if (eof) + break; + else + return false; + } + + if (!pb_field_iter_find(&iter, tag)) + { + /* No match found, check if it matches an extension. */ + if (tag >= extension_range_start) + { + if (!find_extension_field(&iter)) + extension_range_start = (uint32_t)-1; + else + extension_range_start = iter.pos->tag; + + if (tag >= extension_range_start) + { + size_t pos = stream->bytes_left; + + if (!decode_extension(stream, tag, wire_type, &iter)) + return false; + + if (pos != stream->bytes_left) + { + /* The field was handled */ + continue; + } + } + } + + /* No match found, skip data */ + if (!pb_skip_field(stream, wire_type)) + return false; + continue; + } + + if (PB_HTYPE(iter.pos->type) == PB_HTYPE_REQUIRED + && iter.required_field_index < PB_MAX_REQUIRED_FIELDS) + { + uint32_t tmp = ((uint32_t)1 << (iter.required_field_index & 31)); + fields_seen[iter.required_field_index >> 5] |= tmp; + } + + if (!decode_field(stream, wire_type, &iter)) + return false; + } + + /* Check that all required fields were present. */ + { + /* First figure out the number of required fields by + * seeking to the end of the field array. Usually we + * are already close to end after decoding. + */ + unsigned req_field_count; + pb_type_t last_type; + unsigned i; + do { + req_field_count = iter.required_field_index; + last_type = iter.pos->type; + } while (pb_field_iter_next(&iter)); + + /* Fixup if last field was also required. */ + if (PB_HTYPE(last_type) == PB_HTYPE_REQUIRED && iter.pos->tag != 0) + req_field_count++; + + if (req_field_count > 0) + { + /* Check the whole words */ + for (i = 0; i < (req_field_count >> 5); i++) + { + if (fields_seen[i] != allbits) + PB_RETURN_ERROR(stream, "missing required field"); + } + + /* Check the remaining bits */ + if (fields_seen[req_field_count >> 5] != (allbits >> (32 - (req_field_count & 31)))) + PB_RETURN_ERROR(stream, "missing required field"); + } + } + + return true; +} + +bool checkreturn pb_decode(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct) +{ + bool status; + pb_message_set_to_defaults(fields, dest_struct); + status = pb_decode_noinit(stream, fields, dest_struct); + +#ifdef PB_ENABLE_MALLOC + if (!status) + pb_release(fields, dest_struct); +#endif + + return status; +} + +bool pb_decode_delimited(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct) +{ + pb_istream_t substream; + bool status; + + if (!pb_make_string_substream(stream, &substream)) + return false; + + status = pb_decode(&substream, fields, dest_struct); + + if (!pb_close_string_substream(stream, &substream)) + return false; + return status; +} + +#ifdef PB_ENABLE_MALLOC +/* Given an oneof field, if there has already been a field inside this oneof, + * release it before overwriting with a different one. */ +static bool pb_release_union_field(pb_istream_t *stream, pb_field_iter_t *iter) +{ + pb_size_t old_tag = *(pb_size_t*)iter->pSize; /* Previous which_ value */ + pb_size_t new_tag = iter->pos->tag; /* New which_ value */ + + if (old_tag == 0) + return true; /* Ok, no old data in union */ + + if (old_tag == new_tag) + return true; /* Ok, old data is of same type => merge */ + + /* Release old data. The find can fail if the message struct contains + * invalid data. */ + if (!pb_field_iter_find(iter, old_tag)) + PB_RETURN_ERROR(stream, "invalid union tag"); + + pb_release_single_field(iter); + + /* Restore iterator to where it should be. + * This shouldn't fail unless the pb_field_t structure is corrupted. */ + if (!pb_field_iter_find(iter, new_tag)) + PB_RETURN_ERROR(stream, "iterator error"); + + return true; +} + +static void pb_release_single_field(const pb_field_iter_t *iter) +{ + pb_type_t type; + type = iter->pos->type; + + if (PB_HTYPE(type) == PB_HTYPE_ONEOF) + { + if (*(pb_size_t*)iter->pSize != iter->pos->tag) + return; /* This is not the current field in the union */ + } + + /* Release anything contained inside an extension or submsg. + * This has to be done even if the submsg itself is statically + * allocated. */ + if (PB_LTYPE(type) == PB_LTYPE_EXTENSION) + { + /* Release fields from all extensions in the linked list */ + pb_extension_t *ext = *(pb_extension_t**)iter->pData; + while (ext != NULL) + { + pb_field_iter_t ext_iter; + iter_from_extension(&ext_iter, ext); + pb_release_single_field(&ext_iter); + ext = ext->next; + } + } + else if (PB_LTYPE(type) == PB_LTYPE_SUBMESSAGE) + { + /* Release fields in submessage or submsg array */ + void *pItem = iter->pData; + pb_size_t count = 1; + + if (PB_ATYPE(type) == PB_ATYPE_POINTER) + { + pItem = *(void**)iter->pData; + } + + if (PB_HTYPE(type) == PB_HTYPE_REPEATED) + { + count = *(pb_size_t*)iter->pSize; + + if (PB_ATYPE(type) == PB_ATYPE_STATIC && count > iter->pos->array_size) + { + /* Protect against corrupted _count fields */ + count = iter->pos->array_size; + } + } + + if (pItem) + { + while (count--) + { + pb_release((const pb_field_t*)iter->pos->ptr, pItem); + pItem = (char*)pItem + iter->pos->data_size; + } + } + } + + if (PB_ATYPE(type) == PB_ATYPE_POINTER) + { + if (PB_HTYPE(type) == PB_HTYPE_REPEATED && + (PB_LTYPE(type) == PB_LTYPE_STRING || + PB_LTYPE(type) == PB_LTYPE_BYTES)) + { + /* Release entries in repeated string or bytes array */ + void **pItem = *(void***)iter->pData; + pb_size_t count = *(pb_size_t*)iter->pSize; + while (count--) + { + pb_free(*pItem); + *pItem++ = NULL; + } + } + + if (PB_HTYPE(type) == PB_HTYPE_REPEATED) + { + /* We are going to release the array, so set the size to 0 */ + *(pb_size_t*)iter->pSize = 0; + } + + /* Release main item */ + pb_free(*(void**)iter->pData); + *(void**)iter->pData = NULL; + } +} + +void pb_release(const pb_field_t fields[], void *dest_struct) +{ + pb_field_iter_t iter; + + if (!dest_struct) + return; /* Ignore NULL pointers, similar to free() */ + + if (!pb_field_iter_begin(&iter, fields, dest_struct)) + return; /* Empty message type */ + + do + { + pb_release_single_field(&iter); + } while (pb_field_iter_next(&iter)); +} +#endif + +/* Field decoders */ + +bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest) +{ + uint64_t value; + if (!pb_decode_varint(stream, &value)) + return false; + + if (value & 1) + *dest = (int64_t)(~(value >> 1)); + else + *dest = (int64_t)(value >> 1); + + return true; +} + +bool pb_decode_fixed32(pb_istream_t *stream, void *dest) +{ + pb_byte_t bytes[4]; + + if (!pb_read(stream, bytes, 4)) + return false; + + *(uint32_t*)dest = ((uint32_t)bytes[0] << 0) | + ((uint32_t)bytes[1] << 8) | + ((uint32_t)bytes[2] << 16) | + ((uint32_t)bytes[3] << 24); + return true; +} + +bool pb_decode_fixed64(pb_istream_t *stream, void *dest) +{ + pb_byte_t bytes[8]; + + if (!pb_read(stream, bytes, 8)) + return false; + + *(uint64_t*)dest = ((uint64_t)bytes[0] << 0) | + ((uint64_t)bytes[1] << 8) | + ((uint64_t)bytes[2] << 16) | + ((uint64_t)bytes[3] << 24) | + ((uint64_t)bytes[4] << 32) | + ((uint64_t)bytes[5] << 40) | + ((uint64_t)bytes[6] << 48) | + ((uint64_t)bytes[7] << 56); + + return true; +} + +static bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint64_t value; + int64_t svalue; + int64_t clamped; + if (!pb_decode_varint(stream, &value)) + return false; + + /* See issue 97: Google's C++ protobuf allows negative varint values to + * be cast as int32_t, instead of the int64_t that should be used when + * encoding. Previous nanopb versions had a bug in encoding. In order to + * not break decoding of such messages, we cast <=32 bit fields to + * int32_t first to get the sign correct. + */ + if (field->data_size == sizeof(int64_t)) + svalue = (int64_t)value; + else + svalue = (int32_t)value; + + /* Cast to the proper field size, while checking for overflows */ + if (field->data_size == sizeof(int64_t)) + clamped = *(int64_t*)dest = svalue; + else if (field->data_size == sizeof(int32_t)) + clamped = *(int32_t*)dest = (int32_t)svalue; + else if (field->data_size == sizeof(int_least16_t)) + clamped = *(int_least16_t*)dest = (int_least16_t)svalue; + else if (field->data_size == sizeof(int_least8_t)) + clamped = *(int_least8_t*)dest = (int_least8_t)svalue; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + if (clamped != svalue) + PB_RETURN_ERROR(stream, "integer too large"); + + return true; +} + +static bool checkreturn pb_dec_uvarint(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint64_t value, clamped; + if (!pb_decode_varint(stream, &value)) + return false; + + /* Cast to the proper field size, while checking for overflows */ + if (field->data_size == sizeof(uint64_t)) + clamped = *(uint64_t*)dest = value; + else if (field->data_size == sizeof(uint32_t)) + clamped = *(uint32_t*)dest = (uint32_t)value; + else if (field->data_size == sizeof(uint_least16_t)) + clamped = *(uint_least16_t*)dest = (uint_least16_t)value; + else if (field->data_size == sizeof(uint_least8_t)) + clamped = *(uint_least8_t*)dest = (uint_least8_t)value; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + if (clamped != value) + PB_RETURN_ERROR(stream, "integer too large"); + + return true; +} + +static bool checkreturn pb_dec_svarint(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + int64_t value, clamped; + if (!pb_decode_svarint(stream, &value)) + return false; + + /* Cast to the proper field size, while checking for overflows */ + if (field->data_size == sizeof(int64_t)) + clamped = *(int64_t*)dest = value; + else if (field->data_size == sizeof(int32_t)) + clamped = *(int32_t*)dest = (int32_t)value; + else if (field->data_size == sizeof(int_least16_t)) + clamped = *(int_least16_t*)dest = (int_least16_t)value; + else if (field->data_size == sizeof(int_least8_t)) + clamped = *(int_least8_t*)dest = (int_least8_t)value; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + if (clamped != value) + PB_RETURN_ERROR(stream, "integer too large"); + + return true; +} + +static bool checkreturn pb_dec_fixed32(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + PB_UNUSED(field); + return pb_decode_fixed32(stream, dest); +} + +static bool checkreturn pb_dec_fixed64(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + PB_UNUSED(field); + return pb_decode_fixed64(stream, dest); +} + +static bool checkreturn pb_dec_bytes(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint32_t size; + size_t alloc_size; + pb_bytes_array_t *bdest; + + if (!pb_decode_varint32(stream, &size)) + return false; + + if (size > PB_SIZE_MAX) + PB_RETURN_ERROR(stream, "bytes overflow"); + + alloc_size = PB_BYTES_ARRAY_T_ALLOCSIZE(size); + if (size > alloc_size) + PB_RETURN_ERROR(stream, "size too large"); + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { +#ifndef PB_ENABLE_MALLOC + PB_RETURN_ERROR(stream, "no malloc support"); +#else + if (!allocate_field(stream, dest, alloc_size, 1)) + return false; + bdest = *(pb_bytes_array_t**)dest; +#endif + } + else + { + if (alloc_size > field->data_size) + PB_RETURN_ERROR(stream, "bytes overflow"); + bdest = (pb_bytes_array_t*)dest; + } + + bdest->size = (pb_size_t)size; + return pb_read(stream, bdest->bytes, size); +} + +static bool checkreturn pb_dec_string(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint32_t size; + size_t alloc_size; + bool status; + if (!pb_decode_varint32(stream, &size)) + return false; + + /* Space for null terminator */ + alloc_size = size + 1; + + if (alloc_size < size) + PB_RETURN_ERROR(stream, "size too large"); + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { +#ifndef PB_ENABLE_MALLOC + PB_RETURN_ERROR(stream, "no malloc support"); +#else + if (!allocate_field(stream, dest, alloc_size, 1)) + return false; + dest = *(void**)dest; +#endif + } + else + { + if (alloc_size > field->data_size) + PB_RETURN_ERROR(stream, "string overflow"); + } + + status = pb_read(stream, (pb_byte_t*)dest, size); + *((pb_byte_t*)dest + size) = 0; + return status; +} + +static bool checkreturn pb_dec_submessage(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + bool status; + pb_istream_t substream; + const pb_field_t* submsg_fields = (const pb_field_t*)field->ptr; + + if (!pb_make_string_substream(stream, &substream)) + return false; + + if (field->ptr == NULL) + PB_RETURN_ERROR(stream, "invalid field descriptor"); + + /* New array entries need to be initialized, while required and optional + * submessages have already been initialized in the top-level pb_decode. */ + if (PB_HTYPE(field->type) == PB_HTYPE_REPEATED) + status = pb_decode(&substream, submsg_fields, dest); + else + status = pb_decode_noinit(&substream, submsg_fields, dest); + + if (!pb_close_string_substream(stream, &substream)) + return false; + return status; +} + +static bool checkreturn pb_dec_fixed_length_bytes(pb_istream_t *stream, const pb_field_t *field, void *dest) +{ + uint32_t size; + + if (!pb_decode_varint32(stream, &size)) + return false; + + if (size > PB_SIZE_MAX) + PB_RETURN_ERROR(stream, "bytes overflow"); + + if (size == 0) + { + /* As a special case, treat empty bytes string as all zeros for fixed_length_bytes. */ + memset(dest, 0, field->data_size); + return true; + } + + if (size != field->data_size) + PB_RETURN_ERROR(stream, "incorrect fixed length bytes size"); + + return pb_read(stream, (pb_byte_t*)dest, field->data_size); +} diff --git a/StoneIsland/platforms/ios/Pods/nanopb/pb_decode.h b/StoneIsland/platforms/ios/Pods/nanopb/pb_decode.h new file mode 100644 index 00000000..a426bdd7 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/pb_decode.h @@ -0,0 +1,153 @@ +/* pb_decode.h: Functions to decode protocol buffers. Depends on pb_decode.c. + * The main function is pb_decode. You also need an input stream, and the + * field descriptions created by nanopb_generator.py. + */ + +#ifndef PB_DECODE_H_INCLUDED +#define PB_DECODE_H_INCLUDED + +#include "pb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Structure for defining custom input streams. You will need to provide + * a callback function to read the bytes from your storage, which can be + * for example a file or a network socket. + * + * The callback must conform to these rules: + * + * 1) Return false on IO errors. This will cause decoding to abort. + * 2) You can use state to store your own data (e.g. buffer pointer), + * and rely on pb_read to verify that no-body reads past bytes_left. + * 3) Your callback may be used with substreams, in which case bytes_left + * is different than from the main stream. Don't use bytes_left to compute + * any pointers. + */ +struct pb_istream_s +{ +#ifdef PB_BUFFER_ONLY + /* Callback pointer is not used in buffer-only configuration. + * Having an int pointer here allows binary compatibility but + * gives an error if someone tries to assign callback function. + */ + int *callback; +#else + bool (*callback)(pb_istream_t *stream, pb_byte_t *buf, size_t count); +#endif + + void *state; /* Free field for use by callback implementation */ + size_t bytes_left; + +#ifndef PB_NO_ERRMSG + const char *errmsg; +#endif +}; + +/*************************** + * Main decoding functions * + ***************************/ + +/* Decode a single protocol buffers message from input stream into a C structure. + * Returns true on success, false on any failure. + * The actual struct pointed to by dest must match the description in fields. + * Callback fields of the destination structure must be initialized by caller. + * All other fields will be initialized by this function. + * + * Example usage: + * MyMessage msg = {}; + * uint8_t buffer[64]; + * pb_istream_t stream; + * + * // ... read some data into buffer ... + * + * stream = pb_istream_from_buffer(buffer, count); + * pb_decode(&stream, MyMessage_fields, &msg); + */ +bool pb_decode(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); + +/* Same as pb_decode, except does not initialize the destination structure + * to default values. This is slightly faster if you need no default values + * and just do memset(struct, 0, sizeof(struct)) yourself. + * + * This can also be used for 'merging' two messages, i.e. update only the + * fields that exist in the new message. + * + * Note: If this function returns with an error, it will not release any + * dynamically allocated fields. You will need to call pb_release() yourself. + */ +bool pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); + +/* Same as pb_decode, except expects the stream to start with the message size + * encoded as varint. Corresponds to parseDelimitedFrom() in Google's + * protobuf API. + */ +bool pb_decode_delimited(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); + +#ifdef PB_ENABLE_MALLOC +/* Release any allocated pointer fields. If you use dynamic allocation, you should + * call this for any successfully decoded message when you are done with it. If + * pb_decode() returns with an error, the message is already released. + */ +void pb_release(const pb_field_t fields[], void *dest_struct); +#endif + + +/************************************** + * Functions for manipulating streams * + **************************************/ + +/* Create an input stream for reading from a memory buffer. + * + * Alternatively, you can use a custom stream that reads directly from e.g. + * a file or a network socket. + */ +pb_istream_t pb_istream_from_buffer(const pb_byte_t *buf, size_t bufsize); + +/* Function to read from a pb_istream_t. You can use this if you need to + * read some custom header data, or to read data in field callbacks. + */ +bool pb_read(pb_istream_t *stream, pb_byte_t *buf, size_t count); + + +/************************************************ + * Helper functions for writing field callbacks * + ************************************************/ + +/* Decode the tag for the next field in the stream. Gives the wire type and + * field tag. At end of the message, returns false and sets eof to true. */ +bool pb_decode_tag(pb_istream_t *stream, pb_wire_type_t *wire_type, uint32_t *tag, bool *eof); + +/* Skip the field payload data, given the wire type. */ +bool pb_skip_field(pb_istream_t *stream, pb_wire_type_t wire_type); + +/* Decode an integer in the varint format. This works for bool, enum, int32, + * int64, uint32 and uint64 field types. */ +bool pb_decode_varint(pb_istream_t *stream, uint64_t *dest); + +/* Decode an integer in the varint format. This works for bool, enum, int32, + * and uint32 field types. */ +bool pb_decode_varint32(pb_istream_t *stream, uint32_t *dest); + +/* Decode an integer in the zig-zagged svarint format. This works for sint32 + * and sint64. */ +bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest); + +/* Decode a fixed32, sfixed32 or float value. You need to pass a pointer to + * a 4-byte wide C variable. */ +bool pb_decode_fixed32(pb_istream_t *stream, void *dest); + +/* Decode a fixed64, sfixed64 or double value. You need to pass a pointer to + * a 8-byte wide C variable. */ +bool pb_decode_fixed64(pb_istream_t *stream, void *dest); + +/* Make a limited-length substream for reading a PB_WT_STRING field. */ +bool pb_make_string_substream(pb_istream_t *stream, pb_istream_t *substream); +bool pb_close_string_substream(pb_istream_t *stream, pb_istream_t *substream); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/StoneIsland/platforms/ios/Pods/nanopb/pb_encode.c b/StoneIsland/platforms/ios/Pods/nanopb/pb_encode.c new file mode 100644 index 00000000..30f60d83 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/pb_encode.c @@ -0,0 +1,777 @@ +/* pb_encode.c -- encode a protobuf using minimal resources + * + * 2011 Petteri Aimonen <jpa@kapsi.fi> + */ + +#include "pb.h" +#include "pb_encode.h" +#include "pb_common.h" + +/* Use the GCC warn_unused_result attribute to check that all return values + * are propagated correctly. On other compilers and gcc before 3.4.0 just + * ignore the annotation. + */ +#if !defined(__GNUC__) || ( __GNUC__ < 3) || (__GNUC__ == 3 && __GNUC_MINOR__ < 4) + #define checkreturn +#else + #define checkreturn __attribute__((warn_unused_result)) +#endif + +/************************************** + * Declarations internal to this file * + **************************************/ +typedef bool (*pb_encoder_t)(pb_ostream_t *stream, const pb_field_t *field, const void *src) checkreturn; + +static bool checkreturn buf_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count); +static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *field, const void *pData, size_t count, pb_encoder_t func); +static bool checkreturn encode_field(pb_ostream_t *stream, const pb_field_t *field, const void *pData); +static bool checkreturn default_extension_encoder(pb_ostream_t *stream, const pb_extension_t *extension); +static bool checkreturn encode_extension_field(pb_ostream_t *stream, const pb_field_t *field, const void *pData); +static void *pb_const_cast(const void *p); +static bool checkreturn pb_enc_varint(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_uvarint(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_svarint(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_fixed32(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_fixed64(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_string(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_submessage(pb_ostream_t *stream, const pb_field_t *field, const void *src); +static bool checkreturn pb_enc_fixed_length_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src); + +/* --- Function pointers to field encoders --- + * Order in the array must match pb_action_t LTYPE numbering. + */ +static const pb_encoder_t PB_ENCODERS[PB_LTYPES_COUNT] = { + &pb_enc_varint, + &pb_enc_uvarint, + &pb_enc_svarint, + &pb_enc_fixed32, + &pb_enc_fixed64, + + &pb_enc_bytes, + &pb_enc_string, + &pb_enc_submessage, + NULL, /* extensions */ + &pb_enc_fixed_length_bytes +}; + +/******************************* + * pb_ostream_t implementation * + *******************************/ + +static bool checkreturn buf_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count) +{ + size_t i; + pb_byte_t *dest = (pb_byte_t*)stream->state; + stream->state = dest + count; + + for (i = 0; i < count; i++) + dest[i] = buf[i]; + + return true; +} + +pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize) +{ + pb_ostream_t stream; +#ifdef PB_BUFFER_ONLY + stream.callback = (void*)1; /* Just a marker value */ +#else + stream.callback = &buf_write; +#endif + stream.state = buf; + stream.max_size = bufsize; + stream.bytes_written = 0; +#ifndef PB_NO_ERRMSG + stream.errmsg = NULL; +#endif + return stream; +} + +bool checkreturn pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count) +{ + if (stream->callback != NULL) + { + if (stream->bytes_written + count > stream->max_size) + PB_RETURN_ERROR(stream, "stream full"); + +#ifdef PB_BUFFER_ONLY + if (!buf_write(stream, buf, count)) + PB_RETURN_ERROR(stream, "io error"); +#else + if (!stream->callback(stream, buf, count)) + PB_RETURN_ERROR(stream, "io error"); +#endif + } + + stream->bytes_written += count; + return true; +} + +/************************* + * Encode a single field * + *************************/ + +/* Encode a static array. Handles the size calculations and possible packing. */ +static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *field, + const void *pData, size_t count, pb_encoder_t func) +{ + size_t i; + const void *p; + size_t size; + + if (count == 0) + return true; + + if (PB_ATYPE(field->type) != PB_ATYPE_POINTER && count > field->array_size) + PB_RETURN_ERROR(stream, "array max size exceeded"); + + /* We always pack arrays if the datatype allows it. */ + if (PB_LTYPE(field->type) <= PB_LTYPE_LAST_PACKABLE) + { + if (!pb_encode_tag(stream, PB_WT_STRING, field->tag)) + return false; + + /* Determine the total size of packed array. */ + if (PB_LTYPE(field->type) == PB_LTYPE_FIXED32) + { + size = 4 * count; + } + else if (PB_LTYPE(field->type) == PB_LTYPE_FIXED64) + { + size = 8 * count; + } + else + { + pb_ostream_t sizestream = PB_OSTREAM_SIZING; + p = pData; + for (i = 0; i < count; i++) + { + if (!func(&sizestream, field, p)) + return false; + p = (const char*)p + field->data_size; + } + size = sizestream.bytes_written; + } + + if (!pb_encode_varint(stream, (uint64_t)size)) + return false; + + if (stream->callback == NULL) + return pb_write(stream, NULL, size); /* Just sizing.. */ + + /* Write the data */ + p = pData; + for (i = 0; i < count; i++) + { + if (!func(stream, field, p)) + return false; + p = (const char*)p + field->data_size; + } + } + else + { + p = pData; + for (i = 0; i < count; i++) + { + if (!pb_encode_tag_for_field(stream, field)) + return false; + + /* Normally the data is stored directly in the array entries, but + * for pointer-type string and bytes fields, the array entries are + * actually pointers themselves also. So we have to dereference once + * more to get to the actual data. */ + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER && + (PB_LTYPE(field->type) == PB_LTYPE_STRING || + PB_LTYPE(field->type) == PB_LTYPE_BYTES)) + { + if (!func(stream, field, *(const void* const*)p)) + return false; + } + else + { + if (!func(stream, field, p)) + return false; + } + p = (const char*)p + field->data_size; + } + } + + return true; +} + +/* In proto3, all fields are optional and are only encoded if their value is "non-zero". + * This function implements the check for the zero value. */ +static bool pb_check_proto3_default_value(const pb_field_t *field, const void *pData) +{ + if (PB_ATYPE(field->type) == PB_ATYPE_STATIC) + { + if (PB_LTYPE(field->type) == PB_LTYPE_BYTES) + { + const pb_bytes_array_t *bytes = (const pb_bytes_array_t*)pData; + return bytes->size == 0; + } + else if (PB_LTYPE(field->type) == PB_LTYPE_STRING) + { + return *(const char*)pData == '\0'; + } + else if (PB_LTYPE(field->type) == PB_LTYPE_FIXED_LENGTH_BYTES) + { + /* Fixed length bytes is only empty if its length is fixed + * as 0. Which would be pretty strange, but we can check + * it anyway. */ + return field->data_size == 0; + } + else if (PB_LTYPE(field->type) == PB_LTYPE_SUBMESSAGE) + { + /* Check all fields in the submessage to find if any of them + * are non-zero. The comparison cannot be done byte-per-byte + * because the C struct may contain padding bytes that must + * be skipped. + */ + pb_field_iter_t iter; + if (pb_field_iter_begin(&iter, (const pb_field_t*)field->ptr, pb_const_cast(pData))) + { + do + { + if (!pb_check_proto3_default_value(iter.pos, iter.pData)) + { + return false; + } + } while (pb_field_iter_next(&iter)); + } + return true; + } + } + + { + /* Catch-all branch that does byte-per-byte comparison for zero value. + * + * This is for all pointer fields, and for static PB_LTYPE_VARINT, + * UVARINT, SVARINT, FIXED32, FIXED64, EXTENSION fields, and also + * callback fields. These all have integer or pointer value which + * can be compared with 0. + */ + pb_size_t i; + const char *p = (const char*)pData; + for (i = 0; i < field->data_size; i++) + { + if (p[i] != 0) + { + return false; + } + } + + return true; + } +} + +/* Encode a field with static or pointer allocation, i.e. one whose data + * is available to the encoder directly. */ +static bool checkreturn encode_basic_field(pb_ostream_t *stream, + const pb_field_t *field, const void *pData) +{ + pb_encoder_t func; + bool implicit_has; + const void *pSize = &implicit_has; + + func = PB_ENCODERS[PB_LTYPE(field->type)]; + + if (field->size_offset) + { + /* Static optional, repeated or oneof field */ + pSize = (const char*)pData + field->size_offset; + } + else if (PB_HTYPE(field->type) == PB_HTYPE_OPTIONAL) + { + /* Proto3 style field, optional but without explicit has_ field. */ + implicit_has = !pb_check_proto3_default_value(field, pData); + } + else + { + /* Required field, always present */ + implicit_has = true; + } + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { + /* pData is a pointer to the field, which contains pointer to + * the data. If the 2nd pointer is NULL, it is interpreted as if + * the has_field was false. + */ + pData = *(const void* const*)pData; + implicit_has = (pData != NULL); + } + + switch (PB_HTYPE(field->type)) + { + case PB_HTYPE_REQUIRED: + if (!pData) + PB_RETURN_ERROR(stream, "missing required field"); + if (!pb_encode_tag_for_field(stream, field)) + return false; + if (!func(stream, field, pData)) + return false; + break; + + case PB_HTYPE_OPTIONAL: + if (*(const bool*)pSize) + { + if (!pb_encode_tag_for_field(stream, field)) + return false; + + if (!func(stream, field, pData)) + return false; + } + break; + + case PB_HTYPE_REPEATED: + if (!encode_array(stream, field, pData, *(const pb_size_t*)pSize, func)) + return false; + break; + + case PB_HTYPE_ONEOF: + if (*(const pb_size_t*)pSize == field->tag) + { + if (!pb_encode_tag_for_field(stream, field)) + return false; + + if (!func(stream, field, pData)) + return false; + } + break; + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } + + return true; +} + +/* Encode a field with callback semantics. This means that a user function is + * called to provide and encode the actual data. */ +static bool checkreturn encode_callback_field(pb_ostream_t *stream, + const pb_field_t *field, const void *pData) +{ + const pb_callback_t *callback = (const pb_callback_t*)pData; + +#ifdef PB_OLD_CALLBACK_STYLE + const void *arg = callback->arg; +#else + void * const *arg = &(callback->arg); +#endif + + if (callback->funcs.encode != NULL) + { + if (!callback->funcs.encode(stream, field, arg)) + PB_RETURN_ERROR(stream, "callback error"); + } + return true; +} + +/* Encode a single field of any callback or static type. */ +static bool checkreturn encode_field(pb_ostream_t *stream, + const pb_field_t *field, const void *pData) +{ + switch (PB_ATYPE(field->type)) + { + case PB_ATYPE_STATIC: + case PB_ATYPE_POINTER: + return encode_basic_field(stream, field, pData); + + case PB_ATYPE_CALLBACK: + return encode_callback_field(stream, field, pData); + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } +} + +/* Default handler for extension fields. Expects to have a pb_field_t + * pointer in the extension->type->arg field. */ +static bool checkreturn default_extension_encoder(pb_ostream_t *stream, + const pb_extension_t *extension) +{ + const pb_field_t *field = (const pb_field_t*)extension->type->arg; + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + { + /* For pointer extensions, the pointer is stored directly + * in the extension structure. This avoids having an extra + * indirection. */ + return encode_field(stream, field, &extension->dest); + } + else + { + return encode_field(stream, field, extension->dest); + } +} + +/* Walk through all the registered extensions and give them a chance + * to encode themselves. */ +static bool checkreturn encode_extension_field(pb_ostream_t *stream, + const pb_field_t *field, const void *pData) +{ + const pb_extension_t *extension = *(const pb_extension_t* const *)pData; + PB_UNUSED(field); + + while (extension) + { + bool status; + if (extension->type->encode) + status = extension->type->encode(stream, extension); + else + status = default_extension_encoder(stream, extension); + + if (!status) + return false; + + extension = extension->next; + } + + return true; +} + +/********************* + * Encode all fields * + *********************/ + +static void *pb_const_cast(const void *p) +{ + /* Note: this casts away const, in order to use the common field iterator + * logic for both encoding and decoding. */ + union { + void *p1; + const void *p2; + } t; + t.p2 = p; + return t.p1; +} + +bool checkreturn pb_encode(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct) +{ + pb_field_iter_t iter; + if (!pb_field_iter_begin(&iter, fields, pb_const_cast(src_struct))) + return true; /* Empty message type */ + + do { + if (PB_LTYPE(iter.pos->type) == PB_LTYPE_EXTENSION) + { + /* Special case for the extension field placeholder */ + if (!encode_extension_field(stream, iter.pos, iter.pData)) + return false; + } + else + { + /* Regular field */ + if (!encode_field(stream, iter.pos, iter.pData)) + return false; + } + } while (pb_field_iter_next(&iter)); + + return true; +} + +bool pb_encode_delimited(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct) +{ + return pb_encode_submessage(stream, fields, src_struct); +} + +bool pb_get_encoded_size(size_t *size, const pb_field_t fields[], const void *src_struct) +{ + pb_ostream_t stream = PB_OSTREAM_SIZING; + + if (!pb_encode(&stream, fields, src_struct)) + return false; + + *size = stream.bytes_written; + return true; +} + +/******************** + * Helper functions * + ********************/ +bool checkreturn pb_encode_varint(pb_ostream_t *stream, uint64_t value) +{ + pb_byte_t buffer[10]; + size_t i = 0; + + if (value <= 0x7F) + { + pb_byte_t v = (pb_byte_t)value; + return pb_write(stream, &v, 1); + } + + while (value) + { + buffer[i] = (pb_byte_t)((value & 0x7F) | 0x80); + value >>= 7; + i++; + } + buffer[i-1] &= 0x7F; /* Unset top bit on last byte */ + + return pb_write(stream, buffer, i); +} + +bool checkreturn pb_encode_svarint(pb_ostream_t *stream, int64_t value) +{ + uint64_t zigzagged; + if (value < 0) + zigzagged = ~((uint64_t)value << 1); + else + zigzagged = (uint64_t)value << 1; + + return pb_encode_varint(stream, zigzagged); +} + +bool checkreturn pb_encode_fixed32(pb_ostream_t *stream, const void *value) +{ + uint32_t val = *(const uint32_t*)value; + pb_byte_t bytes[4]; + bytes[0] = (pb_byte_t)(val & 0xFF); + bytes[1] = (pb_byte_t)((val >> 8) & 0xFF); + bytes[2] = (pb_byte_t)((val >> 16) & 0xFF); + bytes[3] = (pb_byte_t)((val >> 24) & 0xFF); + return pb_write(stream, bytes, 4); +} + +bool checkreturn pb_encode_fixed64(pb_ostream_t *stream, const void *value) +{ + uint64_t val = *(const uint64_t*)value; + pb_byte_t bytes[8]; + bytes[0] = (pb_byte_t)(val & 0xFF); + bytes[1] = (pb_byte_t)((val >> 8) & 0xFF); + bytes[2] = (pb_byte_t)((val >> 16) & 0xFF); + bytes[3] = (pb_byte_t)((val >> 24) & 0xFF); + bytes[4] = (pb_byte_t)((val >> 32) & 0xFF); + bytes[5] = (pb_byte_t)((val >> 40) & 0xFF); + bytes[6] = (pb_byte_t)((val >> 48) & 0xFF); + bytes[7] = (pb_byte_t)((val >> 56) & 0xFF); + return pb_write(stream, bytes, 8); +} + +bool checkreturn pb_encode_tag(pb_ostream_t *stream, pb_wire_type_t wiretype, uint32_t field_number) +{ + uint64_t tag = ((uint64_t)field_number << 3) | wiretype; + return pb_encode_varint(stream, tag); +} + +bool checkreturn pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_t *field) +{ + pb_wire_type_t wiretype; + switch (PB_LTYPE(field->type)) + { + case PB_LTYPE_VARINT: + case PB_LTYPE_UVARINT: + case PB_LTYPE_SVARINT: + wiretype = PB_WT_VARINT; + break; + + case PB_LTYPE_FIXED32: + wiretype = PB_WT_32BIT; + break; + + case PB_LTYPE_FIXED64: + wiretype = PB_WT_64BIT; + break; + + case PB_LTYPE_BYTES: + case PB_LTYPE_STRING: + case PB_LTYPE_SUBMESSAGE: + case PB_LTYPE_FIXED_LENGTH_BYTES: + wiretype = PB_WT_STRING; + break; + + default: + PB_RETURN_ERROR(stream, "invalid field type"); + } + + return pb_encode_tag(stream, wiretype, field->tag); +} + +bool checkreturn pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size) +{ + if (!pb_encode_varint(stream, (uint64_t)size)) + return false; + + return pb_write(stream, buffer, size); +} + +bool checkreturn pb_encode_submessage(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct) +{ + /* First calculate the message size using a non-writing substream. */ + pb_ostream_t substream = PB_OSTREAM_SIZING; + size_t size; + bool status; + + if (!pb_encode(&substream, fields, src_struct)) + { +#ifndef PB_NO_ERRMSG + stream->errmsg = substream.errmsg; +#endif + return false; + } + + size = substream.bytes_written; + + if (!pb_encode_varint(stream, (uint64_t)size)) + return false; + + if (stream->callback == NULL) + return pb_write(stream, NULL, size); /* Just sizing */ + + if (stream->bytes_written + size > stream->max_size) + PB_RETURN_ERROR(stream, "stream full"); + + /* Use a substream to verify that a callback doesn't write more than + * what it did the first time. */ + substream.callback = stream->callback; + substream.state = stream->state; + substream.max_size = size; + substream.bytes_written = 0; +#ifndef PB_NO_ERRMSG + substream.errmsg = NULL; +#endif + + status = pb_encode(&substream, fields, src_struct); + + stream->bytes_written += substream.bytes_written; + stream->state = substream.state; +#ifndef PB_NO_ERRMSG + stream->errmsg = substream.errmsg; +#endif + + if (substream.bytes_written != size) + PB_RETURN_ERROR(stream, "submsg size changed"); + + return status; +} + +/* Field encoders */ + +static bool checkreturn pb_enc_varint(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + int64_t value = 0; + + if (field->data_size == sizeof(int_least8_t)) + value = *(const int_least8_t*)src; + else if (field->data_size == sizeof(int_least16_t)) + value = *(const int_least16_t*)src; + else if (field->data_size == sizeof(int32_t)) + value = *(const int32_t*)src; + else if (field->data_size == sizeof(int64_t)) + value = *(const int64_t*)src; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + return pb_encode_varint(stream, (uint64_t)value); +} + +static bool checkreturn pb_enc_uvarint(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + uint64_t value = 0; + + if (field->data_size == sizeof(uint_least8_t)) + value = *(const uint_least8_t*)src; + else if (field->data_size == sizeof(uint_least16_t)) + value = *(const uint_least16_t*)src; + else if (field->data_size == sizeof(uint32_t)) + value = *(const uint32_t*)src; + else if (field->data_size == sizeof(uint64_t)) + value = *(const uint64_t*)src; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + return pb_encode_varint(stream, value); +} + +static bool checkreturn pb_enc_svarint(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + int64_t value = 0; + + if (field->data_size == sizeof(int_least8_t)) + value = *(const int_least8_t*)src; + else if (field->data_size == sizeof(int_least16_t)) + value = *(const int_least16_t*)src; + else if (field->data_size == sizeof(int32_t)) + value = *(const int32_t*)src; + else if (field->data_size == sizeof(int64_t)) + value = *(const int64_t*)src; + else + PB_RETURN_ERROR(stream, "invalid data_size"); + + return pb_encode_svarint(stream, value); +} + +static bool checkreturn pb_enc_fixed64(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + PB_UNUSED(field); + return pb_encode_fixed64(stream, src); +} + +static bool checkreturn pb_enc_fixed32(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + PB_UNUSED(field); + return pb_encode_fixed32(stream, src); +} + +static bool checkreturn pb_enc_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + const pb_bytes_array_t *bytes = NULL; + + bytes = (const pb_bytes_array_t*)src; + + if (src == NULL) + { + /* Treat null pointer as an empty bytes field */ + return pb_encode_string(stream, NULL, 0); + } + + if (PB_ATYPE(field->type) == PB_ATYPE_STATIC && + PB_BYTES_ARRAY_T_ALLOCSIZE(bytes->size) > field->data_size) + { + PB_RETURN_ERROR(stream, "bytes size exceeded"); + } + + return pb_encode_string(stream, bytes->bytes, bytes->size); +} + +static bool checkreturn pb_enc_string(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + size_t size = 0; + size_t max_size = field->data_size; + const char *p = (const char*)src; + + if (PB_ATYPE(field->type) == PB_ATYPE_POINTER) + max_size = (size_t)-1; + + if (src == NULL) + { + size = 0; /* Treat null pointer as an empty string */ + } + else + { + /* strnlen() is not always available, so just use a loop */ + while (size < max_size && *p != '\0') + { + size++; + p++; + } + } + + return pb_encode_string(stream, (const pb_byte_t*)src, size); +} + +static bool checkreturn pb_enc_submessage(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + if (field->ptr == NULL) + PB_RETURN_ERROR(stream, "invalid field descriptor"); + + return pb_encode_submessage(stream, (const pb_field_t*)field->ptr, src); +} + +static bool checkreturn pb_enc_fixed_length_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src) +{ + return pb_encode_string(stream, (const pb_byte_t*)src, field->data_size); +} + diff --git a/StoneIsland/platforms/ios/Pods/nanopb/pb_encode.h b/StoneIsland/platforms/ios/Pods/nanopb/pb_encode.h new file mode 100644 index 00000000..d9909fb0 --- /dev/null +++ b/StoneIsland/platforms/ios/Pods/nanopb/pb_encode.h @@ -0,0 +1,154 @@ +/* pb_encode.h: Functions to encode protocol buffers. Depends on pb_encode.c. + * The main function is pb_encode. You also need an output stream, and the + * field descriptions created by nanopb_generator.py. + */ + +#ifndef PB_ENCODE_H_INCLUDED +#define PB_ENCODE_H_INCLUDED + +#include "pb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Structure for defining custom output streams. You will need to provide + * a callback function to write the bytes to your storage, which can be + * for example a file or a network socket. + * + * The callback must conform to these rules: + * + * 1) Return false on IO errors. This will cause encoding to abort. + * 2) You can use state to store your own data (e.g. buffer pointer). + * 3) pb_write will update bytes_written after your callback runs. + * 4) Substreams will modify max_size and bytes_written. Don't use them + * to calculate any pointers. + */ +struct pb_ostream_s +{ +#ifdef PB_BUFFER_ONLY + /* Callback pointer is not used in buffer-only configuration. + * Having an int pointer here allows binary compatibility but + * gives an error if someone tries to assign callback function. + * Also, NULL pointer marks a 'sizing stream' that does not + * write anything. + */ + int *callback; +#else + bool (*callback)(pb_ostream_t *stream, const pb_byte_t *buf, size_t count); +#endif + void *state; /* Free field for use by callback implementation. */ + size_t max_size; /* Limit number of output bytes written (or use SIZE_MAX). */ + size_t bytes_written; /* Number of bytes written so far. */ + +#ifndef PB_NO_ERRMSG + const char *errmsg; +#endif +}; + +/*************************** + * Main encoding functions * + ***************************/ + +/* Encode a single protocol buffers message from C structure into a stream. + * Returns true on success, false on any failure. + * The actual struct pointed to by src_struct must match the description in fields. + * All required fields in the struct are assumed to have been filled in. + * + * Example usage: + * MyMessage msg = {}; + * uint8_t buffer[64]; + * pb_ostream_t stream; + * + * msg.field1 = 42; + * stream = pb_ostream_from_buffer(buffer, sizeof(buffer)); + * pb_encode(&stream, MyMessage_fields, &msg); + */ +bool pb_encode(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct); + +/* Same as pb_encode, but prepends the length of the message as a varint. + * Corresponds to writeDelimitedTo() in Google's protobuf API. + */ +bool pb_encode_delimited(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct); + +/* Encode the message to get the size of the encoded data, but do not store + * the data. */ +bool pb_get_encoded_size(size_t *size, const pb_field_t fields[], const void *src_struct); + +/************************************** + * Functions for manipulating streams * + **************************************/ + +/* Create an output stream for writing into a memory buffer. + * The number of bytes written can be found in stream.bytes_written after + * encoding the message. + * + * Alternatively, you can use a custom stream that writes directly to e.g. + * a file or a network socket. + */ +pb_ostream_t pb_ostream_from_buffer(pb_byte_t *buf, size_t bufsize); + +/* Pseudo-stream for measuring the size of a message without actually storing + * the encoded data. + * + * Example usage: + * MyMessage msg = {}; + * pb_ostream_t stream = PB_OSTREAM_SIZING; + * pb_encode(&stream, MyMessage_fields, &msg); + * printf("Message size is %d\n", stream.bytes_written); + */ +#ifndef PB_NO_ERRMSG +#define PB_OSTREAM_SIZING {0,0,0,0,0} +#else +#define PB_OSTREAM_SIZING {0,0,0,0} +#endif + +/* Function to write into a pb_ostream_t stream. You can use this if you need + * to append or prepend some custom headers to the message. + */ +bool pb_write(pb_ostream_t *stream, const pb_byte_t *buf, size_t count); + + +/************************************************ + * Helper functions for writing field callbacks * + ************************************************/ + +/* Encode field header based on type and field number defined in the field + * structure. Call this from the callback before writing out field contents. */ +bool pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_t *field); + +/* Encode field header by manually specifing wire type. You need to use this + * if you want to write out packed arrays from a callback field. */ +bool pb_encode_tag(pb_ostream_t *stream, pb_wire_type_t wiretype, uint32_t field_number); + +/* Encode an integer in the varint format. + * This works for bool, enum, int32, int64, uint32 and uint64 field types. */ +bool pb_encode_varint(pb_ostream_t *stream, uint64_t value); + +/* Encode an integer in the zig-zagged svarint format. + * This works for sint32 and sint64. */ +bool pb_encode_svarint(pb_ostream_t *stream, int64_t value); + +/* Encode a string or bytes type field. For strings, pass strlen(s) as size. */ +bool pb_encode_string(pb_ostream_t *stream, const pb_byte_t *buffer, size_t size); + +/* Encode a fixed32, sfixed32 or float value. + * You need to pass a pointer to a 4-byte wide C variable. */ +bool pb_encode_fixed32(pb_ostream_t *stream, const void *value); + +/* Encode a fixed64, sfixed64 or double value. + * You need to pass a pointer to a 8-byte wide C variable. */ +bool pb_encode_fixed64(pb_ostream_t *stream, const void *value); + +/* Encode a submessage field. + * You need to pass the pb_field_t array and pointer to struct, just like + * with pb_encode(). This internally encodes the submessage twice, first to + * calculate message size and then to actually write it out. + */ +bool pb_encode_submessage(pb_ostream_t *stream, const pb_field_t fields[], const void *src_struct); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car Binary files differdeleted file mode 100644 index e8c80428..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Assets.car +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib Binary files differdeleted file mode 100644 index e372d277..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib Binary files differdeleted file mode 100644 index b5ec47bc..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Info.plist b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Info.plist Binary files differdeleted file mode 100644 index 20d8377d..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Info.plist +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island Binary files differdeleted file mode 100755 index 349daaa1..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/Stone Island +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-google-analytics/www/analytics.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-google-analytics/www/analytics.js deleted file mode 100644 index b46b19ea..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-google-analytics/www/analytics.js +++ /dev/null @@ -1,130 +0,0 @@ -cordova.define("cordova-plugin-google-analytics.UniversalAnalytics", function(require, exports, module) { -function UniversalAnalyticsPlugin() {} - -UniversalAnalyticsPlugin.prototype.startTrackerWithId = function(id, dispatchPeriod, success, error) { - if (typeof dispatchPeriod === 'undefined' || dispatchPeriod === null) { - dispatchPeriod = 30; - } else if (typeof dispatchPeriod === 'function' && typeof error === 'undefined') { - // Called without dispatchPeriod but with a callback. - // Looks like the original API was used so shift parameters over to remain compatible. - error = success; - success = dispatchPeriod; - dispatchPeriod = 30; - } - cordova.exec(success, error, 'UniversalAnalytics', 'startTrackerWithId', [id, dispatchPeriod]); -}; - -UniversalAnalyticsPlugin.prototype.setAllowIDFACollection = function(enable, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'setAllowIDFACollection', [enable]); -}; - -UniversalAnalyticsPlugin.prototype.setUserId = function(id, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'setUserId', [id]); -}; - -UniversalAnalyticsPlugin.prototype.setAnonymizeIp = function(anonymize, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'setAnonymizeIp', [anonymize]); -}; - -UniversalAnalyticsPlugin.prototype.setOptOut = function(optout, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'setOptOut', [optout]); -}; - -UniversalAnalyticsPlugin.prototype.setAppVersion = function(version, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'setAppVersion', [version]); -}; - -UniversalAnalyticsPlugin.prototype.getVar = function(variable, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'getVar', [variable]); -}; - -UniversalAnalyticsPlugin.prototype.setVar = function(variable, value, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'setVar', [variable, value]); -}; - -UniversalAnalyticsPlugin.prototype.dispatch = function(success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'dispatch', []); -}; - -/* enables verbose logging */ -UniversalAnalyticsPlugin.prototype.debugMode = function(success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'debugMode', []); -}; - -UniversalAnalyticsPlugin.prototype.trackMetric = function(key, value, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'trackMetric', [key, value]); -}; - -UniversalAnalyticsPlugin.prototype.trackView = function(screen, campaignUrl, newSession, success, error) { - if (typeof campaignUrl === 'undefined' || campaignUrl === null) { - campaignUrl = ''; - } - - if (typeof newSession === 'undefined' || newSession === null) { - newSession = false; - } - - cordova.exec(success, error, 'UniversalAnalytics', 'trackView', [screen, campaignUrl, newSession]); -}; - -UniversalAnalyticsPlugin.prototype.addCustomDimension = function(key, value, success, error) { - if (typeof key !== "number") { - throw Error("key must be a valid integer not '" + typeof key + "'"); - } - cordova.exec(success, error, 'UniversalAnalytics', 'addCustomDimension', [key, value]); -}; - -UniversalAnalyticsPlugin.prototype.trackEvent = function(category, action, label, value, newSession, success, error) { - if (typeof label === 'undefined' || label === null) { - label = ''; - } - if (typeof value === 'undefined' || value === null) { - value = 0; - } - - if (typeof newSession === 'undefined' || newSession === null) { - newSession = false; - } - - cordova.exec(success, error, 'UniversalAnalytics', 'trackEvent', [category, action, label, value, newSession]); -}; - -/** - * https://developers.google.com/analytics/devguides/collection/android/v3/exceptions - */ -UniversalAnalyticsPlugin.prototype.trackException = function(description, fatal, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'trackException', [description, fatal]); -}; - -UniversalAnalyticsPlugin.prototype.trackTiming = function(category, intervalInMilliseconds, name, label, success, error) { - if (typeof intervalInMilliseconds === 'undefined' || intervalInMilliseconds === null) { - intervalInMilliseconds = 0; - } - if (typeof name === 'undefined' || name === null) { - name = ''; - } - if (typeof label === 'undefined' || label === null) { - label = ''; - } - - cordova.exec(success, error, 'UniversalAnalytics', 'trackTiming', [category, intervalInMilliseconds, name, label]); -}; - -/* Google Analytics e-Commerce Tracking */ -/* https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce */ -UniversalAnalyticsPlugin.prototype.addTransaction = function(transactionId, affiliation, revenue, tax, shipping, currencyCode, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'addTransaction', [transactionId, affiliation, revenue, tax, shipping, currencyCode]); -}; - -UniversalAnalyticsPlugin.prototype.addTransactionItem = function(transactionId, name ,sku, category, price, quantity, currencyCode, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'addTransactionItem', [transactionId, name ,sku, category, price, quantity, currencyCode]); -}; - -/* automatic uncaught exception tracking */ -UniversalAnalyticsPlugin.prototype.enableUncaughtExceptionReporting = function (enable, success, error) { - cordova.exec(success, error, 'UniversalAnalytics', 'enableUncaughtExceptionReporting', [enable]); -}; - -module.exports = new UniversalAnalyticsPlugin(); - -}); diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/phonegap-plugin-push/www/push.js deleted file mode 100644 index a5315486..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/phonegap-plugin-push/www/push.js +++ /dev/null @@ -1,329 +0,0 @@ -cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { -/* global cordova:false */ -/* globals window */ - -/*! - * Module dependencies. - */ - -var exec = cordova.require('cordova/exec'); - -/** - * PushNotification constructor. - * - * @param {Object} options to initiate Push Notifications. - * @return {PushNotification} instance that can be monitored and cancelled. - */ - -var PushNotification = function(options) { - this._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; - - // require options parameter - if (typeof options === 'undefined') { - throw new Error('The options argument is required.'); - } - - // store the options to this object instance - this.options = options; - - // triggered on registration and notification - var that = this; - var success = function(result) { - if (result && typeof result.registrationId !== 'undefined') { - that.emit('registration', result); - } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { - var executeFuctionOrEmitEventByName = function(callbackName, context, arg) { - var namespaces = callbackName.split('.'); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } - - if (typeof context[func] === 'function') { - context[func].call(context, arg); - } else { - that.emit(callbackName, arg); - } - }; - - executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); - } else if (result) { - that.emit('notification', result); - } - }; - - // triggered on error - var fail = function(msg) { - var e = (typeof msg === 'string') ? new Error(msg) : msg; - that.emit('error', e); - }; - - // wait at least one process tick to allow event subscriptions - setTimeout(function() { - exec(success, fail, 'PushNotification', 'init', [options]); - }, 10); -}; - -/** - * Unregister from push notifications - */ - -PushNotification.prototype.unregister = function(successCallback, errorCallback, options) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.unregister failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.unregister failure: success callback parameter must be a function'); - return; - } - - var that = this; - var cleanHandlersAndPassThrough = function() { - if (!options) { - that._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; - } - successCallback(); - }; - - exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); -}; - -/** - * subscribe to a topic - * @param {String} topic topic to subscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.subscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.subscribe failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.subscribe failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); -}; - -/** - * unsubscribe to a topic - * @param {String} topic topic to unsubscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.unsubscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); -}; - -/** - * Call this to set the application icon badge - */ - -PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{badge: badge}]); -}; - -/** - * Get the application icon badge - */ - -PushNotification.prototype.getApplicationIconBadgeNumber = function(successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); -}; - -/** - * Get the application icon badge - */ - -PushNotification.prototype.clearAllNotifications = function(successCallback, errorCallback) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - - if (typeof errorCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: failure parameter not a function'); - return; - } - - if (typeof successCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: success callback parameter must be a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); -}; - -/** - * Listen for an event. - * - * Any event is supported, but the following are built-in: - * - * - registration - * - notification - * - error - * - * @param {String} eventName to subscribe to. - * @param {Function} callback triggered on the event. - */ - -PushNotification.prototype.on = function(eventName, callback) { - if (!this._handlers.hasOwnProperty(eventName)) { - this._handlers[eventName] = []; - } - this._handlers[eventName].push(callback); -}; - -/** - * Remove event listener. - * - * @param {String} eventName to match subscription. - * @param {Function} handle function associated with event. - */ - -PushNotification.prototype.off = function (eventName, handle) { - if (this._handlers.hasOwnProperty(eventName)) { - var handleIndex = this._handlers[eventName].indexOf(handle); - if (handleIndex >= 0) { - this._handlers[eventName].splice(handleIndex, 1); - } - } -}; - -/** - * Emit an event. - * - * This is intended for internal use only. - * - * @param {String} eventName is the event to trigger. - * @param {*} all arguments are passed to the event listeners. - * - * @return {Boolean} is true when the event is triggered otherwise false. - */ - -PushNotification.prototype.emit = function() { - var args = Array.prototype.slice.call(arguments); - var eventName = args.shift(); - - if (!this._handlers.hasOwnProperty(eventName)) { - return false; - } - - for (var i = 0, length = this._handlers[eventName].length; i < length; i++) { - var callback = this._handlers[eventName][i]; - if (typeof callback === 'function') { - callback.apply(undefined,args); - } else { - console.log('event handler: ' + eventName + ' must be a function'); - } - } - - return true; -}; - -PushNotification.prototype.finish = function(successCallback, errorCallback, id) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - if (!id) { id = 'handler'; } - - if (typeof successCallback !== 'function') { - console.log('finish failure: success callback parameter must be a function'); - return; - } - - if (typeof errorCallback !== 'function') { - console.log('finish failure: failure parameter not a function'); - return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); -}; - -/*! - * Push Notification Plugin. - */ - -module.exports = { - /** - * Register for Push Notifications. - * - * This method will instantiate a new copy of the PushNotification object - * and start the registration process. - * - * @param {Object} options - * @return {PushNotification} instance - */ - - init: function(options) { - return new PushNotification(options); - }, - - hasPermission: function(successCallback, errorCallback) { - exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); - }, - - /** - * PushNotification Object. - * - * Expose the PushNotification object for direct use - * and testing. Typically, you should use the - * .init helper method. - */ - - PushNotification: PushNotification -}; - -}); diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj deleted file mode 100755 index 69471aa0..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.pbxproj +++ /dev/null @@ -1,719 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { -/* Begin PBXBuildFile section */ - 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0207DA571B56EA530066E2B4 /* Images.xcassets */; }; - 099C5D0E05AF43F4B95AAA4A /* CDVNotification.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2F49F2111FC649498658CF3B /* CDVNotification.bundle */; }; - 0EB9CC91D14946018E9E8959 /* NSString+URLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = B67D2EE318FB494FA66C6A82 /* NSString+URLEncoding.m */; }; - 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 237E7D4BC93D43E9A298210F /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2AF51DC70C6443E88037BD84 /* CoreLocation.framework */; }; - 301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; }; - 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; }; - 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; }; - 35DC9CF8FDC24E6DA829674B /* AppDelegate+notification.m in Sources */ = {isa = PBXBuildFile; fileRef = 202110AF22594D0F9C1A334F /* AppDelegate+notification.m */; }; - 36186AA3639F426384682A75 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 014A3BF81C154724B8D195A5 /* libsqlite3.tbd */; }; - 3F54272035164B97980AEFF8 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C144F975307417B892CAC2C /* Social.framework */; }; - 4A6286E85D8E48729B679999 /* SocialSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = DDCE40E086B24A98A0490DA7 /* SocialSharing.m */; }; - 5246BFCFEB754DCC9DD156F5 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = F6093E605D6D49D1918413AA /* CDVDevice.m */; }; - 62A7DCEB605B49F4BD73FFF0 /* CDVSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A7B4D488DBC402C922C7574 /* CDVSplashScreen.m */; }; - 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; }; - 76C30D264E504728A7F0FD0C /* PushPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = B195BD92B31445039168DCCC /* PushPlugin.m */; }; - 84B2CD60DA194555B86E263D /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81D376C7F9874FA1B2318AFA /* AudioToolbox.framework */; }; - 84D89679250B4DF4ABF3BE7F /* CDVNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = 6921995B5AF0481CA93F7A5D /* CDVNotification.m */; }; - 8568F48189D243CA91300537 /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 63D8B1ADC251482C8620B623 /* CDVLogger.m */; }; - 90CAC9CF36B14DF486D02F7F /* CDVViewController+SplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = 4258DE006F82471E996DD840 /* CDVViewController+SplashScreen.m */; }; - 9E00629777934E4E82871B2C /* CDVLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FC74AC82074B0DA3CB7885 /* CDVLocation.m */; }; - 9E26B81E92624D9896571609 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FCCC22BF4385472E88382D56 /* MessageUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - A9267928B9A04BE29B534458 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6940DEA5B3084B54B48BD8F1 /* AddressBook.framework */; }; - B88B1D224DEA4E699F7502F8 /* CDVReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = E0008CA3AF7D47F497F52E48 /* CDVReachability.m */; }; - D126BF4289EA4FE087802574 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44965ED7EC514AD283A3DAA2 /* CoreTelephony.framework */; }; - E162E7029FC24C4595D1D82D /* IonicKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 738136BA596342BB82CCDD80 /* IonicKeyboard.m */; }; - E5CA6AAEC723E2850C15309E /* libPods-Stone Island.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1827DA33B918A624C9D0E74D /* libPods-Stone Island.a */; }; - E761267B18B0459FA2514AE8 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 85D3B0CF3FF74E3D97E33BF4 /* SystemConfiguration.framework */; }; - EF28FE2B49A344FBA3F7306F /* CDVInAppBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 729B6141DF9D4C1BB64A7097 /* CDVInAppBrowser.m */; }; - F4862C5594894163A3C3AB06 /* CDVConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E7CCBA15DC14F20830BD1B3 /* CDVConnection.m */; }; - F990B4C12C3746EAA8C30F8D /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 6465D215A1B148A387730F27 /* libz.tbd */; }; - 9DF0159ECE654EF1921606B9 /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CDFA08638E64E9F9CDB1109 /* CDVStatusBar.m */; }; - BC359FDFB50941649B56E28F /* AppDelegate+FirebasePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 5EC39C5B4DAE4FAD8CF8695D /* AppDelegate+FirebasePlugin.m */; }; - C866439BEFD34ABD84D2C187 /* FirebasePlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C3DDD8A49E340CF957F7B1F /* FirebasePlugin.m */; }; - 0FB747315D6F471689E642F5 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2C70563D47C64AF3ACAF61E0 /* GoogleService-Info.plist */; }; - 5E621514A94641479C72A50D /* FirebaseAnalytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F685F82C990346D690E3964A /* FirebaseAnalytics.framework */; }; - 1D5CAB42B5DE48328017C472 /* FirebaseCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD9D2163E342476EB5E0C76F /* FirebaseCore.framework */; }; - F5C11F2CB8FA4EDE90455B16 /* FirebaseInstanceID.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07EDF5A22AD84B9A9589735F /* FirebaseInstanceID.framework */; }; - 248907F240C5452893560A33 /* GoogleToolboxForMac.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 618739808BC6467DA23E8206 /* GoogleToolboxForMac.framework */; }; - AEAE498777844A5280FD25F4 /* Protobuf.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 608DE9DAFDE94B8A861130BD /* Protobuf.framework */; }; - 605B0C4C903B4FD8B1F0F694 /* FirebaseMessaging.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC38B894F8C343BCA787D906 /* FirebaseMessaging.framework */; }; - 7C872490D5A94AEBBBD1349E /* FirebaseCrash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0710864CDF044948B1C18450 /* FirebaseCrash.framework */; }; - 2082C1FBFC0E43BB8C609980 /* FirebaseRemoteConfig.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4398FE67A32F4A6CA63E3979 /* FirebaseRemoteConfig.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 301BF534109A57CC0062928A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC07E0554694100DB518D; - remoteInfo = CordovaLib; - }; - 301BF550109A68C00062928A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC07D0554694100DB518D; - remoteInfo = CordovaLib; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 014A3BF81C154724B8D195A5 /* libsqlite3.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; - 01C680112F874557A2F31A23 /* CDVSplashScreen.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVSplashScreen.h; path = "cordova-plugin-splashscreen/CDVSplashScreen.h"; sourceTree = "<group>"; }; - 0207DA571B56EA530066E2B4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "Stone Island/Images.xcassets"; sourceTree = SOURCE_ROOT; }; - 0B1CCEFB092F4CECA26CD473 /* CDVNotification.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVNotification.h; path = "cordova-plugin-dialogs/CDVNotification.h"; sourceTree = "<group>"; }; - 126A7C33C770436081C4808A /* CDVLocation.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVLocation.h; path = "cordova-plugin-geolocation/CDVLocation.h"; sourceTree = "<group>"; }; - 15B798542A834D5F9C46B593 /* CDVLogger.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVLogger.h; path = "cordova-plugin-console/CDVLogger.h"; sourceTree = "<group>"; }; - 1827DA33B918A624C9D0E74D /* libPods-Stone Island.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Stone Island.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1A7B4D488DBC402C922C7574 /* CDVSplashScreen.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVSplashScreen.m; path = "cordova-plugin-splashscreen/CDVSplashScreen.m"; sourceTree = "<group>"; }; - 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; - 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; - 1D6058910D05DD3D006BFB54 /* Stone Island.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Stone Island.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 202110AF22594D0F9C1A334F /* AppDelegate+notification.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "AppDelegate+notification.m"; path = "phonegap-plugin-push/AppDelegate+notification.m"; sourceTree = "<group>"; }; - 2371391E63BB4E19BE123F25 /* NSString+URLEncoding.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "NSString+URLEncoding.h"; path = "cordova-plugin-x-socialsharing/NSString+URLEncoding.h"; sourceTree = "<group>"; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; - 2AF51DC70C6443E88037BD84 /* CoreLocation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; - 2F49F2111FC649498658CF3B /* CDVNotification.bundle */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.plug-in"; path = CDVNotification.bundle; sourceTree = "<group>"; }; - 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CordovaLib.xcodeproj; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; }; - 301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; }; - 302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; }; - 302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; }; - 302D95F014D2391D003F00A1 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; }; - 3047A50F1AB8059700498E2A /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = "cordova/build-debug.xcconfig"; sourceTree = SOURCE_ROOT; }; - 3047A5101AB8059700498E2A /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; }; - 3047A5111AB8059700498E2A /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; }; - 32CA4F630368D1EE00C91783 /* Stone Island-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Stone Island-Prefix.pch"; sourceTree = "<group>"; }; - 40CE234F002F419597A039E4 /* AppDelegate+notification.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "AppDelegate+notification.h"; path = "phonegap-plugin-push/AppDelegate+notification.h"; sourceTree = "<group>"; }; - 4258DE006F82471E996DD840 /* CDVViewController+SplashScreen.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "CDVViewController+SplashScreen.m"; path = "cordova-plugin-splashscreen/CDVViewController+SplashScreen.m"; sourceTree = "<group>"; }; - 44965ED7EC514AD283A3DAA2 /* CoreTelephony.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; - 47F2E7D4A25F4BC1BF2C5DA9 /* CDVReachability.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVReachability.h; path = "cordova-plugin-network-information/CDVReachability.h"; sourceTree = "<group>"; }; - 4E80481E26EC4E568CC3903D /* CDVViewController+SplashScreen.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "CDVViewController+SplashScreen.h"; path = "cordova-plugin-splashscreen/CDVViewController+SplashScreen.h"; sourceTree = "<group>"; }; - 627E8711314C4B91BFAABD62 /* IonicKeyboard.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = IonicKeyboard.h; path = "ionic-plugin-keyboard/IonicKeyboard.h"; sourceTree = "<group>"; }; - 63D8B1ADC251482C8620B623 /* CDVLogger.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVLogger.m; path = "cordova-plugin-console/CDVLogger.m"; sourceTree = "<group>"; }; - 6465D215A1B148A387730F27 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; - 68D70F7F2E124A87BF3A302E /* CDVConnection.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVConnection.h; path = "cordova-plugin-network-information/CDVConnection.h"; sourceTree = "<group>"; }; - 68FC74AC82074B0DA3CB7885 /* CDVLocation.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVLocation.m; path = "cordova-plugin-geolocation/CDVLocation.m"; sourceTree = "<group>"; }; - 6921995B5AF0481CA93F7A5D /* CDVNotification.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVNotification.m; path = "cordova-plugin-dialogs/CDVNotification.m"; sourceTree = "<group>"; }; - 6940DEA5B3084B54B48BD8F1 /* AddressBook.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; - 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CDVLaunchScreen.storyboard; path = "Stone Island/CDVLaunchScreen.storyboard"; sourceTree = SOURCE_ROOT; }; - 6C144F975307417B892CAC2C /* Social.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; - 6E7CCBA15DC14F20830BD1B3 /* CDVConnection.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVConnection.m; path = "cordova-plugin-network-information/CDVConnection.m"; sourceTree = "<group>"; }; - 729B6141DF9D4C1BB64A7097 /* CDVInAppBrowser.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVInAppBrowser.m; path = "cordova-plugin-inappbrowser/CDVInAppBrowser.m"; sourceTree = "<group>"; }; - 738136BA596342BB82CCDD80 /* IonicKeyboard.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = IonicKeyboard.m; path = "ionic-plugin-keyboard/IonicKeyboard.m"; sourceTree = "<group>"; }; - 81D376C7F9874FA1B2318AFA /* AudioToolbox.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; - 85D3B0CF3FF74E3D97E33BF4 /* SystemConfiguration.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 876C6279414F4D5A82514049 /* CDVDevice.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVDevice.h; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; }; - 8D1107310486CEB800E47090 /* Stone Island-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "Stone Island-Info.plist"; path = "Stone Island/Stone Island-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; }; - 9AA8E7740E114B6E967452F8 /* PushPlugin.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = PushPlugin.h; path = "phonegap-plugin-push/PushPlugin.h"; sourceTree = "<group>"; }; - 9F81F9288C7B4B628408E9AF /* CDVInAppBrowser.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVInAppBrowser.h; path = "cordova-plugin-inappbrowser/CDVInAppBrowser.h"; sourceTree = "<group>"; }; - B195BD92B31445039168DCCC /* PushPlugin.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = PushPlugin.m; path = "phonegap-plugin-push/PushPlugin.m"; sourceTree = "<group>"; }; - B67D2EE318FB494FA66C6A82 /* NSString+URLEncoding.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "NSString+URLEncoding.m"; path = "cordova-plugin-x-socialsharing/NSString+URLEncoding.m"; sourceTree = "<group>"; }; - DDCE40E086B24A98A0490DA7 /* SocialSharing.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = SocialSharing.m; path = "cordova-plugin-x-socialsharing/SocialSharing.m"; sourceTree = "<group>"; }; - E0008CA3AF7D47F497F52E48 /* CDVReachability.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVReachability.m; path = "cordova-plugin-network-information/CDVReachability.m"; sourceTree = "<group>"; }; - EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; }; - EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; }; - ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; }; - EFE07C93437141668090A998 /* SocialSharing.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = SocialSharing.h; path = "cordova-plugin-x-socialsharing/SocialSharing.h"; sourceTree = "<group>"; }; - F6093E605D6D49D1918413AA /* CDVDevice.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVDevice.m; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; }; - F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "Stone Island/config.xml"; sourceTree = "<group>"; }; - FCCC22BF4385472E88382D56 /* MessageUI.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; - 4CDFA08638E64E9F9CDB1109 /* CDVStatusBar.m */ = {isa = PBXFileReference; name = "CDVStatusBar.m"; path = "cordova-plugin-statusbar/CDVStatusBar.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; }; - 80A8B3832B6347E09B3FB7EF /* CDVStatusBar.h */ = {isa = PBXFileReference; name = "CDVStatusBar.h"; path = "cordova-plugin-statusbar/CDVStatusBar.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; }; - 5EC39C5B4DAE4FAD8CF8695D /* AppDelegate+FirebasePlugin.m */ = {isa = PBXFileReference; name = "AppDelegate+FirebasePlugin.m"; path = "cordova-plugin-firebase/AppDelegate+FirebasePlugin.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; }; - 3C3DDD8A49E340CF957F7B1F /* FirebasePlugin.m */ = {isa = PBXFileReference; name = "FirebasePlugin.m"; path = "cordova-plugin-firebase/FirebasePlugin.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; }; - 8214BDBCCC7A406D97F13D14 /* AppDelegate+FirebasePlugin.h */ = {isa = PBXFileReference; name = "AppDelegate+FirebasePlugin.h"; path = "cordova-plugin-firebase/AppDelegate+FirebasePlugin.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; }; - 6733A6B615EC46D9A22EF1BB /* FirebasePlugin.h */ = {isa = PBXFileReference; name = "FirebasePlugin.h"; path = "cordova-plugin-firebase/FirebasePlugin.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; }; - BB95C4F62552438CBF008B58 /* Firebase.h */ = {isa = PBXFileReference; name = "Firebase.h"; path = "cordova-plugin-firebase/Firebase.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; }; - 2C70563D47C64AF3ACAF61E0 /* GoogleService-Info.plist */ = {isa = PBXFileReference; name = "GoogleService-Info.plist"; path = "GoogleService-Info.plist"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = text.plist.xml; explicitFileType = undefined; includeInIndex = 0; }; - F685F82C990346D690E3964A /* FirebaseAnalytics.framework */ = {isa = PBXFileReference; name = "FirebaseAnalytics.framework"; path = "Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; }; - FD9D2163E342476EB5E0C76F /* FirebaseCore.framework */ = {isa = PBXFileReference; name = "FirebaseCore.framework"; path = "Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; }; - 07EDF5A22AD84B9A9589735F /* FirebaseInstanceID.framework */ = {isa = PBXFileReference; name = "FirebaseInstanceID.framework"; path = "Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; }; - 618739808BC6467DA23E8206 /* GoogleToolboxForMac.framework */ = {isa = PBXFileReference; name = "GoogleToolboxForMac.framework"; path = "Stone Island/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; }; - 608DE9DAFDE94B8A861130BD /* Protobuf.framework */ = {isa = PBXFileReference; name = "Protobuf.framework"; path = "Stone Island/Plugins/cordova-plugin-firebase/Protobuf.framework"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; }; - DC38B894F8C343BCA787D906 /* FirebaseMessaging.framework */ = {isa = PBXFileReference; name = "FirebaseMessaging.framework"; path = "Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; }; - 0710864CDF044948B1C18450 /* FirebaseCrash.framework */ = {isa = PBXFileReference; name = "FirebaseCrash.framework"; path = "Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; }; - 4398FE67A32F4A6CA63E3979 /* FirebaseRemoteConfig.framework */ = {isa = PBXFileReference; name = "FirebaseRemoteConfig.framework"; path = "Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.framework; explicitFileType = undefined; includeInIndex = 0; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 301BF552109A68D80062928A /* libCordova.a in Frameworks */, - 84B2CD60DA194555B86E263D /* AudioToolbox.framework in Frameworks */, - 237E7D4BC93D43E9A298210F /* CoreLocation.framework in Frameworks */, - 3F54272035164B97980AEFF8 /* Social.framework in Frameworks */, - E761267B18B0459FA2514AE8 /* SystemConfiguration.framework in Frameworks */, - D126BF4289EA4FE087802574 /* CoreTelephony.framework in Frameworks */, - 9E26B81E92624D9896571609 /* MessageUI.framework in Frameworks */, - E5CA6AAEC723E2850C15309E /* libPods-Stone Island.a in Frameworks */, - A9267928B9A04BE29B534458 /* AddressBook.framework in Frameworks */, - 36186AA3639F426384682A75 /* libsqlite3.tbd in Frameworks */, - F990B4C12C3746EAA8C30F8D /* libz.tbd in Frameworks */, - 5E621514A94641479C72A50D /* FirebaseAnalytics.framework in Frameworks */, - 1D5CAB42B5DE48328017C472 /* FirebaseCore.framework in Frameworks */, - F5C11F2CB8FA4EDE90455B16 /* FirebaseInstanceID.framework in Frameworks */, - 248907F240C5452893560A33 /* GoogleToolboxForMac.framework in Frameworks */, - AEAE498777844A5280FD25F4 /* Protobuf.framework in Frameworks */, - 605B0C4C903B4FD8B1F0F694 /* FirebaseMessaging.framework in Frameworks */, - 7C872490D5A94AEBBBD1349E /* FirebaseCrash.framework in Frameworks */, - 2082C1FBFC0E43BB8C609980 /* FirebaseRemoteConfig.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 302D95EE14D2391D003F00A1 /* MainViewController.h */, - 302D95EF14D2391D003F00A1 /* MainViewController.m */, - 302D95F014D2391D003F00A1 /* MainViewController.xib */, - 1D3623240D0F684500981E51 /* AppDelegate.h */, - 1D3623250D0F684500981E51 /* AppDelegate.m */, - ); - name = Classes; - path = "Stone Island/Classes"; - sourceTree = SOURCE_ROOT; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* Stone Island.app */, - ); - name = Products; - sourceTree = "<group>"; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - EB87FDF41871DAF40020F90C /* config.xml */, - EB87FDF31871DA8E0020F90C /* www */, - EB87FDF11871DA420020F90C /* Staging */, - 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */, - 080E96DDFE201D6D7F000001 /* Classes */, - 307C750510C5A3420062BCA9 /* Plugins */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - 6F67A5A4D88AE361686FAC4F /* Pods */, - ); - name = CustomTemplate; - sourceTree = "<group>"; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* Stone Island-Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */, - ); - name = "Other Sources"; - path = "Stone Island"; - sourceTree = "<group>"; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 0207DA571B56EA530066E2B4 /* Images.xcassets */, - 3047A50E1AB8057F00498E2A /* config */, - 8D1107310486CEB800E47090 /* Stone Island-Info.plist */, - 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */, - 2F49F2111FC649498658CF3B /* CDVNotification.bundle */, - 2C70563D47C64AF3ACAF61E0 /* GoogleService-Info.plist */, - ); - name = Resources; - path = "Stone Island/Resources"; - sourceTree = "<group>"; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 81D376C7F9874FA1B2318AFA /* AudioToolbox.framework */, - 2AF51DC70C6443E88037BD84 /* CoreLocation.framework */, - 6C144F975307417B892CAC2C /* Social.framework */, - 85D3B0CF3FF74E3D97E33BF4 /* SystemConfiguration.framework */, - 44965ED7EC514AD283A3DAA2 /* CoreTelephony.framework */, - FCCC22BF4385472E88382D56 /* MessageUI.framework */, - 1827DA33B918A624C9D0E74D /* libPods-Stone Island.a */, - 6940DEA5B3084B54B48BD8F1 /* AddressBook.framework */, - 014A3BF81C154724B8D195A5 /* libsqlite3.tbd */, - 6465D215A1B148A387730F27 /* libz.tbd */, - F685F82C990346D690E3964A /* FirebaseAnalytics.framework */, - FD9D2163E342476EB5E0C76F /* FirebaseCore.framework */, - 07EDF5A22AD84B9A9589735F /* FirebaseInstanceID.framework */, - 618739808BC6467DA23E8206 /* GoogleToolboxForMac.framework */, - 608DE9DAFDE94B8A861130BD /* Protobuf.framework */, - DC38B894F8C343BCA787D906 /* FirebaseMessaging.framework */, - 0710864CDF044948B1C18450 /* FirebaseCrash.framework */, - 4398FE67A32F4A6CA63E3979 /* FirebaseRemoteConfig.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 301BF52E109A57CC0062928A /* Products */ = { - isa = PBXGroup; - children = ( - 301BF535109A57CC0062928A /* libCordova.a */, - ); - name = Products; - sourceTree = "<group>"; - }; - 3047A50E1AB8057F00498E2A /* config */ = { - isa = PBXGroup; - children = ( - 3047A50F1AB8059700498E2A /* build-debug.xcconfig */, - 3047A5101AB8059700498E2A /* build-release.xcconfig */, - 3047A5111AB8059700498E2A /* build.xcconfig */, - ); - name = config; - sourceTree = "<group>"; - }; - 307C750510C5A3420062BCA9 /* Plugins */ = { - isa = PBXGroup; - children = ( - 63D8B1ADC251482C8620B623 /* CDVLogger.m */, - 15B798542A834D5F9C46B593 /* CDVLogger.h */, - F6093E605D6D49D1918413AA /* CDVDevice.m */, - 876C6279414F4D5A82514049 /* CDVDevice.h */, - 6921995B5AF0481CA93F7A5D /* CDVNotification.m */, - 0B1CCEFB092F4CECA26CD473 /* CDVNotification.h */, - 68FC74AC82074B0DA3CB7885 /* CDVLocation.m */, - 126A7C33C770436081C4808A /* CDVLocation.h */, - 729B6141DF9D4C1BB64A7097 /* CDVInAppBrowser.m */, - 9F81F9288C7B4B628408E9AF /* CDVInAppBrowser.h */, - 6E7CCBA15DC14F20830BD1B3 /* CDVConnection.m */, - E0008CA3AF7D47F497F52E48 /* CDVReachability.m */, - 68D70F7F2E124A87BF3A302E /* CDVConnection.h */, - 47F2E7D4A25F4BC1BF2C5DA9 /* CDVReachability.h */, - 1A7B4D488DBC402C922C7574 /* CDVSplashScreen.m */, - 4258DE006F82471E996DD840 /* CDVViewController+SplashScreen.m */, - 01C680112F874557A2F31A23 /* CDVSplashScreen.h */, - 4E80481E26EC4E568CC3903D /* CDVViewController+SplashScreen.h */, - B67D2EE318FB494FA66C6A82 /* NSString+URLEncoding.m */, - DDCE40E086B24A98A0490DA7 /* SocialSharing.m */, - 2371391E63BB4E19BE123F25 /* NSString+URLEncoding.h */, - EFE07C93437141668090A998 /* SocialSharing.h */, - 738136BA596342BB82CCDD80 /* IonicKeyboard.m */, - 627E8711314C4B91BFAABD62 /* IonicKeyboard.h */, - 202110AF22594D0F9C1A334F /* AppDelegate+notification.m */, - B195BD92B31445039168DCCC /* PushPlugin.m */, - 40CE234F002F419597A039E4 /* AppDelegate+notification.h */, - 9AA8E7740E114B6E967452F8 /* PushPlugin.h */, - 4CDFA08638E64E9F9CDB1109 /* CDVStatusBar.m */, - 80A8B3832B6347E09B3FB7EF /* CDVStatusBar.h */, - 5EC39C5B4DAE4FAD8CF8695D /* AppDelegate+FirebasePlugin.m */, - 3C3DDD8A49E340CF957F7B1F /* FirebasePlugin.m */, - 8214BDBCCC7A406D97F13D14 /* AppDelegate+FirebasePlugin.h */, - 6733A6B615EC46D9A22EF1BB /* FirebasePlugin.h */, - BB95C4F62552438CBF008B58 /* Firebase.h */, - ); - name = Plugins; - path = "Stone Island/Plugins"; - sourceTree = SOURCE_ROOT; - }; - 6F67A5A4D88AE361686FAC4F /* Pods */ = { - isa = PBXGroup; - children = ( - ); - name = Pods; - sourceTree = "<group>"; - }; - EB87FDF11871DA420020F90C /* Staging */ = { - isa = PBXGroup; - children = ( - F840E1F0165FE0F500CFE078 /* config.xml */, - 301BF56E109A69640062928A /* www */, - ); - name = Staging; - sourceTree = "<group>"; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* Stone Island */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Stone Island" */; - buildPhases = ( - F32B3DCA842773566FE7D449 /* [CP] Check Pods Manifest.lock */, - 304B58A110DAC018002A0835 /* Copy www directory */, - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - 4BFB002450DEEC7E97D681A5 /* [CP] Embed Pods Frameworks */, - EB7BF2920E610805B0B63F0E /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 301BF551109A68C00062928A /* PBXTargetDependency */, - ); - name = "Stone Island"; - productName = "Stone Island"; - productReference = 1D6058910D05DD3D006BFB54 /* Stone Island.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 900; - TargetAttributes = { - 1D6058900D05DD3D006BFB54 = { - DevelopmentTeam = C6JQTPGJ97; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Stone Island" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - en, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - productRefGroup = 19C28FACFE9D520D11CA2CBB /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 301BF52E109A57CC0062928A /* Products */; - ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* Stone Island */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 301BF535109A57CC0062928A /* libCordova.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libCordova.a; - remoteRef = 301BF534109A57CC0062928A /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */, - 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */, - 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */, - 099C5D0E05AF43F4B95AAA4A /* CDVNotification.bundle in Resources */, - 0FB747315D6F471689E642F5 /* GoogleService-Info.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 304B58A110DAC018002A0835 /* Copy www directory */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy www directory"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "NODEJS_PATH=/usr/local/bin; NVM_NODE_PATH=~/.nvm/versions/node/`nvm version 2>/dev/null`/bin; N_NODE_PATH=`find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1`/bin; XCODE_NODE_PATH=`xcode-select --print-path`/usr/share/xcs/Node/bin; PATH=$NODEJS_PATH:$NVM_NODE_PATH:$N_NODE_PATH:$XCODE_NODE_PATH:$PATH && node cordova/lib/copy-www-build-step.js"; - showEnvVarsInLog = 0; - }; - 4BFB002450DEEC7E97D681A5 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - EB7BF2920E610805B0B63F0E /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - F32B3DCA842773566FE7D449 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../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"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, - 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */, - 8568F48189D243CA91300537 /* CDVLogger.m in Sources */, - 5246BFCFEB754DCC9DD156F5 /* CDVDevice.m in Sources */, - 84D89679250B4DF4ABF3BE7F /* CDVNotification.m in Sources */, - 9E00629777934E4E82871B2C /* CDVLocation.m in Sources */, - EF28FE2B49A344FBA3F7306F /* CDVInAppBrowser.m in Sources */, - F4862C5594894163A3C3AB06 /* CDVConnection.m in Sources */, - B88B1D224DEA4E699F7502F8 /* CDVReachability.m in Sources */, - 62A7DCEB605B49F4BD73FFF0 /* CDVSplashScreen.m in Sources */, - 90CAC9CF36B14DF486D02F7F /* CDVViewController+SplashScreen.m in Sources */, - 0EB9CC91D14946018E9E8959 /* NSString+URLEncoding.m in Sources */, - 4A6286E85D8E48729B679999 /* SocialSharing.m in Sources */, - E162E7029FC24C4595D1D82D /* IonicKeyboard.m in Sources */, - 35DC9CF8FDC24E6DA829674B /* AppDelegate+notification.m in Sources */, - 76C30D264E504728A7F0FD0C /* PushPlugin.m in Sources */, - 9DF0159ECE654EF1921606B9 /* CDVStatusBar.m in Sources */, - BC359FDFB50941649B56E28F /* AppDelegate+FirebasePlugin.m in Sources */, - C866439BEFD34ABD84D2C187 /* FirebasePlugin.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 301BF551109A68C00062928A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = CordovaLib; - targetProxy = 301BF550109A68C00062928A /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEVELOPMENT_TEAM = C6JQTPGJ97; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"Stone Island/Plugins/com.parse.cordova.core.pushplugin\"", - "\"Stone Island/Plugins/com.parse.cordova.core.pushplugin\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Stone Island/Stone Island-Prefix.pch"; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INFOPLIST_FILE = "Stone Island/Stone Island-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = us.okfoc.stoneisland; - PRODUCT_NAME = "Stone Island"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5101AB8059700498E2A /* build-release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - DEVELOPMENT_TEAM = C6JQTPGJ97; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "\"Stone Island/Plugins/com.parse.cordova.core.pushplugin\"", - "\"Stone Island/Plugins/com.parse.cordova.core.pushplugin\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - "\"Stone Island/Plugins/cordova-plugin-firebase\"", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Stone Island/Stone Island-Prefix.pch"; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - INFOPLIST_FILE = "Stone Island/Stone Island-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = us.okfoc.stoneisland; - PRODUCT_NAME = "Stone Island"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SKIP_INSTALL = NO; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */; - buildSettings = { - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_THUMB_SUPPORT = NO; - GCC_VERSION = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - SDKROOT = iphoneos; - SKIP_INSTALL = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Stone Island" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Stone Island" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Workspace - version = "1.0"> - <FileRef - location = "self:"> - </FileRef> -</Workspace> diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate Binary files differdeleted file mode 100644 index 4acbcf10..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Stone Island.xcscheme b/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Stone Island.xcscheme deleted file mode 100644 index 769f0221..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/Stone Island.xcscheme +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Scheme - LastUpgradeVersion = "0900" - version = "1.3"> - <BuildAction - parallelizeBuildables = "YES" - buildImplicitDependencies = "YES"> - <BuildActionEntries> - <BuildActionEntry - buildForTesting = "YES" - buildForRunning = "YES" - buildForProfiling = "YES" - buildForArchiving = "YES" - buildForAnalyzing = "YES"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "1D6058900D05DD3D006BFB54" - BuildableName = "Stone Island.app" - BlueprintName = "Stone Island" - ReferencedContainer = "container:Stone Island.xcodeproj"> - </BuildableReference> - </BuildActionEntry> - </BuildActionEntries> - </BuildAction> - <TestAction - buildConfiguration = "Debug" - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" - shouldUseLaunchSchemeArgsEnv = "YES"> - <Testables> - </Testables> - <MacroExpansion> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "1D6058900D05DD3D006BFB54" - BuildableName = "Stone Island.app" - BlueprintName = "Stone Island" - ReferencedContainer = "container:Stone Island.xcodeproj"> - </BuildableReference> - </MacroExpansion> - <AdditionalOptions> - </AdditionalOptions> - </TestAction> - <LaunchAction - buildConfiguration = "Debug" - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" - launchStyle = "0" - useCustomWorkingDirectory = "NO" - ignoresPersistentStateOnLaunch = "NO" - debugDocumentVersioning = "YES" - debugServiceExtension = "internal" - allowLocationSimulation = "YES"> - <BuildableProductRunnable - runnableDebuggingMode = "0"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "1D6058900D05DD3D006BFB54" - BuildableName = "Stone Island.app" - BlueprintName = "Stone Island" - ReferencedContainer = "container:Stone Island.xcodeproj"> - </BuildableReference> - </BuildableProductRunnable> - <AdditionalOptions> - </AdditionalOptions> - </LaunchAction> - <ProfileAction - buildConfiguration = "Release" - shouldUseLaunchSchemeArgsEnv = "YES" - savedToolIdentifier = "" - useCustomWorkingDirectory = "NO" - debugDocumentVersioning = "YES"> - <BuildableProductRunnable - runnableDebuggingMode = "0"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "1D6058900D05DD3D006BFB54" - BuildableName = "Stone Island.app" - BlueprintName = "Stone Island" - ReferencedContainer = "container:Stone Island.xcodeproj"> - </BuildableReference> - </BuildableProductRunnable> - </ProfileAction> - <AnalyzeAction - buildConfiguration = "Debug"> - </AnalyzeAction> - <ArchiveAction - buildConfiguration = "Release" - revealArchiveInOrganizer = "YES"> - </ArchiveAction> -</Scheme> diff --git a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate Binary files differdeleted file mode 100644 index 7d29ed0f..00000000 --- a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/AppDelegate+FirebasePlugin.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/AppDelegate+FirebasePlugin.h deleted file mode 100755 index 210cbb65..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/AppDelegate+FirebasePlugin.h +++ /dev/null @@ -1,5 +0,0 @@ -#import "AppDelegate.h"
-
-@interface AppDelegate (FirebasePlugin)
-@property (nonatomic, strong) NSNumber *applicationInBackground;
-@end
diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/AppDelegate+FirebasePlugin.m b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/AppDelegate+FirebasePlugin.m deleted file mode 100755 index c4c45778..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/AppDelegate+FirebasePlugin.m +++ /dev/null @@ -1,132 +0,0 @@ -#import "AppDelegate+FirebasePlugin.h"
-#import "FirebasePlugin.h"
-#import "Firebase.h"
-#import <objc/runtime.h>
-
-#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
-@import UserNotifications;
-#endif
-
-// Implement UNUserNotificationCenterDelegate to receive display notification via APNS for devices
-// running iOS 10 and above. Implement FIRMessagingDelegate to receive data message via FCM for
-// devices running iOS 10 and above.
-#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
-@interface AppDelegate () <UNUserNotificationCenterDelegate, FIRMessagingDelegate>
-@end
-#endif
-
-#define kApplicationInBackgroundKey @"applicationInBackground"
-
-@implementation AppDelegate (FirebasePlugin)
-
-+ (void)load {
- Method original = class_getInstanceMethod(self, @selector(application:didFinishLaunchingWithOptions:));
- Method swizzled = class_getInstanceMethod(self, @selector(application:swizzledDidFinishLaunchingWithOptions:));
- method_exchangeImplementations(original, swizzled);
-}
-
-- (void)setApplicationInBackground:(NSNumber *)applicationInBackground {
- objc_setAssociatedObject(self, kApplicationInBackgroundKey, applicationInBackground, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-- (NSNumber *)applicationInBackground {
- return objc_getAssociatedObject(self, kApplicationInBackgroundKey);
-}
-
-- (BOOL)application:(UIApplication *)application swizzledDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- [self application:application swizzledDidFinishLaunchingWithOptions:launchOptions];
-
- if(![FIRApp defaultApp]) {
- [FIRApp configure];
- }
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tokenRefreshNotification:)
- name:kFIRInstanceIDTokenRefreshNotification object:nil];
-
- self.applicationInBackground = @(YES);
-
- return YES;
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application {
- [self connectToFcm];
- self.applicationInBackground = @(NO);
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application {
- [[FIRMessaging messaging] disconnect];
- self.applicationInBackground = @(YES);
- NSLog(@"Disconnected from FCM");
-}
-
-- (void)tokenRefreshNotification:(NSNotification *)notification {
- // Note that this callback will be fired everytime a new token is generated, including the first
- // time. So if you need to retrieve the token as soon as it is available this is where that
- // should be done.
- NSString *refreshedToken = [[FIRInstanceID instanceID] token];
- NSLog(@"InstanceID token: %@", refreshedToken);
-
- // Connect to FCM since connection may have failed when attempted before having a token.
- [self connectToFcm];
-
- [FirebasePlugin.firebasePlugin sendToken:refreshedToken];
-}
-
-- (void)connectToFcm {
- [[FIRMessaging messaging] connectWithCompletion:^(NSError * _Nullable error) {
- if (error != nil) {
- NSLog(@"Unable to connect to FCM. %@", error);
- } else {
- NSLog(@"Connected to FCM.");
- NSString *refreshedToken = [[FIRInstanceID instanceID] token];
- NSLog(@"InstanceID token: %@", refreshedToken);
- }
- }];
-}
-
-- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
- NSDictionary *mutableUserInfo = [userInfo mutableCopy];
-
- [mutableUserInfo setValue:self.applicationInBackground forKey:@"tap"];
-
- // Pring full message.
- NSLog(@"%@", mutableUserInfo);
-
- [FirebasePlugin.firebasePlugin sendNotification:mutableUserInfo];
-}
-
-- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
- fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
-
- NSDictionary *mutableUserInfo = [userInfo mutableCopy];
-
- [mutableUserInfo setValue:self.applicationInBackground forKey:@"tap"];
-
- // Pring full message.
- NSLog(@"%@", mutableUserInfo);
-
- [FirebasePlugin.firebasePlugin sendNotification:mutableUserInfo];
-}
-
-#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
-- (void)userNotificationCenter:(UNUserNotificationCenter *)center
- willPresentNotification:(UNNotification *)notification
- withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
- NSDictionary *mutableUserInfo = [notification.request.content.userInfo mutableCopy];
-
- [mutableUserInfo setValue:self.applicationInBackground forKey:@"tap"];
-
- // Pring full message.
- NSLog(@"%@", mutableUserInfo);
-
- [FirebasePlugin.firebasePlugin sendNotification:mutableUserInfo];
-}
-
-// Receive data message on iOS 10 devices.
-- (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage {
- // Print full message
- NSLog(@"%@", [remoteMessage appData]);
-}
-#endif
-
-@end
diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/Firebase.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/Firebase.h deleted file mode 100644 index 90798a6a..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/Firebase.h +++ /dev/null @@ -1,52 +0,0 @@ -#import <FirebaseAnalytics/FirebaseAnalytics.h> -#import <FirebaseCore/FirebaseCore.h> - -#if !defined(__has_include) - #error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \ - import the headers individually." -#else - #if __has_include(<FirebaseAppIndexing/FirebaseAppIndexing.h>) - #import <FirebaseAppIndexing/FirebaseAppIndexing.h> - #endif - - #if __has_include(<FirebaseAuth/FirebaseAuth.h>) - #import <FirebaseAuth/FirebaseAuth.h> - #endif - - #if __has_include(<FirebaseCrash/FirebaseCrash.h>) - #import <FirebaseCrash/FirebaseCrash.h> - #endif - - #if __has_include(<FirebaseDatabase/FirebaseDatabase.h>) - #import <FirebaseDatabase/FirebaseDatabase.h> - #endif - - #if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>) - #import <FirebaseDynamicLinks/FirebaseDynamicLinks.h> - #endif - - #if __has_include(<FirebaseInstanceID/FirebaseInstanceID.h>) - #import <FirebaseInstanceID/FirebaseInstanceID.h> - #endif - - #if __has_include(<FirebaseInvites/FirebaseInvites.h>) - #import <FirebaseInvites/FirebaseInvites.h> - #endif - - #if __has_include(<FirebaseMessaging/FirebaseMessaging.h>) - #import <FirebaseMessaging/FirebaseMessaging.h> - #endif - - #if __has_include(<FirebaseRemoteConfig/FirebaseRemoteConfig.h>) - #import <FirebaseRemoteConfig/FirebaseRemoteConfig.h> - #endif - - #if __has_include(<FirebaseStorage/FirebaseStorage.h>) - #import <FirebaseStorage/FirebaseStorage.h> - #endif - - #if __has_include(<GoogleMobileAds/GoogleMobileAds.h>) - #import <GoogleMobileAds/GoogleMobileAds.h> - #endif - -#endif // defined(__has_include) diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h deleted file mode 100755 index e3ff4c12..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIRAnalytics+AppDelegate.h +++ /dev/null @@ -1,57 +0,0 @@ -#import <Foundation/Foundation.h> - -#import "FIRAnalytics.h" - -/** - * Provides App Delegate handlers to be used in your App Delegate. - * - * To save time integrating Firebase Analytics in an application, Firebase Analytics does not - * require delegation implementation from the AppDelegate. Instead this is automatically done by - * Firebase Analytics. Should you choose instead to delegate manually, you can turn off the App - * Delegate Proxy by adding FirebaseAppDelegateProxyEnabled into your app's Info.plist and setting - * it to NO, and adding the methods in this category to corresponding delegation handlers. - * - * To handle Universal Links, you must return YES in - * [UIApplicationDelegate application:didFinishLaunchingWithOptions:]. - */ -@interface FIRAnalytics (AppDelegate) - -/** - * Handles events related to a URL session that are waiting to be processed. - * - * For optimal use of Firebase Analytics, call this method from the - * [UIApplicationDelegate application:handleEventsForBackgroundURLSession:completionHandler] - * method of the app delegate in your app. - * - * @param identifier The identifier of the URL session requiring attention. - * @param completionHandler The completion handler to call when you finish processing the events. - * Calling this completion handler lets the system know that your app's user interface is - * updated and a new snapshot can be taken. - */ -+ (void)handleEventsForBackgroundURLSession:(NSString *)identifier - completionHandler:(void (^)(void))completionHandler; - -/** - * Handles the event when the app is launched by a URL. - * - * Call this method from [UIApplicationDelegate application:openURL:options:] (on iOS 9.0 and - * above), or [UIApplicationDelegate application:openURL:sourceApplication:annotation:] (on iOS 8.x - * and below) in your app. - * - * @param url The URL resource to open. This resource can be a network resource or a file. - */ -+ (void)handleOpenURL:(NSURL *)url; - -/** - * Handles the event when the app receives data associated with user activity that includes a - * Universal Link (on iOS 9.0 and above). - * - * Call this method from [UIApplication continueUserActivity:restorationHandler:] in your app - * delegate (on iOS 9.0 and above). - * - * @param userActivity The activity object containing the data associated with the task the user - * was performing. - */ -+ (void)handleUserActivity:(id)userActivity; - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIREventNames.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIREventNames.h deleted file mode 100755 index 3b40eecf..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseAnalytics.framework/Headers/FIREventNames.h +++ /dev/null @@ -1,336 +0,0 @@ -/// @file FIREventNames.h -/// -/// Predefined event names. -/// -/// An Event is an important occurrence in your app that you want to measure. You can report up to -/// 500 different types of Events per app and you can associate up to 25 unique parameters with each -/// Event type. Some common events are suggested below, but you may also choose to specify custom -/// Event types that are associated with your specific app. Each event type is identified by a -/// unique name. Event names can be up to 40 characters long, may only contain alphanumeric -/// characters and underscores ("_"), and must start with an alphabetic character. The "firebase_" -/// prefix is reserved and should not be used. - -/// Add Payment Info event. This event signifies that a user has submitted their payment information -/// to your app. -static NSString *const kFIREventAddPaymentInfo = @"add_payment_info"; - -/// E-Commerce Add To Cart event. This event signifies that an item was added to a cart for -/// purchase. Add this event to a funnel with kFIREventEcommercePurchase to gauge the effectiveness -/// of your checkout process. Note: If you supply the @c kFIRParameterValue parameter, you must -/// also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed -/// accurately. Params: -/// -/// <ul> -/// <li>@c kFIRParameterQuantity (signed 64-bit integer as NSNumber)</li> -/// <li>@c kFIRParameterItemID (NSString)</li> -/// <li>@c kFIRParameterItemName (NSString)</li> -/// <li>@c kFIRParameterItemCategory (NSString)</li> -/// <li>@c kFIRParameterItemLocationID (NSString) (optional)</li> -/// <li>@c kFIRParameterPrice (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> -/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterOrigin (NSString) (optional)</li> -/// <li>@c kFIRParameterDestination (NSString) (optional)</li> -/// <li>@c kFIRParameterStartDate (NSString) (optional)</li> -/// <li>@c kFIRParameterEndDate (NSString) (optional)</li> -/// </ul> -static NSString *const kFIREventAddToCart = @"add_to_cart"; - -/// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. -/// Use this event to identify popular gift items in your app. Note: If you supply the -/// @c kFIRParameterValue parameter, you must also supply the @c kFIRParameterCurrency -/// parameter so that revenue metrics can be computed accurately. Params: -/// -/// <ul> -/// <li>@c kFIRParameterQuantity (signed 64-bit integer as NSNumber)</li> -/// <li>@c kFIRParameterItemID (NSString)</li> -/// <li>@c kFIRParameterItemName (NSString)</li> -/// <li>@c kFIRParameterItemCategory (NSString)</li> -/// <li>@c kFIRParameterItemLocationID (NSString) (optional)</li> -/// <li>@c kFIRParameterPrice (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> -/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> -/// </ul> -static NSString *const kFIREventAddToWishlist = @"add_to_wishlist"; - -/// App Open event. By logging this event when an App is moved to the foreground, developers can -/// understand how often users leave and return during the course of a Session. Although Sessions -/// are automatically reported, this event can provide further clarification around the continuous -/// engagement of app-users. -static NSString *const kFIREventAppOpen = @"app_open"; - -/// E-Commerce Begin Checkout event. This event signifies that a user has begun the process of -/// checking out. Add this event to a funnel with your kFIREventEcommercePurchase event to gauge the -/// effectiveness of your checkout process. Note: If you supply the @c kFIRParameterValue -/// parameter, you must also supply the @c kFIRParameterCurrency parameter so that revenue -/// metrics can be computed accurately. Params: -/// -/// <ul> -/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> -/// <li>@c kFIRParameterTransactionID (NSString) (optional)</li> -/// <li>@c kFIRParameterStartDate (NSString) (optional)</li> -/// <li>@c kFIRParameterEndDate (NSString) (optional)</li> -/// <li>@c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for -/// hotel bookings</li> -/// <li>@c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for -/// hotel bookings</li> -/// <li>@c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) -/// for travel bookings</li> -/// <li>@c kFIRParameterOrigin (NSString) (optional)</li> -/// <li>@c kFIRParameterDestination (NSString) (optional)</li> -/// <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li> -/// </ul> -static NSString *const kFIREventBeginCheckout = @"begin_checkout"; - -/// Campaign Detail event. Log this event to supply the referral details of a re-engagement -/// campaign. Note: you must supply at least one of the required parameters kFIRParameterSource, -/// kFIRParameterMedium or kFIRParameterCampaign. Params: -/// -/// <ul> -/// <li>@c kFIRParameterSource (NSString)</li> -/// <li>@c kFIRParameterMedium (NSString)</li> -/// <li>@c kFIRParameterCampaign (NSString)</li> -/// <li>@c kFIRParameterTerm (NSString) (optional)</li> -/// <li>@c kFIRParameterContent (NSString) (optional)</li> -/// <li>@c kFIRParameterAdNetworkClickID (NSString) (optional)</li> -/// <li>@c kFIRParameterCP1 (NSString) (optional)</li> -/// </ul> -static NSString *const kFIREventCampaignDetails = @"campaign_details"; - -/// Earn Virtual Currency event. This event tracks the awarding of virtual currency in your app. Log -/// this along with @c kFIREventSpendVirtualCurrency to better understand your virtual economy. -/// Params: -/// -/// <ul> -/// <li>@c kFIRParameterVirtualCurrencyName (NSString)</li> -/// <li>@c kFIRParameterValue (signed 64-bit integer or double as NSNumber)</li> -/// </ul> -static NSString *const kFIREventEarnVirtualCurrency = @"earn_virtual_currency"; - -/// E-Commerce Purchase event. This event signifies that an item was purchased by a user. Note: -/// This is different from the in-app purchase event, which is reported automatically for App -/// Store-based apps. Note: If you supply the @c kFIRParameterValue parameter, you must also -/// supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed -/// accurately. Params: -/// -/// <ul> -/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> -/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterTransactionID (NSString) (optional)</li> -/// <li>@c kFIRParameterTax (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterShipping (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterCoupon (NSString) (optional)</li> -/// <li>@c kFIRParameterLocation (NSString) (optional)</li> -/// <li>@c kFIRParameterStartDate (NSString) (optional)</li> -/// <li>@c kFIRParameterEndDate (NSString) (optional)</li> -/// <li>@c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for -/// hotel bookings</li> -/// <li>@c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for -/// hotel bookings</li> -/// <li>@c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) -/// for travel bookings</li> -/// <li>@c kFIRParameterOrigin (NSString) (optional)</li> -/// <li>@c kFIRParameterDestination (NSString) (optional)</li> -/// <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li> -/// </ul> -static NSString *const kFIREventEcommercePurchase = @"ecommerce_purchase"; - -/// Generate Lead event. Log this event when a lead has been generated in the app to understand the -/// efficacy of your install and re-engagement campaigns. Note: If you supply the -/// @c kFIRParameterValue parameter, you must also supply the @c kFIRParameterCurrency -/// parameter so that revenue metrics can be computed accurately. Params: -/// -/// <ul> -/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> -/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> -/// </ul> -static NSString *const kFIREventGenerateLead = @"generate_lead"; - -/// Join Group event. Log this event when a user joins a group such as a guild, team or family. Use -/// this event to analyze how popular certain groups or social features are in your app. Params: -/// -/// <ul> -/// <li>@c kFIRParameterGroupID (NSString)</li> -/// </ul> -static NSString *const kFIREventJoinGroup = @"join_group"; - -/// Level Up event. This event signifies that a player has leveled up in your gaming app. It can -/// help you gauge the level distribution of your userbase and help you identify certain levels that -/// are difficult to pass. Params: -/// -/// <ul> -/// <li>@c kFIRParameterLevel (signed 64-bit integer as NSNumber)</li> -/// <li>@c kFIRParameterCharacter (NSString) (optional)</li> -/// </ul> -static NSString *const kFIREventLevelUp = @"level_up"; - -/// Login event. Apps with a login feature can report this event to signify that a user has logged -/// in. -static NSString *const kFIREventLogin = @"login"; - -/// Post Score event. Log this event when the user posts a score in your gaming app. This event can -/// help you understand how users are actually performing in your game and it can help you correlate -/// high scores with certain audiences or behaviors. Params: -/// -/// <ul> -/// <li>@c kFIRParameterScore (signed 64-bit integer as NSNumber)</li> -/// <li>@c kFIRParameterLevel (signed 64-bit integer as NSNumber) (optional)</li> -/// <li>@c kFIRParameterCharacter (NSString) (optional)</li> -/// </ul> -static NSString *const kFIREventPostScore = @"post_score"; - -/// Present Offer event. This event signifies that the app has presented a purchase offer to a user. -/// Add this event to a funnel with the kFIREventAddToCart and kFIREventEcommercePurchase to gauge -/// your conversion process. Note: If you supply the @c kFIRParameterValue parameter, you must -/// also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed -/// accurately. Params: -/// -/// <ul> -/// <li>@c kFIRParameterQuantity (signed 64-bit integer as NSNumber)</li> -/// <li>@c kFIRParameterItemID (NSString)</li> -/// <li>@c kFIRParameterItemName (NSString)</li> -/// <li>@c kFIRParameterItemCategory (NSString)</li> -/// <li>@c kFIRParameterItemLocationID (NSString) (optional)</li> -/// <li>@c kFIRParameterPrice (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> -/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> -/// </ul> -static NSString *const kFIREventPresentOffer = @"present_offer"; - -/// E-Commerce Purchase Refund event. This event signifies that an item purchase was refunded. -/// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the -/// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. -/// Params: -/// -/// <ul> -/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> -/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterTransactionID (NSString) (optional)</li> -/// </ul> -static NSString *const kFIREventPurchaseRefund = @"purchase_refund"; - -/// Search event. Apps that support search features can use this event to contextualize search -/// operations by supplying the appropriate, corresponding parameters. This event can help you -/// identify the most popular content in your app. Params: -/// -/// <ul> -/// <li>@c kFIRParameterSearchTerm (NSString)</li> -/// <li>@c kFIRParameterStartDate (NSString) (optional)</li> -/// <li>@c kFIRParameterEndDate (NSString) (optional)</li> -/// <li>@c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for -/// hotel bookings</li> -/// <li>@c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for -/// hotel bookings</li> -/// <li>@c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) -/// for travel bookings</li> -/// <li>@c kFIRParameterOrigin (NSString) (optional)</li> -/// <li>@c kFIRParameterDestination (NSString) (optional)</li> -/// <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li> -/// </ul> -static NSString *const kFIREventSearch = @"search"; - -/// Select Content event. This general purpose event signifies that a user has selected some content -/// of a certain type in an app. The content can be any object in your app. This event can help you -/// identify popular content and categories of content in your app. Params: -/// -/// <ul> -/// <li>@c kFIRParameterContentType (NSString)</li> -/// <li>@c kFIRParameterItemID (NSString)</li> -/// </ul> -static NSString *const kFIREventSelectContent = @"select_content"; - -/// Share event. Apps with social features can log the Share event to identify the most viral -/// content. Params: -/// -/// <ul> -/// <li>@c kFIRParameterContentType (NSString)</li> -/// <li>@c kFIRParameterItemID (NSString)</li> -/// </ul> -static NSString *const kFIREventShare = @"share"; - -/// Sign Up event. This event indicates that a user has signed up for an account in your app. The -/// parameter signifies the method by which the user signed up. Use this event to understand the -/// different behaviors between logged in and logged out users. Params: -/// -/// <ul> -/// <li>@c kFIRParameterSignUpMethod (NSString)</li> -/// </ul> -static NSString *const kFIREventSignUp = @"sign_up"; - -/// Spend Virtual Currency event. This event tracks the sale of virtual goods in your app and can -/// help you identify which virtual goods are the most popular objects of purchase. Params: -/// -/// <ul> -/// <li>@c kFIRParameterItemName (NSString)</li> -/// <li>@c kFIRParameterVirtualCurrencyName (NSString)</li> -/// <li>@c kFIRParameterValue (signed 64-bit integer or double as NSNumber)</li> -/// </ul> -static NSString *const kFIREventSpendVirtualCurrency = @"spend_virtual_currency"; - -/// Tutorial Begin event. This event signifies the start of the on-boarding process in your app. Use -/// this in a funnel with kFIREventTutorialComplete to understand how many users complete this -/// process and move on to the full app experience. -static NSString *const kFIREventTutorialBegin = @"tutorial_begin"; - -/// Tutorial End event. Use this event to signify the user's completion of your app's on-boarding -/// process. Add this to a funnel with kFIREventTutorialBegin to gauge the completion rate of your -/// on-boarding process. -static NSString *const kFIREventTutorialComplete = @"tutorial_complete"; - -/// Unlock Achievement event. Log this event when the user has unlocked an achievement in your -/// game. Since achievements generally represent the breadth of a gaming experience, this event can -/// help you understand how many users are experiencing all that your game has to offer. Params: -/// -/// <ul> -/// <li>@c kFIRParameterAchievementID (NSString)</li> -/// </ul> -static NSString *const kFIREventUnlockAchievement = @"unlock_achievement"; - -/// View Item event. This event signifies that some content was shown to the user. This content may -/// be a product, a webpage or just a simple image or text. Use the appropriate parameters to -/// contextualize the event. Use this event to discover the most popular items viewed in your app. -/// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the -/// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. -/// Params: -/// -/// <ul> -/// <li>@c kFIRParameterItemID (NSString)</li> -/// <li>@c kFIRParameterItemName (NSString)</li> -/// <li>@c kFIRParameterItemCategory (NSString)</li> -/// <li>@c kFIRParameterItemLocationID (NSString) (optional)</li> -/// <li>@c kFIRParameterPrice (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterQuantity (signed 64-bit integer as NSNumber) (optional)</li> -/// <li>@c kFIRParameterCurrency (NSString) (optional)</li> -/// <li>@c kFIRParameterValue (double as NSNumber) (optional)</li> -/// <li>@c kFIRParameterStartDate (NSString) (optional)</li> -/// <li>@c kFIRParameterEndDate (NSString) (optional)</li> -/// <li>@c kFIRParameterFlightNumber (NSString) (optional) for travel bookings</li> -/// <li>@c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) -/// for travel bookings</li> -/// <li>@c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for -/// travel bookings</li> -/// <li>@c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for -/// travel bookings</li> -/// <li>@c kFIRParameterOrigin (NSString) (optional)</li> -/// <li>@c kFIRParameterDestination (NSString) (optional)</li> -/// <li>@c kFIRParameterSearchTerm (NSString) (optional) for travel bookings</li> -/// <li>@c kFIRParameterTravelClass (NSString) (optional) for travel bookings</li> -/// </ul> -static NSString *const kFIREventViewItem = @"view_item"; - -/// View Item List event. Log this event when the user has been presented with a list of items of a -/// certain category. Params: -/// -/// <ul> -/// <li>@c kFIRParameterItemCategory (NSString)</li> -/// </ul> -static NSString *const kFIREventViewItemList = @"view_item_list"; - -/// View Search Results event. Log this event when the user has been presented with the results of a -/// search. Params: -/// -/// <ul> -/// <li>@c kFIRParameterSearchTerm (NSString)</li> -/// </ul> -static NSString *const kFIREventViewSearchResults = @"view_search_results"; diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/FirebaseCore b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/FirebaseCore Binary files differdeleted file mode 100755 index 364c6d67..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/FirebaseCore +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h deleted file mode 100755 index 667d5a4b..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRAnalyticsConfiguration.h +++ /dev/null @@ -1,38 +0,0 @@ -#import <Foundation/Foundation.h> - -/** - * This class provides configuration fields for Firebase Analytics. - */ -@interface FIRAnalyticsConfiguration : NSObject - -/** - * Returns the shared instance of FIRAnalyticsConfiguration. - */ -+ (FIRAnalyticsConfiguration *)sharedInstance; - -/** - * Sets the minimum engagement time in seconds required to start a new session. The default value - * is 10 seconds. - */ -- (void)setMinimumSessionInterval:(NSTimeInterval)minimumSessionInterval; - -/** - * Sets the interval of inactivity in seconds that terminates the current session. The default - * value is 1800 seconds (30 minutes). - */ -- (void)setSessionTimeoutInterval:(NSTimeInterval)sessionTimeoutInterval; - -/** - * Sets whether analytics collection is enabled for this app on this device. This setting is - * persisted across app sessions. By default it is enabled. - */ -- (void)setAnalyticsCollectionEnabled:(BOOL)analyticsCollectionEnabled; - -/** - * Deprecated. Sets whether measurement and reporting are enabled for this app on this device. By - * default they are enabled. - */ -- (void)setIsEnabled:(BOOL)isEnabled - DEPRECATED_MSG_ATTRIBUTE("Use setAnalyticsCollectionEnabled: instead."); - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRApp.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRApp.h deleted file mode 100755 index 263c4bef..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRApp.h +++ /dev/null @@ -1,98 +0,0 @@ -#import <Foundation/Foundation.h> -#import <UIKit/UIKit.h> - -@class FIROptions; - -NS_ASSUME_NONNULL_BEGIN - -/** A block that takes a BOOL and has no return value. */ -typedef void (^FIRAppVoidBoolCallback)(BOOL success); - -/** - * The entry point of Firebase SDKs. - * - * Initialize and configure FIRApp using +[FIRApp configure] - * or other customized ways as shown below. - * - * The logging system has two modes: default mode and debug mode. In default mode, only logs with - * log level Notice, Warning and Error will be sent to device. In debug mode, all logs will be sent - * to device. The log levels that Firebase uses are consistent with the ASL log levels. - * - * Enable debug mode by passing the -FIRDebugEnabled argument to the application. You can add this - * argument in the application's Xcode scheme. When debug mode is enabled via -FIRDebugEnabled, - * further executions of the application will also be in debug mode. In order to return to default - * mode, you must explicitly disable the debug mode with the application argument -FIRDebugDisabled. - * - * It is also possible to change the default logging level in code by calling setLoggerLevel: on - * the FIRConfiguration interface. - */ -@interface FIRApp : NSObject - -/** - * Configures a default Firebase app. Raises an exception if any configuration step fails. The - * default app is named "__FIRAPP_DEFAULT". This method should be called after the app is launched - * and before using Firebase services. This method is thread safe. - */ -+ (void)configure; - -/** - * Configures the default Firebase app with the provided options. The default app is named - * "__FIRAPP_DEFAULT". Raises an exception if any configuration step fails. This method is thread - * safe. - * - * @param options The Firebase application options used to configure the service. - */ -+ (void)configureWithOptions:(FIROptions *)options; - -/** - * Configures a Firebase app with the given name and options. Raises an exception if any - * configuration step fails. This method is thread safe. - * - * @param name The application's name given by the developer. The name should should only contain - Letters, Numbers and Underscore. - * @param options The Firebase application options used to configure the services. - */ -+ (void)configureWithName:(NSString *)name options:(FIROptions *)options; - -/** - * Returns the default app, or nil if the default app does not exist. - */ -+ (nullable FIRApp *)defaultApp NS_SWIFT_NAME(defaultApp()); - -/** - * Returns a previously created FIRApp instance with the given name, or nil if no such app exists. - * This method is thread safe. - */ -+ (nullable FIRApp *)appNamed:(NSString *)name; - -/** - * Returns the set of all extant FIRApp instances, or nil if there are no FIRApp instances. This - * method is thread safe. - */ -+ (nullable NSDictionary *)allApps; - -/** - * Cleans up the current FIRApp, freeing associated data and returning its name to the pool for - * future use. This method is thread safe. - */ -- (void)deleteApp:(FIRAppVoidBoolCallback)completion; - -/** - * FIRApp instances should not be initialized directly. Call +[FIRApp configure], - * +[FIRApp configureWithOptions:], or +[FIRApp configureWithNames:options:] directly. - */ -- (instancetype)init NS_UNAVAILABLE; - -/** - * Gets the name of this app. - */ -@property(nonatomic, copy, readonly) NSString *name; - -/** - * Gets the options for this app. - */ -@property(nonatomic, readonly) FIROptions *options; - -@end - -NS_ASSUME_NONNULL_END diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRLoggerLevel.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRLoggerLevel.h deleted file mode 100755 index ddf683f7..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Headers/FIRLoggerLevel.h +++ /dev/null @@ -1,12 +0,0 @@ -/** - * The log levels used by internal logging. - */ -typedef NS_ENUM(NSInteger, FIRLoggerLevel) { - FIRLoggerLevelError = 3 /*ASL_LEVEL_ERR*/, - FIRLoggerLevelWarning = 4 /*ASL_LEVEL_WARNING*/, - FIRLoggerLevelNotice = 5 /*ASL_LEVEL_NOTICE*/, - FIRLoggerLevelInfo = 6 /*ASL_LEVEL_INFO*/, - FIRLoggerLevelDebug = 7 /*ASL_LEVEL_DEBUG*/, - FIRLoggerLevelMin = FIRLoggerLevelError, - FIRLoggerLevelMax = FIRLoggerLevelDebug -}; diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Modules/module.modulemap deleted file mode 100755 index f3db90d8..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCore.framework/Modules/module.modulemap +++ /dev/null @@ -1,8 +0,0 @@ -framework module FirebaseCore { - umbrella header "FirebaseCore.h" - export * - module * { export *} - link "z" - link framework "Foundation" - link framework "UIKit" -}
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/FirebaseCrash b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/FirebaseCrash Binary files differdeleted file mode 100755 index 7cf08c10..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/FirebaseCrash +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Headers/FIRCrashLog.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Headers/FIRCrashLog.h deleted file mode 100755 index ac446a62..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Headers/FIRCrashLog.h +++ /dev/null @@ -1,164 +0,0 @@ -#import <Foundation/Foundation.h> - -NS_ASSUME_NONNULL_BEGIN - -/** - * @abstract Logs a message to the Firebase Crash Reporter system. - * - * @discussion This method adds a message to the crash reporter - * logging system. The recent logs will be sent with the crash - * report when the application exits abnormally. Note that the - * timestamp of this message and the timestamp of the console - * message may differ by a few milliseconds. - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @warning Raises an NSInvalidArgumentException if @p format is nil. - * - * @param format A format string. - * - * @param ap A variable argument list. - */ -FOUNDATION_EXTERN NS_FORMAT_FUNCTION(1, 0) -void FIRCrashLogv(NSString *format, va_list ap); - -/** - * @abstract Logs a message to the Firebase Crash Reporter system. - * - * @discussion This method adds a message to the crash reporter - * logging system. The recent logs will be sent with the crash - * report when the application exits abnormally. Note that the - * timestamp of this message and the timestamp of the console - * message may differ by a few milliseconds. - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @warning Raises an NSInvalidArgumentException if @p format is nil. - * - * @param format A format string. - * - * @param ... A comma-separated list of arguments to substitute into - * format. - * - * @see FIRCrashLogv(format, ap) - */ -FOUNDATION_STATIC_INLINE NS_FORMAT_FUNCTION(1, 2) -void FIRCrashLog(NSString *format, ...) { - va_list ap; - - va_start(ap, format); - FIRCrashLogv(format, ap); - va_end(ap); -} - -/** - * @abstract Logs a message to the Firebase Crash Reporter system as - * well as <code>NSLog()</code>. - * - * @discussion This method adds a message to the crash reporter - * logging system. The recent logs will be sent with the crash - * report when the application exits abnormally. Note that the - * timestamp of this message and the timestamp of the console - * message may differ by a few milliseconds. - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @warning Raises an NSInvalidArgumentException if @p format is nil. - * - * @param format A format string. - * - * @param ap A variable argument list. - */ -FOUNDATION_STATIC_INLINE NS_FORMAT_FUNCTION(1, 0) -void FIRCrashNSLogv(NSString *format, va_list ap) { - va_list ap2; - - va_copy(ap2, ap); - NSLogv(format, ap); - FIRCrashLogv(format, ap2); - va_end(ap2); -} - -/** - * @abstract Logs a message to the Firebase Crash Reporter system as - * well as <code>NSLog()</code>. - * - * @discussion This method adds a message to the crash reporter - * logging system. The recent logs will be sent with the crash - * report when the application exits abnormally. Note that the - * timestamp of this message and the timestamp of the console - * message may differ by a few milliseconds. - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @warning Raises an NSInvalidArgumentException if @p format is nil. - * - * @param format A format string. - * - * @param ... A comma-separated list of arguments to substitute into - * format. - * - * @see FIRCrashLogv(format, ap) - */ -FOUNDATION_STATIC_INLINE NS_FORMAT_FUNCTION(1, 2) -void FIRCrashNSLog(NSString *format, ...) { - va_list ap; - - va_start(ap, format); - FIRCrashNSLogv(format, ap); - va_end(ap); -} - -/** - * @abstract Logs a message to the Firebase Crash Reporter system in - * a way that is easily called from Swift code. - * - * @discussion This method adds a message to the crash reporter - * logging system. Similar to FIRCrashLog, but with a call signature - * that is more Swift friendly. Unlike FIRCrashLog, callers - * use string interpolation instead of formatting arguments. - * - * @code - * public func mySwiftFunction() { - * let unexpected_number = 10; - * FIRCrashMessage("This number doesn't seem right: \(unexpected_number)"); - * } - * @endcode - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @param Message A log message - * - * @see FIRCrashLog(format, ...) - */ -FOUNDATION_STATIC_INLINE -void FIRCrashMessage(NSString *message) { - FIRCrashLog(@"%@", message); -} - -NS_ASSUME_NONNULL_END - -#ifdef FIRCRASH_REPLACE_NSLOG -#if defined(DEBUG) || defined(FIRCRASH_LOG_TO_CONSOLE) -#define NSLog(...) FIRCrashNSLog(__VA_ARGS__) -#define NSLogv(...) FIRCrashNSLogv(__VA_ARGS__) -#else -#define NSLog(...) FIRCrashLog(__VA_ARGS__) -#define NSLogv(...) FIRCrashLogv(__VA_ARGS__) -#endif -#endif diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Headers/FirebaseCrash.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Headers/FirebaseCrash.h deleted file mode 100755 index 18659214..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Headers/FirebaseCrash.h +++ /dev/null @@ -1 +0,0 @@ -#import "FIRCrashLog.h" diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Modules/module.modulemap deleted file mode 100755 index 537a790a..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseCrash.framework/Modules/module.modulemap +++ /dev/null @@ -1,12 +0,0 @@ -framework module FirebaseCrash { - umbrella header "FirebaseCrash.h" - export * - module * { export *} - link "sqlite3" - link "z" - link framework "CoreGraphics" - link framework "CoreTelephony" - link framework "Foundation" - link framework "SystemConfiguration" - link framework "UIKit" -}
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/FirebaseInstanceID b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/FirebaseInstanceID Binary files differdeleted file mode 100755 index 2ebc6e68..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/FirebaseInstanceID +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/Modules/module.modulemap deleted file mode 100755 index 267c0356..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseInstanceID.framework/Modules/module.modulemap +++ /dev/null @@ -1,7 +0,0 @@ -framework module FirebaseInstanceID { - umbrella header "FirebaseInstanceID.h" - export * - module * { export *} - link framework "Foundation" - link framework "UIKit" -}
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/FirebaseMessaging b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/FirebaseMessaging Binary files differdeleted file mode 100755 index a0573d06..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/FirebaseMessaging +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/Headers/FIRMessaging.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/Headers/FIRMessaging.h deleted file mode 100755 index a0ae2e90..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/Headers/FIRMessaging.h +++ /dev/null @@ -1,227 +0,0 @@ -#import <Foundation/Foundation.h> - -/** - * The completion handler invoked once the data connection with FIRMessaging is - * established. The data connection is used to send a continous stream of - * data and all the FIRMessaging data notifications arrive through this connection. - * Once the connection is established we invoke the callback with `nil` error. - * Correspondingly if we get an error while trying to establish a connection - * we invoke the handler with an appropriate error object and do an - * exponential backoff to try and connect again unless successful. - * - * @param error The error object if any describing why the data connection - * to FIRMessaging failed. - */ -typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error); - -/** - * Notification sent when the upstream message has been delivered - * successfully to the server. The notification object will be the messageID - * of the successfully delivered message. - */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification; - -/** - * Notification sent when the upstream message was failed to be sent to the - * server. The notification object will be the messageID of the failed - * message. The userInfo dictionary will contain the relevant error - * information for the failure. - */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification; - -/** - * Notification sent when the Firebase messaging server deletes pending - * messages due to exceeded storage limits. This may occur, for example, when - * the device cannot be reached for an extended period of time. - * - * It is recommended to retrieve any missing messages directly from the - * server. - */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotification; - -/** - * @enum FIRMessagingError - */ -typedef NS_ENUM(NSUInteger, FIRMessagingError) { - /// Unknown error. - FIRMessagingErrorUnknown = 0, - - /// FIRMessaging couldn't validate request from this client. - FIRMessagingErrorAuthentication = 1, - - /// InstanceID service cannot be accessed. - FIRMessagingErrorNoAccess = 2, - - /// Request to InstanceID backend timed out. - FIRMessagingErrorTimeout = 3, - - /// No network available to reach the servers. - FIRMessagingErrorNetwork = 4, - - /// Another similar operation in progress, bailing this one. - FIRMessagingErrorOperationInProgress = 5, - - /// Some parameters of the request were invalid. - FIRMessagingErrorInvalidRequest = 7, -}; - -/// Status for the downstream message received by the app. -typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { - /// Unknown status. - FIRMessagingMessageStatusUnknown, - /// New downstream message received by the app. - FIRMessagingMessageStatusNew, -}; - -/// Information about a downstream message received by the app. -@interface FIRMessagingMessageInfo : NSObject - -/// The status of the downstream message -@property(nonatomic, readonly, assign) FIRMessagingMessageStatus status; - -@end - -/** - * A remote data message received by the app via FCM (not just the APNs interface). - * - * This is only for devices running iOS 10 or above. To support devices running iOS 9 or below, use - * the local and remote notifications handlers defined in UIApplicationDelegate protocol. - */ -@interface FIRMessagingRemoteMessage : NSObject - -/// The downstream message received by the application. -@property(nonatomic, readonly, strong, nonnull) NSDictionary *appData; - -@end - -/** - * A protocol to receive data message via FCM for devices running iOS 10 or above. - * - * To support devices running iOS 9 or below, use the local and remote notifications handlers - * defined in UIApplicationDelegate protocol. - */ -@protocol FIRMessagingDelegate <NSObject> - -/// The callback to handle data message received via FCM for devices running iOS 10 or above. -- (void)applicationReceivedRemoteMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage; - -@end - -/** - * Firebase Messaging lets you reliably deliver messages at no cost. - * - * To send or receive messages, the app must get a - * registration token from FIRInstanceID. This token authorizes an - * app server to send messages to an app instance. - * - * In order to receive FIRMessaging messages, declare `application:didReceiveRemoteNotification:`. - * - * - */ -@interface FIRMessaging : NSObject - -/** - * Delegate to handle remote data messages received via FCM for devices running iOS 10 or above. - */ -@property(nonatomic, weak, nullable) id<FIRMessagingDelegate> remoteMessageDelegate; - -/** - * FIRMessaging - * - * @return An instance of FIRMessaging. - */ -+ (nonnull instancetype)messaging NS_SWIFT_NAME(messaging()); - -/** - * Unavailable. Use +messaging instead. - */ -- (nonnull instancetype)init __attribute__((unavailable("Use +messaging instead."))); - -#pragma mark - Connect - -/** - * Create a FIRMessaging data connection which will be used to send the data notifications - * sent by your server. It will also be used to send ACKS and other messages based - * on the FIRMessaging ACKS and other messages based on the FIRMessaging protocol. - * - * - * @param handler The handler to be invoked once the connection is established. - * If the connection fails we invoke the handler with an - * appropriate error code letting you know why it failed. At - * the same time, FIRMessaging performs exponential backoff to retry - * establishing a connection and invoke the handler when successful. - */ -- (void)connectWithCompletion:(nonnull FIRMessagingConnectCompletion)handler; - -/** - * Disconnect the current FIRMessaging data connection. This stops any attempts to - * connect to FIRMessaging. Calling this on an already disconnected client is a no-op. - * - * Call this before `teardown` when your app is going to the background. - * Since the FIRMessaging connection won't be allowed to live when in background it is - * prudent to close the connection. - */ -- (void)disconnect; - -#pragma mark - Topics - -/** - * Asynchronously subscribes to a topic. - * - * @param topic The name of the topic, for example, @"sports". - */ -- (void)subscribeToTopic:(nonnull NSString *)topic; - -/** - * Asynchronously unsubscribe from a topic. - * - * @param topic The name of the topic, for example @"sports". - */ -- (void)unsubscribeFromTopic:(nonnull NSString *)topic; - -#pragma mark - Upstream - -/** - * Sends an upstream ("device to cloud") message. - * - * The message is queued if we don't have an active connection. - * You can only use the upstream feature if your FCM implementation - * uses the XMPP server protocol. - * - * @param message Key/Value pairs to be sent. Values must be String, any - * other type will be ignored. - * @param to A string identifying the receiver of the message. For FCM - * project IDs the value is `SENDER_ID@gcm.googleapis.com`. - * @param messageID The ID of the message. This is generated by the application. It - * must be unique for each message generated by this application. - * It allows error callbacks and debugging, to uniquely identify - * each message. - * @param ttl The time to live for the message. In case we aren't able to - * send the message before the TTL expires we will send you a - * callback. If 0, we'll attempt to send immediately and return - * an error if we're not connected. Otherwise, the message will - * be queued. As for server-side messages, we don't return an error - * if the message has been dropped because of TTL; this can happen - * on the server side, and it would require extra communication. - */ -- (void)sendMessage:(nonnull NSDictionary *)message - to:(nonnull NSString *)receiver - withMessageID:(nonnull NSString *)messageID - timeToLive:(int64_t)ttl; - -#pragma mark - Analytics - -/** - * Use this to track message delivery and analytics for messages, typically - * when you receive a notification in `application:didReceiveRemoteNotification:`. - * However, you only need to call this if you set the `FirebaseAppDelegateProxyEnabled` - * flag to NO in your Info.plist. If `FirebaseAppDelegateProxyEnabled` is either missing - * or set to YES in your Info.plist, the library will call this automatically. - * - * @param message The downstream message received by the application. - * - * @return Information about the downstream message. - */ -- (nonnull FIRMessagingMessageInfo *)appDidReceiveMessage:(nonnull NSDictionary *)message; - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/Modules/module.modulemap deleted file mode 100755 index 80bc59c1..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseMessaging.framework/Modules/module.modulemap +++ /dev/null @@ -1,11 +0,0 @@ -framework module FirebaseMessaging { - umbrella header "FirebaseMessaging.h" - export * - module * { export *} - link "sqlite3" - link "z" - link framework "CoreGraphics" - link framework "Foundation" - link framework "SystemConfiguration" - link framework "UIKit" -}
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebasePlugin.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebasePlugin.h deleted file mode 100755 index 93542737..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebasePlugin.h +++ /dev/null @@ -1,30 +0,0 @@ -#import <Cordova/CDV.h>
-#import "AppDelegate.h"
-
-@interface FirebasePlugin : CDVPlugin
-+ (FirebasePlugin *) firebasePlugin;
-- (void)getInstanceId:(CDVInvokedUrlCommand*)command;
-- (void)getToken:(CDVInvokedUrlCommand*)command;
-- (void)grantPermission:(CDVInvokedUrlCommand*)command;
-- (void)hasPermission:(CDVInvokedUrlCommand*)command;
-- (void)setBadgeNumber:(CDVInvokedUrlCommand*)command;
-- (void)getBadgeNumber:(CDVInvokedUrlCommand*)command;
-- (void)subscribe:(CDVInvokedUrlCommand*)command;
-- (void)unsubscribe:(CDVInvokedUrlCommand*)command;
-- (void)unregister:(CDVInvokedUrlCommand*)command;
-- (void)onNotificationOpen:(CDVInvokedUrlCommand*)command;
-- (void)onTokenRefresh:(CDVInvokedUrlCommand*)command;
-- (void)sendNotification:(NSDictionary*)userInfo;
-- (void)sendToken:(NSString*)token;
-- (void)logEvent:(CDVInvokedUrlCommand*)command;
-- (void)setScreenName:(CDVInvokedUrlCommand*)command;
-- (void)setUserId:(CDVInvokedUrlCommand*)command;
-- (void)setUserProperty:(CDVInvokedUrlCommand*)command;
-- (void)fetch:(CDVInvokedUrlCommand*)command;
-- (void)activateFetched:(CDVInvokedUrlCommand*)command;
-- (void)getValue:(CDVInvokedUrlCommand*)command;
-@property (nonatomic, copy) NSString *notificationCallbackId;
-@property (nonatomic, copy) NSString *tokenRefreshCallbackId;
-@property (nonatomic, retain) NSMutableArray *notificationStack;
-
-@end
diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebasePlugin.m b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebasePlugin.m deleted file mode 100644 index 580fb760..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebasePlugin.m +++ /dev/null @@ -1,331 +0,0 @@ -#import "FirebasePlugin.h" -#import <Cordova/CDV.h> -#import "AppDelegate.h" -#import "Firebase.h" -@import FirebaseInstanceID; -@import FirebaseMessaging; -@import FirebaseAnalytics; -@import FirebaseRemoteConfig; - -#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 -@import UserNotifications; -#endif - -#ifndef NSFoundationVersionNumber_iOS_9_x_Max -#define NSFoundationVersionNumber_iOS_9_x_Max 1299 -#endif - -@implementation FirebasePlugin - -@synthesize notificationCallbackId; -@synthesize tokenRefreshCallbackId; -@synthesize notificationStack; - -static NSInteger const kNotificationStackSize = 10; -static FirebasePlugin *firebasePlugin; - -+ (FirebasePlugin *) firebasePlugin { - return firebasePlugin; -} - -- (void)pluginInitialize { - NSLog(@"Starting Firebase plugin"); - firebasePlugin = self; -} - -// DEPRECATED - alias of getToken -- (void)getInstanceId:(CDVInvokedUrlCommand *)command { - CDVPluginResult *pluginResult; - - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString: - [[FIRInstanceID instanceID] token]]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)getToken:(CDVInvokedUrlCommand *)command { - CDVPluginResult *pluginResult; - - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString: - [[FIRInstanceID instanceID] token]]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} -- (void)hasPermission:(CDVInvokedUrlCommand *)command -{ - BOOL enabled = NO; - UIApplication *application = [UIApplication sharedApplication]; - if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) { - enabled = application.currentUserNotificationSettings.types != UIUserNotificationTypeNone; - } else { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - enabled = application.enabledRemoteNotificationTypes != UIRemoteNotificationTypeNone; -#pragma GCC diagnostic pop - } - - NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:1]; - [message setObject:[NSNumber numberWithBool:enabled] forKey:@"isEnabled"]; - CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:message]; - [self.commandDelegate sendPluginResult:commandResult callbackId:command.callbackId]; -} -- (void)grantPermission:(CDVInvokedUrlCommand *)command { - if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max) { - if ([[UIApplication sharedApplication]respondsToSelector:@selector(registerUserNotificationSettings:)]) { - UIUserNotificationType notificationTypes = - (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge); - UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil]; - [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; - } else { - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; - #pragma GCC diagnostic pop - } - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - return; - } - - - - #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 - BOOL isIOS10 = TRUE; - #else - BOOL isIOS10 = FALSE; - #endif - - - if ( !isIOS10 ) { - [[UIApplication sharedApplication] registerForRemoteNotifications]; - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - return; - } - - - - // IOS 10 - UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert|UNAuthorizationOptionSound|UNAuthorizationOptionBadge; - [[UNUserNotificationCenter currentNotificationCenter] - requestAuthorizationWithOptions:authOptions - completionHandler:^(BOOL granted, NSError * _Nullable error) { - - if ( ![NSThread isMainThread] ) { - dispatch_sync(dispatch_get_main_queue(), ^{ - [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; - [[FIRMessaging messaging] setRemoteMessageDelegate:self]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: granted ? CDVCommandStatus_OK : CDVCommandStatus_ERROR]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }); - } - else { - [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; - [[FIRMessaging messaging] setRemoteMessageDelegate:self]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - } - ]; - - return; -} - -- (void)setBadgeNumber:(CDVInvokedUrlCommand *)command { - int number = [[command.arguments objectAtIndex:0] intValue]; - - [self.commandDelegate runInBackground:^{ - [[UIApplication sharedApplication] setApplicationIconBadgeNumber:number]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)getBadgeNumber:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - long badge = [[UIApplication sharedApplication] applicationIconBadgeNumber]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:badge]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)subscribe:(CDVInvokedUrlCommand *)command { - NSString* topic = [NSString stringWithFormat:@"/topics/%@", [command.arguments objectAtIndex:0]]; - - [[FIRMessaging messaging] subscribeToTopic: topic]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)unsubscribe:(CDVInvokedUrlCommand *)command { - NSString* topic = [NSString stringWithFormat:@"/topics/%@", [command.arguments objectAtIndex:0]]; - - [[FIRMessaging messaging] unsubscribeFromTopic: topic]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)unregister:(CDVInvokedUrlCommand *)command { - [[FIRInstanceID instanceID] deleteIDWithHandler:^void(NSError *_Nullable error){ - if (error) { - NSLog(@"Unable to delete instance"); - } else { - NSString* currentToken = [[FIRInstanceID instanceID] token]; - if (currentToken != nil) { - [self sendToken:currentToken]; - } - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - }]; -} - -- (void)onNotificationOpen:(CDVInvokedUrlCommand *)command { - self.notificationCallbackId = command.callbackId; - - if (self.notificationStack != nil && [self.notificationStack count]) { - for (NSDictionary *userInfo in self.notificationStack) { - [self sendNotification:userInfo]; - } - [self.notificationStack removeAllObjects]; - } -} - -- (void)onTokenRefresh:(CDVInvokedUrlCommand *)command { - self.tokenRefreshCallbackId = command.callbackId; - NSString* currentToken = [[FIRInstanceID instanceID] token]; - if (currentToken != nil) { - [self sendToken:currentToken]; - } -} - -- (void)sendNotification:(NSDictionary *)userInfo { - if (self.notificationCallbackId != nil) { - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:userInfo]; - [pluginResult setKeepCallbackAsBool:YES]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:self.notificationCallbackId]; - } else { - if (!self.notificationStack) { - self.notificationStack = [[NSMutableArray alloc] init]; - } - - // stack notifications until a callback has been registered - [self.notificationStack addObject:userInfo]; - - if ([self.notificationStack count] >= kNotificationStackSize) { - [self.notificationStack removeLastObject]; - } - } -} - -- (void)sendToken:(NSString *)token { - if (self.tokenRefreshCallbackId != nil) { - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:token]; - [pluginResult setKeepCallbackAsBool:YES]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:self.tokenRefreshCallbackId]; - } -} - -- (void)logEvent:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - NSString* name = [command.arguments objectAtIndex:0]; - NSDictionary* parameters = [command.arguments objectAtIndex:1]; - - [FIRAnalytics logEventWithName:name parameters:parameters]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)setScreenName:(CDVInvokedUrlCommand *)command { - NSString* name = [command.arguments objectAtIndex:0]; - - [FIRAnalytics setScreenName:name screenClass:NULL]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)setUserId:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - NSString* id = [command.arguments objectAtIndex:0]; - - [FIRAnalytics setUserID:id]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)setUserProperty:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - NSString* name = [command.arguments objectAtIndex:0]; - NSString* value = [command.arguments objectAtIndex:1]; - - [FIRAnalytics setUserPropertyString:value forName:name]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)fetch:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - FIRRemoteConfig* remoteConfig = [FIRRemoteConfig remoteConfig]; - - if ([command.arguments count] > 0){ - int expirationDuration = [[command.arguments objectAtIndex:0] intValue]; - - [remoteConfig fetchWithExpirationDuration:expirationDuration completionHandler:^(FIRRemoteConfigFetchStatus status, NSError * _Nullable error) { - if (status == FIRRemoteConfigFetchStatusSuccess) { - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - }]; - } else { - [remoteConfig fetchWithCompletionHandler:^(FIRRemoteConfigFetchStatus status, NSError * _Nullable error) { - if (status == FIRRemoteConfigFetchStatusSuccess) { - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - }]; - } - }]; -} - -- (void)activateFetched:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - FIRRemoteConfig* remoteConfig = [FIRRemoteConfig remoteConfig]; - BOOL activated = [remoteConfig activateFetched]; - CDVPluginResult *pluginResult; - if (activated) { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - } else { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR]; - } - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)getValue:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - NSString* key = [command.arguments objectAtIndex:0]; - FIRRemoteConfig* remoteConfig = [FIRRemoteConfig remoteConfig]; - NSString* value = remoteConfig[key].stringValue; - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:value]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/FirebaseRemoteConfig b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/FirebaseRemoteConfig Binary files differdeleted file mode 100755 index 45637862..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/FirebaseRemoteConfig +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h deleted file mode 100755 index 395020ca..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h +++ /dev/null @@ -1,224 +0,0 @@ -// -// FIRRemoteConfig.h -// Firebase Remote Config service SDK -// Copyright 2016 Google Inc. All rights reserved. -// -#import <Foundation/Foundation.h> - -/// The Firebase Remote Config service default namespace, to be used if the API method does not -/// specify a different namespace. Use the default namespace if configuring from the Google Firebase -/// service. -extern NSString *const __nonnull FIRNamespaceGoogleMobilePlatform; - -/// Key used to manage throttling in NSError user info when the refreshing of Remote Config -/// parameter values (data) is throttled. The value of this key is the elapsed time since 1970, -/// measured in seconds. -extern NSString *const __nonnull FIRRemoteConfigThrottledEndTimeInSecondsKey; - -/// Indicates whether updated data was successfully fetched. -typedef NS_ENUM(NSInteger, FIRRemoteConfigFetchStatus) { - /// Config has never been fetched. - FIRRemoteConfigFetchStatusNoFetchYet, - /// Config fetch succeeded. - FIRRemoteConfigFetchStatusSuccess, - /// Config fetch failed. - FIRRemoteConfigFetchStatusFailure, - /// Config fetch was throttled. - FIRRemoteConfigFetchStatusThrottled, -}; - -/// Remote Config error domain that handles errors when fetching data from the service. -extern NSString *const __nonnull FIRRemoteConfigErrorDomain; -/// Firebase Remote Config service fetch error. -typedef NS_ENUM(NSInteger, FIRRemoteConfigError) { - /// Unknown or no error. - FIRRemoteConfigErrorUnknown = 8001, - /// Frequency of fetch requests exceeds throttled limit. - FIRRemoteConfigErrorThrottled = 8002, - /// Internal error that covers all internal HTTP errors. - FIRRemoteConfigErrorInternalError = 8003, -}; - -/// Enumerated value that indicates the source of Remote Config data. Data can come from -/// the Remote Config service, the DefaultConfig that is available when the app is first installed, -/// or a static initialized value if data is not available from the service or DefaultConfig. -typedef NS_ENUM(NSInteger, FIRRemoteConfigSource) { - FIRRemoteConfigSourceRemote, ///< The data source is the Remote Config service. - FIRRemoteConfigSourceDefault, ///< The data source is the DefaultConfig defined for this app. - FIRRemoteConfigSourceStatic, ///< The data doesn't exist, return a static initialized value. -}; - -/// Completion handler invoked by fetch methods when they get a response from the server. -/// -/// @param status Config fetching status. -/// @param error Error message on failure. -typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus status, - NSError *__nullable error); - -#pragma mark - FIRRemoteConfigValue -/// This class provides a wrapper for Remote Config parameter values, with methods to get parameter -/// values as different data types. -@interface FIRRemoteConfigValue : NSObject<NSCopying> -/// Gets the value as a string. -@property(nonatomic, readonly, nullable) NSString *stringValue; -/// Gets the value as a number value. -@property(nonatomic, readonly, nullable) NSNumber *numberValue; -/// Gets the value as a NSData object. -@property(nonatomic, readonly, nonnull) NSData *dataValue; -/// Gets the value as a boolean. -@property(nonatomic, readonly) BOOL boolValue; -/// Identifies the source of the fetched value. -@property(nonatomic, readonly) FIRRemoteConfigSource source; -@end - -#pragma mark - FIRRemoteConfigSettings -/// Firebase Remote Config settings. -@interface FIRRemoteConfigSettings : NSObject -/// Indicates whether Developer Mode is enabled. -@property(nonatomic, readonly) BOOL isDeveloperModeEnabled; -/// Initializes FIRRemoteConfigSettings, which is used to set properties for custom settings. To -/// make custom settings take effect, pass the FIRRemoteConfigSettings instance to the -/// configSettings property of FIRRemoteConfig. -- (nullable FIRRemoteConfigSettings *)initWithDeveloperModeEnabled:(BOOL)developerModeEnabled - NS_DESIGNATED_INITIALIZER; -@end - -#pragma mark - FIRRemoteConfig -/// Firebase Remote Config class. The shared instance method +remoteConfig can be created and used -/// to fetch, activate and read config results and set default config results. -@interface FIRRemoteConfig : NSObject<NSFastEnumeration> -/// Last successful fetch completion time. -@property(nonatomic, readonly, strong, nullable) NSDate *lastFetchTime; -/// Last fetch status. The status can be any enumerated value from FIRRemoteConfigFetchStatus. -@property(nonatomic, readonly, assign) FIRRemoteConfigFetchStatus lastFetchStatus; -/// Config settings are custom settings. -@property(nonatomic, readwrite, strong, nonnull) FIRRemoteConfigSettings *configSettings; - -/// Returns the FIRRemoteConfig instance shared throughout your app. This singleton object contains -/// the complete set of Remote Config parameter values available to the app, including the Active -/// Config and Default Config. This object also caches values fetched from the Remote Config Server -/// until they are copied to the Active Config by calling activateFetched. -/// When you fetch values from the Remote Config Server using the default Firebase namespace -/// service, you should use this class method to create a shared instance of the FIRRemoteConfig -/// object to ensure that your app will function properly with the Remote Config Server and the -/// Firebase service. -+ (nonnull FIRRemoteConfig *)remoteConfig NS_SWIFT_NAME(remoteConfig()); - -/// Unavailable. Use +remoteConfig instead. -- (nonnull instancetype)init __attribute__((unavailable("Use +remoteConfig instead."))); - -#pragma mark - Fetch -/// Fetches Remote Config data with a callback. Call activateFetched to make fetched data available -/// to your app. -/// @param completionHandler Fetch operation callback. -- (void)fetchWithCompletionHandler:(nullable FIRRemoteConfigFetchCompletion)completionHandler; - -/// Fetches Remote Config data and sets a duration that specifies how long config data lasts. -/// Call activateFetched to make fetched data available to your app. -/// @param expirationDuration Duration that defines how long fetched config data is available, in -/// seconds. When the config data expires, a new fetch is required. -/// @param completionHandler Fetch operation callback. -- (void)fetchWithExpirationDuration:(NSTimeInterval)expirationDuration - completionHandler:(nullable FIRRemoteConfigFetchCompletion)completionHandler; - -#pragma mark - Apply -/// Applies Fetched Config data to the Active Config, causing updates to the behavior and appearance -/// of the app to take effect (depending on how config data is used in the app). -/// Returns true if there was a Fetched Config, and it was activated. -/// Returns false if no Fetched Config was found, or the Fetched Config was already activated. -- (BOOL)activateFetched; - -#pragma mark - Get Config -/// Enables access to configuration values by using object subscripting syntax. -/// This is used to get the config value of the default namespace. -/// <pre> -/// // Example: -/// FIRRemoteConfig *config = [FIRRemoteConfig remoteConfig]; -/// FIRRemoteConfigValue *value = config[@"yourKey"]; -/// BOOL b = value.boolValue; -/// NSNumber *number = config[@"yourKey"].numberValue; -/// </pre> -- (nonnull FIRRemoteConfigValue *)objectForKeyedSubscript:(nonnull NSString *)key; - -/// Gets the config value of the default namespace. -/// @param key Config key. -- (nonnull FIRRemoteConfigValue *)configValueForKey:(nullable NSString *)key; - -/// Gets the config value of a given namespace. -/// @param key Config key. -/// @param aNamespace Config results under a given namespace. -- (nonnull FIRRemoteConfigValue *)configValueForKey:(nullable NSString *)key - namespace:(nullable NSString *)aNamespace; - -/// Gets the config value of a given namespace and a given source. -/// @param key Config key. -/// @param aNamespace Config results under a given namespace. -/// @param source Config value source. -- (nonnull FIRRemoteConfigValue *)configValueForKey:(nullable NSString *)key - namespace:(nullable NSString *)aNamespace - source:(FIRRemoteConfigSource)source; - -/// Gets all the parameter keys from a given source and a given namespace. -/// -/// @param source The config data source. -/// @param aNamespace The config data namespace. -/// @return An array of keys under the given source and namespace. -- (nonnull NSArray<NSString *> *)allKeysFromSource:(FIRRemoteConfigSource)source - namespace:(nullable NSString *)aNamespace; - -/// Returns the set of parameter keys that start with the given prefix, from the default namespace -/// in the active config. -/// -/// @param prefix The key prefix to look for. If prefix is nil or empty, returns all the -/// keys. -/// @return The set of parameter keys that start with the specified prefix. -- (nonnull NSSet<NSString *> *)keysWithPrefix:(nullable NSString *)prefix; - -/// Returns the set of parameter keys that start with the given prefix, from the given namespace in -/// the active config. -/// -/// @param prefix The key prefix to look for. If prefix is nil or empty, returns all the -/// keys in the given namespace. -/// @param aNamespace The namespace in which to look up the keys. If the namespace is invalid, -/// returns an empty set. -/// @return The set of parameter keys that start with the specified prefix. -- (nonnull NSSet<NSString *> *)keysWithPrefix:(nullable NSString *)prefix - namespace:(nullable NSString *)aNamespace; - -#pragma mark - Defaults -/// Sets config defaults for parameter keys and values in the default namespace config. -/// -/// @param defaultConfig A dictionary mapping a NSString * key to a NSObject * value. -- (void)setDefaults:(nullable NSDictionary<NSString *, NSObject *> *)defaults; - -/// Sets config defaults for parameter keys and values in the default namespace config. -/// -/// @param defaultConfig A dictionary mapping a NSString * key to a NSObject * value. -/// @param aNamespace Config under a given namespace. -- (void)setDefaults:(nullable NSDictionary<NSString *, NSObject *> *)defaultConfig - namespace:(nullable NSString *)aNamespace; - -/// Sets default configs from plist for default namespace; -/// @param fileName The plist file name, with no file name extension. For example, if the plist file -/// is defaultSamples.plist, call: -/// [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:@"defaultSamples"]; -- (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName; - -/// Sets default configs from plist for a given namespace; -/// @param fileName The plist file name, with no file name extension. For example, if the plist file -/// is defaultSamples.plist, call: -/// [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:@"defaultSamples"]; -/// @param aNamespace The namespace where the default config is set. -- (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName - namespace:(nullable NSString *)aNamespace; - -/// Returns the default value of a given key and a given namespace from the default config. -/// -/// @param key The parameter key of default config. -/// @param aNamespace The namespace of default config. -/// @return Returns the default value of the specified key and namespace. Returns -/// nil if the key or namespace doesn't exist in the default config. -- (nullable FIRRemoteConfigValue *)defaultValueForKey:(nullable NSString *)key - namespace:(nullable NSString *)aNamespace; - -@end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Headers/FirebaseRemoteConfig.h b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Headers/FirebaseRemoteConfig.h deleted file mode 100755 index eedc4fce..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Headers/FirebaseRemoteConfig.h +++ /dev/null @@ -1 +0,0 @@ -#import "FIRRemoteConfig.h" diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Modules/module.modulemap b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Modules/module.modulemap deleted file mode 100755 index a6627f5e..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/FirebaseRemoteConfig.framework/Modules/module.modulemap +++ /dev/null @@ -1,11 +0,0 @@ -framework module FirebaseRemoteConfig { - umbrella header "FirebaseRemoteConfig.h" - export * - module * { export *} - link "c++" - link "sqlite3" - link "z" - link framework "CoreGraphics" - link framework "Foundation" - link framework "UIKit" -}
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac Binary files differdeleted file mode 100644 index 345b889c..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/GoogleToolboxForMac.framework/GoogleToolboxForMac +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/Protobuf.framework/Protobuf b/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/Protobuf.framework/Protobuf Binary files differdeleted file mode 100644 index 546e02ec..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-firebase/Protobuf.framework/Protobuf +++ /dev/null diff --git a/StoneIsland/platforms/ios/Stone Island/Resources/Resources/GoogleService-Info.plist b/StoneIsland/platforms/ios/Stone Island/Resources/Resources/GoogleService-Info.plist deleted file mode 100644 index 0d23216d..00000000 --- a/StoneIsland/platforms/ios/Stone Island/Resources/Resources/GoogleService-Info.plist +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>AD_UNIT_ID_FOR_BANNER_TEST</key> - <string>ca-app-pub-3940256099942544/2934735716</string> - <key>AD_UNIT_ID_FOR_INTERSTITIAL_TEST</key> - <string>ca-app-pub-3940256099942544/4411468910</string> - <key>CLIENT_ID</key> - <string>426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt.apps.googleusercontent.com</string> - <key>REVERSED_CLIENT_ID</key> - <string>com.googleusercontent.apps.426306878988-nuqlbd4k944sk5mm63vdubdptb3cpkmt</string> - <key>API_KEY</key> - <string>AIzaSyAp9tJ_gK45ZhRDiaKOCgvsztQMbhsD_Ms</string> - <key>GCM_SENDER_ID</key> - <string>426306878988</string> - <key>PLIST_VERSION</key> - <string>1</string> - <key>BUNDLE_ID</key> - <string>us.okfoc.stoneisland</string> - <key>PROJECT_ID</key> - <string>stone-island</string> - <key>STORAGE_BUCKET</key> - <string>stone-island.appspot.com</string> - <key>IS_ADS_ENABLED</key> - <true></true> - <key>IS_ANALYTICS_ENABLED</key> - <false></false> - <key>IS_APPINVITE_ENABLED</key> - <true></true> - <key>IS_GCM_ENABLED</key> - <true></true> - <key>IS_SIGNIN_ENABLED</key> - <true></true> - <key>GOOGLE_APP_ID</key> - <string>1:426306878988:ios:0efb92963073829a</string> - <key>DATABASE_URL</key> - <string>https://stone-island.firebaseio.com</string> -</dict> -</plist>
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Info.plist index b4c661fe..3e5df678 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Info.plist +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Info.plist @@ -5,7 +5,7 @@ <key>ApplicationProperties</key> <dict> <key>ApplicationPath</key> - <string>Applications/Stone Island.app</string> + <string>Applications/StoneIsland.app</string> <key>CFBundleIdentifier</key> <string>us.okfoc.stoneisland</string> <key>CFBundleShortVersionString</key> @@ -18,10 +18,10 @@ <key>ArchiveVersion</key> <integer>2</integer> <key>CreationDate</key> - <date>2017-09-25T17:20:14Z</date> + <date>2017-09-25T23:34:14Z</date> <key>Name</key> - <string>Stone Island</string> + <string>StoneIsland</string> <key>SchemeName</key> - <string>Stone Island</string> + <string>StoneIsland</string> </dict> </plist> diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29.png Binary files differindex 1bc2ef3a..1bc2ef3a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29@2x.png Binary files differindex f2b09580..f2b09580 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29@2x~ipad.png Binary files differindex f2b09580..f2b09580 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29@3x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29@3x.png Binary files differindex cd9d0c5b..cd9d0c5b 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29@3x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29~ipad.png Binary files differindex 1bc2ef3a..1bc2ef3a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon29x29~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon29x29~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon40x40@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon40x40@2x.png Binary files differindex e8748382..e8748382 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon40x40@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon40x40@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon40x40@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon40x40@2x~ipad.png Binary files differindex e8748382..e8748382 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon40x40@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon40x40@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon40x40@3x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon40x40@3x.png Binary files differindex cce0af8d..cce0af8d 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon40x40@3x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon40x40@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon40x40~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon40x40~ipad.png Binary files differindex 3fbeff4f..3fbeff4f 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon40x40~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon40x40~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon50x50@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon50x50@2x~ipad.png Binary files differindex d57ee90d..d57ee90d 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon50x50@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon50x50@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon50x50~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon50x50~ipad.png Binary files differindex e54ea306..e54ea306 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon50x50~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon50x50~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon57x57.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon57x57.png Binary files differindex 90da1bf7..90da1bf7 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon57x57.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon57x57.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon57x57@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon57x57@2x.png Binary files differindex 43a52b41..43a52b41 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon57x57@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon57x57@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon60x60@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon60x60@2x.png Binary files differindex cce0af8d..cce0af8d 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon60x60@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon60x60@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon60x60@3x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon60x60@3x.png Binary files differindex 77bf6c1d..77bf6c1d 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon60x60@3x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon60x60@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon72x72@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon72x72@2x~ipad.png Binary files differindex 3fad3673..3fad3673 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon72x72@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon72x72@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon72x72~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon72x72~ipad.png Binary files differindex 5b99b007..5b99b007 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon72x72~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon72x72~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon76x76@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon76x76@2x~ipad.png Binary files differindex 2ca4f28f..2ca4f28f 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon76x76@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon76x76@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon76x76~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon76x76~ipad.png Binary files differindex 5a7a3184..5a7a3184 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon76x76~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon76x76~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon83.5x83.5@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon83.5x83.5@2x~ipad.png Binary files differindex ba9b6287..ba9b6287 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/AppIcon83.5x83.5@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/AppIcon83.5x83.5@2x~ipad.png diff --git a/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/Assets.car b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/Assets.car Binary files differnew file mode 100644 index 00000000..83458387 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/Assets.car diff --git a/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib Binary files differnew file mode 100644 index 00000000..356ebda6 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/Info.plist b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVLaunchScreen.storyboardc/Info.plist Binary files differindex 32288e88..32288e88 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVLaunchScreen.storyboardc/Info.plist +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVLaunchScreen.storyboardc/Info.plist diff --git a/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib Binary files differnew file mode 100644 index 00000000..cab46b2d --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVNotification.bundle/beep.wav b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVNotification.bundle/beep.wav Binary files differindex 05f5997f..05f5997f 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/CDVNotification.bundle/beep.wav +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/CDVNotification.bundle/beep.wav diff --git a/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/Info.plist b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/Info.plist Binary files differnew file mode 100644 index 00000000..fa3f4c03 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/Info.plist diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-568h@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-568h@2x.png Binary files differindex 7fdd75b1..7fdd75b1 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-568h@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-568h@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-568h@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-568h@2x.png Binary files differindex 7fdd75b1..7fdd75b1 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-568h@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-568h@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-Landscape@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-Landscape@2x~ipad.png Binary files differindex ecd0e167..ecd0e167 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-Landscape@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-Landscape@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-Landscape~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-Landscape~ipad.png Binary files differindex 2ff86bb6..2ff86bb6 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-Landscape~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-Landscape~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-Portrait@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-Portrait@2x~ipad.png Binary files differindex 9bcb4a4a..9bcb4a4a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-Portrait@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-Portrait@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-Portrait~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-Portrait~ipad.png Binary files differindex 858c3509..858c3509 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700-Portrait~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700-Portrait~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700@2x.png Binary files differindex 26f77e6a..26f77e6a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-700@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-700@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-800-667h@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-800-667h@2x.png Binary files differindex c98b2486..c98b2486 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-800-667h@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-800-667h@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-800-Landscape-736h@3x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-800-Landscape-736h@3x.png Binary files differindex 7dfc309c..7dfc309c 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-800-Landscape-736h@3x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-800-Landscape-736h@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-800-Portrait-736h@3x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-800-Portrait-736h@3x.png Binary files differindex d6561fd7..d6561fd7 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-800-Portrait-736h@3x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-800-Portrait-736h@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-Portrait@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-Portrait@2x~ipad.png Binary files differindex 9bcb4a4a..9bcb4a4a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-Portrait@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-Portrait@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-Portrait~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-Portrait~ipad.png Binary files differindex 858c3509..858c3509 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage-Portrait~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage-Portrait~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage.png Binary files differindex be1bd783..be1bd783 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage@2x.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage@2x.png Binary files differindex 26f77e6a..26f77e6a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/LaunchImage@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/LaunchImage@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/MainViewController.nib Binary files differindex 12fa41c4..87e795cc 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/MainViewController.nib +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/MainViewController.nib diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/PkgInfo b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/PkgInfo index bd04210f..bd04210f 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/PkgInfo +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/PkgInfo diff --git a/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/StoneIsland b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/StoneIsland Binary files differnew file mode 100755 index 00000000..e7adec73 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/StoneIsland diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/_CodeSignature/CodeResources index 9d041f8f..0637ee14 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/_CodeSignature/CodeResources +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/_CodeSignature/CodeResources @@ -86,11 +86,11 @@ </data> <key>Assets.car</key> <data> - c7cQjaJd7R2Nht7YeBCfIriwFIw= + vUA+WMNyBzm4Gzu5IojuLR10Srw= </data> <key>CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key> <data> - QfKNiUmpkuX2BR116ONpsqXyJ5g= + lZFHmS+cWjBI2yVw++tERDXkhqE= </data> <key>CDVLaunchScreen.storyboardc/Info.plist</key> <data> @@ -98,7 +98,7 @@ </data> <key>CDVLaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib</key> <data> - zwpugbO7/ezK+k04J2eIughVr7Y= + rtTPR+ZE7NWMDZFvlJmYjRRauN0= </data> <key>CDVNotification.bundle/beep.wav</key> <data> @@ -106,7 +106,7 @@ </data> <key>Info.plist</key> <data> - esm7qidDkYZyVd9Yjm+EwUTPJmE= + 8B+LELePdR4Wa3RlkuJfViZBzUY= </data> <key>LaunchImage-568h@2x.png</key> <data> @@ -166,7 +166,7 @@ </data> <key>MainViewController.nib</key> <data> - rlzpyuixdnUf5Fo0uggUxNCUbzc= + Q+QgIgId0xUKDXTjfY35UvX8rGg= </data> <key>PkgInfo</key> <data> @@ -178,7 +178,7 @@ </data> <key>config.xml</key> <data> - 4Kd5MyqaGCYxA8ZPfFVxOuSGEOI= + P+aw4SLsUPsBi703kbfTiODfwa4= </data> <key>embedded.mobileprovision</key> <data> @@ -194,11 +194,11 @@ </data> <key>www/cordova.js</key> <data> - hYeg9zH5hCPufSL3lQ4iz/z1w5U= + U5qD+h8czHzRSMNDeKZnVmgA3ao= </data> <key>www/cordova_plugins.js</key> <data> - NV8qo242MHKzuAtDp77aqJksvZo= + ZLiJikY3+FWToLfZjEmru0f7jFE= </data> <key>www/css/account.css</key> <data> @@ -398,7 +398,7 @@ </data> <key>www/js/lib/_router.js</key> <data> - kEgP1UyqTxv0qdxIM4py0YvbGI0= + O4eZM5nyghVF7WELlWxgCniAfZc= </data> <key>www/js/lib/account/AccountView.js</key> <data> @@ -498,7 +498,7 @@ </data> <key>www/js/lib/etc/push.js</key> <data> - lXGqoF3JDAFzFbpV0m5Dr7xQ+uY= + U8nG+j1hS9youOH485pn4Ei/hfg= </data> <key>www/js/lib/nav/AddressView.js</key> <data> @@ -546,7 +546,7 @@ </data> <key>www/js/lib/products/ProductView.js</key> <data> - D0qw484px++H8SgEz/RzF5RTb4Q= + y8oQIYrgG+mfj1RXFIyCOzFLNaU= </data> <key>www/js/lib/products/Selector.js</key> <data> @@ -594,7 +594,7 @@ </data> <key>www/js/sdk/auth.js</key> <data> - GeG4SscTJbq+zn8HT+R3CEvfKc4= + +1ZjnlN26KDrimArQWfhljcz3CM= </data> <key>www/js/sdk/cart.js</key> <data> @@ -696,10 +696,6 @@ <data> DBMSf1DRKjXfKMDgaSJHjnx+wgI= </data> - <key>www/plugins/cordova-plugin-google-analytics/www/analytics.js</key> - <data> - 2UgVPRV4/ypublz8rMNhB+kLW8g= - </data> <key>www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js</key> <data> EfUzmAcUagDDJeG2yHQTy4FngxU= @@ -730,7 +726,7 @@ </data> <key>www/plugins/phonegap-plugin-push/www/push.js</key> <data> - 5lqeq3eXKNBSZFridjwkmGk0IH8= + AF+WnBEprzr+ql8AKjlyCUKSiTI= </data> </dict> <key>files2</key> @@ -959,22 +955,22 @@ <dict> <key>hash</key> <data> - c7cQjaJd7R2Nht7YeBCfIriwFIw= + vUA+WMNyBzm4Gzu5IojuLR10Srw= </data> <key>hash2</key> <data> - q9T5OSlWsvnz4qAma+oOBwTWA6Dichr6tVY6PcMt4qM= + N/X5o959jHuFU72KMuRRAFOEVCv3x83yzdZ6wFDfCb4= </data> </dict> <key>CDVLaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib</key> <dict> <key>hash</key> <data> - QfKNiUmpkuX2BR116ONpsqXyJ5g= + lZFHmS+cWjBI2yVw++tERDXkhqE= </data> <key>hash2</key> <data> - 8FPGjV6ofRu2EkZLf3VsDAkc+b0Gl+dneIgkT3Pjy7s= + +JpHUUwnuGTA0lqs8KRKPW4p+AelnFMKFNrcLjf41ME= </data> </dict> <key>CDVLaunchScreen.storyboardc/Info.plist</key> @@ -992,11 +988,11 @@ <dict> <key>hash</key> <data> - zwpugbO7/ezK+k04J2eIughVr7Y= + rtTPR+ZE7NWMDZFvlJmYjRRauN0= </data> <key>hash2</key> <data> - WwR6UCvRvU8aw4ifEbhdMUI0nEZPeq0M63tDBGqSGI4= + +A9Ot+1km7pmrvC7BKt4ZgNvbMc4lkb1vxWfwVHFLLk= </data> </dict> <key>CDVNotification.bundle/beep.wav</key> @@ -1168,11 +1164,11 @@ <dict> <key>hash</key> <data> - rlzpyuixdnUf5Fo0uggUxNCUbzc= + Q+QgIgId0xUKDXTjfY35UvX8rGg= </data> <key>hash2</key> <data> - Wy+l7QC1BAumuuH/+fYw86ankvdNafN5g8Uwg+H8yCQ= + tG2SscCwuWqKzIoHqyF58H3m2Cr+mQbSmwbx0GfnYDU= </data> </dict> <key>archived-expanded-entitlements.xcent</key> @@ -1190,11 +1186,11 @@ <dict> <key>hash</key> <data> - 4Kd5MyqaGCYxA8ZPfFVxOuSGEOI= + P+aw4SLsUPsBi703kbfTiODfwa4= </data> <key>hash2</key> <data> - p+pxXEAIbVFNAwFwn63PKQGWbgrIXdl0Pup8XBimc2c= + PiNIDT6KMds4MaD/FWOKQClrHpD8gXqOubjel8wRhQo= </data> </dict> <key>embedded.mobileprovision</key> @@ -1234,22 +1230,22 @@ <dict> <key>hash</key> <data> - hYeg9zH5hCPufSL3lQ4iz/z1w5U= + U5qD+h8czHzRSMNDeKZnVmgA3ao= </data> <key>hash2</key> <data> - dfmFgVVKEylAM88S8U6sOC51nA/iWk1KrTshtEvuBmo= + vvROt4nAghiz/nS7ekznMtV1kOKlu40f/Me6P8Npd+4= </data> </dict> <key>www/cordova_plugins.js</key> <dict> <key>hash</key> <data> - NV8qo242MHKzuAtDp77aqJksvZo= + ZLiJikY3+FWToLfZjEmru0f7jFE= </data> <key>hash2</key> <data> - 74a5FyW/xzc7bbQ9F0EVKBim3tOCb2beVzfdRRg/hfk= + wwWxpCP0qmAuV4RuUx2DnJnMTPMZAtjGSnrEH1SLn/E= </data> </dict> <key>www/css/account.css</key> @@ -1795,11 +1791,11 @@ <dict> <key>hash</key> <data> - kEgP1UyqTxv0qdxIM4py0YvbGI0= + O4eZM5nyghVF7WELlWxgCniAfZc= </data> <key>hash2</key> <data> - bB0wfGhmM3yeutz8u2ZWhynazXNLzvb06Bsk3RR92HE= + eiZImA/5F7g1thdb5LR3bhPmWAf53J6gAxt+2MsEw4c= </data> </dict> <key>www/js/lib/account/AccountView.js</key> @@ -2070,11 +2066,11 @@ <dict> <key>hash</key> <data> - lXGqoF3JDAFzFbpV0m5Dr7xQ+uY= + U8nG+j1hS9youOH485pn4Ei/hfg= </data> <key>hash2</key> <data> - PnAVCDHnmi7tyE7sK/K3c/GWhxYZ0pvzP4bY+3mNqYY= + haDxOQGcLiCtmyW97PLGYreNCQ4qzqftlHUSQM0rxQ0= </data> </dict> <key>www/js/lib/nav/AddressView.js</key> @@ -2202,11 +2198,11 @@ <dict> <key>hash</key> <data> - D0qw484px++H8SgEz/RzF5RTb4Q= + y8oQIYrgG+mfj1RXFIyCOzFLNaU= </data> <key>hash2</key> <data> - 4zohpwepXZsBtqhROr5spKlTXW/2MY6hIPGpMGieFqk= + q44Y3/AkLJes50oNASO7J22TPTk2wx71qMwVvXQF0Aw= </data> </dict> <key>www/js/lib/products/Selector.js</key> @@ -2334,11 +2330,11 @@ <dict> <key>hash</key> <data> - GeG4SscTJbq+zn8HT+R3CEvfKc4= + +1ZjnlN26KDrimArQWfhljcz3CM= </data> <key>hash2</key> <data> - jgGbQWQJRBhW+pPXRBsCfLIjFq2kkhbxyozRRbbeZAI= + HqJDZULqlG5IKEg7hjVHwXPq953Qvy5Lai7Q6ucCqdo= </data> </dict> <key>www/js/sdk/cart.js</key> @@ -2616,17 +2612,6 @@ c0FvNwJUoj6DTFiJbDJ//4pUO/Nc0Pmmq+lh9eVocuE= </data> </dict> - <key>www/plugins/cordova-plugin-google-analytics/www/analytics.js</key> - <dict> - <key>hash</key> - <data> - 2UgVPRV4/ypublz8rMNhB+kLW8g= - </data> - <key>hash2</key> - <data> - 1g4SfpnqGa216VS6pZZwiQ0XY0/Zmp2e9U7JvIO9P+g= - </data> - </dict> <key>www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js</key> <dict> <key>hash</key> @@ -2708,11 +2693,11 @@ <dict> <key>hash</key> <data> - 5lqeq3eXKNBSZFridjwkmGk0IH8= + AF+WnBEprzr+ql8AKjlyCUKSiTI= </data> <key>hash2</key> <data> - fnu6B3igubTsRbXXflx/zb6AbO9quQlivKUyNjtq/qo= + DM9CphyuhWhvXVU7i7uP/StHfzN+/Qa2dT8+dOaab6I= </data> </dict> </dict> diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/archived-expanded-entitlements.xcent b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/archived-expanded-entitlements.xcent index 903def2a..903def2a 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/archived-expanded-entitlements.xcent +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/archived-expanded-entitlements.xcent diff --git a/StoneIsland/platforms/ios/Stone Island/config.xml b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/config.xml index 46a44916..f3d3cf56 100755 --- a/StoneIsland/platforms/ios/Stone Island/config.xml +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/config.xml @@ -37,6 +37,10 @@ <param name="ios-package" value="CDVSplashScreen" /> <param name="onload" value="true" /> </feature> + <feature name="StatusBar"> + <param name="ios-package" value="CDVStatusBar" /> + <param name="onload" value="true" /> + </feature> <feature name="SocialSharing"> <param name="ios-package" value="SocialSharing" /> <param name="onload" value="true" /> @@ -47,14 +51,6 @@ <feature name="PushNotification"> <param name="ios-package" value="PushPlugin" /> </feature> - <feature name="StatusBar"> - <param name="ios-package" value="CDVStatusBar" /> - <param name="onload" value="true" /> - </feature> - <feature name="FirebasePlugin"> - <param name="ios-package" value="FirebasePlugin" /> - <param name="onload" value="true" /> - </feature> <name>StoneIsland</name> <description> Stone Island diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/embedded.mobileprovision b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/embedded.mobileprovision Binary files differindex 7ef37a30..7ef37a30 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/embedded.mobileprovision +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/embedded.mobileprovision diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/cordova-js-src/exec.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/cordova-js-src/exec.js index 3fb7fa19..3fb7fa19 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/cordova-js-src/exec.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/cordova-js-src/exec.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/cordova-js-src/platform.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/cordova-js-src/platform.js index 36529ba5..36529ba5 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/cordova-js-src/platform.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/cordova-js-src/platform.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/cordova.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/cordova.js index 29be9099..3540a020 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/cordova.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/cordova.js @@ -1,5 +1,5 @@ // Platform: ios -// a3732cb71d9b1dd590338e8cf44196f366d46da3 +// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '4.3.1'; +var PLATFORM_VERSION_BUILD_LABEL = '4.4.0'; // file: src/scripts/require.js /*jshint -W079 */ diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/cordova_plugins.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/cordova_plugins.js index e80f5bbb..5d4c04be 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/cordova_plugins.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/cordova_plugins.js @@ -107,6 +107,14 @@ module.exports = [ ] }, { + "id": "cordova-plugin-statusbar.statusbar", + "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", + "pluginId": "cordova-plugin-statusbar", + "clobbers": [ + "window.StatusBar" + ] + }, + { "id": "cordova-plugin-x-socialsharing.SocialSharing", "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js", "pluginId": "cordova-plugin-x-socialsharing", @@ -130,28 +138,12 @@ module.exports = [ "clobbers": [ "PushNotification" ] - }, - { - "id": "cordova-plugin-google-analytics.UniversalAnalytics", - "file": "plugins/cordova-plugin-google-analytics/www/analytics.js", - "pluginId": "cordova-plugin-google-analytics", - "clobbers": [ - "analytics", - "ga" - ] - }, - { - "id": "cordova-plugin-statusbar.statusbar", - "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", - "pluginId": "cordova-plugin-statusbar", - "clobbers": [ - "window.StatusBar" - ] } ]; module.exports.metadata = // TOP OF METADATA { + "cordova-plugin-app-name": "1.0.4", "cordova-plugin-compat": "1.1.0", "cordova-plugin-console": "1.0.4", "cordova-plugin-customurlscheme": "4.2.0", @@ -161,12 +153,11 @@ module.exports.metadata = "cordova-plugin-inappbrowser": "1.5.0", "cordova-plugin-network-information": "1.3.0", "cordova-plugin-splashscreen": "4.0.0", + "cordova-plugin-statusbar": "2.2.3", "cordova-plugin-whitelist": "1.3.0", "cordova-plugin-x-socialsharing": "5.1.3", "ionic-plugin-keyboard": "2.2.1", - "phonegap-plugin-push": "1.9.2", - "cordova-plugin-google-analytics": "1.8.3", - "cordova-plugin-statusbar": "2.2.3" + "phonegap-plugin-push": "2.0.0" }; // BOTTOM OF METADATA });
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/account.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/account.css index da710fd7..da710fd7 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/account.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/account.css diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/blogs.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/blogs.css index 4823fbef..4823fbef 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/blogs.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/blogs.css diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/cart.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/cart.css index 58e712b0..58e712b0 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/cart.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/cart.css diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/andale_mono.ttf b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/andale_mono.ttf Binary files differindex e766a6e1..e766a6e1 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/andale_mono.ttf +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/andale_mono.ttf diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/andale_mono.woff b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/andale_mono.woff Binary files differindex 9b0372de..9b0372de 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/andale_mono.woff +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/andale_mono.woff diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/fonts.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/fonts.css index 8ddce654..8ddce654 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/fonts.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/fonts.css diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.css index 885aa6bd..885aa6bd 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.css diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.eot b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.eot Binary files differindex 92a3f20a..92a3f20a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.eot +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.eot diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.svg b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.svg index 49fc8f36..49fc8f36 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.svg +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.svg diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.ttf b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.ttf Binary files differindex c4e46324..c4e46324 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.ttf +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.ttf diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.woff b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.woff Binary files differindex 5f3a14e0..5f3a14e0 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/ionicons.woff +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/ionicons.woff diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-bold-webfont.woff b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-bold-webfont.woff Binary files differindex 97aa9ea6..97aa9ea6 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-bold-webfont.woff +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-bold-webfont.woff diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-italic-webfont.woff b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-italic-webfont.woff Binary files differindex 787d47cb..787d47cb 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-italic-webfont.woff +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-italic-webfont.woff diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-light-webfont.woff b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-light-webfont.woff Binary files differindex 45f21c23..45f21c23 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-light-webfont.woff +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-light-webfont.woff diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-medium-webfont.woff b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-medium-webfont.woff Binary files differindex 4fb708fd..4fb708fd 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-medium-webfont.woff +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-medium-webfont.woff diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-regular-webfont.woff b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-regular-webfont.woff Binary files differindex b51127f3..b51127f3 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/fonts/pfdintextpro-regular-webfont.woff +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/fonts/pfdintextpro-regular-webfont.woff diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/index.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/index.css index a67e4bcf..a67e4bcf 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/index.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/index.css diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/nav.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/nav.css index 28385680..28385680 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/nav.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/nav.css diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/products.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/products.css index c4599866..c4599866 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/products.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/products.css diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/vendor/flickity.css b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/vendor/flickity.css index b8eca4e4..b8eca4e4 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/css/vendor/flickity.css +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/css/vendor/flickity.css diff --git a/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/db.json b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/db.json new file mode 100644 index 00000000..7e0fa471 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/db.json @@ -0,0 +1,2124 @@ +{ + "story": [ + { + "id": "philosophy", + "title": "Philosophy", + "image": { + "uri": "http://cdn3.yoox.biz/stoneisland/wp-content/uploads/2013/11/philosophy1.jpg", + "caption": "" + }, + "body": "A culture of research, experimentation, function and use are the matrixes that have always defined Stone Island: the sportswear brand established in 1982, designed to become a symbol of extreme research on fibers and textiles, applied to an innovative design. Season after season, it is through the study of form and the “manipulation” of the matter that Stone Island has found its own language with the aim of establishing new boundaries in the world of garment making. \r\n\r\nThe study of uniforms and of work wear, its evolution according to new requirements of use, has become Stone Island’s observation post for defining a project in which the clothing item’s function is never just aesthetic.\r\n\r\nAn ongoing investigation, thorough and without frontiers, on the processing and ennobling of fibers and textiles, leading to discover materials and production techniques never used before in the clothing industry.\r\n\r\nJackets constructed in nylon monofilament, deriving from the water filtering technology. Highly reflective or thermo-sensitive fabrics, changing color with the variation of temperature. Featherweight polyester cloth vacuum- coated with a 100% stainless steel film used in aviation technology to protect the on-board computers. Non-woven materials, Kevlar® and polyester felt, rhomboidal nets in polyester used in the construction industry and coated in polyurethane. These are some examples of materials conceived by Stone Island philosophy.\r\n\r\nStone Island’s strength is also based on the unique ability to intervene on the finished item, through the continuous tests on dyeing and treatments carried out in the Sportswear Company’s laboratory of color. A department able to combine advanced technology, experience and human capacity and that has developed more than 60,000 different recipes of dyes throughout the years.\r\n\r\nAll the accumulated knowledge and experience, an inalienable heritage, on which great part of Stone Island’s know-how is based, is kept in the historical archive that collects the trial tests, and the recipes for textile dyeing and handling that have been developed by all those people who have worked on this project with passion.", + "__index": "0", + "dateCreated": "Thu, 05 Nov 2015 00:24:44 GMT" + }, + { + "id": "history", + "title": "History", + "image": { + "uri": "https://ltho.s3.amazonaws.com/ce68408c-34b3-40ca-8ddf-c10cd1412c5f.jpg", + "caption": "" + }, + "body": "Stone Island, the Italian brand that reinvented the concept of casual wear, was founded in 1982 out of the passion and brilliant research into textile finishing performed by its creator and art director, intellectual from Bologna, Massimo Osti. It was Osti, in the mid-Seventies, who researched thousands of uniforms and pieces of work clothing and catalogued their functional characteristics. In Ravarino, in the province of Modena, he created a company whose hub was a full-scale center of research into materials and treatments became a sophisticated laboratory for garment and experimental dyeing.\r\n\r\nThe story of Stone Island began, almost by chance, with research into a special material, a thick truck tarpaulin, the outstanding feature of which was that it had been resin-treated in red on one side and blue on the other. The first prototype was too stiff, so it was washed for a long period in water with pumice stones to break down the structure of the material. The result was surprising, a worn-look garment with great appeal. It was therefore decided to create seven jackets in that unique fabric called Tela Stella, and to give this product a name. The strong identity of the project called for an important name, which was identified by analyzing the most commonly occurring words in Joseph Conrad’s novels: the words Stone and Island were chosen.\r\n\r\nStone Island has a marine feel, conjuring up old oilskins corroded by the sea and a military feel, which is drawn from the fund of research completed until that time. The name also evokes a love of the sea and that first treatment selected to “process” the garments. The badge, the detachable fabric label that has distinguished Stone Island garments since the first season, showed a Compass Rose, displayed like a military badge.\r\n\r\nThe reaction is immediate. Stone Island became a success phenomenon, with no set plan or marketing research behind it: a uniquely Italian mix of creativity, intuition and entrepreneurial spirit. A star was born.", + "__index": "1", + "dateCreated": "Thu, 05 Nov 2015 00:27:25 GMT" + }, + { + "id": "carlo-rivetti", + "title": "Carlo Rivetti", + "image": { + "uri": "https://ltho.s3.amazonaws.com/2fe16d85-e85f-4f12-ae55-72622c8efafd.jpg", + "caption": "" + }, + "body": "My family has deep roots within the clothing industry. In the 19th century, Giuseppe Rivetti – son of Giovanni Battista, Italy’s first carding machine operator, inherited his father’s passion and in order to fund his own wool factory he secretly sold cows from the family farms to buy looms. By 1872 he had his own wool factory: “Giuseppe Rivetti e Figli”, which later merged with the Turin based GFT group (Gruppo Finanziario Tessile). There, my uncle Pinot had the unique idea of rubberizing wool fabrics to increase their performance.
This fondness for research also drove my father, Silvio. In the immediate post-war period, he set off for the United States where he found the Palm Beach Incorporated company, who produced something that didn’t yet exist in Europe: clothing constructed on theoretical measurements; what we now know as sizes.
My father was stunned, working for six months as a laborer, before returning and convincing his brothers to give up their shares in the wool factories in order to buy out GFT. \r\n\r\nIn the early 1950’s GFT measured more than 25,000 Italians, which allowed them to effectively dress the whole nation for the first time with non-tailored garments. \r\n\r\nThe 1973 oil crisis brought severe yet swift recession, and something had to be done to recover sales. My cousin, Marco Rivetti, noticed a French couturier working in a women’s outerwear firm we’d acquired one year earlier. He would design and fit the garments, write orders in Paris and then use our company to manufacture them. He was Emanuel Ungaro. This led us to realize that in order to re-launch the sector we needed to add a fundamental ingredient to the clothing industry: fashion.
As a result, GFT became a licensee of the rising stars of Italian fashion, including Giorgio Armani and Valentino. The rise of Italian-made Prêt à Porter was due to the ability to combine entrepreneurial ability with creativity.\r\n\r\nI joined GFT in 1975. Towards the end of that decade, I had the idea to start a new area within the group; to generate something more timeless: sportswear. In the early 1980’s, I discovered C.P. Company, a firm known for being innovative and cutting edge in this field. The company was owned by Trabaldo Togna and Massimo Osti, a graphic artist by profession and the firm’s designer and art director. We bought first 50% in 1983 and later on the entire company.
That was the beginning of my journey. In 1993 I left GFT and, together with my sister Cristina, acquired 100% of the firm which is known today as Sportswear Company.
\r\n\r\nIt was in 1983 that I got to know Massimo Osti, who had brought Stone Island into existence almost by chance, a year earlier. A special fabric named ‘Tela Stella’ had arrived in the company: a cloth that had a different color on each side, used to make truck tarpaulins. The effect was very interesting but had little to do with the existing C.P. Company line. Osti decided to do something special with that fabric and created a collection of just seven jackets. The collection strongly referenced military style with the now iconic badge inspired by military insignia. The compass symbolized love for the sea and an aim for constant research.\r\n\r\nMassimo was at least ten years ahead of others in his field. He saw himself as a producer rather than a fashion designer.
His achievement establishing Stone Island was not only appealing and saleable, but also true to his core belief in informal wear. His ideas were drawn from military and work wear, accompanying them with endless textile research.\r\n\r\nIn the mid-nineties, Massimo our paths eventually came apart, and I found myself with the difficult task of finding someone to design Stone Island.
In 1994 as I wandered through a Munich trade fair I came across the work of designer Paul Harvey, an English designer who lived in Sant’Arcangelo di Romagna, Italy. I was struck by a strange feeling of familiarity and cried out: “so here’s the Stone of the 21st Century!”. From 1996, with Paul, we embarked on the second era of our brand.\r\n\r\nPaul designed 24 collections, each consistent in the evolution and research that has always set Stone Island apart.
He is another extraordinary character. After graduating Central Saint Martins, he decided fashion was not his career path and worked as a truck driver! Only after marrying a fantastic Italian lady and moving to Italy did he start designing clothes.
His approach to design has functionality in its blood, which allowed him to interpret Stone Island perfectly. He led the brand masterfully into the new century. \r\n\r\nAfter 12 marvelous years, Paul needed to leave the fashion world to “do something for the Planet”. With such a noble ambition, I could only accept and support his decision.
In that moment, facing another crucial decision, I came to the conclusion the era of “one man at the helm” was over.
Times had changed. It was necessary to be multicultural in order to be truly contemporary.
I built a design team. I felt that in this era it is this possible to face all aspects of a world only with several minds and several visions: and this has been Stone Island from 2008 to today.
\r\n\r\nI feel like the coach. I choose which men to send onto the pitch, depending upon who we have to play: We need to be more sensitive, faster, and ready to grasp the signs of strength and weakness.
As a result, we need multi-cultural people that travel the world and observe it from different viewpoints: people of different ages and from different cultures.\r\n\r\nThis, in short, is my story. I like to think there’s a common thread that binds us all. A desire for continual experimentation and research, not without a touch of healthy insanity: that special something that makes our Stone Island much more than a just a clothing brand.\r\n\r\n<i>Carlo Rivetti,\r\nPresident and Creative Director, Stone Island</i>", + "__index": "2", + "dateCreated": "Thu, 05 Nov 2015 00:27:38 GMT" + } + ], + "archive": [ + { + "id": "-010-015", + "title": "'010'015", + "images": [ + { + "uri": "https://ltho.s3.amazonaws.com/2bafd7a2-fbbb-4904-8e64-ff394888fd24.png", + "label": "LIQUID REFLECTIVE", + "code": "5315 42944", + "caption": "Fabric that is highly reflective owing to its coating made up\r\nof thousands of glass microspheres. Each finished garment\r\nis hand sprayed individually and individually baked dry.\r\nThe varying intensity of the reflective element and varying\r\nintensity of color, the dribbling and speckled effect, are\r\nowing to the high level of craftsmanship involved in the\r\nprocess, making each garment unique and unrepeatable.\r\nLining in quilted microfiber with polyester padding.\r\nStone Island badge with white embroidery, reserved for\r\ngarments that are made using advanced research into\r\nfabrics or processes." + }, + { + "uri": "https://ltho.s3.amazonaws.com/a0714935-2800-425f-9b34-63fdc4a7fc78.png", + "label": "30/30 JACKET", + "code": "5715 4TTY2", + "caption": "The 30/30 jacket is a cross section of the state of the art of Stone Island. A testament to three decades of exploration and development, it has been designed to embody the spirit of Stone Island’s endless creativity. Linked by the signature looped rigging system, both the jacket shell and jacket liner are reversible. These can be worn, either together or alone, in a total of 10 different ways. The transformative\r\nproperties of the fabrics mean that these 10 ways can each be worn in 3 different modes: Ice, Reflective,\r\nand Normal; resulting in a total of 30 different jacket states.\r\nThis piece features is our 30th anniversary special edition badge.\r\nJACKET /SHELL _ RASO GOMMATO PRISMATIC COVER.\r\nSatin weave cotton of military origin bonded on the inside to a a shiny transparent fine-grained polyurethane film reflecting the light, magnifying the color effects and bestowing the surface with a three-dimensional and ‘liquid’ appearance.\r\nJACKET/ LINER_ THERMO REFLECTIVE / ENGINEERED WOOL\r\nThis material merges two of Stone Island’s most avant-garde research paths. It explores the interaction between light refraction and thermosensitivity technologies. The resins used to coat the nylon substrate host both the glass microspheres allowing fabric refraction and the micro-encapsulated pigments modifying the passage of light and thus enabling color changes in relation to temperature. The final effect is an organic and dynamic interaction of light and color. On the reverse side, an engineered wool face made with a double knit machine." + }, + { + "uri": "https://ltho.s3.amazonaws.com/d51dce63-d467-45ea-88a6-5b077ffe3c3c.png", + "label": "REFLECTIVE KNIT WITH WINDSTOPPER® 3L", + "code": "5715 587Y5", + "caption": "To celebrate the thirtieth anniversary of Stone Island, a yarn has been engineered that represents the\r\nheight of our tireless research. The President’S Knit 5715 has been created in Reflective yarn, made\r\nup of micro plates coated with glass microspheres trapped inside a polyester mesh. The structure of\r\nthe jumper has been made double, reflective on the outside and wool on the inside. The outer face\r\nhas then been printed in a darker shade using heat and pressure sublimation printing to amalgamate\r\nthe fibers, obtain an even surface and reduce the strong reflective appearance.\r\nThe detachable padded and quilted lining has been created in a polyester jersey laminated with a\r\nWindstopper® membrane, which provides an unbeatable balance between protection and comfort.\r\nThis piece features is our 30th anniversary special edition badge." + }, + { + "uri": "https://ltho.s3.amazonaws.com/5883b275-a2eb-4a34-890f-69b30250a62b.png", + "label": "RASO HAND PAINTED TORTOISE SHELL", + "code": "6115 70565", + "caption": "Trench coat in a satin-weave cotton fabric of military origin. The garment has been dyed and then faded in selected areas with a corrosive paste. The bleached parts have then been hand-painted with a tortoiseshell-inspired motif also appearing on the Stone Island badge on the left sleeve. This extraordinary manual process makes each piece unique and unrepeatable. Detachable hood in garment-dyed padded iridescent nylon. Detachable lining in GARMENT-DYED DOWN_26 GR X SQM_N, an ultra-light nylon weighing only 26 grams per square meter, filled with the finest down specially treated to bear the stress of the garment dyeing procedure. Garment-dyed with special dye recipes. It is secured to the outer garment by the iconic Stone Island fastening system." + }, + { + "uri": "https://ltho.s3.amazonaws.com/a25cc013-5c2c-4221-974a-987b8fd00ab4.png", + "label": "HAND PAINTED SHEEPSKIN", + "code": "6115 00379", + "caption": "Sheepskin parka. The finished piece has been hand-sprayed on the outer face with a resin based product and then hand waxed to achieve a softer feel. Hood edged by fur trim. " + }, + { + "uri": "https://ltho.s3.amazonaws.com/fa5ed231-8b04-4ecc-b126-7a5543d5614a.png", + "label": "ICE JACKET THERMO-SENSITIVE FABRIC", + "code": "6115 43098", + "caption": "Hooded jacket in thermo sensitive fabric. A water- and wind-resistant polyurethane film is embedded with micro-encapsulated pigments. The molecules of these pigments modify the path of light and change color according to the temperature. The garment is then padded with the finest down.Two chest patch pockets, with snap-flap fastening and second pocket with vertical zip fastening. Adjustable elastic at cuffs. Cotton terry lined hood. Hidden zip and button fastening." + }, + { + "uri": "https://ltho.s3.amazonaws.com/bfd9defc-a1ef-4322-9e53-9505ec606ed9.png", + "label": "RASO GOMMATO REVERSE COLOR PROCESS", + "code": "6215 42338", + "caption": "Jacket in Raso Gommato -rubberized satin- a mil. spec. cotton satin bonded with a polyurethane cover making the fabric wind and water resistant. In this version, the transparent cover is bonded to a previously piece dyed and printed the cotton satin. The finished garment undergoes an exclusive procedure named Reverse Color Process, a fading technique followed by an overdyeing process on the finished garment, owing to the piece unparalleled shaded print effects, resist print areas and residual color deposits, unique to each single item." + }, + { + "uri": "https://ltho.s3.amazonaws.com/390b68f3-7f9a-41af-a09c-bd15ac7008a3.png", + "label": "POLYPROPYLENE TELA", + "code": "6315 40534", + "caption": "Down filled parka in polypropylene tela treated with an anti-drop agent. Polypropylene, a material with antibacterial properties, is the lightest man-made fibre. Even very bulky garments astonish for their specific lightness. The paste colored yarn is texturized to obtain a cotton looking opaque aspect. " + }, + { + "uri": "https://ltho.s3.amazonaws.com/cc9f8c72-bbac-4d34-9762-4eae85374abf.png", + "label": "HIDDEN REFLECTIVE", + "code": "6315 G0598", + "caption": "Vest in a reflective, water and wind resistant polyester fabric owing its features to a coating made of thousands of glass microspheres. An opaque black plating totally covers the refraction of the material which is unveiled when photographed in flash mode. The reflective features will be revealed through usage, with diverse effects and intensities from piece to piece, depending on its wearer usage. Stone Island logo on the back obtained through laser printing. Filled with the finest down. Sheepskin over collar. " + }, + { + "uri": "https://ltho.s3.amazonaws.com/512029b0-f4a3-469a-9d7d-1cd7fc15c1c8.png", + "label": "POLY COVER COMPOSITE + POLY FUR SILVER DETACHABLE LINING", + "code": "6315 491Y1", + "caption": "Hooded jacket in Poly Cover Composite, a matte, colorless and opaque two-component water and wind resistant film. The garment dyeing technique colors the film without affecting its transparency. Completely heat sealed seams.\r\nDetachable hooded lining in Poly Fur, a synthetic fur with external silver colored coating. Snap fastening on nylon tape." + } + ], + "__index": "4", + "dateCreated": "Thu, 05 Nov 2015 01:48:39 GMT" + }, + { + "id": "-000-009", + "title": "'000'009", + "images": [ + { + "uri": "https://ltho.s3.amazonaws.com/725e1b3f-58ee-49f6-8413-0a7e3dc9890f.png", + "label": "KEVLAR®", + "code": "3315 4031", + "caption": "Kevlar® felt. Five times more robust than steel given the same weight, Kevlar® is lightweight and\r\nhighly insulating. It is resistant to even extreme changes in temperature and to both fresh and salt\r\nwater. Owing to its qualities, it is used in the aerospace field, in competitive sailing and for Formula\r\n1 racing. With its soft yellow color, dyeing this material is usually impossible, but with Stone Island\r\ngarment dyeing expertise, laminating the hydro-cohered Kevlar® fibers to an invisible nylon mesh and\r\na polyurethane coating on the outer side and a simple polyurethane coating on the inside this has been\r\nmade possible.\r\nDetachable lining in triple woven fabric, two nylon honeycomb patterns have been machine raised\r\nwith a further nylon yarn. The detachable lining is attached to the outer garment using a system of ties,\r\nadapted from those used in the sailing world. Stone Island badge with white embroidery, reserved for\r\ngarments that are made using advanced research into fabrics or processes." + }, + { + "uri": "https://ltho.s3.amazonaws.com/c1c9db4f-5aa9-4698-9fe3-04a58a631653.png", + "label": "MONOFILAMENT-S", + "code": "3715 4316", + "caption": "Nylon twill monofilament mesh. On the inside, a cotton muslin\r\nlayer is laminated on the outer face with a black breathable\r\nand water resistant membrane, with the application of\r\nwhite polyester taped seams. The monofilament mesh has\r\na protecting function for the inner membrane. From the\r\naesthetic point of view, its transparency is designed to reveal\r\nthe internal construction of the garment. The piece is lined in\r\na brushed cotton fabric quilted with polyester padding. The\r\nfinished garment is over-dyed with a double cotton and nylon\r\nrecipe." + }, + { + "uri": "https://ltho.s3.amazonaws.com/4f1783c2-1ff7-4054-9d18-faebbd617305.png", + "label": "LIGHT", + "code": "3715 4Q30", + "caption": "Stone Island anticipated the use of light in clothing. Also for safety purposes in cases of\r\ndiminished visibility. The beginning of the Nineties, saw the introduction of the Reflective\r\nJacket - the first reflective garment ever - and in ‘002, to mark its twentieth anniversary,\r\nthe use of light went from being passive to active and self-generated with the use of optical\r\nfibres.\r\nThe fabric’s cotton warp is woven with polyester yarns as well as with optical fibre\r\nfilaments forming a band of light along the front fastening and around the edge of the hood.\r\nThe light is switched on using a small battery hidden inside the garment.\r\nHooded detachable lining in microfiber quilted to a polyester padding, attached to the\r\nouter garment using a system of ties, adapted from those used in the sailing world." + }, + { + "uri": "https://ltho.s3.amazonaws.com/c62f3de3-a639-4818-988c-3aba9db057e5.png", + "label": "COMPACT", + "code": "3915 4N40", + "caption": "Compact treated linen felt. The Compact process is the transfer to finished garments of a textile process that is usually used to cleanse the natural fibers of their impurities. The garments are boiled at 130°C under pressure, with special additives. In the finished garments the material shrinks approximately 50%, the material becomes extraordinarily compact, the hand of the fabrics becomes dryer and naturally elastic. The fabrics take on an uneven, hand crafted appearance, as if they had been woven on antique looms. The fabric volume reduction involved with the Compact treatment creates very important pattern making complexities. The garment can be fitted to the body with a strings and loops system on the sides, front and hood. This system is inspired by anti-G suits of military aviators. Garment dyed; Compact pieces are very receptive to the garment dyeing recipes, the colors result far more intense than those of untreated garments.\r\nDetachable lining in peached microfiber, quilted with polyester padding. The detachable lining is attached to the outer garment using a system of ties, adapted from those used in the sailing world." + }, + { + "uri": "https://ltho.s3.amazonaws.com/ba287902-7b92-4128-867f-69d6b1e40cc0.png", + "label": "OPAQUE NYLON TELA", + "code": "4315 4C24 30GR", + "caption": "Japanese featherweight nylon canvas, weighing just 30 grams per square\r\nmeter. The Stone Island badge is ultra light, in embroidered nylon mesh in\r\norder to avoid weighing down the sleeve. The garment is padded with the\r\nfinest down. The lightweight construction of the down bags and the direct\r\ninjection of feathers heightens the lightness of the garments." + }, + { + "uri": "https://ltho.s3.amazonaws.com/320c3a59-c8ae-4dec-b863-15b15ccc368a.png", + "label": "OPAQUE NYLON CANVAS", + "code": "4515 4H24", + "caption": "Japanese featherweight nylon canvas, weighing just 37 grams\r\nper square meter. The Stone Island badge is ultra light, in\r\nembroidered nylon mesh in order to avoid weighing down the\r\nsleeve. The garment is padded with direct injection finest down.\r\nApart from highlighting the lightness of the fabric, the black\r\nedging under the fabric underscores the removal of the feather\r\nbags to increase the lightness of the garment. The yoke on the\r\nchest is disguised by the horizontal quilting motive. Inside the\r\nhood of the garment, an extra fabric hood with external coating\r\nand PVC print may be laced up by loops." + }, + { + "uri": "https://ltho.s3.amazonaws.com/35f9ec2a-fc52-42e5-b015-899e40ae9e89.png", + "label": "DAVID-TC SUBLIMATION PRINT", + "code": "4615 4C44", + "caption": "Reversible garment. Star-shaped cross-section polyester / polyamide\r\nJapanese microfiber. During garment dyeing under pressure at 130°C,\r\nthe heat transforms the structure and hand of the material radically.\r\nBeyond the depth of color and despite maintaining an industrial\r\nappearance, the David-TC garments take on an appearance and\r\nhand that grant a unique tactile experience, similar to both chamois\r\nleather and non-woven coagulated fabric. One of the two faces has\r\nbeen over printed on the finished garment with a dark color, using\r\na hot sublimation / pressure printing technique that reveals the\r\nconstruction details of both sides of the garment." + }, + { + "uri": "https://ltho.s3.amazonaws.com/03785345-d63c-4c18-addf-fb7461949cec.png", + "label": "ANTIQUED REFLECTIVE", + "code": "4715 7423", + "caption": "Cotton Batavia with a coating made up of thousands of glass microspheres. Antiqued Reflective fabric\r\nhas a strong capacity to reflect even the weakest light sources and is enhanced by a color patina that is\r\nparticularly evident in the folds of the garment, granting to the piece a three-dimensional appearance.\r\nThe shape and details of the garment have been deliberately designed with a retro style in order to\r\ncreate a contrast with the modernity of the reflective face. The hood is lined in a khaki colored wool\r\nwith parallel stripes, reminiscent of military blankets.\r\nDetachable lining in microfiber quilted to a thin polyester padding. The lining is attached to the outer\r\ngarment using a system of ties, adapted from those used in the sailing world.\r\nStone Island badge with white embroidery, reserved for garments that are made using advanced\r\nresearch into fabrics or processes." + }, + { + "uri": "https://ltho.s3.amazonaws.com/b7b6db65-3688-4472-839d-38852b074790.png", + "label": "RASO GOMMATO - HAND PAINTED CAMOUFLAGE", + "code": "4915 4C43", + "caption": "Drawing inspiration from the actions of soldiers during the First World War, who\r\nused earth from the trenches to make their uniforms dirty, thus inventing the\r\nconcept of camouflage, the fabric base in black satin weave cotton of military\r\norigin bonded to a black polyurethane cover on the inner face, has been faded\r\nwith a corrosive paste and then hand painted on the finished garment to create\r\na camouflage effect. By means of this manual process, each garment is rendered\r\nunique and unrepeatable.\r\nThe detachable quilted nylon lining with polyester padding, with front edging\r\nand collar in felted wool, is attached to the outer garment using a system of ties,\r\nadapted from those used in the sailing world." + }, + { + "uri": "https://ltho.s3.amazonaws.com/9a25ed8c-2293-4d6e-b63a-c17580113d63.png", + "label": "WAXED ICE - THERMO SENSITIVE FABRIC", + "code": "5115 7498", + "caption": "Cotton moleskin with a resin treatment containing thermo sensitive\r\nquartz. The color of the garment ranges from bright yellow at\r\nroom temperature to a deeper and deeper shade of olive green as\r\nthe temperature drops. The garment is washed and then waxed.\r\nThe detachable black woolen lining with Stone Island logo in the\r\ncentre is attached to the outer garment using a system of ties,\r\nadapted from those used in the sailing world.\r\nStone Island badge with white embroidery, reserved for garments\r\nthat are made using advanced research into fabrics or processes." + } + ], + "__index": "3", + "dateCreated": "Thu, 05 Nov 2015 01:49:03 GMT" + }, + { + "id": "-990-999", + "title": "'990'999", + "images": [ + { + "uri": "https://ltho.s3.amazonaws.com/f58db57f-a469-4c7b-b248-6cab5a927c8a.png", + "label": "RASO GOMMATO COLORED COVER", + "code": "05 4001", + "caption": "Satin weave cotton of military origin bonded to a\r\nmustard yellow polyurethane cover on the outside\r\nand white on the hood. The inner fabric face takes its\r\ncoloring from garment dyeing. Double parallel row\r\nof snap fasteners mounted on small rubber disks\r\nallow the garment to be tightened or loosened to fit." + }, + { + "uri": "https://ltho.s3.amazonaws.com/56189889-630b-4293-95e9-2c747d1209fe.png", + "label": "ICE JACKET CAMOUFLAGE THERMO-SENSITIVE FABRIC", + "code": "05 4N06", + "caption": "Cotton poplin with a camouflage print in a thermo-sensitive\r\ncoating with liquid crystals that change color based on\r\nthe temperature. Over dyed on the finished garment. As the\r\ntemperature drops, the fabric print gradually disappears\r\nas it takes on the same shade as the solid color of the\r\ngarment dye." + }, + { + "uri": "https://ltho.s3.amazonaws.com/d46fc981-d51c-4001-a72a-7d5bc3bedc15.png", + "label": "RUBBERISED SATIN SILVER COVER", + "code": "35 4405", + "caption": "Satin weave cotton of military origin bonded to a silver\r\npolyurethane cover on the outside. Padded with goose down.\r\nDouble parallel row of snap fasteners mounted on small rubber\r\ndisks allow the garment to be tightened or loosened to fit.\r\nLining in colored peached polyester microfiber. Hood in the\r\nRaso Gommato Silver Cover garment dyed, with detachable wolf\r\nfur edging." + }, + { + "uri": "https://ltho.s3.amazonaws.com/65a6a008-a634-4155-8dba-0e2f22e1dc74.png", + "label": "REFLECTIVE JACKET", + "code": "1815 4N02", + "caption": "Owing to a coating made up of thousands of glass\r\nmicrospheres on a polyester base, the Reflective\r\nfabric has a strong capacity to reflect even the\r\nweakest light sources. It reflects and intensifies\r\nthe brightness of the color of the fabric itself,\r\nparticularly if placed in the dark. If it is photographed\r\nusing a flash, it detracts light from the other\r\ncomponents in the shot, which show up as black.\r\nPocket linings in cotton mesh." + }, + { + "uri": "https://ltho.s3.amazonaws.com/7011fe4a-22de-4bf0-bd4d-4440c49d8409.png", + "label": "WQR WATER RESISTANT QUILTING", + "code": "2515 6L51", + "caption": "Nylon jersey quilted with polyester padding,\r\nwith a special external coating used to close\r\nall the needle holes produced in the quilting\r\nprocess, rendering the garment totally\r\nwaterproof. The garment takes its final\r\ncoloring from garment dyeing." + }, + { + "uri": "https://ltho.s3.amazonaws.com/ca0447d1-3bd3-4702-a7d5-f1da98764ffb.png", + "label": "LINO GOMMATO REVERSE COLOR PROCESS", + "code": "2815 4P49", + "caption": "Black linen canvas bonded to a transparent polyurethane\r\ncover on the outside. By means of an exclusive process\r\ncarried out on the finished garment, the original color of\r\nthe fabric is corroded, with the exclusion of the Stone Island\r\nlettering, of the two parallel stripes and of the name of the\r\nprocess on the left sleeve. The collar, placket, pocket flaps,\r\ncuffs and bottom hem are less faded owing to the double\r\nlayer of fabric and the seams. Light garment over dye." + }, + { + "uri": "https://ltho.s3.amazonaws.com/23b746d9-311b-4f9f-b356-d1f49046bda9.png", + "label": "THE PRESIDENT’S KNIT", + "code": "2915 5784", + "caption": "The President’s Knit is the name of a knitted garment introduced in the autumn winter ‘998-’999\r\nseason and then retaken with different processes in the years that followed. It is an innovative knitted\r\ngarment that takes on the functions of a jacket owing to its detachable lining.\r\nThe first of these garments was created in a double face knit, nylon chenille on the outside, cotton on\r\nthe inside. Three black nylon parallel stripes on the cuff. Ends of the sleeves and bottom hem as well\r\nin black nylon. The garment takes its final coloring from garment dyeing.\r\nDetachable lightweight nylon fabric lining with water resistant polyurethane resin finish, quilted\r\nwith polyester padding. The detachable lining is attached to the outer garment using a system of ties,\r\nadapted from those used in the sailing world." + }, + { + "uri": "https://ltho.s3.amazonaws.com/ebaf6ae8-f465-4a8d-b6d0-ff45a93f0350.png", + "label": "LAMINATE - NOC 1", + "code": "3015 4C41", + "caption": "Two ultra light cotton gauzes laminated by means of a\r\nmatte colored resin. This slightly stretch fabric provides\r\ntechnical features owing to its light lamination. This fabric\r\nhas a natural appearance but high-tech performance and\r\nis waterproof, windproof and breathable. Fully thermotaped\r\nseams on the inside.\r\nInjection moulded PVC NOC 1 hood. The shape of the\r\nhood is taken by the shape of gas masks. A research by\r\nStone Island into the making of non-fabric components." + }, + { + "uri": "https://ltho.s3.amazonaws.com/a39caa9e-4dbe-4c31-8bda-41ebc2a508b4.png", + "label": "PURE METAL SHELL – BRONZE", + "code": "3115 4T43", + "caption": "100% bronze mesh applied to a black nylon jersey base. The polyurethane adhesive\r\nprovides a light protection for the mesh. A Teflon® treatment makes the garment water\r\nresistant. The metal mesh is a living material with the features of metallic materials when\r\nused untreated, and therefore they are subject to oxidation over time, losing its shine.\r\nThe worn look, creases and breaks that form on the surface are features that make each\r\ngarment different from the next.\r\nDetachable woolen lining with raw cut edging, attached to the outer garment using a\r\nsystem of ties adapted from those used in the sailing world.\r\nThe Autumn Winter ´999-´000 collection saw the introduction of the Stone Island badge\r\nwith white embroidery, dedicated to garments created using advanced research into\r\nfabrics or processes." + }, + { + "uri": "https://ltho.s3.amazonaws.com/f221b596-7cc0-493c-9cea-6755f64d1641.png", + "label": "PURE METAL SHELL - SILVER SPRAY", + "code": "3115 4U39", + "caption": "Ultra light polyester fabric with the application, through\r\na patented procedure, of a micro stainless steel film in a\r\nvacuum and sterile environment. This Japanese fabric,\r\nused in airplanes to shield the on-board computers from\r\nelectromagnetic radiation. Cotton canvas lining. The garment is\r\npadded with goose down.\r\nThe Autumn Winter ´999-´000 collection saw the introduction\r\nof the Stone Island badge with white embroidery for pieces\r\ninvolving advanced research." + } + ], + "__index": "2", + "dateCreated": "Thu, 05 Nov 2015 01:49:20 GMT" + }, + { + "id": "-982-989", + "title": "'982'989", + "__index": "1", + "dateCreated": "Wed, 02 Dec 2015 05:15:20 GMT", + "images": [ + { + "uri": "https://ltho.s3.amazonaws.com/e486c7c7-798e-4bf7-9e67-973f2cb02368.png", + "label": "TELA STELLA", + "code": "45 4NN", + "caption": "Stone Island was founded on this fabric. Tela Stella was born out of the study\r\nof the technical and functional characteristics of military truck tarpaulins. It\r\nis a cotton canvas impregnated on both sides with special pigmented resins\r\nin contrasting colors. The finished garment then undergoes an extended\r\nenzyme wash in order to give it a faded look and to break down the density of\r\nthe material. The result is a windproof garment that has an air of old oilskins\r\ncorroded by the sea, which, at the same time, has a marked military feel." + }, + { + "uri": "https://ltho.s3.amazonaws.com/757164f9-0699-482a-9187-e7d097f84319.png", + "label": "TELA STELA DUAL COATED", + "code": "65 404", + "caption": "Cotton canvas impregnated on both sides with special pigmented resins in contrasting colors.\r\nWhite outside, sand colored inside. Garment dyed midnight blue; a mélange effect is obtained with\r\ndifferent textured depths of color on the outside and inside of the garment. Appliqués in reflective\r\nfabric and stretch cotton tape on the pockets. Metal buckles on the bottom hem. Long cotton strap\r\nsewn under the collar label and attached to one of the buckles by means of a snap hook to allow the\r\ngarment to be worn over the shoulders." + }, + { + "uri": "https://ltho.s3.amazonaws.com/eb9cadb6-9712-41cf-9984-086518c7c391.png", + "label": "TELA STELLA DUAL COATED", + "code": "65 410", + "caption": "Cotton canvas impregnated on both sides with special pigmented resins in\r\ncontrasting colors. White outside, sand colored inside. Neither washed,\r\nnor garment dyed, it maintains the body and intensity of the coating.\r\nAppliqués in reflective fabric and stretch cotton tape. Adjustable straps at\r\nthe sides." + }, + { + "uri": "https://ltho.s3.amazonaws.com/8237f317-5272-4760-a6ab-b56c475b50d3.png", + "label": "JOCK-23", + "code": "75 436", + "caption": "Cotton canvas with thick matte PVC coating. Appliqués in the same fabric\r\nwith contrasting color coating. On the back, appliqué in mélange felted wool\r\npolyester on the collar. On the inside the neckline and shoulders are lined\r\nin cotton jersey. Rubber buttons created from a mould. Detachable lining in\r\ngarment dyed cotton fleece, attached with snap fasteners." + }, + { + "uri": "https://ltho.s3.amazonaws.com/c790cbf7-0a92-449e-8557-f6174946ab68.png", + "label": "JOCK-23", + "code": "75 460", + "caption": "Cotton canvas with thick matte PVC coating. Hood and buckled inserts at the cuff, with\r\ncontrasting color coating. Appliqué in latex right around the edge. Metal eyelets.\r\nRubber buttons created from a mould." + }, + { + "uri": "https://ltho.s3.amazonaws.com/1062f397-c1d7-4012-ae8d-9ddf13363743.png", + "label": "JOCK-23", + "code": "75 409", + "caption": "Cotton canvas with thick matte PVC coating. Inner flap in a contrasting\r\ncolor. Collar in felted wool polyester, lined with latex. Latex band at cuffs.\r\nRubber buttons created from a mould. Detachable lining in garment dyed\r\ncotton fleece, attached with snap fasteners." + }, + { + "uri": "https://ltho.s3.amazonaws.com/5f315b73-1572-460c-abfe-cda498886abe.png", + "label": "RASO GOMMATO BLACK COVER", + "code": "35 4NN", + "caption": "Satin weave cotton of military origin bonded to a black\r\npolyurethane cover on the inside. The garment takes its\r\nfinal coloring from garment dyeing. Detachable hood in Silk\r\nLight, an ultra light, slightly resin treated shiny trilobate nylon\r\nfabric, quilted with polyester padding.\r\nDetachable lining in Silk Light, quilted with polyester padding.\r\nThe detachable lining is attached to the outer garment using\r\na system of ties, adapted from those used in the sailing world.\r\nThe hood and detachable lining are also garment dyed." + }, + { + "uri": "https://ltho.s3.amazonaws.com/cd370f63-4fab-41e1-bbb6-d9e4955d068e.png", + "label": "GLAZED SILK LIGHT", + "code": "55 4910", + "caption": "Fine shiny trilobate nylon with thick, glazed effect\r\nPVC coating, creating a translucent, semi-transparent\r\nappearance. Hood part lined in a layer of PVC and with a\r\nstrip of honeycomb pattern non-woven fabric in microfibre.\r\nPVC windproof cuffs inside the sleeves. Lining made with\r\na layer of heat-sealed PVC, with interlining in polyester\r\nmesh quilted with polyester padding. The piece takes its\r\nfinal color from a double cotton and nylon garment dyeing\r\nrecipe, to obtain different shades on the finished garment." + }, + { + "uri": "https://ltho.s3.amazonaws.com/417e64df-f318-4500-977b-2eaed1668bc4.png", + "label": "RASO GOMMATO BLACK COVER", + "code": "65 4A10", + "caption": "Satin weave cotton of military origin bonded to a\r\nblack polyurethane cover on the inside. Removable\r\neye mask in the hood, which folds away in the\r\ncollar. The garment takes its final coloring from\r\ngarment dyeing." + }, + { + "uri": "https://ltho.s3.amazonaws.com/93d8d8fa-ad6e-4fe5-9182-c9e45c7e4ff5.png", + "label": "NYLON RIP-STOP COVER", + "code": "75 4503", + "caption": "Khaki iridescent nylon with rip-stop twill, laminated on the\r\noutside with a transparent amber polyurethane film. The\r\ndepth of color is obtained by adding together the color of\r\nthe textile base and that of the coating. Lined in iridescent\r\nnylon rip-stop quilted with polyester padding." + } + ] + } + ], + "hub": [ + { + "id": "ss_-016-over-shirt-in-nylon-metal", + "date": "Tue, 26 Jan 2016 12:00:00 GMT", + "title": "SS_’016 Over Shirt in Nylon Metal", + "subtitle": "Stone Island App Exclusive Colorway", + "body": "NYLON METAL: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. The addition of a special agent to the dye formula makes the piece anti-drop.", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/5f8ea79e-89b1-497a-a64d-ab1616a73d14.JPG", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/dcbdc373-b95c-4891-86ba-6dc39e13f49d.JPG", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/6828eb54-ebbf-412f-a246-5b208f8e6733.JPG", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/0ef84bf3-5b79-4e34-b115-9a31821cec24.JPG", + "caption": "" + } + ], + "__index": "1", + "dateCreated": "Tue, 26 Jan 2016 15:31:47 GMT" + }, + { + "id": "ss_-016-collection-preview", + "date": "Tue, 12 Jan 2016 12:00:00 GMT", + "title": "SS_'016 COLLECTION PREVIEW", + "subtitle": "Stone Island App exclusive 1/12-1/19", + "body": "The unrelenting research by Stone Island results in a collection full of textiles evolutions, finishing and dyeing, featuring pop colors and extraordinary visual effects.\r\n\r\n44447 NYLON METAL WATRO\r\nHooded blouson in Nylon Metal. Hood with half lining in cotton and half in nylon mesh. Slanting hand pockets with windproof entrance and zip fastening. Adjustable strap at cuffs. Drawstring in bottom hem. Zip fastening. \r\nNYLON METAL WATRO: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. The fabric is resin treated inside to achieve a mild wind and water resistance The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n10544 NYLON METAL \r\nOver shirt in Nylon Metal. Garment dyed. Hook fastening collar. On seam pocket along central placket, with snaps fastening. Snap-fastened cuffs. Hidden zip and snap fastening.\r\nNYLON METAL: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n70532 POLYESTER SHANTUNG\r\nParka in an organic looking polyester. Hood with visor and chin strap adjustable with Velcro. Two bellows pockets on chest with flap closed by hidden snaps. Two welt pockets closed by a zip with a second snap opening that holds a cotton tape belt. Snap fasteners at cuffs. Zip and hidden button fastening.\r\nPOLYESTER SHANTUNG: organic looking polyester material with a shantung effect. The organic look is given by the highly technological spinning of the raw material and by its super tight weaving. The pieces are sewn and then garment dyed under pressure at 130°C with the addition of an anti-drop agent. The high pressure dye process compacts the material and induces the high absorption of the color recipe.\r\n\r\n41923 MEMBRANA 3L TC\r\nHooded jacket in a light 3 layers fabric. Garment dyed. Adjustable straps on hood with elasticated gathering on back. Patch pockets with zip fastening. Adjustable straps at cuffs. Elasticated adjustable drawstring on bottom edge. Zip fastening. \r\nMEMBRANA 3L TC: 3 layer light performance fabric made from an opaque nylon outer face laminated to a breathable, water resistant, windproof membrane, protected by an impalpable polyester base. Stone Island’s expertise in garment dyeing gives an outstanding color to the outer face while preserving the performance features of the inner membrane. The addition of a special agent to the dye formula makes the piece anti-drop.\r\n\r\n65260 T.CO+OLD\r\nHooded full zip sweatshirt in malfilé cotton, garment dyed to create the OLD effect, an exclusive dyeing treatment and subsequent fading on the finished garment to create a slightly worn and three-dimensional appearance. Hood drawstring in contrasting color. Pouch pockets. Ribbed side band, cuffs and bottom band. Zip fastening.\r\n\r\n530B0\r\nCardigan knit in plain stitching cotton nylon. Raised collar with concealed hood in Nylon Metal. Garment dyed. On seam pockets. Plain cuffs and bottom band with inner ribbing. Zip fastening.\r\nNYLON METAL: The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and tonic sheen of Nylon Metal, one of the most versatile fabrics born of Stone Island’s textile research. ", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/76ecda74-afef-406b-9b17-2d940700a1f6.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/f96e6884-f558-4da4-bce6-dc6fa4137442.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b22d0c15-e948-4b74-b275-c25cfdd824ec.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/2d5d5ced-3383-4203-affc-3fd0aff991b3.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/5698df03-ab54-4f08-ac64-5bdde9e9ba05.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/36c356ef-ffbd-47b4-8103-3310fc46eb6e.png", + "caption": "" + } + ], + "__index": 2, + "dateCreated": "Wed, 27 Jan 2016 01:57:35 GMT" + }, + { + "id": "nikelab-x-stone-island-windrunner", + "date": "Wed, 09 Dec 2015 12:00:00 GMT", + "title": "NikeLab x Stone Island Windrunner", + "subtitle": "", + "body": "<b>NikeLab partners with Stone Island to deliver a unique interpretation of its foremost apparel icon, to celebrate the beginning of “The Year of Windrunner.</b>\r\n\r\n “An exciting co-lab. Stone Island loves challenges. We source our strength from challenges. It’s a great satisfaction to share our knowhow and expertise with Nike”.\r\n<i>Carlo Rivetti – Stone Island President and Creative Director</i>\r\n \r\nThe Nike Windrunner was born during a time of firsts. Created by Nike’s first apparel designer in 1978 and revolutionary for its raglan sleeves and 26-degree chevron yoke, the jacket became the first piece of Nike apparel worn by athletes at track and field trials before and after competition. Today, to commemorate this running icon, the Nike Windrunner experiences another first, the fabric innovation, the engineering and garment dyeing techniques of Stone Island.\r\n \r\nIn 2016 Nike is celebrating its foremost apparel icon: the Nike Windrunner Jacket. Designed in the late ‘70s, the silhouette has been a fixture on medal stands and city streets ever since. In the launch edition of this yearlong celebration Nike and Stone Island merge the distinctiveness of two brands to create a unique garment.\r\n \r\nThe chevron and hood of the NikeLab x Stone Island Windrunner are constructed with water and wind-resistant Mussola Gommata fabric, formed by bonding lightweight cotton muslin to an opaque polyurethane film. Nylon Metal, a proprietary Stone Island fabric with a metallic sheen, is featured on the body of the garment, which is lined with PrimaLoft®.\r\n \r\nWhile the exterior of the jacket is monochromatic, it mimics the traditional Nike Windrunner color blocking through Stone Island’s garment dyeing process. The result is a subtle distinction between the shades of the Mussola Gommata and Nylon Metal fabrics. The silver PrimaLoft® lining provides a stunning contrast to the monochromatic exterior, while the oversized trims contribute to a rugged look.\r\n \r\nThe NikeLab x Stone Island Windrunner will be available on December 17th at 10am PST from the Stone Island App and selected NikeLab retailers and on nike.com/nikelab.", + "link": "http://www.stoneisland.com/experience/us/nikelab-x-stone-island/", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/83cc1844-73f2-4b76-b968-4d8225d84c5b.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/ae57c043-dc9c-43fb-a64f-867cece10c77.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/ea1b402b-fc94-4363-aa97-88806b6aadd1.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/bdcfd9d4-ae84-45de-8d80-3c91c8f8ce81.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/1c194494-d6e6-45ed-8a00-d4c337c2a104.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/83832a1b-14e7-41d2-afc9-12956cae78c9.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/944abccb-b2d0-40ee-88eb-7ee027127878.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/35290536-15b7-43de-9bbe-e3ee199fe520.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b3538dbb-b203-49d4-93b7-59826fcf6298.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/9e5f54c7-ae5d-432a-b45e-2cbc2c98970c.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/eb961f79-587a-4df6-bac3-7159b313a6c2.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/eada5a2f-0de2-4a40-9e7a-409e1de28b4e.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b8264d5d-d0cf-4e84-a7d2-0e241f7337c2.png", + "caption": "" + } + ], + "__index": "3", + "dateCreated": "Wed, 27 Jan 2016 01:58:22 GMT" + }, + { + "id": "nikelab-x-stone-island-koth-ultra-mid-si", + "date": "Wed, 09 Dec 2015 12:00:00 GMT", + "title": "NikeLab x Stone Island Koth Ultra Mid SI", + "subtitle": "", + "body": "Inspired by the Nike Air Mowabb, the revolutionary 1991 sneaker-hiker hybrid, this all-weather Nike Koth Ultra Mid SI Shoe is made in Nike water resistant materials, real leather, and in Mussola Gommata, a fabric issued from the Stone Island research and treatment research, an exclusive panel dyed material made by bonding an extremely light cotton muslin to an opaque polyurethane film. The shoe features aggressive traction and flexible ankle support. Unitsole foam midsole for cushioning and durable support. Waffle rubber lugs for rugged traction and durability. Flex grooves allow for natural range of motion. Heel loop for easier on and off. Heel overlay for enhanced support. The shoe dust bag is made in 2 Stone Island fabrics, Nylon Metal, nylon canvas with a distinctive metallic and iridescent sheen, 50 Fili, a cotton/nylon canvas, both panel dyed.\r\n\r\nThe NikeLab x Stone Island Koth Ultra Mid SI will be available on December 17th at 10am PST from the Stone Island App and selected NikeLab retailers and on nike.com/nikelab.", + "link": "http://www.stoneisland.com/experience/us/nikelab-x-stone-island/", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/783b5830-6f63-41df-ad3e-22e8a6ecb640.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/332d5d23-1661-4444-b9d3-fcebda25e17d.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/66ad13cd-11cd-477d-af29-1bac747c7fc7.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/f11681bb-e698-4206-a147-4083ef881180.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4ae2c8e5-a7b0-4787-a564-86efee2a75f8.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/f88aa2e4-0359-4114-855c-f742c3347217.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/3adb8ecb-e656-40fd-b1d3-26afd25c1443.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/e13421b7-ace5-4540-a051-a6aaba198092.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4ff448bf-bd24-40a2-86ff-ead87e3abc95.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/0ed0705a-7804-4ecb-871e-fb7da49d17c3.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/db63550e-4026-4dac-ae8c-23ae0c4ddcbf.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/7cde7501-df12-4849-9dc6-24e09917da4f.png", + "caption": "" + } + ], + "__index": 4, + "dateCreated": "Wed, 27 Jan 2016 02:06:13 GMT" + }, + { + "id": "45546-garment-dyed-pixel-reflective-", + "date": "Thu, 11 Feb 2016 12:00:00 GMT", + "title": "45546 GARMENT DYED PIXEL REFLECTIVE ", + "subtitle": "APP EXCLUSIVE 2/11 - 2/15", + "body": "GARMENT DYED PIXEL REFLECTIVE: STONE ISLAND’s research introduces garment dyeing on reflective fabrics. The landmark iridescent Nylon Metal fabric is printed with a resin substance containing thousands of glass microspheres. The garment dyeing procedure lends extraordinary colors to the textile base while the Pixel Reflective printing provides it with a strong capacity to reflect even the weakest light sources. A special agent was added to the dyeing bath for an anti-drop effect.\r\n\r\nLong Bomber jacket in Pixel reflective fabric. Garment dyed. Ribbed neckline and cuffs. Flap pockets with button flap on front. Straight pocket on chest with nylon tape edge. Windproof pocket with Velcro fastening on arm. Zip fastening.", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/6184e4f6-a1f5-483a-8151-4f425ea49da3.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/e179b0eb-9476-41a5-9a83-ccc9ce824d78.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/e451542c-392f-4fcc-ad80-142ab3551f16.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/8c593568-64c8-4bd2-bcab-d90ed83438f8.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/adb18f34-2968-4981-a5d1-a81a09f7e9c3.jpg", + "caption": "" + } + ], + "__index": "5", + "dateCreated": "Thu, 11 Feb 2016 15:01:24 GMT" + }, + { + "id": "stone-island_los-angeles", + "date": "Tue, 23 Feb 2016 12:00:00 GMT", + "title": "STONE ISLAND_LOS ANGELES", + "subtitle": "", + "body": "Stone Island opens first US retail location at 145 S La Brea Ave, Los Angeles.\r\n\r\nThe destination offers Stone Island collections, alongside curated brand experiences and presentations.\r\n\r\nThe store’s inaugural exhibition features “Reflective Research ‘992 — ‘015” which will run through March 13th, 2016\r\n\r\nSTONE ISLAND_LOS ANGELES\r\n145 S La Brea Avenue, Los Angeles, CA 90036\r\n\r\nMonday - Saturday 11AM - 7PM\r\nSunday - 11AM - 6PM", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/9d82d33c-e9ea-47b4-8aeb-8e316843bca8.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4029fc99-1fa6-41ce-b0b2-bf05657333d1.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/d40cf381-c20f-4577-8326-e2f31e10875a.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/0749fbcf-1bfc-41b2-8540-5c6d358eddd3.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4c13a8cc-c47e-4837-95b5-70a69f111a21.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/90c03aa2-869b-48b5-87aa-da22bffac4a7.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/a0807612-4ee0-494e-9820-c0426b3ac166.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/44ab5342-68d2-410c-90e5-2130f2fdc80d.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/c4aa9eea-7446-4309-a885-cdd50078880e.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/44342be6-39ef-4612-b76f-aa1c0c1b9a9c.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/60ae0f89-3d2d-4f6e-885c-fd3f2797c8a0.jpg", + "caption": "" + } + ], + "__index": "6", + "dateCreated": "Tue, 23 Feb 2016 18:02:12 GMT" + }, + { + "id": "stone-island-ss_-016-icons", + "date": "Wed, 24 Feb 2016 12:00:00 GMT", + "title": "Stone Island SS_'016 Icons", + "subtitle": "", + "body": "", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/afb364d3-a8fc-40e1-a922-d93d57a10f07.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/ccbcec28-fe70-4f60-8806-2dcce06b3121.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/af25c582-bca2-4365-b8f8-a262eae0e1ac.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/408d6ecb-fa1f-4d65-9e29-3e94574ff26a.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/6df375f6-9261-46e2-994a-b48b4b2b33c4.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/f6eb87a7-ffbb-4a65-a3e4-299c8d22f0a9.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4593fb77-3bc7-475a-ac56-a42f3a40d2ef.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/8d7f419b-5342-4ccc-beeb-8354cc5823a1.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/8169511b-c904-42cf-8f26-077df472d6a9.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/adf18770-73fb-4f4b-bf9a-20efd5f72a53.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/30c9f8f4-92cb-4f51-a050-0d54e73dc862.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/cf274bc6-2690-4625-9902-5417d257e7e5.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/3a16057d-b939-4d82-b9b5-5f3ba5019dd8.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b9baed9e-f7b5-46d8-bedf-bdf479a73797.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/fc14ba8f-920a-490b-b881-2bfea3c225cc.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/cf6f23c9-f24a-4a5c-945c-4ceed52c655f.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/061184a8-adef-4630-8fa7-527ba6a83d93.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/24c11eff-4795-4782-b8f2-8f92edfb428e.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/a7bab9ac-e23e-4f65-96b8-1dbbcef0299f.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b49d11ad-02f6-4f5a-ae7b-dbc0d5782141.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/ea63d777-09f9-4813-b348-aafef19f5137.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/08c31779-5223-479a-b242-dcb7c9185d71.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/79058530-adc3-4415-9a01-268731f8c439.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b5c527a5-dd95-4bfd-91d3-ae269d9aa31e.png", + "caption": "" + } + ], + "__index": "7", + "dateCreated": "Wed, 24 Feb 2016 19:18:05 GMT" + }, + { + "id": "44537-water-repellent-wool-ghost-piece-", + "date": "Tue, 01 Mar 2016 12:00:00 GMT", + "title": "44537 WATER REPELLENT WOOL - GHOST PIECE ", + "subtitle": "APP EXCLUSIVE 3/1 - 3/7", + "body": "WATER REPELLENT WOOL: 100% naturally water repellent wool. The specific fiber processing allow increased yarn contractility and the ultra-tight compact density weaving with high temperature finishing make the fabric windproof, breathable and water repellent without the need of chemicals, coating or lamination techniques.\r\n\r\nHooded jacket in water repellent wool. Diagonal pockets with zip fastening. Two pockets with slanting flap closed by hidden snaps on chest. Heat sealed tapes on inner seams. Tyvek® half lining with nylon mesh, in the hood as well. Hidden zip and snap fastening. \r\n\r\nGhost pieces are based on the concept of camouflage and are entirely monochromatic. Even their STONE ISLAND badges have been created in special mono-color versions to blend with the garment.", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/f5ceb26d-9830-4103-a29a-974c352617bf.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/48728c3c-5ee9-4b4c-abf3-5577eddab822.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/13fad590-9dd7-4529-a7e0-2e2685351bc8.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/c4ac3668-67b4-4287-bf87-f12df58c96c4.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/e4dd378e-034d-49cf-a683-7d267cb8e7c7.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/264d3e31-cf18-4e88-866c-feff0fd5377e.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/69d6714a-5b78-46f0-917e-2765f7ece13f.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/0b278eda-2223-4d73-874b-c4b1f163d0c8.png", + "caption": "" + } + ], + "__index": "8", + "dateCreated": "Tue, 01 Mar 2016 15:00:17 GMT" + }, + { + "id": "stone-island-supreme-", + "date": "Mon, 14 Mar 2016 12:00:00 GMT", + "title": "Stone Island / Supreme ", + "subtitle": "Co-Lab SS '016_Preview", + "body": "Third collaboration with the cult US skate brand Supreme.\r\nOuterwear, lightweight garments and accessories represent the fusion between the fabric research of Stone Island and the iconic style of Supreme.\r\n\r\nIN THE US AND CANADA THE CO-LAB WILL BE AVAILABLE FROM MARCH 17TH ON THE FOLLOWING CHANNELS: \r\nSTONE ISLAND APP AND STONE ISLAND LOS ANGELES STORE. SUPREME NEW YORK AND LOS ANGELES STORES, SUPREME APP AND ONLINE STORE.\r\n\r\nSTONE ISLAND FOR SUPREME \r\n701S1 HEAT REACTIVE – THERMOSENSITIVE FABRIC\r\nTrench coat in Heat Reactive fabric, changing color depending on temperature. The molecules of the micro pigments encapsulated in the coating change the path of light, the garment gradually turns to a lighter color as the temperature rises and becomes darker again as it drops.\r\nDetachable hood. Hand pockets with hidden snap fastening. Strap at cuffs, adjustable through snaps. Central back slit with hidden snap fastening. Hidden buttons fastening.Stone Island badge with white embroidery, reserved for garments that are made using advanced research into fabrics or processes. \r\n\r\nSTONE ISLAND FOR SUPREME \r\n401S2 NYLON METAL\r\nTrack Jacket in NYLON METAL. One of the most versatile fabrics born of Stone Island textile research. The trilobate structure of the nylon yarn and the grey weft/white warp color weave are the grounds of its distinctive metallic and iridescent sheen, when garment dyed. The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. The addition of a special agent to the dye formula makes the piece anti-drop.\r\nStand up collar. Tonal Supreme water based print on left sleeve. Welt pockets on front with double snap fastening. Elasticated cuffs and bottom band. Inner nylon mesh lining. Zip fastening.\r\n\r\nSTONE ISLAND FOR SUPREME \r\n401S3 NYLON METAL 4C PRINTED\r\nTrack Jacket in NYLON METAL 4C PRINTED. Nylon Metal is one of the most versatile fabrics born of Stone Island textile research. The trilobate structure of the nylon yarn and the grey weft/white warp color weave are the grounds of its distinctive metallic sheen. The fabric is printed with a 4 color pigment Supreme camouflage motif. The garment is washed at 40°C (104°F) with the addition of a special anti-drop agent.\r\nStand up collar. Supreme water based print on left sleeve. Welt pockets on front with double snap fastening. Elasticated cuffs and bottom band. Inner nylon mesh lining. Zip fastening.\r\n\r\nSTONE ISLAND FOR SUPREME \r\n301S2 NYLON METAL\r\nTrack Pants in NYLON METAL, one of the most versatile fabrics born of Stone Island textile research. The trilobate structure of the nylon yarn and the grey weft/white warp color weave are the grounds of its distinctive metallic and iridescent sheen, when garment dyed. The finished piece undergoes an elaborate double dye procedure providing different tones, intensities and colors to the fibers and textile accessories of the garment. \r\nTonal Supreme water based print on left leg. On seam hand pockets with snap fastening. One slit back pocket with hidden zip fastening. Elasticated waistband with inner drawstring. Elasticated leg bottom with side zip fastening. Inner nylon mesh lining.\r\n\r\nSTONE ISLAND FOR SUPREME \r\n301S3 NYLON METAL 4C PRINTED \r\nTrack Pants in NYLON METAL 4C PRINTED. Nylon Metal is one of the most versatile fabrics born of Stone Island textile research. The trilobate structure of the nylon yarn and the grey weft/white warp color weave are the grounds of its distinctive metallic sheen. The fabric is printed with a 4 color pigment Supreme camouflage motif. The garment is washed at 40°C (104°F). \r\nSupreme water based print on one leg. On seam hand pockets with snap fastening. One slit back pocket with hidden zip fastening. Elasticated waistband with inner drawstring. Elasticated leg bottom with side zip fastening. Inner nylon mesh lining.\r\n\r\nSTONE ISLAND FOR SUPREME \r\n501S7 COMPASS PIN SWEATER IN PIMA COTTON\r\nCrewneck sweater in 100% Pima Cotton. By using only selected long staples, Pima cotton has a superior soft hand and extra smooth feel.\r\nReflective tonal Stone Island/Supreme Compass Pin transfer print on chest. Ribbed cuffs and bottom band.\r\n\r\nSTONE ISLAND FOR SUPREME\r\n201S4 ALL OVER PLACED PRINT \r\nLong-sleeve T-Shirt in slightly raw cotton. The striped motif is pigment printed. The cutting of the piece respects the stripes placement with the Supreme print on back. Slight enzyme wash to loosen the hand of the print. \r\nStand up collar. Metal zip collar fastening. Topstitch seams on shoulders, with interior taping. Side splits on bottom sides. \r\n\r\nSTONE ISLAND FOR SUPREME \r\n901S5 COMPASS PIN DRYBAG® BY ORTLIEB\r\nDuffle bag in ultra-resistant waterproof PVC. The glossy and super resistant, heat sealed PVC Drybag® by Ortlieb carries the exclusive patented airtight waterproof zip for extreme protection. When air is captured inside the duffle bag it can act as a pillow.\r\nZip fastening. Big polyester strap handles. Supreme logo print on one side, Stone Island logo print on the other. Both ends are printed with the Stone Island/Supreme Compass Pin. Adjustable shoulder strap with padded piece carrying the Stone Island Compass logo. Pockets inside.\r\n\r\n903S6 STONE ISLAND HEAT REACTIVE\r\nTHERMOSENSITIVE FABRIC\r\nSupreme crusher in Stone Island Heat Reactive fabric, changing color depending on temperature. The molecules of the micro pigments encapsulated in the coating change the path of light, the garment gradually turns to a lighter color as the temperature rises and becomes darker again as it drops. \r\nStone Island patch logo on front. \r\n\r\n902S6 STONE ISLAND HEAT REACTIVE \r\nTHERMOSENSITIVE FABRIC\r\nSupreme six panels cap in Stone Island Heat Reactive fabric, changing color depending on temperature. The molecules of the micro pigments encapsulated in the coating change the path of light, the garment gradually turns to a lighter color as the temperature rises and becomes darker again as it drops.\r\nStone Island patch logo on front. Supreme embroidered logo on back. Adjustable closure.", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/69862dba-1df3-4f98-9dae-91783a4b2877.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/428df6c6-c60d-4f11-b00d-e90343118a13.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b539aa07-328a-40b6-a993-daa2e05d8ff5.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/87f32651-1a69-4e6e-bb18-769bfc0fdbb1.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/dabb2e39-5700-4440-8c99-fbeaece6ec09.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b445d653-4c81-48d5-98d3-3f4848d277d4.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/91326bed-8f98-4049-8883-bbda6226f95f.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4d74363f-3362-4948-bac0-c6c8e4eb32e6.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/ddb040f9-a8b4-4f91-87a0-02fc53bfbe4f.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/358b2608-eef7-4580-b016-9cac172c1e55.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/51085eff-b0c7-4e09-af58-d68bec8b3d91.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4907a7cd-0f1e-42ce-b7d0-9ad112ae478f.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/0b5f7a26-f879-4421-afe0-82996f6610f7.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/fc45fc87-a048-4fd3-8ff9-c58d5f5a7d15.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/7c6308b8-a99c-4b1b-8aad-c2d6dfc1a93f.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/681692a6-5b64-4f43-91ca-77ca7b45228e.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/5f5543bc-921a-4285-a4da-034910744976.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/097d40ba-f82c-4b0e-a614-de440e21345c.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/6787ab06-a7c5-4029-ac05-4e53d67a964b.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/378a4db2-e228-448d-83d6-e2735a89bdb9.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/61ec3ce3-b8bb-4544-b51f-779721bbb7b0.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/cd072dde-ec8e-4f23-b263-4fd83b04b9cf.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/a50b89e8-07e4-4da2-bf69-1b02f84feae7.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/04a57bfd-5e22-42df-a415-4dbec1d7c193.jpg", + "caption": "" + } + ], + "__index": "9", + "dateCreated": "Mon, 14 Mar 2016 13:57:55 GMT" + }, + { + "id": "70329-tank-shield-multi-layer-fusion-technology-", + "date": "Thu, 21 Apr 2016 12:00:00 GMT", + "title": "70329 TANK SHIELD - MULTI LAYER FUSION TECHNOLOGY ", + "subtitle": "", + "body": "Exclusive MULTI LAYER FUSION TECHNOLOGY. The garment, made in an opaque polyester tela, is preassembled and then entirely laminated with slightly overlapping panels producing a performing membrane to isolate hermetically the outer textile base and stitching. This technique guarantees improved waterproofness and breathability compared to common lamination techniques. \r\n\r\nCar coat using highly performing fabric and construction. Diagonal pockets with zip fastening. Adjustable straps at cuffs. Central vent on back. Zip and snap fastening.", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/77035181-a6e8-4817-a4f2-3dfee6afd509.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/f96d0cc2-a005-4c28-9dd4-467a204e6bc5.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/9b2305c6-20e6-4731-84e3-64fcf4d293ab.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/65ac1990-4390-4d84-bbbc-9afcdf61a1ad.png", + "caption": "" + } + ], + "__index": "10", + "dateCreated": "Thu, 21 Apr 2016 14:00:47 GMT" + }, + { + "id": "109ln-t-co-old", + "date": "Tue, 14 Jun 2016 12:00:00 GMT", + "title": "109LN T.CO+OLD", + "subtitle": "", + "body": "Hooded over shirt in stretch cotton broken twill. Garment dyed to create an OLD effect, an exclusive dyeing treatment and subsequent fading on the finished garment to create a slightly worn and three-dimensional appearance. Flat pockets at sides. Chest pockets with horizontal zip fastening. Ergonomic shaped sleeves. Hood edged with cotton tape. Zip fastening.", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/b4329a3b-0349-4473-af22-4b6f5151e337.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/7f762552-b961-4ab3-9ec3-97b5221bad3d.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/c003b009-79bc-491d-b3a7-3b79c8f4d0f0.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/fc12babb-8c79-423c-a1a5-68664e177952.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/5ba840fd-8159-496c-a1e4-772ce0c67510.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/73287608-5669-4404-8bf3-ddae63fd9131.png", + "caption": "" + } + ], + "__index": 10, + "dateCreated": "Tue, 14 Jun 2016 15:07:41 GMT" + }, + { + "id": "icon-imagery_fw-016-017", + "date": "Thu, 07 Jul 2016 12:00:00 GMT", + "title": "ICON IMAGERY_FW '016 '017", + "subtitle": "", + "body": "", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/4ad2bab9-2a63-4991-bf1e-2b1f616801fd.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/3c959c20-2534-477d-a77f-9eb59dfc5d93.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/e83dea7b-4672-4a02-bc85-def9929af6f0.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/0aa5e8d3-dc41-4c7f-a118-9007957674bb.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/681f033b-61aa-4ec0-8faf-2ac9e9874290.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/e68fdfa1-b543-42d1-84ca-db2f3b52d90d.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4abf9ef6-38ea-46fa-a0bc-9911b18fa106.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/e904dc23-a492-42ab-be30-0f3df2b3c957.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/0fb47449-d80f-4478-85c9-25d53d269967.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/cf1205ae-63cd-4eab-86e4-b9008322a16b.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/9e601e11-75c8-49f9-bdfe-eda859a27282.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4062566b-aaf5-48af-803e-0b9ad492cad4.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/6aaf42eb-68a8-4428-9bf5-2990adefa030.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/154300df-032b-4c1c-86c2-d63f48931415.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/1ed22a93-d2cd-43f8-a9c1-aafd376a4a16.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/06b2a209-14e9-422c-acf5-633992a4c9d4.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/98889f73-3320-4ee9-9ecd-30d36c6ad123.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/a2259e94-8c11-4afc-9b0f-0852b9fa5a7d.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/4eecf0ec-1bc0-4f54-a0c0-21466f272ca9.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/0d6b242b-b9aa-483f-b99a-d1bfbb03bacb.png", + "caption": "" + } + ], + "__index": "11", + "dateCreated": "Thu, 07 Jul 2016 18:14:16 GMT" + }, + { + "id": "457j4-stone-island-house-check-jacquard-on-nylon-metal-black-watro-", + "date": "Tue, 12 Jul 2016 12:00:00 GMT", + "title": "457J4 STONE ISLAND HOUSE CHECK JACQUARD ON NYLON METAL BLACK WATRO ", + "subtitle": "App exclusive 7/12 - 7/18", + "body": "STONE ISLAND HOUSE CHECK JACQUARD ON NYLON METAL BLACK WATRO: Long anorak in Nylon Metal Black Watro with jacquard motive. The trilobate structure of the nylon yarn, with its grey weft and white ready to dye warp colors, is the grounds of the distinctive metallic and iridescent sheen of Nylon Metal. Jacquard technique creates a rip-stop design on the surface that is derived from the Stone Island House Check and integrates the star in the vertical and horizontal checked pattern. The fabric has been resin treated inside to achieve a mild water resistance. Garment dyed through double color recipe with the addition of a special anti-drop agent.\r\n\r\nDrawstring around the raised collar. Two large pockets on the front with hidden snap fastening. The pockets are contoured by zip; the garment can be folded away and packed into the zipped front pockets. Elastic tape at cuffs. Drawstring bottom hem.", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/7e1ec747-7322-43d4-b9c6-aec9104bf351.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/8b75a21c-d372-4acd-99ca-9556c7c3088c.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/db0fc358-7447-4623-a0bb-3f6cee5ce8b7.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/ae096f9c-3699-4e7f-b6a0-36ccf93ca5f9.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/d4fa8667-27aa-4c60-a363-6493620be435.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/70fa7875-bd70-4572-9612-f7d039238126.png", + "caption": "" + } + ], + "__index": "12", + "dateCreated": "Tue, 12 Jul 2016 15:15:33 GMT" + }, + { + "id": "stone-island-opens-new-york-store", + "date": "Thu, 14 Jul 2016 12:00:00 GMT", + "title": "STONE ISLAND OPENS NEW YORK STORE", + "subtitle": "", + "body": "Stone Island opens New York store, located at 41 Greene St. New York, NY 10013.\r\n\r\nThe unique location — a classic SoHo building from 1910 that last autumn hosted the exhibition “Reflective Research ‘992 – ‘015”— measures 3,500 SF and has undergone significant architectural renovation to create an archetypal Stone Island environment. Presenting both Stone Island and Stone Island Shadow Project collections, the flagship store in New York will carry special and exclusive products and installations in its dedicated Hub presentation space.\r\n\r\nStone Island New York\r\n41 Greene St, New York, NY 10013\r\nHours: Monday—Saturday, 11am-7pm, and Sunday, 11am-6pm.", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/b627cfa1-0782-42c3-9487-a57428893fda.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/2ac003a6-f035-49cb-bc27-2da6a3ce4ffb.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/c636b626-4fdb-4ac6-818a-35c26b520e0e.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/55a429b6-2f47-4c79-86f6-05db5d7fa7eb.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/d4636f88-d11f-4fca-af70-df941378bca0.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/aaf8f0a5-a420-427b-af4b-bad00b5709fd.jpg", + "caption": "" + } + ], + "__index": "14", + "dateCreated": "Thu, 14 Jul 2016 17:16:01 GMT" + }, + { + "id": "10112-nylon-metal", + "date": "Tue, 23 Aug 2016 12:00:00 GMT", + "title": "10112 NYLON METAL", + "subtitle": "", + "body": "NYLON METAL: Over shirt in Nylon Metal doubled inside in jersey. The trilobate structure of the nylon yarn, with its gray weft and white ready to dye warp colors, is the grounds of the distinctive metallic and iridescent sheen of Nylon Metal. The finished piece undergoes an elaborate double dye process providing the fibers and textile accessories of the garment with different tones, intensities and shades.\r\n\r\nFront yoke with inseam pocket alongside the closure with hidden zips. Snaps at cuffs. Zip fastening.", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/b2b4036c-5b9f-4537-9b16-9b823835d1c1.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/11eb738b-98a4-4ba3-a39a-63e19915c584.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/9a6f91ee-6950-4efd-9f2e-a75d47100169.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/a8dfb935-a952-419e-ac89-932ec755d5ae.png", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/75214c5d-5840-485f-b836-6cd8e9cb9ed2.png", + "caption": "" + } + ], + "__index": "15", + "dateCreated": "Tue, 23 Aug 2016 14:03:29 GMT" + }, + { + "id": "stone-island-chinatown-invitational", + "date": "Tue, 30 Aug 2016 12:00:00 GMT", + "title": "Stone Island Chinatown Invitational", + "subtitle": "", + "body": "Earlier this summer the Chinatown Soccer Club (CSC) hosted the 2016 Chinatown Invitational in Lower Manhattan. This year’s tournament featured four teams from around the world: CSC (New York), Ringleaders FC (Montreal), Soho Warriors FC (London), and Stone Island FC (Milan). The participating teams comprised an eclectic group of creatives united by a shared love of soccer.\r\n\r\nWriter, director, and CSC member, Alexander Klein, documented the invitational, capturing the diversity and camaraderie of the tournament, stating \"The short film was inspired by the pitches of downtown New York. It’s soccer infused with the sights, sounds, and energy of New York City — creating a sporting flavor unlike anything else in the world.\" Earlier this year he shot the soccer-documentary WE ARE SAN MARINO, narrated by Alex Karpovsky, for BitTorrent Now. \r\n\r\nThe short film will be presented by Stone Island from 6-9 tonight at the Nanogallery (100 Forsyth Street) and be on show through September 11. Alongside the film will be an installation of imagery, shot before and during the tournament by CSC members and photographers, Pep Kim and Dominic Neitz.", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/907548da-f870-420a-aff3-d4fec07cfd55.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/197f894b-e7dd-43b8-a603-12bff46f3c2f.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/b89ea6bb-0128-4259-8bb6-28ca631dd61b.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/a1913c20-5c80-4303-bcdb-69dcdf261043.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/79dd20cd-08b8-490d-b678-f98210ba8692.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/df4affac-20c9-4186-9c28-1d6efcb6cd85.jpg", + "caption": "" + } + ], + "__index": "10", + "dateCreated": "Tue, 30 Aug 2016 16:02:48 GMT" + }, + { + "id": "polypropylene-denim", + "date": "Mon, 26 Sep 2016 12:00:00 GMT", + "title": "POLYPROPYLENE DENIM", + "subtitle": "APP EXCLUSIVE PREVIEW FROM 9/27 TO 10/3", + "body": "A new interpretation of a classic.\r\nPolypropylene, a material with antibacterial properties, is the lightest available fiber on earth.\r\nEven very bulky garments made in this material astonish for their specific lightness.\r\nThese denim cloth weaves a polypropylene yarn into an indigo dyed cotton warp. The result is an impeccable denim tela with a drastically reduced weight: it has the look of a 19 ounce material but weighs only 10.\r\nThe jumpsuit, the outerwear pieces, the trousers and backpack have undergone the DARK treatment, a manual sanding and light stonewash as well as an enzyme wash.\r\n \r\nPOLYPROPYLENE INDIGO KNIT is made by weaving yarns, an innovative technique from the knitwear industry. For this project a yarn was especially created from indigo dyed polypropylene and cotton yarn with chain construction.\r\n \r\nThe INDIGO FLEECE features WASH treatment.", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/ab51e2e6-19d6-4bfd-b8aa-7089bd49635b.jpg", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/091aa545-2605-4374-9437-e375d096d75c.jpg", + "caption": "" + } + ], + "__index": 10, + "dateCreated": "Tue, 27 Sep 2016 14:02:10 GMT" + }, + { + "id": "polypropylene-denim-video", + "date": "Tue, 27 Sep 2016 12:00:00 GMT", + "title": "POLYPROPYLENE DENIM VIDEO", + "subtitle": "APP EXCLUSIVE PREVIEW FROM 9/27 TO 10/3", + "body": "", + "link": "https://www.youtube.com/watch?v=twiCdserZ1M&feature=youtu.be", + "store": "true", + "__index": 11, + "dateCreated": "Tue, 27 Sep 2016 14:02:50 GMT", + "image": [ + { + "uri": "https://i.ytimg.com/vi/twiCdserZ1M/maxresdefault.jpg", + "width": "1920", + "height": "1080", + "caption": "" + } + ] + }, + { + "id": "garment-dyed-crinkle-reps-and-overalls-in-mussola-gommata", + "date": "Wed, 05 Oct 2016 12:00:00 GMT", + "title": "GARMENT DYED CRINKLE REPS AND OVERALLS IN MUSSOLA GOMMATA", + "subtitle": "APP EXCLUSIVE FROM 10/6 TO 10/12", + "body": "70223_Long down jacket in light nylon rep with an ultra-tight weaving construction. The resin coating of its inner face makes it wind resistant and mildly water resistant. \r\nThe dye bath gives the resin-treated fabric a slightly crinkled appearance on the surface.\r\n\r\nF0211_Overalls in Mussola Gommata, an exclusive fabric created by laminating an ultra light cotton muslin to an outer matte transparent polyurethane film. Rear and bottom front leg in Nylon Metal, with a metallic/iridescent appearance. The special double dye recipe provides the garment with unique shades. ", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/96660fe0-8b04-11e6-bd08-255bc61066e4.jpg", + "width": "827", + "height": "1240", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/96761570-8b04-11e6-bd08-255bc61066e4.jpg", + "width": "827", + "height": "1240", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/96800080-8b04-11e6-bd08-255bc61066e4.jpg", + "width": "827", + "height": "1240", + "caption": "" + } + ], + "__index": 12, + "dateCreated": "Wed, 05 Oct 2016 14:04:36 GMT" + }, + { + "id": "limited-edition-ice-jacket-resin-t-shell-down_fluo-pink-", + "date": "Tue, 11 Oct 2016 12:00:00 GMT", + "title": "LIMITED EDITION: ICE JACKET RESIN-T SHELL DOWN_FLUO PINK ", + "subtitle": "APP EXCLUSIVE FROM 10/13 TO 10/19", + "body": "70999_Parka/Down Jacket limited edition featuring a fluorescent pink internal down. \r\n\r\nThe jacket has a very light translucent nylon shell that changes color according to temperature variations thanks to a special thermo-chromatic resin coating.
\r\nInside the shell, a removable premium feather down jacket in fluorescent pink nylon creates further color play.
\r\n\r\nStone Island presents the new Ice Jacket, the evolution of the historical thermo-chromatic garment introduced in 1988.
\r\n\r\nThe Jacket will be on sale exclusively at Stone Island stores in New York and Los Angeles and on this App starting from 13 October.
", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/aab445e0-8fc1-11e6-bd08-255bc61066e4.jpg", + "width": "1334", + "height": "1000", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/a997d960-8fc1-11e6-bd08-255bc61066e4.jpg", + "width": "906", + "height": "1181", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/a97cfe60-8fc1-11e6-bd08-255bc61066e4.jpg", + "width": "906", + "height": "1181", + "caption": "" + } + ], + "__index": 17, + "dateCreated": "Tue, 11 Oct 2016 15:01:20 GMT" + }, + { + "id": "featherweight-leather-down", + "date": "Wed, 19 Oct 2016 12:00:00 GMT", + "title": "Featherweight Leather Down", + "subtitle": "APP EXCLUSIVE FROM 10/20 TO 10/26", + "body": "00196_Ultralight leather down jacket with inside insulation in nylon technical mesh filled with the finest down by direct injection. The insulation is heat sealed along the external leather seams with an artisan technique.
Completely heat sealed. ", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/f2c7b2d0-9607-11e6-bd08-255bc61066e4.jpg", + "width": "1000", + "height": "1335", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/f2730320-9607-11e6-bd08-255bc61066e4.jpg", + "width": "1000", + "height": "749", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/f2b5d880-9607-11e6-bd08-255bc61066e4.jpg", + "width": "1000", + "height": "749", + "caption": "" + } + ], + "__index": 18, + "dateCreated": "Wed, 19 Oct 2016 14:26:10 GMT" + }, + { + "id": "prototype-research-series_video", + "date": "Wed, 02 Nov 2016 12:00:00 GMT", + "title": "Prototype Research Series_Video", + "subtitle": "", + "body": "The STONE ISLAND _ Prototype Research Series are native limited editions. Numbered garments are made in fabrics and with treatments born from research and experimentation processes that have not yet been industrialized.\r\n\r\n
Series 01 presents LASERING ON LIQUID REFLECTIVE BASE, a piece made in a highly reflective fabric, entirely hand sprayed with a resin-based color.
A laser beam etches the surface, producing a graphic motif on the finished garment.
\r\n\r\nThe first drop of the project will be on sale exclusively on the Stone Island App starting Friday, 4 November.", + "link": "https://www.youtube.com/watch?v=PjhAdGglfa8", + "store": "false", + "__index": 19, + "dateCreated": "Wed, 02 Nov 2016 17:05:50 GMT", + "image": [] + }, + { + "id": "prototype-research_series-01-br-701r1_lasering-on-liquid-reflective-base", + "date": "Fri, 04 Nov 2016 12:00:00 GMT", + "title": "PROTOTYPE RESEARCH_SERIES 01 <br>701R1_LASERING ON LIQUID REFLECTIVE BASE", + "subtitle": "
LIMITED EDITION - NUMBERED 01 TO 100", + "body": "Anorak in an exclusive custom made highly reflective fabric, thanks to a resin coating embedding thousands of glass microspheres, individually hand sprayed with a resin-based color and then oven dried.
A numerical control laser beam etches the surface, producing a three dimensional tone-on-tone effect on the finished garment.\r\n\r\nThe backside features the lasered Stone Island logo.
The high level of artisanship involved in the process makes each garment unique and unrepeatable.
\r\n\r\nExclusively available on Stone Island App
", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/87b07d60-a29b-11e6-bd08-255bc61066e4.jpg", + "width": "1211", + "height": "1477", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/8832ccc0-a29b-11e6-bd08-255bc61066e4.jpg", + "width": "1211", + "height": "1477", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/88604560-a29b-11e6-bd08-255bc61066e4.jpg", + "width": "1211", + "height": "1477", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/88db8fe0-a29b-11e6-bd08-255bc61066e4.jpg", + "width": "1211", + "height": "1477", + "caption": "" + } + ], + "__index": 20, + "dateCreated": "Fri, 04 Nov 2016 15:27:17 GMT" + }, + { + "id": "nikelab-x-stone-island_preview", + "date": "Wed, 09 Nov 2016 12:00:00 GMT", + "title": "NIKELAB X STONE ISLAND_PREVIEW", + "subtitle": "", + "body": "The third collaboration between NikeLab and Stone Island, concluding the year of the Windrunner.\r\n\r\nThe Nike Windrunner, remastered with parka length, volumes and functions, is made in JACQUARD GRID ON WOOL FUR, exclusively engineered by Stone Island for this co-lab.\r\n\r\nThe garment is composed of an outer face in a jacquard engineered tonic nylon rip stop grid that is bonded to a water and wind resistant membrane and to an inner 100% wool fur on cotton layer.\r\nNike’s distinctive Windrunner chevron is made in nylon tape. Through a complex garment dyeing recipe, the jacquard grid and the inner woolen fur both capture high definition contrasts and subtle tonal shades, while respecting the performance features of the membrane.\r\n\r\nNikeLab x Stone Island will be on sale from Thursday, November 17 in Stone Island flagship stores, on the Stone Island app, in NikeLab stores and on nike.com/nikelab.", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/64ea2d80-a697-11e6-bd08-255bc61066e4.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/64f2e010-a697-11e6-bd08-255bc61066e4.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/64ed3ac0-a697-11e6-bd08-255bc61066e4.jpg", + "width": "776", + "height": "1012", + "caption": "" + } + ], + "__index": 21, + "dateCreated": "Wed, 09 Nov 2016 16:13:18 GMT" + }, + { + "id": "spring-summer_-017-lookbook", + "date": "Tue, 13 Dec 2016 12:00:00 GMT", + "title": "SPRING SUMMER_'017 LOOKBOOK", + "subtitle": "", + "body": "SS'017 Crinkle Reps Bomber special preview exclusive available from December 15th on the Stone Island App.", + "link": "", + "store": "false", + "__index": 22, + "dateCreated": "Tue, 13 Dec 2016 14:58:50 GMT", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/21ba23d0-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/200ee4d0-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/1e2f2850-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/1c8066e0-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/197bb260-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/17803080-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/15b7f3a0-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/13b4f7b0-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/0579ee80-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/036dcad0-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/01a9aca0-c145-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/ff9ec170-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/fda98120-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/fb383300-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/f918fc80-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/f73bb100-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/f4906720-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/f27a7f70-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/f0134370-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/e950eab0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/e35404d0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/debfd6b0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/daa98b20-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d7f95f40-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d4cde8e0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d1b97cf0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/ceb2cca0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/c87b4ec0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/c3b206e0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/bf0101f0-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/bac04b00-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/b823a720-c144-11e6-bd08-255bc61066e4.jpg", + "width": "800", + "height": "1200", + "caption": "" + } + ] + }, + { + "id": "stone-island_spring-summer_-017_video-teaser", + "date": "Wed, 11 Jan 2017 12:00:00 GMT", + "title": "Stone Island_Spring Summer_'017_Video teaser", + "subtitle": "", + "body": "", + "link": "https://youtu.be/iia_oPZPY_Y", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/93699100-d8dd-11e6-abc7-59ceb822d9d2.jpg", + "width": "1920", + "height": "1080", + "caption": "" + } + ], + "__index": 23, + "dateCreated": "Thu, 12 Jan 2017 15:42:24 GMT" + }, + { + "id": "stone-island_spring-summer_-017_icon-imagery", + "date": "Thu, 12 Jan 2017 12:00:00 GMT", + "title": "Stone Island_Spring Summer_'017_Icon Imagery", + "subtitle": "", + "body": "", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d5f07520-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d4b13e60-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d57c7da0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d6bb1820-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d432bf90-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d4f54c40-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d33043b0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d58222f0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d28f21b0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d1f1a930-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d3219db0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d32658a0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d0611e20-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d131b490-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d07bf920-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d1d2fda0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d21006a0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/d01d5e60-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/cec19ef0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/cd455f30-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/ce493aa0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/ce8224f0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/ce774f80-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/cd49a4f0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/cd0e49a0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/cbc771c0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/cac06200-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/c9ca6940-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/cbbe22f0-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/cbba5260-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/ca202a60-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/ca130b00-d8d8-11e6-abc7-59ceb822d9d2.jpg", + "width": "776", + "height": "1012", + "caption": "" + } + ], + "__index": 24, + "dateCreated": "Thu, 12 Jan 2017 15:46:04 GMT" + }, + { + "id": "nikelab-x-stone-island-sock-dart-mid_preview-stone-island-research-meets-nike-design", + "date": "Thu, 19 Jan 2017 12:00:00 GMT", + "title": "NIKELAB X STONE ISLAND SOCK DART MID_PREVIEW
STONE ISLAND RESEARCH MEETS NIKE DESIGN", + "subtitle": "", + "body": "With this collaboration Stone Island has been challenged to apply its research skills on Nike fabrics in an interpretation of the Nike Sock Dart Mid Slip On Shoe.
Applying the personal approach to investigation and the development of new technologies, Stone Island has tested several techniques in able to combine a graphic look and feel with functionality, in order to find the right meeting point between its know-how and Nike’s design.
The outcome is a glossy and elastic engineered zonal silicone print, adding structure and protection to the hyper-stretch breathable sandwich mesh used for the upper, still maintains the flexibility attributes that are signature to the Sock Dart.
The new mid-cut silhouette has an extended collar with a leather grain deboss pattern and poly spandex lining.
Glossy molded midfoot adjustable strap.
New Duralon foam outsole: the forefoot features a multidirectional sipe pattern for water dispersion and improved traction.
NikeLab x Stone Island Sock Dart Mid will be released in three colorways: black, obsidian bleu and - exclusively at flagship stores - in sequoia green.
It will be on sale from Thursday, January 26 in Stone Island flagship stores, on the Stone Island app, in NikeLab stores and on nike.com/nikelab.", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/a6e5c860-de47-11e6-abc7-59ceb822d9d2.jpg", + "width": "1000", + "height": "563", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/89838140-de47-11e6-abc7-59ceb822d9d2.jpg", + "width": "770", + "height": "488", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/89aa4320-de47-11e6-abc7-59ceb822d9d2.jpg", + "width": "770", + "height": "488", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/89a7ab10-de47-11e6-abc7-59ceb822d9d2.jpg", + "width": "770", + "height": "488", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/89378420-de47-11e6-abc7-59ceb822d9d2.jpg", + "width": "770", + "height": "488", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/89548200-de47-11e6-abc7-59ceb822d9d2.jpg", + "width": "770", + "height": "488", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/890c5570-de47-11e6-abc7-59ceb822d9d2.jpg", + "width": "770", + "height": "488", + "caption": "" + } + ], + "__index": 25, + "dateCreated": "Thu, 19 Jan 2017 13:44:32 GMT" + }, + { + "id": "hand-corrosion_stone-island-app-exclusive-colorways", + "date": "Sun, 22 Jan 2017 12:00:00 GMT", + "title": "Hand Corrosion_Stone Island App Exclusive Colorways", + "subtitle": "", + "body": "An artisan process with corrosive paste
that makes each garment unique and unrepeatable.
\r\n\r\nHAND CORROSION\r\nGarments are dyed with special recipes and then decolored by hand with a corrosive paste.
The Stone Island badge is attached to the pieces during the manual fading and features the same corrosion marks.
Residual dye highlights the architecture of the garments.
This artisan process makes each piece unique and unrepeatable.\r\n\r\nSTONE ISLAND APP EXCLUSIVE COLORWAYS \r\n\r\n45131_Yellow Field Jacket made in military-derived cotton satin, garment dyed with special corrodible colorants and then manually faded, steamed and intensely washed with the addition of an anti-drop agent.\r\n\r\n
541A1_Black cotton crew neck. Worked in brioche stitch knit. Garment dyed with special corrodible colorants and then faded by hand with a corrosive paste, steamed and intensely washed. ", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/020846f0-e17c-11e6-abc7-59ceb822d9d2.jpg", + "width": "580", + "height": "813", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/023d60b0-e17c-11e6-abc7-59ceb822d9d2.jpg", + "width": "580", + "height": "813", + "caption": "" + } + ], + "__index": 26, + "dateCreated": "Mon, 23 Jan 2017 14:57:23 GMT" + }, + { + "id": "hand-corrosion-video", + "date": "Mon, 23 Jan 2017 12:00:00 GMT", + "title": "Hand Corrosion Video", + "subtitle": "", + "body": "An artisan process with corrosive paste\r\nthat makes each garment unique and unrepeatable.", + "link": "https://youtu.be/1u6OovE0cY4", + "store": "true", + "__index": 27, + "dateCreated": "Mon, 23 Jan 2017 15:21:19 GMT", + "image": [] + }, + { + "id": "nylon-metal-color-weft_app-exclusive-colorway", + "date": "Tue, 14 Feb 2017 12:00:00 GMT", + "title": "Nylon Metal Color Weft_App Exclusive Colorway", + "subtitle": "", + "body": "The evolution of one of the most iconic Stone Island fabrics\r\nUnprecedented iridescent colors \r\n\r\nNYLON METAL COLOR WEFT\r\n\r\n10245_Over shirt in Nylon Metal with colored weaved yarns.
Two pockets with flap and button fastening on chest.
Hidden zip fastening.
\r\n\r\nThe metallic and iridescent aspect of Nylon Metal, one of the most versatile fabrics issued from the STONE ISLAND textile research, is enhanced with colored tones thanks to the tint of its weft yarns. Garments made in this fabric undergo an elaborate double recipe dye process enhancing its chromatic iridescences.
\r\n\r\nAPP EXCLUSIVE FROM 2/16 TO 2/20", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://ltho.s3.amazonaws.com/undefined/579783e0-f2c7-11e6-abc7-59ceb822d9d2.jpg", + "width": "466", + "height": "692", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/57936530-f2c7-11e6-abc7-59ceb822d9d2.jpg", + "width": "466", + "height": "692", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/57861ec0-f2c7-11e6-abc7-59ceb822d9d2.jpg", + "width": "466", + "height": "692", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/57a16ef0-f2c7-11e6-abc7-59ceb822d9d2.jpg", + "width": "466", + "height": "692", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/57a2a770-f2c7-11e6-abc7-59ceb822d9d2.jpg", + "width": "466", + "height": "692", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/578e0e00-f2c7-11e6-abc7-59ceb822d9d2.jpg", + "width": "466", + "height": "692", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/57ef67e0-f2c7-11e6-abc7-59ceb822d9d2.jpg", + "width": "466", + "height": "692", + "caption": "" + }, + { + "uri": "https://ltho.s3.amazonaws.com/undefined/58036510-f2c7-11e6-abc7-59ceb822d9d2.jpg", + "width": "466", + "height": "692", + "caption": "" + } + ], + "__index": 28, + "dateCreated": "Tue, 14 Feb 2017 15:08:43 GMT" + }, + { + "id": "garment-dyed-plated-reflective", + "date": "Thu, 02 Mar 2017 12:00:00 GMT", + "title": "GARMENT DYED PLATED REFLECTIVE", + "subtitle": "", + "body": "The new Reflective Jacket is made with an innovative fabric engineered to be garment-dyed.\r\nIts nylon tela base is plated with a highly reflective resin coating, while the details in Mussola Gommata and fabric mixes highlight the garment-dye technique.\r\n\r\nSTONE ISLAND APP EXCLUSIVE COLORWAYS PINK QUARTZ AND AVIO BLUE\r\n\r\n453S6_Hooded jacket constructed with parts in Mussola Gommata. \r\nThe finished piece is garment dyed with specific double dye recipes lending color to the textile base while respecting the reflective surface.", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://marsupial.s3.amazonaws.com/stoneisland/b9fe8eb0-ff6b-11e6-8ca3-81835dc6c47b.jpg", + "width": "580", + "height": "813", + "caption": "" + }, + { + "uri": "https://marsupial.s3.amazonaws.com/stoneisland/ba1a7b20-ff6b-11e6-8ca3-81835dc6c47b.jpg", + "width": "580", + "height": "813", + "caption": "" + } + ], + "__index": 29, + "dateCreated": "Thu, 02 Mar 2017 17:17:11 GMT" + }, + { + "id": "stone-island-marina_tank-shield-featuring-multi-layer-fusion-technology-", + "date": "Thu, 09 Mar 2017 12:00:00 GMT", + "title": "STONE ISLAND MARINA_TANK SHIELD
FEATURING MULTI LAYER FUSION TECHNOLOGY ", + "subtitle": "", + "body": "703X1_Trench Coat characterized by highly performing
fabric and construction. Fold-away hood into stand up collar.
\r\n\r\nGarments pre-assembled and then laminated to membrane-bonded panels, hermetically sealing the external base fabric and all seams.\r\n
The exclusive Multi Layer Fusion Technology guarantees maximum waterproofness and breathability.
\r\nStripes on sleeves and logo on back are created with laser technology, revealing the inside membrane.\r\n\r\n
APP EXCLUSIVE FROM 3/10 TO 3/16", + "link": "", + "store": "false", + "image": [ + { + "uri": "https://marsupial.s3.amazonaws.com/stoneisland/782e15f0-04d9-11e7-9f22-910070d5f727.jpg", + "width": "1304", + "height": "1229", + "caption": "" + }, + { + "uri": "https://marsupial.s3.amazonaws.com/stoneisland/781adc10-04d9-11e7-9f22-910070d5f727.jpg", + "width": "1571", + "height": "2000", + "caption": "" + }, + { + "uri": "https://marsupial.s3.amazonaws.com/stoneisland/779ea730-04d9-11e7-9f22-910070d5f727.jpg", + "width": "1571", + "height": "2000", + "caption": "" + } + ], + "__index": 30, + "dateCreated": "Thu, 09 Mar 2017 15:03:13 GMT" + }, + { + "id": "stone-island-marina_corrosion-print_app-exclusive-preview", + "date": "Thu, 23 Mar 2017 12:00:00 GMT", + "title": "Stone Island Marina_Corrosion Print_App Exclusive Preview", + "subtitle": "", + "body": "T-shirt and bermuda shorts made in black printed cotton with placed reserve Stone Island Marina motif.
A further striped motif is printed through the corrosion of the base fabric color.
\r\n\r\nBackpack in ultra-resistant waterproof PVC with waterproof zip fastening.
Thermal printed Stone Island Marina graphic and stripes.\r\n\r\n
APP EXCLUSIVE FROM 3/24 TO 3/29", + "link": "", + "store": "true", + "image": [ + { + "uri": "https://marsupial.s3.amazonaws.com/stoneisland/974bb740-0fd2-11e7-85aa-87522fc1a5c5.jpg", + "width": "580", + "height": "813", + "caption": "" + }, + { + "uri": "https://marsupial.s3.amazonaws.com/stoneisland/969bef40-0fd2-11e7-85aa-87522fc1a5c5.jpg", + "width": "580", + "height": "813", + "caption": "" + } + ], + "__index": 31, + "dateCreated": "Thu, 23 Mar 2017 14:22:34 GMT" + } + ], + "page": [ + { + "id": "terms-and-conditions", + "title": "Terms and Conditions", + "image": { + "uri": "", + "caption": "" + }, + "body": "<center><b>TERMS AND CONDITIONS OF USE</center></b>\r\nWelcome to www.stoneisland.com. These terms and conditions (the “General Terms and Conditions of Use”) govern your use of, access to, and purchase of products from the United States section of www.stoneisland.com (the \"US Site\"). By using the US Site, you agree to comply with and be bound by these General Terms and Conditions of Use. If you do not agree to these General Terms and Conditions of Use, please do not use the US Site.\r\n\r\n<b>1. GENERAL</b>\r\nwww.stoneisland.com is the property of SPORTSWEAR COMPANY, a company having an address at Galleria Cavour 4, 40124 Bologna, Italy (\"STONE ISLAND and STONE ISLAND DENIMS\") and is operated under license by YOOX Corporation, a Delaware corporation having an address at 148 Lafayette Street, 10th Floor, New York, NY, 10013, United States of America (the \"Provider\"). \r\n\r\n<b>2. OTHER SITE POLICIES</b>\r\nPlease review our <a href=“http://www.stoneisland.com/localize.asp?tskay=4036416C&page=legal/saleterms&”>General Terms and Conditions of Sale</a>, <a href=“http://www.stoneisland.com/localize.asp?tskay=4036416C&page=legal/returnpolicy& “>Return Policy</a> and <a href=“http://www.stoneisland.com/localize.asp?tskay=4036416C&page=legal/privacypolicy&”>Privacy Policy</a> (collectively, the “Site Policies\"). All Site Policies are incorporated in these General Terms and Conditions of Use by this reference and, therefore, apply to your access to, use of and purchase of products from the US Site. If you do not agree to our Site Policies, please do not use the US Site. We reserve the right to make changes to the US Site, the Site Policies, and these General Terms and Conditions of Use at any time. If any of these conditions shall be deemed invalid, void, or for any reason unenforceable, that condition shall be deemed severable and shall not affect the validity and enforceability of any remaining condition. \r\n\r\n<b>3. PURCHASE FOR PERSONAL USE ONLY</b>\r\nYou may purchase products on the US Site only for personal use and not for resale. By placing your order, you certify that you are purchasing products for personal use only and not for resale and you accept our <a href=“http://www.stoneisland.com/localize.asp?tskay=4036416C&page=legal/saleterms&”>General Terms and Conditions of Sale</a>. WE RESERVE THE RIGHT TO REFUSE ORDERS FOR ANY REASON WITHOUT EXPLANATION. \r\n\r\n<b>4. USER'S SUBMISSIONS</b>\r\nWe welcome your comments and feedback regarding the US Site, our products and our services. We do not, however, accept confidential or proprietary information. Accordingly, all comments, feedback, reviews, ideas, suggestions, materials, images, information and other submissions (collectively, the “Submissions”) disclosed, submitted or offered to the Provider via the US Site, or otherwise, are not confidential. You represent and warrant that any Submissions that you submit to the Provider are made in compliance with applicable laws, do not violate any right of any third party, including privacy and intellectual property rights. By disclosing, submitting or offering any Submissions to the Provider, you grant the Provider and STONE ISLAND and STONE ISLAND DENIMS a nonexclusive, royalty-free, perpetual, irrevocable, and fully sublicensable right to use, reproduce, modify, adapt, publish, translate, create derivative work from, distribute, display such Material throughout the world in any media. You are and shall remain solely responsible for any Submissions you disclose, submit or offer to the Provider or STONE ISLAND and STONE ISLAND DENIMS. \r\n\r\n<b>5. PRIVACY</b>\r\nWe recommend that you read our <a href=“http://www.stoneisland.com/localize.asp?tskay=4036416C&page=legal/privacypolicy&”>Privacy Policy</a>, which explains our online privacy practices. \r\n\r\n<b>6. COPYRIGHT</b>\r\nAll content included on www.stoneisland.com US Site, such as works, images, pictures, dialogues, music, sounds, videos, documents, drawings, figures, logos, menus, web pages, graphics, colors, schemes, tools, fonts, designs, diagrams, layouts, methods, processes, functions and software (collectively, the \"Content\"), is the property of STONE ISLAND and STONE ISLAND DENIMS or its content suppliers and is protected by national and international copyright and other intellectual property laws. You may not reproduce, publish, distribute, display, modify, create derivative work from, or exploit in any way, in whole or in part, the Content without the prior express written consent of STONE ISLAND and STONE ISLAND DENIMS, or its content suppliers, as the case may be. STONE ISLAND and STONE ISLAND DENIMS and its content suppliers shall have the exclusive right to authorize or prohibit in their sole discretion any reproduction, publication, distribution, display, modification, creation of derivative work from, or exploitation in any way of, in whole or in part, the Content. STONE ISLAND and STONE ISLAND DENIMS and its content suppliers shall have the right, at any time, to claim the authorship of any Content posted on the US Site and to object to any use, distortion or other modification of such Content. Any reproduction, publication, distribution, display, modification, creation of derivative work from, or exploitation in any way of, the Content expressly authorized in writing by STONE ISLAND and STONE ISLAND DENIMS or its content suppliers shall be carried out by you for lawful purposes only and in compliance with all applicable laws. \r\n\r\n<b>7. LICENSE AND SITE ACCESS</b>\r\nThe viewing, printing or downloading of any Content from the US Site grants you only a limited, nonexclusive and nontransferable license for use solely by you for your own personal use and not for republication, distribution, assignment, sublicense, sale, preparation of derivative works or other use. No part of any Content may be reproduced in any form or incorporated into any information system, electronic or mechanical, other than for your personal use (but not for resale or redistribution). Any unauthorized use of the US Site and the Content immediately terminates the license granted by the Provider. \r\nYou will be solely responsible for all damages and other harm resulting from your use of the US Site and the Content. STONE ISLAND and STONE ISLAND DENIMS and the Provider shall not be deemed liable for any use of the US Site and the Content made by you in violation of any applicable laws and regulations and these General Terms and Conditions of Use. \r\n\r\n<b>8. COPYRIGHT COMPLAINTS</b>\r\nWe respect the intellectual property of others. If you believe that your work has been copied in a way that constitutes copyright infringement, please contact a STONE ISLAND and STONE ISLAND DENIMS copyright representative for further information at <a href=“mailto:privacy@mail.stoneisland.com”>privacy@mail.stoneisland.com</a>. \r\n\r\n<b>9. LINKS TO OTHER WEB SITES</b>\r\nThe US Site may provide hyperlinks to third party websites (“Third Party Websites\"). The Provider and STONE ISLAND and STONE ISLAND DENIMS do not operate, control, endorse or guarantee any Third Party Websites. You agree that the Provider and STONE ISLAND and STONE ISLAND DENIMS are not responsible for any content, services and/or products provided by any Third Party Website, nor are the Provider and STONE ISLAND and STONE ISLAND DENIMS responsible for any practice followed by such Third Party Website with respect to the collection and processing of personal data of their users. When you access any Third Party Website through a hyperlink posted on the US Site, please carefully read the terms and conditions of use, privacy policy and other policies of such Third Party Website. Our policies do not apply to any Third Party Website. \r\nYou The Provider provides hyperlinks to Third Party Websites only for the convenience of its users. By providing hyperlinks to Third Party Websites, the Provider does not recommend that its users access such Third Party Websites. \r\n\r\nYOU AGREE THAT YOUR USE OF ANY THIRD PARTY WEBSITE IS AT YOUR SOLE RISK AND WITHOUT WARRANTIES OF ANY KIND BY THE PROVIDER, EXPRESSED, IMPLIED OR OTHERWISE, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NONINFRINGEMENT. UNDER NO CIRCUMSTANCES ARE THE PROVIDER AND/OR STONE ISLAND and STONE ISLAND DENIMS LIABLE FOR DAMAGES ARISING FROM ANY TRANSACTION BETWEEN YOU AND ANY THIRD PARTY WEBSITE OR FOR ANY INFORMATION APPEARING ON THIRD PARTY WEBSITES. \r\n\r\n<b>10. GOVERNING LAW AND CHOICE OF FORUM</b>\r\nThe laws of the State of New York (without giving effect to its conflicts of law principles) govern all matters arising out of or relating to these General Terms and Conditions of Sale, including, without limitation, their validity, interpretation, construction, performance, and enforcement. All legal proceedings arising out of or in connection with these General Terms and Conditions of Sale shall be brought solely in the City of New York, State of New York. \r\n\r\n<b>11. DISCLAIMER OF WARRANTIES AND LIMITATION OF LIABILITY</b>\r\nTHE US SITE AND ALL INFORMATION, CONTENT, MATERIALS, PRODUCTS (INCLUDING SOFTWARE) AND SERVICES INCLUDED ON OR OTHERWISE MADE AVAILABLE TO YOU THROUGH THIS SITE ARE PROVIDED BY THE PROVIDER ON AN \"AS IS\" AND \"AS AVAILABLE\" BASIS, UNLESS OTHERWISE SPECIFIED IN WRITING. THE PROVIDER MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE OPERATION OF THIS SITE OR THE INFORMATION, CONTENT, MATERIALS, PRODUCTS (INCLUDING SOFTWARE) OR SERVICES INCLUDED ON OR OTHERWISE MADE AVAILABLE TO YOU THROUGH THIS SITE, UNLESS OTHERWISE SPECIFIED IN WRITING. YOU EXPRESSLY AGREE THAT YOUR USE OF THIS SITE IS AT YOUR SOLE RISK. \r\n\r\nTO THE FULL EXTENT PERMISSIBLE BY APPLICABLE LAW, THE PROVIDER DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE PROVIDER DOES NOT WARRANT THAT THIS SITE; INFORMATION, CONTENT, MATERIALS, PRODUCTS (INCLUDING SOFTWARE) OR SERVICES INCLUDED ON OR OTHERWISE MADE AVAILABLE TO YOU THROUGH THIS SITE; THEIR SERVERS; OR E-MAIL SENT FROM THE PROVIDER ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS. THE PROVIDER WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF THIS SITE OR FROM ANY INFORMATION, CONTENT, MATERIALS, PRODUCTS (INCLUDING SOFTWARE) OR SERVICES INCLUDED ON OR OTHERWISE MADE AVAILABLE TO YOU THROUGH THIS SITE, INCLUDING, BUT NOT LIMITED TO DIRECT, INDIRECT, INCIDENTAL, PUNITIVE, AND CONSEQUENTIAL DAMAGES, UNLESS OTHERWISE SPECIFIED IN WRITING. \r\n\r\nCERTAIN STATE LAWS DO NOT ALLOW LIMITATIONS ON IMPLIED WARRANTIES OR THE EXCLUSION OR LIMITATION OF CERTAIN DAMAGES. IF THESE LAWS APPLY TO YOU, SOME OR ALL OF THE ABOVE DISCLAIMERS, EXCLUSIONS, OR LIMITATIONS MAY NOT APPLY TO YOU, AND YOU MIGHT HAVE ADDITIONAL RIGHTS.\r\n\r\n<center><b>TERMS AND CONDITIONS OF SALE</center></b>\r\nThe following General Terms and Conditions of Sale govern the sale of merchandise by YOOX Corporation, an affiliate of YOOX NET-A-PORTER GROUP S.p.A. (the \"Provider\" or \"we\") to you through the US section of www.stoneisland.com (\"US Site\"). The US Site is available only for purchases made and delivered within the United States. Your use of the US Site to purchase merchandise indicates your agreement to follow and to be bound by these General Terms and Conditions of Sale.\r\n\r\n<b>1. ORDERS & PRODUCTS</b>\r\nAll orders are subject to e-mail confirmation by us. Please note that the products displayed on the US Site may be out-of-stock or discontinued, and availability is not guaranteed. Please note that while we have tried to accurately display the colors of products, the actual colors you see will depend on your monitor and may not be accurate. \r\n\r\n<b>2. PRICES</b>\r\nAll prices are in US Dollars. Prices may change without notice from time to time. The total amount due is inclusive of sales tax applied in accordance with applicable state and local regulations based on your shipping address. The applicable sales tax amount is indicated on the payment page of the cart.\r\n\r\nThe amount of sales tax charged on your order will depend upon various factors, including type of item purchased, sales price and destination of the shipment. Sales tax regulations may change between the time you place an order and the time of credit card charge authorization and this may affect the calculation of sales taxes. The amount appearing on your payment page of the cart may differ from the sales taxes ultimately charged as indicated in the invoice you will receive with the shipping confirmation e-mail.\r\n\r\nAll prices are inclusive of customs and import duties.\r\n\r\n<b>3. SHIPPING COSTS</b>\r\nYou are responsible for the shipping costs associated with the delivery of the products you purchase on the US Site as specified on your order confirmation. \r\n\r\n<b>4. SHIPMENTS AND DELIVERY</b>\r\nYou bear all risks of loss and damage to the products from the time the same have cleared our fulfillment house. Delivery is deemed complete and title to the products passes to you upon acceptance of shipment by a common carrier.\r\n\r\n<b>5. RETURNS AND REFUNDS</b>\r\nPlease refer to our <a href=“http://www.stoneisland.com/localize.asp?tskay=4036416C&page=legal/returnpolicy&“>Return and Refund Policy</a>, which forms an integral part of these General Terms and Conditions of Sale. \r\n\r\n<b>6. BINDING AGREEMENT</b>\r\nOur order confirmation, these General Terms and Conditions of Sale and our other Site Policies shall be deemed the final and integrated agreement between you and us on the matters contained in these General Terms and Conditions of Sale. \r\n\r\n<b>7. GOVERNING LAW AND CHOICE OF FORUM</b>\r\nThe laws of the State of New York (without giving effect to its conflicts of law principles) govern all matters arising out of or relating to these General Terms and Conditions of Sale, including, without limitation, their validity, interpretation, construction, performance, and enforcement. All legal proceedings arising out of or in connection with these General Terms and Conditions of Sale shall be brought solely in the City of New York, State of New York. \r\n\r\n<b>8. DISCLAIMERS AND LIMITATIONS OF LIABILITY</b>\r\nTHE PROVIDER MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE PRODUCTS INCLUDED IN THE www.stoneisland.com US SITE NOR AS TO THE MERCHANDISE BEING SOLD TO YOU. TO THE FULLEST EXTENT PERMISSIBLE BY APPLICABLE LAW, THE PROVIDER DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, AND THERE ARE NO WARRANTIES, EXPRESS OR IMPLIED, WHICH EXTEND BEYOND THE DESCRIPTION OF THE MERCHANDISE CONTAINED ON OUR ORDER CONFIRMATION. THE PROVIDER WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF THE US SITE, INCLUDING BUT NOT LIMITED TO DIRECT, INDIRECT, INCIDENTAL, PUNITIVE AND CONSEQUENTIAL DAMAGES \r\nCERTAIN STATE LAWS DO NOT ALLOW LIMITATIONS ON IMPLIED WARRANTIES OR THE EXCLUSION OR LIMITATION OF CERTAIN DAMAGES. IF THESE LAWS APPLY TO YOU, SOME OR ALL OF THE ABOVE DISCLAIMERS, EXCLUSIONS, OR LIMITATIONS MAY NOT APPLY TO YOU, AND YOU MIGHT HAVE ADDITIONAL RIGHTS.\r\n\r\n<b>9. SEVERABILITY</b>\r\nIf any provision of these General Terms and Conditions of Sale is determined to be invalid, illegal or unenforceable, the remaining provisions of these General Terms and Conditions of Sale remain in full force to the extent permitted by law.\r\n\r\n<b>10. PRIVACY</b>\r\nThe terms and conditions of the our <a href=“http://www.stoneisland.com/localize.asp?tskay=4036416C&page=legal/privacypolicy&”>Privacy Policy</a> govern the processing of all personal data collected from you in connection with your purchase of products through the US Site.\r\n\r\n<b>11. FORCE MAJEURE</b>\r\nProvider shall not be liable for any delay or failure in performance caused by circumstances beyond its reasonable control.\r\n\r\n<b>12. ERRORS AND INACCURACIES</b>\r\nOur goal is to provide complete, accurate, and up-to-date information on our website. Unfortunately, it is not possible to ensure that any website is completely free of human or technological errors. This website may contain typographical mistakes, inaccuracies, or omissions, some of which may relate to pricing and availability, and product information. We reserve the right to correct any errors, inaccuracies or omissions, including after an order has been submitted, and to change or update information at any time without prior notice.\r\n", + "__index": "1", + "dateCreated": "Tue, 17 Nov 2015 20:31:52 GMT", + "tag": "terms" + }, + { + "id": "privacy-policy", + "title": "Privacy Policy", + "image": { + "uri": "", + "caption": "" + }, + "body": "Welcome to www.stoneisland.com. Please read our Privacy Policy carefully. This Privacy Policy applies when you visit and surf the United States section of www.stoneisland.com (the \"www.stoneisland.com US Site\") regardless of whether you purchase products or not, when you register with the www.stoneisland.com US Site, and when you use our services. By using the www.stoneisland.com US Site, you accept the practices described in this Privacy Policy. If you do not want to accept the practices described in this Privacy Policy, please do not use the www.stoneisland.com US Site. \r\nThe www.stoneisland.com US Site is operated under license by , a Delaware corporation having an address at 148 Lafayette Street, 10th Floor, New York, NY, 10013, United States of America (\"YOOX USA\"). YOOX USA is a subsidiary of YOOX NET-A-PORTER GROUP S.p.A., an Italian company having its registered address at via Morimondo, 17 – Milano 20143 (\"YOOX\") and controls the personal data of users and customers of the www.stoneisland.com US Site together with SPORTSWEAR COMPANY, having address at Galleria Cavour 4, 40124 Bologna, Italy, Italy, VAT, 01046470371 (jointly referred to as \"YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY\"). \r\nSince personal data of users and customers of the www.stoneisland.com US Site may be processed in Italy, any such processing of personal data will be conducted in compliance with applicable US law as well as the Italian Data Protection Code (Legislative Decree no. 196 dated June 30, 2003). Pursuant to the Italian Data Protection Code, YOOX USA is the controller of personal data of users and customers of the www.stoneisland.com US Site. As controller of personal data, YOOX USA independently determines the purposes and means by which your personal data are processed, including all security measures. As required by the Italian Data Protection Code, YOOX USA has appointed YOOX NET-A-PORTER GROUP as its data protection representative in Italy. As our data protection representative in Italy, YOOX, together with SPORTSWEAR COMPANY, independently ensures that personal data are processed in Italy in a correct and lawful manner and in accordance with good practice.\r\n\r\n<b>1. OUR POLICY</b>\r\nEveryone has the right to the protection of his/her personal data. YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY respect our users' right to be informed about the collection and processing of their personal data. The www.stoneisland.com US Site has been designed in such a way that the use of your personal data will be minimal and will not exceed the original purpose for which your personal data are collected and/or processed. In particular, we do not disclose your identity when the purpose for which your personal data are being processed can be achieved by using anonymous aggregate information. This Privacy Policy is intended to provide you with all the information you need in order to understand our privacy practices.\r\nHowever, if you have any questions regarding our privacy practices and this Privacy Policy, please contact us at the following e-mail address:<a target=\"_blank\" href=“mailto:privacy@mail.stoneisland.com”>privacy@mail.stoneisland.com</a>.\r\nThe www.stoneisland.com US Site is not directed at, nor do we knowingly collect personally identifiable information from children under the age of 13, although we may sell children's products or services for purchase by adults. If you are under 18, you may use the www.stoneisland.com US Site only with the involvement of a parent or guardian. \r\n\r\n<b>2. WHO PROCESSES YOUR PERSONAL DATA</b>\r\nFor organizational and operational purposes only, YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY have appointed certain entities that will also process personal data of users and customers of the www.stoneisland.com US Site. Such purposes are strictly connected to the performance of services provided on the www.stoneisland.com US Site by YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY, including the sale of products.\r\nThe above-mentioned data processors have been chosen by YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY because of their experience in processing personal data, their sufficient guarantees with respect to compliance with applicable laws and regulations, including the Italian Data Protection Code (Legislative Decree no. 196 of 30 June 2003) as well as the technical security measures adopted by them in connection with the processing of personal data. In processing personal data of the users of the www.stoneisland.com US Site, our processors will act only in accordance with instructions provided by YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY. We regularly verify that our processors comply with our instructions and that they provide sufficient guarantees with respect to their compliance with applicable laws and regulations. The following is a list of the companies primarily involved in the processing of personal data of users and customers of the www.stoneisland.com US Site:\r\n\t•\t<a href=“http://www.ups.com/“>United Parcel Service S.p.A.(“UPS\")</a>. We provide UPS, by electronic means, with customers' addresses and other personal data for the purpose of shipping, delivering and returning products purchased on the www.stoneisland.com US Site;\r\n\t•\tBT Italia S.p.A., for purposes related to the maintenance of YOOX NET-A-PORTER GROUP servers;\r\n\t•\t<a href=“http://www.yoox.com/“>YOOX NET-A-PORTER GROUP Italy</a>. We provide YOOX NET-A-PORTER GROUP Italy with personal data of users and customers for purposes related to direct marketing services of YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY and in connection with other services provided by YOOX NET-A-PORTER GROUP Italy to YOOX USA, such as call center and help desk services.\r\nPlease contact our Customer Care or send us an e-mail at <a href=“mailto:privacy@mail.stoneisland.com”>privacy@mail.stoneisland.com</a> if you would like to receive a full list of our data processors.\r\n\r\n<b>3. HOW DO WE USE PERSONAL DATA AND FOR WHAT PURPOSES</b>\r\nYour personal data are collected and processed by YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY for purposes which are strictly connected to the use of the www.stoneisland.com US Site, its services and the purchase of products on the www.stoneisland.com US Site. However, your personal data may also be used for other processing operations within the limits of such purposes. In particular, your personal data may be processed for the following purposes:\r\n\t•\twhen you register with the www.stoneisland.com US Site we collect your personal data (for example, your personal information, e-mail address, gender) through the relevant registration form (My Account) in order to provide you with services in reserved access areas of the www.stoneisland.com US Site and in order to send you our Newsletter, when specifically requested;\r\n\t•\twhen you request Customer Care services, we collect your personal data (for example, your password) for purposes strictly necessary to provide you with customer care services relevant to the US Site and to the purchase of products on the US Site;\r\n\t•\twhen you request Customer Service assistance, we collect your personal data (for example, your first and last names, e-mail address and password) for purposes strictly necessary to provide you with Customer Service relevant to the www.stoneisland.com US Site and to the purchase of products on the www.stoneisland.com US Site;\r\n\t•\twhen you are executing purchasing procedures for products sold on the www.stoneisland.com US Site, including conclusion of an agreement for the purchase of products, we collect your personal data (for example, personal information, e-mail address, address, Credit Card numbers, bank account number and telephone number) on your order form only for the purpose of selling the products ordered by you;\r\n\t•\twhen you request technical assistance, we collect your personal data in order to provide you with information on net-surfing, Internet browsing or viewing and downloading web pages;\r\n\t•\twhen creating your Wish List, we process your personal data in order to customize our services for the purchase of products on the www.stoneisland.com US Site.\r\nYour personal data are generally processed by electronic means; however, in certain circumstances, paper-based means may be used (for example, when the processing of your personal data is required for the prevention of fraud against us). Your personal data are stored in a way which allows YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY to identify you for the period that is strictly necessary for the original purposes for which such personal data are collected and subsequently processed, all in accordance with applicable laws.\r\nPlease report any changes to your personal data to the e-mail address <a href=“mailto:privacy@mail.stoneisland.com”>privacy@mail.stoneisland.com</a> in order to ensure that your personal data are always accurate and kept up-to-date.\r\nYour personal data will not be disclosed to third parties for purposes not permitted by law or without your explicit consent. Your personal data may only be disclosed to third parties when it is necessary to process an order placed by you. For example, your personal data are disclosed to Banca Sella S.p.A. for the performance electronic payment services, through Credit/Debit Cards. Moreover, your personal data may be disclosed to the police or to judicial authorities, in compliance with applicable laws and regulations and upon a formal request by such authorities for the purposes of preventing a fraud against us (anti-fraud services). Data processors will also have access to your personal data, as stated in Section 2 of this Privacy Policy, for the specific purposes stated in that Section. In all the above circumstances, your consent for data processing will not be specifically requested.\r\nYour personal data will not be transferred to any countries outside the United States and Italy if such countries do not provide for an adequate level of protection of the privacy of individuals. Should the above be necessary in order to supply services to you or to execute contracts for the purchase of products, the transfer of your personal data to any such countries will be carried out only after the execution of specific contracts between YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY and all parties involved, in accordance with applicable laws and regulations.\r\nWe wish to inform you that YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY process users' personal data for purposes that are strictly connected to the supply of services through the www.stoneisland.com US Site, the execution of contracts related to the sale and purchase of products on the www.stoneisland.com US Site and, after receiving your consent, in order to send you information on new commercial initiatives which are strictly related to the www.stoneisland.com US Site's activities and services. YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY process your personal data for direct marketing purposes, including by e-mail, only after receiving your consent.\r\nYOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY may have access to third parties' personal data which is directly disclosed by their users to YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY, for instance when the user buys a product to be sent to a friend, when the user who pays the purchase price for a product is different from the recipient of such product, or when a user wishes to recommend to a friend a service provided through the www.stoneisland.com US Site or the sale of a particular product posted on the www.stoneisland.com US Site.\r\nIn all cases involving the disclosure of information of a third party, you must obtain the consent of such individuals before disclosing their personal data to YOOX USA, YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY and have informed said individuals about this Privacy Policy. You will be the only person liable in connection with the disclosure of information and data relevant to such third parties and with any other incompatible and unlawful use of such data if they have not provided you with their consent. You agree to indemnify, defend and hold each of YOOX USA, YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY harmless from any liability, claims and expenses, including reasonable attorneys' fees, arising from or related to any unauthorized disclosure of personally identifiable information of third parties.\r\n\r\n<b>4. WHAT HAPPENS IF YOU DO NOT DISCLOSE YOUR PERSONAL DATA</b>\r\nThe personal data we request you to provide to YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY, including your e-mail address, your address, your Credit/Debit Card numbers, bank account number and your telephone number, is necessary for the processing of your order for the purchase of products on the www.stoneisland.com US Site, to supply other services provided on the www.stoneisland.com US Site upon your request, or to carry out obligations arising out of applicable laws and regulations.\r\nYour refusal to provide certain personal data to YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY may prevent YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY from processing your order for the purchase of products sold on the www.stoneisland.com US Site or from providing other services through the www.stoneisland.com US Site, such as Customer Services, sending the Newsletter, use of the Wish List, recommending a product to a friend.\r\nYour failure to provide personal data to YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY may prevent the processing of your order for the purchase of products sold or to provide services through the www.stoneisland.com US Site. \r\nThe disclosure of personal data to YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY other than that required in order to fulfill legal or contractual obligations or to provide the services requested by you is optional and does not have any effect on the use of the www.stoneisland.com US Site and its services or on the purchase of products on the www.stoneisland.com US Site. We will inform you if the personal data we ask you to provide is necessary or optional by marking with an asterisk (*) the information that is necessary. Your failure to disclose optional personal data will not pose any obligation or disadvantage to you, except to the extent that we may no be able to offer you some of our optional, personalized features of the www.stoneisland.com US Site. \r\n\r\n<b>5. TO WHOM YOUR PERSONAL DATA WILL BE DISCLOSED</b> \r\nYour personal data may be disclosed to third parties who provide specific services as Data Processors on behalf of YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY or who autonomously process personal data collected by YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY in connection with the performance of a contract for the purchase of products on the www.stoneisland.com US Site (for example, Banca Sella, S.p.A.). \r\nAny such disclosure will be conducted, in each instance, without exceeding the original purposes for which your personal data were collected and subsequently processed. In addition, your personal data may be disclosed to third parties in order to (1) comply with applicable laws, (2) respond to governmental and judiciary inquiries, (3) comply with valid legal process, and (4) protect the rights or property of YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY. \r\nAny third party information disclosed to YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY in accordance with this Privacy Policy will not be used for any purpose other than as required to technically operate the service, to complete a transaction, or as otherwise required by law. \r\nIn the event there is a change in the corporate structure of YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY including, without limitation, by merger, consolidation, sale, liquidation, or transfer of substantial assets, YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY may, in their sole discretion, transfer, sell or assign personal data collected on and through the www.stoneisland.com US Site, including, without limitation, personally identifiable information and aggregate information concerning users and customers, to one or more affiliated or unaffiliated third parties. \r\nIn any event, your personal data will not be disclosed to third parties without you being informed or without your consent, when such consent is required by law.\r\n\r\n<b>6. HOW DO WE COLLECT YOUR DATA ON www.stoneisland.com</b> \r\nCookies\r\nWhen you are using the www.stoneisland.com US Site, some personal data may be collected automatically through so-called \"cookies\". A cookie is a device transmitted to the hard drive of an Internet user. While cookies do not contain intelligible information, they allow us to link an Internet user to personal information provided by such user through the www.stoneisland.com US Site. YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY process information collected by cookies in a collective and anonymous way, in order to optimize our services and the www.stoneisland.com US Site for the needs and preferences of its users. We use cookies to collect users' IP addresses and other information regarding users' data traffic or preferences in the choice of services provided and products purchased through the www.stoneisland.com US Site.\r\nWe disseminate cookies in connection with functions such as browsing the catalogue, purchasing products on-line and supplying \"My Account\" services.\r\nAs you may know, each Internet browser allows the deletion of cookies after each session. Your Internet browser contains instructions on how to carry out these procedures of deletion. Please access the appropriate instructions section on your Internet browser if you wish to delete cookies. \r\nYour acceptance of our automatic procedures of collection of data and the use of cookies is necessary to take advantage of many features and services offered by the www.stoneisland.com US Site, including the purchase of products. If you set your browser to block or delete cookies, we cannot guarantee that you will have access to all the features and services offered by the US Site (for example, your computer may not be able to display the image of the product you are in the process of purchasing).\r\nOther Methods of Collecting User Information. \r\nYOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY directly collect personal data and information from users when they register on-line with the www.stoneisland.com US Site or when they send purchase orders for products sold on the www.stoneisland.com US Site in order to finalize their transactions.\r\n\r\n<b>7. SECURITY MEASURES</b>\r\nWe have adopted security measures to protect personal data against accidental or unlawful destruction, loss, alteration, unauthorized disclosure or access and against other unlawful forms of data processing, as provided in our Privacy Policy. \r\nNevertheless, YYOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY cannot guarantee that the security measures adopted for the protection of the www.stoneisland.com US Site and the transmission of data and information through the www.stoneisland.com US Site will prevent or exclude any risk of unauthorized access to or loss of data. It is advisable that your computer be equipped with software devices for the protection of network data transmission and receipt (such as, updated antivirus systems) and that your Internet service provider take appropriate measures for the security of network data transmission (such as, firewalls and anti-spam filtering).\r\n\r\n<b>8. OPT-IN/OPT OUT</b> Advertising material and direct marketing or other commercial communications which are not specifically requested by you or necessary to provide a service you requested, including the purchase of products on the US Site, will be sent to you only after we receive your consent. Please note that each time your consent is required, we will inform you in advance and we will give you the option to either provide or refuse your consent by selecting the appropriate box.\r\nYOOX and STONE ISLAND and STONE ISLAND DENIMS may process your personal data without your consent when such processing is necessary to comply with applicable laws and regulations or to provide you with services you requested, including the purchase of products on the US Site.\r\nEven when your prior consent is not necessary, you may exercise, at any time, your right not to receive future communications regarding services you requested, such as the Newsletter.\r\n\r\n<b>9. YOUR RIGHT TO ACCESS PERSONAL DATA AND FURTHER RIGHTS</b>\r\nYou are entitled to obtain, at any time, confirmation from YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY as to whether or not data relating to you is being processed, even if not yet registered, and the communication of any such data in an intelligible form. \r\nMoreover, you are entitled to receive from YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY information on the source from which we received your personal data; the purposes and means of processing your personal data; the logic involved in any electronic data processing; information regarding the data controller and the data processors and the names of subjects and categories of subjects to whom your personal data may be disclosed or who may access your personal data (for example, the names of data processors). You can also find the above information in our Privacy Policy. \r\nYou are entitled to obtain at any time from YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY:\r\n\t•\tthe updating, rectification or integration of your personal data;\r\n\t•\tthe deletion, transformation into anonymous form or blocking of your personal data, which are processed in violation of the law, including when the storage of data is not necessary for the purposes for which it has been collected and subsequently processed;\r\n\t•\tthe confirmation that the operations under letters a) and b) have been reported to whom the data were disclosed or disseminated, except when it becomes impossible to do so or if it means exceeding the protection of the right you are claiming.\r\nYou are entitled to object, in all or in part:\r\n\t•\tfor legitimate reasons, to the processing of your personal data, even if it is related to the purposes for which it was collected;\r\n\t•\tto the processing of your personal data for advertising or direct marketing purposes or in order to carry out marketing research or commercial communications.\r\nYou may freely and at any time exercise your rights, provided that you do so in compliance with applicable laws and regulations, by sending your request to YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY at the following e-mail address: <a href=“mailto:privacy@mail.stoneisland.com”>privacy@mail.stoneisland.com</a>.\r\n\r\n<b>10. LINKS TO OTHER WEB SITES</b>\r\nThe www.stoneisland.com US Site may provide hyperlinks to third party websites (the \"Third Party Websites\"). YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY do not operate, control, endorse or guarantee any Third Party Websites. You agree that and SPORTSWEAR COMPANY are not responsible for any content, services and/or products provided by any Third Party Website, nor are YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY responsible for any practice followed by such Third Party Website with respect to the collection and processing of personal data of their users. When you access any Third Party Website through a hyperlink posted on the www.stoneisland.com US Site, please carefully read the Privacy Policy and other policies of such Third Party Website.\r\nOur Privacy Policy and other policies do not apply to any Third Party Website. YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY provide hyperlinks to Third Party Websites only for the convenience of our users. By providing hyperlinks to Third Party Websites, YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY do not recommend that users access such Third Party Websites.\r\nYOU AGREE THAT YOUR USE OF ANY THIRD PARTY WEBSITE IS AT YOUR SOLE RISK AND WITHOUT WARRANTIES OF ANY KIND BY YOOX, YOOX USA, AND/OR SPORTSWEAR COMPANY, EXPRESSED, IMPLIED OR OTHERWISE, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NONINFRINGEMENT. UNDER NO CIRCUMSTANCES ARE YOOX, YOOX USA, AND/OR SPORTSWEAR COMPANY LIABLE FOR DAMAGES ARISING FROM ANY TRANSACTION BETWEEN YOU AND ANY THIRD PARTY WEBSITE OR FOR ANY INFORMATION APPEARING ON THIRD PARTY WEBSITES. \r\n\r\n<b>11. CONTACTS</b>\r\nIf you wish to receive further information regarding our privacy practices, please contact us at the following e-mail address: <a href=“mailto:privacy@mail.stoneisland.com”>privacy@mail.stoneisland.com</a>. For more information regarding your rights under the Italian Data Protection Code, please go to the web site of the Italian Data Protection Authority at <a href=“http://www.garanteprivacy.it/ “>www.garanteprivacy.it</a>. \r\n\r\n<b>12. GOVERNING LAW</b>\r\nThe processing of personal data by YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY will be conducted in compliance with applicable US laws. The laws of Italy, including the Italian Personal Data Protection Code (Legislative Decree no. 196 dated June 30, 2003), also apply to the processing of personal data carried out by YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY (see the Companies of YOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY Group). The Italian Personal Data Protection Code guarantees that the processing of your personal data will be carried out in compliance with the fundamental rights and freedoms of individuals and their dignity, with particular reference to confidentiality, identity and the right to personal data protection. \r\n\r\n<b>13. MODIFICATION AND UPDATING</b>\r\nYOOX NET-A-PORTER GROUP and SPORTSWEAR COMPANY may amend or update from time to time all or any part of this Privacy Policy, whether or not required by a change in the applicable laws and regulation. Our users will be notified of any amendment to or update of our Privacy Policy on our homepage. All amendments and updates will become effective upon publication on this section of the www.stoneisland.com US Site. You should regularly access this section of the www.stoneisland.com US Site in order to review the most recent and updated version of our Privacy Policy.", + "__index": "2", + "dateCreated": "Tue, 17 Nov 2015 20:32:07 GMT", + "tag": "privacy" + }, + { + "id": "returns-policy", + "title": "Returns Policy", + "image": { + "uri": "", + "caption": "" + }, + "body": "We want to make sure that you are completely satisfied with your purchases on this Site. If, for any reason, you are not satisfied with your order, you may return any UNUSED products within twenty (20) days from the date of delivery. Before sending any products back to us, please make sure that all of the following conditions have been correctly satisfied. \r\nThe product you wish to return:\r\n<li>can be sent back to us only after you have completed and submitted the online <a href=“http://www.stoneisland.com/localize.asp?tskay=4036416C&page=help/return&”>Return Form</a> available on the www.stoneisland.com US Site within twenty (20) days of delivery; by completing and submitting our online return form you will receive your Return Number, which you must include on your return shipping label;</li>\r\n<li>must be unused, unworn, unwashed and in the same condition in which it was received by you;</li>\r\n<li>must have all disposable seals still attached with the disposable seal that must still be intact;</li>\r\n<li>must be returned complete with all of its parts and accessories;</li>\r\n<li>must be sent in its original packaging;</li>\r\n<li>must be shipped back to our fulfillment house within twenty (20) days of the date of delivery;</li>\r\n<li>must be sent in one single shipment; products that belong to the same order must be returned to us at the same time; and</li>\r\n<li>must be shipped from the United States.</li>\r\nIf all of these conditions are satisfied, we will refund the value of the returned product(s), Sales Tax included, less any original shipping costs. If you send the package with UPS, return shipping costs charged to the customer will correspond to $6.00. If you prefer you can send the return at your expense, with a courier of your choice. We will not issue any refunds for returns that do not satisfy all of the conditions indicated above; provided, however, that you will have the option to request within thirty (30) days of being notified that you are not entitled to a refund that your merchandise be shipped back to you, at your own cost, in the condition in which it was received by Provider’s fulfillment house.\r\nIf you do not request the return of your merchandise within said thirty-day period, you authorize Provider, and any of its affiliates or agents, to dispose of such merchandise as it sees fit. \r\n\r\nSALES OF BEACHWEAR AND UNDERWEAR ARE FINAL. WE RESERVE THE RIGHT TO DESIGNATE ON THE SITE OTHER NON-RETURNABLE MERCHANDISE. ANY SUCH DESIGNATION WILL BE NOTED ON THE DETAIL PAGE OF THE MERCHANDISE WHICH IS NON-RETURNABLE. \r\n\r\n<b>REFUND POLICY</b>\r\nRefunds are processed within approximately three (3) business days of our receipt of your merchandise. Your refund will be credited back to the same payment method used to make the original purchase on the US Site. If you paid by credit card, refund times will depend on the credit or debit card company’s policies. Be aware that the refund date for the credit will coincide with the date of the original payment, therefore you will not be charged any interest fees. If you paid by PayPal (where available), refunds will be credited to your PayPal account and will be visible immediately. The date of reimbursement to the credit card associated with your PayPal account depends on the company that issued the card. WE OFFER NO REFUNDS ON ANY PRODUCTS DESIGNATED ON THIS SITE AS NON-RETURNABLE. \r\n\r\n<b>IDENTIFICATION TAG</b>\r\nAll of our products come with an identification tag with a disposable seal. Please try your item on before removing the tag and seal, since we do not accept returns once the disposable seal has been removed, broken or damaged in any way. Shoes come with a sticker under the sole; if you remove or alter this sticker, you may no longer return your purchase. \r\n\r\n<b>UPS</b>\r\nYour return can be sent to us by UPS, using the pre-printed label which you can find within the original shipment. If you send the package with UPS, return shipping costs charged to the customer will correspond to $6.00. Please visit <a href=“https://www.ups.com/dropoff?loc=en_US “>http://www.ups.com/dropoff?loc=en_US</a> to find the UPS drop-off location nearest to you. If you prefer you can send the return at your expense, with a courier of your choice. We are not responsible for any loss or damage to products if you ship your return without using UPS. \r\n\r\nWE OFFER NO EXCHANGES ON MERCHANDISE PURCHASED ON THE www.stoneisland.com US SITE\r\n\r\nDISCLAIMER OF WARRANTIES AND LIMITATION OF LIABILITY\r\n\r\nPROVIDER MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE PRODUCTS INCLUDED ON THE SITE NOR AS TO THE MERCHANDISE BEING SOLD TO YOU. TO THE FULLEST EXTENT PERMISSIBLE BY APPLICABLE LAW, PROVIDER DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, AND THERE ARE NO WARRANTIES, EXPRESS OR IMPLIED, WHICH EXTEND BEYOND THE DESCRIPTION OF THE MERCHANDISE CONTAINED ON OUR ORDER CONFIRMATION. PROVIDER WILL NOT BE LIABLE FOR ANY DAMAGES OF ANY KIND ARISING FROM THE USE OF THE SITE, INCLUDING BUT NOT LIMITED TO DIRECT, INDIRECT, INCIDENTAL, PUNITIVE AND CONSEQUENTIAL DAMAGES. \r\n\r\nCERTAIN STATE LAWS DO NOT ALLOW LIMITATIONS ON IMPLIED WARRANTIES OR THE EXCLUSION OR LIMITATION OF CERTAIN DAMAGES. IF THESE LAWS APPLY TO YOU, SOME OR ALL OF THE ABOVE DISCLAIMERS, EXCLUSIONS, OR LIMITATIONS MAY NOT APPLY TO YOU, AND YOU MIGHT HAVE ADDITIONAL RIGHTS.\r\n\r\n<b>Force Majeure</b>\r\nProvider shall not be liable for any delay or failure in performance caused by circumstances beyond its reasonable control.", + "__index": "3", + "dateCreated": "Tue, 17 Nov 2015 21:03:44 GMT", + "tag": "returns" + }, + { + "id": "customer-care", + "title": "Customer Care", + "image": { + "uri": "", + "caption": "" + }, + "body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam blandit in risus sit amet maximus. Phasellus ullamcorper auctor fermentum. Aenean diam libero, rhoncus vel efficitur sed, dictum vel neque. Aliquam mollis leo vitae est vehicula, non pulvinar elit congue. Phasellus sit amet mauris neque. Integer volutpat nisl est, vel finibus purus lacinia vehicula. Proin dapibus velit quis sapien ultricies accumsan. Sed accumsan dui id porta efficitur.\r\n\r\nCurabitur pretium ut libero a varius. Morbi in lacinia felis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam dolor justo, consequat eu lectus at, interdum sollicitudin arcu. Nunc accumsan velit volutpat, venenatis leo eu, rhoncus nibh. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus semper consequat ipsum, sed fringilla ligula tincidunt at.\r\n\r\nMauris vehicula, purus ut iaculis facilisis, mi leo dignissim libero, at lobortis lectus odio consequat urna. Etiam accumsan volutpat nibh, eget ultricies mi feugiat eu. Duis id aliquam enim. Pellentesque quis enim eu dolor bibendum interdum. Cras ultrices erat velit, eu volutpat erat consequat non. Nam ut nibh facilisis, egestas sapien vitae, scelerisque sapien. Nullam tortor ex, convallis vel nisi vitae, efficitur dapibus nunc. In hac habitasse platea dictumst. Nam posuere ligula lorem, sit amet ultricies odio tristique in. Etiam gravida tincidunt mollis. Duis quis nulla ligula. Etiam ut vehicula tellus. Sed ipsum lacus, tincidunt sit amet velit et, aliquet hendrerit erat. Nam sed velit dapibus, congue odio non, ultrices ligula. Suspendisse at quam eu lorem finibus ultricies id tempus lorem. Nulla vel quam luctus, viverra nulla cursus, faucibus tellus.\r\n\r\nPraesent magna ex, posuere at hendrerit varius, auctor a nisl. Nullam sodales erat ut nisl vestibulum luctus. Donec id sagittis orci. Cras imperdiet, erat non dictum feugiat, elit turpis viverra neque, interdum cursus mi turpis vitae dolor. Suspendisse potenti. Aenean et auctor diam, vel eleifend eros. Praesent viverra felis at enim elementum fermentum. Etiam convallis, elit porta molestie condimentum, arcu ligula vestibulum nisi, et aliquet massa tellus quis eros. Aliquam a dignissim tellus, non ullamcorper purus. Phasellus in risus mattis dui vehicula cursus in at urna.\r\n\r\nCurabitur laoreet lorem eu euismod volutpat. Suspendisse vulputate aliquet tempor. Pellentesque purus augue, eleifend a maximus eu, commodo nec felis. Mauris mattis turpis nec volutpat tincidunt. Mauris imperdiet ante at orci mollis sagittis. Etiam lacus risus, consectetur ut dui non, pulvinar pulvinar libero. Aliquam ut rhoncus justo, quis sollicitudin nisi. Proin et iaculis sem. Pellentesque id tempor elit, et tincidunt nunc. Quisque laoreet et massa quis imperdiet. Morbi dapibus, felis sed auctor porttitor, massa nunc sollicitudin urna, non congue odio enim eget nisi. Suspendisse semper vehicula nisl vitae vehicula. Maecenas sed justo quis nisi auctor ultrices. Nam vel dolor fringilla, accumsan nulla eu, rutrum ex. Donec ante quam, molestie vel ex eget, dictum luctus nunc. Phasellus tincidunt libero non quam finibus, at convallis sem laoreet.\r\n\r\nDonec consequat, leo tincidunt elementum consectetur, nisl augue sollicitudin dolor, vel fringilla dui lorem non enim. Morbi id arcu felis. Integer malesuada ex enim, sed consectetur massa condimentum id. In mollis libero eu neque sollicitudin, sit amet interdum orci bibendum. Curabitur tincidunt purus vel vestibulum placerat. Aliquam erat volutpat. Praesent ac eros diam. Mauris ultrices euismod sodales. Vestibulum dui leo, auctor sit amet finibus eu, suscipit eu diam. Cras ac rhoncus turpis, at sagittis mi. Praesent urna metus, euismod vitae nunc eget, suscipit auctor lectus. Pellentesque maximus arcu justo. Duis mi arcu, rutrum et vulputate nec, mattis sit amet risus. Donec posuere velit sed enim accumsan, eu lobortis nulla sagittis.\r\n\r\nDonec viverra consectetur turpis sit amet malesuada. Sed sit amet urna luctus, sodales est porta, aliquam mi. Curabitur et ullamcorper odio, dapibus facilisis nisl. Fusce tortor leo, mattis sit amet massa ut, ultrices aliquam massa. Pellentesque consectetur metus in molestie egestas. Quisque vehicula at mauris ut eleifend. Duis eu ipsum quis ipsum bibendum luctus.\r\n\r\nSed sed viverra diam. Quisque lacinia nisl orci. Fusce vulputate dui ut nunc vulputate feugiat. Praesent felis quam, semper nec dapibus eget, venenatis vitae leo. Maecenas rutrum egestas dapibus. Vestibulum sodales molestie varius. Ut ac laoreet est, nec posuere ipsum. Cras ac eros sapien. Quisque eu dui lorem. Donec congue varius tortor ac ullamcorper. Curabitur vulputate faucibus finibus. Donec tellus neque, euismod ac aliquet at, vehicula in mauris. Vivamus justo nulla, maximus sit amet quam ac, vulputate dapibus purus. Mauris ante urna, posuere varius vehicula sed, fringilla sed quam. In eget ex tincidunt, ultrices elit id, congue quam. Suspendisse congue tristique dolor, rhoncus venenatis purus tempor at.\r\n\r\nVivamus efficitur, odio in tempor rutrum, quam nunc congue orci, non posuere lorem lacus et arcu. Aenean sit amet diam quis dui dapibus semper ac vitae est. Aenean ornare arcu justo, id sodales odio maximus interdum. Curabitur sit amet augue pretium metus bibendum imperdiet vitae vitae nunc. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc euismod ante eu justo mollis dignissim. Maecenas et velit eu lorem laoreet ornare. Sed accumsan est nec rutrum dignissim.\r\n\r\nIn bibendum mattis ligula. Pellentesque gravida felis sed congue viverra. Nam volutpat quam at velit sodales, nec egestas dolor consectetur. Etiam id tortor tincidunt, sollicitudin risus ut, lacinia diam. Morbi consequat euismod justo vitae sagittis. Pellentesque interdum orci ligula, tincidunt maximus nulla sollicitudin sed. Duis finibus odio eros, eget consequat ante tristique ac. Suspendisse at interdum leo. Nunc sagittis ante ac felis iaculis fermentum. Sed elementum dictum dictum. Aliquam eget metus molestie, varius mi ac, auctor quam.", + "__index": "4", + "dateCreated": "Tue, 17 Nov 2015 21:03:57 GMT", + "tag": "care" + } + ], + "store": [ + { + "id": "stone-island", + "title": "STONE ISLAND", + "StoreIsOpen": "false", + "ClosedStoreImages": [ + { + "uri": "https://marsupial.s3.amazonaws.com/stoneisland/cfffd4b0-14b7-11e7-b4a1-69af24d3ff84.jpg", + "width": "580", + "height": "813", + "caption": "" + } + ], + "__index": 0, + "dateCreated": "Fri, 20 Nov 2015 00:45:03 GMT", + "collection": "", + "FitsLarge": "false", + "BackgroundIsGray": "false", + "CollectionId": "", + "StoreStatus": "closed", + "OpensOn": "", + "DepartmentId": "", + "StoreClosedMessageOne": "", + "StoreClosedMessageTwo": "", + "FittingCodes": "", + "DepartmentStoreStatus": "closed", + "Departments": [ + { + "text": "STONE ISLAND MARINA_CORROSION PRINT <br>& ORTLIEB DRY BAGS", + "uri": "DrpppMrnCrrsn" + } + ], + "GroupBy": "size", + "FilterBy": "size", + "ShowProductNameOnCollectionPage": true + } + ] +}
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/CDVNotification.bundle/beep.wav b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/CDVNotification.bundle/beep.wav Binary files differindex 05f5997f..05f5997f 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/CDVNotification.bundle/beep.wav +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/CDVNotification.bundle/beep.wav diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-568h@2x~iphone.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-568h@2x~iphone.png Binary files differindex 47079c45..47079c45 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-568h@2x~iphone.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-568h@2x~iphone.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-667h.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-667h.png Binary files differindex 57a8f40e..57a8f40e 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-667h.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-667h.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-736h.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-736h.png Binary files differindex 2f00da21..2f00da21 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-736h.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-736h.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Landscape-736h.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Landscape-736h.png Binary files differindex fc6512f7..fc6512f7 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Landscape-736h.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Landscape-736h.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Landscape@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Landscape@2x~ipad.png Binary files differindex f0fa0658..f0fa0658 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Landscape@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Landscape@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Landscape~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Landscape~ipad.png Binary files differindex 89964903..89964903 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Landscape~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Landscape~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Portrait@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Portrait@2x~ipad.png Binary files differindex 9002f6f3..9002f6f3 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Portrait@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Portrait@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Portrait~ipad.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Portrait~ipad.png Binary files differindex 2916e875..2916e875 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default-Portrait~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default-Portrait~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default@2x~iphone.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default@2x~iphone.png Binary files differindex 13ada67a..13ada67a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default@2x~iphone.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default@2x~iphone.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default~iphone.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default~iphone.png Binary files differindex 19d2b2ae..19d2b2ae 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/Resources/splash/Default~iphone.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/Resources/splash/Default~iphone.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/angle-down.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/angle-down.png Binary files differindex e0b3b00f..e0b3b00f 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/angle-down.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/angle-down.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/bottom-fade.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/bottom-fade.png Binary files differindex 2765c9bf..2765c9bf 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/bottom-fade.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/bottom-fade.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/cart-box.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/cart-box.png Binary files differindex 4f2ff471..4f2ff471 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/cart-box.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/cart-box.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/cart-handle.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/cart-handle.png Binary files differindex 96b9e400..96b9e400 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/cart-handle.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/cart-handle.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/compass-logo.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/compass-logo.png Binary files differindex bdc8d946..bdc8d946 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/compass-logo.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/compass-logo.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/compass-logo.png.old b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/compass-logo.png.old Binary files differindex d280a7fa..d280a7fa 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/compass-logo.png.old +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/compass-logo.png.old diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/fade-to-bottom-threshold.gif b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/fade-to-bottom-threshold.gif Binary files differindex 808757e9..808757e9 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/fade-to-bottom-threshold.gif +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/fade-to-bottom-threshold.gif diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/fade-to-bottom.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/fade-to-bottom.png Binary files differindex 2765c9bf..2765c9bf 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/fade-to-bottom.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/fade-to-bottom.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/left-arrow.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/left-arrow.png Binary files differindex d19f48f3..d19f48f3 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/left-arrow.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/left-arrow.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/right-arrow.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/right-arrow.png Binary files differindex 00b62502..00b62502 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/right-arrow.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/right-arrow.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/small-cart-box.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/small-cart-box.png Binary files differindex 59ebcd70..59ebcd70 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/small-cart-box.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/small-cart-box.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/small-cart-handle.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/small-cart-handle.png Binary files differindex 6b3567c2..6b3567c2 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/small-cart-handle.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/small-cart-handle.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/small-logo.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/small-logo.png Binary files differindex 7b6e1b0d..7b6e1b0d 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/small-logo.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/small-logo.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/spinner.gif b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/spinner.gif Binary files differindex d9e986d3..d9e986d3 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/spinner.gif +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/spinner.gif diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/wide-logo.png b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/wide-logo.png Binary files differindex a7f4a2ac..a7f4a2ac 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/img/wide-logo.png +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/img/wide-logo.png diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/index.html b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/index.html index 0b10cd52..0b10cd52 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/index.html +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/index.html diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/index.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/index.js index a28faabf..a28faabf 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/index.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/index.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/_router.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/_router.js index 9927712a..19bd3247 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/_router.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/_router.js @@ -87,6 +87,9 @@ var SiteRouter = Router.extend({ else { app.view = app[name] } + + // window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) + app.header.set_back( !! app.view.back ) app.view.show() }.bind(this) diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/AccountView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/AccountView.js index 80738be0..80738be0 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/AccountView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/AccountView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/OrdersView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/OrdersView.js index b3ff3e7a..b3ff3e7a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/OrdersView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/OrdersView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/PaymentView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/PaymentView.js index 796ea188..796ea188 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/PaymentView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/PaymentView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/ProfileView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/ProfileView.js index 52ef8056..52ef8056 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/ProfileView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/ProfileView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/SettingsView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/SettingsView.js index 90ace549..90ace549 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/SettingsView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/SettingsView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/ShippingView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/ShippingView.js index 67a1cfec..67a1cfec 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/account/ShippingView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/account/ShippingView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/auth/LoginView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/auth/LoginView.js index aeb15d1d..aeb15d1d 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/auth/LoginView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/auth/LoginView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/auth/LogoutView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/auth/LogoutView.js index 481dcb8d..481dcb8d 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/auth/LogoutView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/auth/LogoutView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/auth/SignupView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/auth/SignupView.js index 220026c0..220026c0 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/auth/SignupView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/auth/SignupView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/ArchiveView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/ArchiveView.js index 12aaf7de..12aaf7de 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/ArchiveView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/BlogView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/BlogView.js index fd7b5212..fd7b5212 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/BlogView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/BlogView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/HubView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/HubView.js index 38a7eecf..38a7eecf 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/HubView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/HubView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/PageView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/PageView.js index f5f8ab2e..f5f8ab2e 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/PageView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/PageView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/StoryView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/StoryView.js index 5a7a56d1..5a7a56d1 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/blogs/StoryView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/blogs/StoryView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartConfirm.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartConfirm.js index a82509af..a82509af 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartConfirm.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartConfirm.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartError.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartError.js index f9a1963e..f9a1963e 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartError.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartError.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartPayment.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartPayment.js index 31c371a5..31c371a5 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartPayment.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartPayment.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartShipping.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartShipping.js index 536b5161..536b5161 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartShipping.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartShipping.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartSummary.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartSummary.js index 9b5da7b7..9b5da7b7 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartSummary.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartSummary.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartThanks.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartThanks.js index 03a45d4d..03a45d4d 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartThanks.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartThanks.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartView.js index 6ed8238f..6ed8238f 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/cart/CartView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/cart/CartView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/backup_db.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/etc/backup_db.js index dce8835a..dce8835a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/backup_db.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/etc/backup_db.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/deeplink.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/etc/deeplink.js index 7667cfcd..7667cfcd 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/deeplink.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/etc/deeplink.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/geo.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/etc/geo.js index 22899141..22899141 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/geo.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/etc/geo.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/etc/push.js index 14236728..f3f3132e 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/etc/push.js @@ -7,7 +7,7 @@ var push = (function(){ push.disabled = true return } - + pushPlugin = PushNotification.init({ ios: { alert: true, @@ -105,8 +105,8 @@ var push = (function(){ return sdk.cms() + '/_services/push/' + key } push.got_push_notification = function(push_obj) { - console.log('We received this push notification: ' + JSON.stringify(push_obj)); - window.zsazsa = push_obj + // console.log('We received this push notification: ' + JSON.stringify(push_obj)); + app.blog.refresh() push_obj.additionalData = push_obj.additionalData || {} @@ -119,10 +119,10 @@ var push = (function(){ catch (e) { } - if (is_hub || push_obj.additionalData.url)) { + if (is_hub) { app.intro.$alert.show().html("[ HUB UPDATED ]") } - else { + else if (! push_obj.additionalData.url) { auth.clear_cart() app.intro.$alert.show().html("[ STORE UPDATED ]") } @@ -130,9 +130,10 @@ var push = (function(){ if (push_obj.additionalData.foreground === false) { // TODO: route the user to the uri in push_obj pushPlugin.finish(function(){}, function(){}) - } - else if (push_obj.additionalData.url) { - app.router.go(push_obj.additionalData.url) + + if (push_obj.additionalData.url) { + app.router.go(push_obj.additionalData.url) + } } else if (is_hub) { app.router.go("hub") diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/AddressView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/AddressView.js index 4a05c4b6..4a05c4b6 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/AddressView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/AddressView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/CreditCardView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/CreditCardView.js index 63784618..63784618 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/CreditCardView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/CreditCardView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/CurtainView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/CurtainView.js index d444fd60..d444fd60 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/CurtainView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/CurtainView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/FooterView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/FooterView.js index 8641668f..8641668f 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/FooterView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/FooterView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/HeaderView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/HeaderView.js index 0961a5e8..0961a5e8 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/HeaderView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/HeaderView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/IntroView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/IntroView.js index c075619a..c075619a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/IntroView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/IntroView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/NavView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/NavView.js index cfb39ff6..cfb39ff6 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/NavView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/NavView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/SearchView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/SearchView.js index b477d72f..b477d72f 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/nav/SearchView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/nav/SearchView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/ClosedStoreView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/ClosedStoreView.js index 97b46006..97b46006 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/ClosedStoreView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/ClosedStoreView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/CollectionView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/CollectionView.js index 7c73d66f..7c73d66f 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/CollectionView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/CollectionView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/GalleryView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/GalleryView.js index 1428aca9..1428aca9 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/GalleryView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/GalleryView.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/ProductView.js index 6a61be1b..6972b436 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/ProductView.js @@ -167,6 +167,8 @@ var ProductView = ScrollableView.extend({ this.$price.html(price) this.$body.html(body) + // window.FirebasePlugin && window.FirebasePlugin.setScreenName('product:' + code) + this.$productHeader.toggleClass("wide", title.length > 48) var fits_large = !! this.fitLargeCodes[this.code] diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/Selector.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/Selector.js index 9c1109f6..9c1109f6 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/Selector.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/Selector.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/CategoryFilter.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/filters/CategoryFilter.js index 53f9a59b..53f9a59b 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/CategoryFilter.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/filters/CategoryFilter.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/DepartmentFilter.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/filters/DepartmentFilter.js index 7d5ccf3d..7d5ccf3d 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/products/filters/DepartmentFilter.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/filters/DepartmentFilter.js diff --git a/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/filters/SizeFilter.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/filters/SizeFilter.js new file mode 100644 index 00000000..d0231021 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/products/filters/SizeFilter.js @@ -0,0 +1,60 @@ +var SizeFilter = View.extend({ + + initialize: function(opt){ + this.parent = opt.parent + }, + + filter: function(){ + var seen_sizes = {} + var sizes = [] + this.parent.data.SearchResponseFull.Results.Items.forEach(function(item){ + item.Sizes.forEach(function(size){ + if (size.Id in seen_sizes) { + return + } + seen_sizes[size.Id] = true + sizes.push(size) + }) + }) + sizes.sort(function(a,b){ + return a.Id - b.Id + }) + + var cats = sizes.map(function(cat){ + return { + id: cat.Id, + label: cat.Text, + } + }) + if (this.last_choice) { + cats.push({ + id: "__remove_filter", + label: "REMOVE FILTER", + }) + } + app.selector.select("wide", cats, this.pick.bind(this)) + }, + + last_choice: null, + + pick: function(choice){ + this.parent.$content.empty() + if (choice.id == "__remove_filter") { + this.last_choice = null + this.parent.filtered_items = null + this.parent.data.SearchResponseFull.Results.Items.forEach(this.parent.append.bind(this.parent)) + } + else { + this.last_choice = choice + console.log("filtering for size", choice.id) + var items = this.parent.data.SearchResponseFull.Results.Items.filter(function(item){ + console.log(item.Sizes.map(function(s){ return s })) + return item.Sizes.some(function(size){ return size.Id == choice.id }) + }) + this.parent.filtered_items = items + items.forEach(this.parent.append.bind(this.parent)) + } + this.parent.deferScrollToTop() + }, + +}) diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Router.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/view/Router.js index a8ec331f..a8ec331f 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Router.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/view/Router.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Scrollable.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/view/Scrollable.js index 7f90929a..7f90929a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Scrollable.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/view/Scrollable.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Serializable.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/view/Serializable.js index fa4eba02..fa4eba02 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/Serializable.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/view/Serializable.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/View.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/view/View.js index 2401df0d..2401df0d 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/lib/view/View.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/lib/view/View.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/_sdk.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/_sdk.js index c251e364..c251e364 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/_sdk.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/_sdk.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/account.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/account.js index 3eb3f3bd..3eb3f3bd 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/account.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/account.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/address.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/address.js index 1256df54..1256df54 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/address.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/address.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/auth.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/auth.js index fa8dd71c..bcfb2d3a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/auth.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/auth.js @@ -51,6 +51,9 @@ var auth = sdk.auth = (function(){ localStorage.setItem("yoox.access_token", access_token) localStorage.setItem("yoox.user_id", user_id) + + window.FirebasePlugin && window.FirebasePlugin.setUserId(user_id) + cb && cb() } auth.get_user = function(cb){ @@ -63,6 +66,7 @@ var auth = sdk.auth = (function(){ auth.user_id = -1 localStorage.removeItem("yoox.access_token") localStorage.removeItem("yoox.user_id") + cb && cb() } diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/cart.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/cart.js index 3ff2e1d2..3ff2e1d2 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/cart.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/cart.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/payment.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/payment.js index 283fee92..283fee92 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/payment.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/payment.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/product.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/product.js index 671d1fea..671d1fea 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/product.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/product.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/shipping.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/shipping.js index 28a0db76..28a0db76 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/sdk/shipping.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/sdk/shipping.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/fastclick.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/fastclick.js index 9c746c2b..9c746c2b 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/fastclick.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/fastclick.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/flickity.pkgd.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/flickity.pkgd.js index 0471fa5b..0471fa5b 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/flickity.pkgd.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/flickity.pkgd.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/iscroll.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/iscroll.js index 8bd2b8da..8bd2b8da 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/iscroll.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/iscroll.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/jquery-2.1.4.min.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/jquery-2.1.4.min.js index 49990d6e..49990d6e 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/jquery-2.1.4.min.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/jquery-2.1.4.min.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/jquery.creditCardValidator.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/jquery.creditCardValidator.js index 56ce1bf6..56ce1bf6 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/jquery.creditCardValidator.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/jquery.creditCardValidator.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/loader.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/loader.js index ccfcdc9e..ccfcdc9e 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/loader.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/loader.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/lodash.min.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/lodash.min.js index e6c9820b..e6c9820b 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/lodash.min.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/lodash.min.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/moment.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/moment.js index 30e9239a..30e9239a 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/moment.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/moment.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/oktween.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/oktween.js index 7e820b04..7e820b04 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/oktween.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/oktween.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/prefixfree.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/prefixfree.js index e2c87c42..e2c87c42 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/prefixfree.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/prefixfree.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/promise.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/promise.js index f458ab06..f458ab06 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/promise.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/promise.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/util.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/util.js index d45c4b98..d45c4b98 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/js/vendor/util.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/js/vendor/util.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-console/www/console-via-logger.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-console/www/console-via-logger.js index 0ecd9cc3..0ecd9cc3 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-console/www/console-via-logger.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-console/www/console-via-logger.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-console/www/logger.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-console/www/logger.js index deb07b57..deb07b57 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-console/www/logger.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-console/www/logger.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js index 72fee9e3..72fee9e3 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-customurlscheme/www/ios/LaunchMyApp.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-device/www/device.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-device/www/device.js index 977dfc09..977dfc09 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-device/www/device.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-device/www/device.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-dialogs/www/notification.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-dialogs/www/notification.js index 4ddf530b..4ddf530b 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-dialogs/www/notification.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-dialogs/www/notification.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-geolocation/www/Coordinates.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-geolocation/www/Coordinates.js index 4a995077..4a995077 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-geolocation/www/Coordinates.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-geolocation/www/Coordinates.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-geolocation/www/Position.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-geolocation/www/Position.js index 97c6c2e3..97c6c2e3 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-geolocation/www/Position.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-geolocation/www/Position.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-geolocation/www/PositionError.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-geolocation/www/PositionError.js index c26dd754..c26dd754 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-geolocation/www/PositionError.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-geolocation/www/PositionError.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-geolocation/www/geolocation.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-geolocation/www/geolocation.js index 50f1f953..50f1f953 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-geolocation/www/geolocation.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-geolocation/www/geolocation.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js index 3e87a6e7..3e87a6e7 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-network-information/www/Connection.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-network-information/www/Connection.js index 5f7279c5..5f7279c5 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-network-information/www/Connection.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-network-information/www/Connection.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-network-information/www/network.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-network-information/www/network.js index 770e6ba5..770e6ba5 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-network-information/www/network.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-network-information/www/network.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js index 5beaa5fd..5beaa5fd 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-splashscreen/www/splashscreen.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-statusbar/www/statusbar.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-statusbar/www/statusbar.js index 708186f9..708186f9 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-statusbar/www/statusbar.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-statusbar/www/statusbar.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js index fe0e83ad..fe0e83ad 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/ionic-plugin-keyboard/www/ios/keyboard.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/ionic-plugin-keyboard/www/ios/keyboard.js index c74bb4d6..c74bb4d6 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/www/plugins/ionic-plugin-keyboard/www/ios/keyboard.js +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/ionic-plugin-keyboard/www/ios/keyboard.js diff --git a/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/phonegap-plugin-push/www/push.js new file mode 100644 index 00000000..7234d474 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcarchive/Products/Applications/StoneIsland.app/www/plugins/phonegap-plugin-push/www/push.js @@ -0,0 +1,377 @@ +cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { +/** +* This file has been generated by Babel. +* +* DO NOT EDIT IT DIRECTLY +* +* Edit the JS source file src/js/push.js +**/'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/* global cordova:false */ +/* globals window */ + +/*! + * Module dependencies. + */ + +var exec = cordova.require('cordova/exec'); + +var PushNotification = function () { + /** + * PushNotification constructor. + * + * @param {Object} options to initiate Push Notifications. + * @return {PushNotification} instance that can be monitored and cancelled. + */ + function PushNotification(options) { + var _this = this; + + _classCallCheck(this, PushNotification); + + this.handlers = { + registration: [], + notification: [], + error: [] + }; + + // require options parameter + if (typeof options === 'undefined') { + throw new Error('The options argument is required.'); + } + + // store the options to this object instance + this.options = options; + + // triggered on registration and notification + var success = function success(result) { + if (result && typeof result.registrationId !== 'undefined') { + _this.emit('registration', result); + } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { + var executeFuctionOrEmitEventByName = function executeFuctionOrEmitEventByName(functionName, context) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + var namespaces = functionName.split('.'); + var func = namespaces.pop(); + for (var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } + + if (typeof context[func] === 'function') { + context[func].call(context, args); + } else { + _this.emit(functionName, args); + } + }; + + executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); + } else if (result) { + _this.emit('notification', result); + } + }; + + // triggered on error + var fail = function fail(msg) { + var e = typeof msg === 'string' ? new Error(msg) : msg; + _this.emit('error', e); + }; + + // wait at least one process tick to allow event subscriptions + setTimeout(function () { + exec(success, fail, 'PushNotification', 'init', [options]); + }, 10); + } + + /** + * Unregister from push notifications + */ + + + _createClass(PushNotification, [{ + key: 'unregister', + value: function unregister(successCallback) { + var _this2 = this; + + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var options = arguments[2]; + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.unregister failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.unregister failure: success callback parameter ' + ' must be a function'); + return; + } + + var cleanHandlersAndPassThrough = function cleanHandlersAndPassThrough() { + if (!options) { + _this2.handlers = { + registration: [], + notification: [], + error: [] + }; + } + successCallback(); + }; + + exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); + } + + /** + * subscribe to a topic + * @param {String} topic topic to subscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + + }, { + key: 'subscribe', + value: function subscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); + } + + /** + * unsubscribe to a topic + * @param {String} topic topic to unsubscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + + }, { + key: 'unsubscribe', + value: function unsubscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: ' + 'success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); + } + + /** + * Call this to set the application icon badge + */ + + }, { + key: 'setApplicationIconBadgeNumber', + value: function setApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var badge = arguments[2]; + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{ badge: badge }]); + } + + /** + * Get the application icon badge + */ + + }, { + key: 'getApplicationIconBadgeNumber', + value: function getApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); + } + + /** + * Clear all notifications + */ + + }, { + key: 'clearAllNotifications', + value: function clearAllNotifications() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + + if (typeof errorCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: failure parameter ' + 'not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: success callback ' + 'parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); + } + /** + * Listen for an event. + * + * The following events are supported: + * + * - registration + * - notification + * - error + * + * @param {String} eventName to subscribe to. + * @param {Function} callback triggered on the event. + */ + + }, { + key: 'on', + value: function on(eventName, callback) { + if (!this.handlers.hasOwnProperty(eventName)) { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(callback); + } + + /** + * Remove event listener. + * + * @param {String} eventName to match subscription. + * @param {Function} handle function associated with event. + */ + + }, { + key: 'off', + value: function off(eventName, handle) { + if (this.handlers.hasOwnProperty(eventName)) { + var handleIndex = this.handlers[eventName].indexOf(handle); + if (handleIndex >= 0) { + this.handlers[eventName].splice(handleIndex, 1); + } + } + } + + /** + * Emit an event. + * + * This is intended for internal use only. + * + * @param {String} eventName is the event to trigger. + * @param {*} all arguments are passed to the event listeners. + * + * @return {Boolean} is true when the event is triggered otherwise false. + */ + + }, { + key: 'emit', + value: function emit() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + var eventName = args.shift(); + + if (!this.handlers.hasOwnProperty(eventName)) { + return false; + } + + for (var i = 0, length = this.handlers[eventName].length; i < length; i++) { + var callback = this.handlers[eventName][i]; + if (typeof callback === 'function') { + callback.apply(undefined, args); + } else { + console.log('event handler: ' + eventName + ' must be a function'); + } + } + + return true; + } + }, { + key: 'finish', + value: function finish() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'handler'; + + if (typeof successCallback !== 'function') { + console.log('finish failure: success callback parameter must be a function'); + return; + } + + if (typeof errorCallback !== 'function') { + console.log('finish failure: failure parameter not a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); + } + }]); + + return PushNotification; +}(); + +/*! + * Push Notification Plugin. + */ + +module.exports = { + /** + * Register for Push Notifications. + * + * This method will instantiate a new copy of the PushNotification object + * and start the registration process. + * + * @param {Object} options + * @return {PushNotification} instance + */ + + init: function init(options) { + return new PushNotification(options); + }, + + hasPermission: function hasPermission(successCallback, errorCallback) { + exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); + }, + + /** + * PushNotification Object. + * + * Expose the PushNotification object for direct use + * and testing. Typically, you should use the + * .init helper method. + */ + PushNotification: PushNotification +}; +}); diff --git a/StoneIsland/platforms/ios/StoneIsland.xcodeproj/project.pbxproj b/StoneIsland/platforms/ios/StoneIsland.xcodeproj/project.pbxproj new file mode 100755 index 00000000..7aa355e0 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcodeproj/project.pbxproj @@ -0,0 +1,648 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { +/* Begin PBXBuildFile section */ + 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0207DA571B56EA530066E2B4 /* Images.xcassets */; }; + 19B92E24D7334971979147BD /* SocialSharing.m in Sources */ = {isa = PBXBuildFile; fileRef = 781555BB549646A98D904D14 /* SocialSharing.m */; }; + 1B127F71B7964A91A580846F /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 696034AC75BE4140A0413443 /* CDVStatusBar.m */; }; + 1D00BC1B95F14E568B0D22E6 /* CDVNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = D53C0162FCFD416C89470C39 /* CDVNotification.m */; }; + 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AppDelegate.m */; }; + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 287D4ED79FF44FB9935043DE /* CDVLocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D25F885BC814573A6D59B5D /* CDVLocation.m */; }; + 301BF552109A68D80062928A /* libCordova.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */; }; + 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /* MainViewController.m */; }; + 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /* MainViewController.xib */; }; + 506254402AA543DEA633AE93 /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DBA5C36653B434F8585334D /* Social.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; }; + 6D4B1D64786A4DE9BBFF4576 /* CDVSplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = ECDF3D7961FD46EFB2BD1E3B /* CDVSplashScreen.m */; }; + 7E53F00CCE0F42CA88ECD332 /* CDVLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 95B50A14B8F44B85AB61955A /* CDVLogger.m */; }; + 8155B29FFB944377B9649923 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F2080D56CCF24C34B80747B8 /* AudioToolbox.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 8FD0703756394FC98D0FCE9D /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09F98F5DDE0F4E6F9C33ADFB /* CoreLocation.framework */; }; + 92094E30447348219495635B /* IonicKeyboard.m in Sources */ = {isa = PBXBuildFile; fileRef = A8419C664AF14800B4B53BE0 /* IonicKeyboard.m */; }; + ACAA9D904BEF4A0A9377F6E0 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2D5950B013941CC8A1043A4 /* SystemConfiguration.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + B0D3AAA1CF7B4C4B947FFDD0 /* CDVReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A41B2893F76498BBFADEA98 /* CDVReachability.m */; }; + BF92C97528124CB9B0AD21E3 /* NSString+URLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D7CE6CDDD014138932DD949 /* NSString+URLEncoding.m */; }; + C4BF606CD2554E8FB391C75F /* CDVNotification.bundle in Resources */ = {isa = PBXBuildFile; fileRef = F36E9943F38A40AABE1C336D /* CDVNotification.bundle */; }; + C57B06064D4840A282C9600B /* CDVInAppBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7717F7BEA2904E15B4B35ECF /* CDVInAppBrowser.m */; }; + CFF445E2198FA7B5B3AF9189 /* libPods-StoneIsland.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DAD8F5836E4E32A95DD0B3C /* libPods-StoneIsland.a */; }; + D8A2A80915824415A559EEA6 /* CDVViewController+SplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = FD4C6CF5A2E747BCA98D155A /* CDVViewController+SplashScreen.m */; }; + DDB4744E4087413EA8CE0714 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 8E5B33239793468E9B7D1CBB /* CDVDevice.m */; }; + E9403FA0D84C47D88ADE3C19 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BA686B6DC79249608477A4F3 /* CoreTelephony.framework */; }; + EE53AAF2C95F486184E667E0 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D92ECC88E3FD4166AF2E3FFE /* MessageUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + F8445B8587004A8FB4A12400 /* CDVConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = BD679850B5694C5B98AB2B7A /* CDVConnection.m */; }; + D3B2B19A337B42188C5DEA9A /* AppDelegate+notification.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D5057B0E0AE4510B8FE8763 /* AppDelegate+notification.m */; }; + EF9DEB21F5DC449C92C000C8 /* PushPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = A81AE493A34A4F35A1128D88 /* PushPlugin.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 301BF534109A57CC0062928A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = D2AAC07E0554694100DB518D; + remoteInfo = CordovaLib; + }; + 301BF550109A68C00062928A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = CordovaLib; + }; + CE9F4EEA1F79C085005FBFFB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C0C01EB21E3911D50056E6CB; + remoteInfo = Cordova; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0207DA571B56EA530066E2B4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = StoneIsland/Images.xcassets; sourceTree = SOURCE_ROOT; }; + 09F98F5DDE0F4E6F9C33ADFB /* CoreLocation.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; + 0A41B2893F76498BBFADEA98 /* CDVReachability.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVReachability.m; path = "cordova-plugin-network-information/CDVReachability.m"; sourceTree = "<group>"; }; + 141FBCADBB214798B2EE0707 /* CDVDevice.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVDevice.h; path = "cordova-plugin-device/CDVDevice.h"; sourceTree = "<group>"; }; + 1A746E0151894DCBA5328D06 /* CDVLogger.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVLogger.h; path = "cordova-plugin-console/CDVLogger.h"; sourceTree = "<group>"; }; + 1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; + 1D3623250D0F684500981E51 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; + 1D6058910D05DD3D006BFB54 /* StoneIsland.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StoneIsland.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1D7CE6CDDD014138932DD949 /* NSString+URLEncoding.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "NSString+URLEncoding.m"; path = "cordova-plugin-x-socialsharing/NSString+URLEncoding.m"; sourceTree = "<group>"; }; + 215170862E93414E832DCE85 /* CDVViewController+SplashScreen.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "CDVViewController+SplashScreen.h"; path = "cordova-plugin-splashscreen/CDVViewController+SplashScreen.h"; sourceTree = "<group>"; }; + 25D4EF773A41429FA399CF0E /* CDVLocation.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVLocation.h; path = "cordova-plugin-geolocation/CDVLocation.h"; sourceTree = "<group>"; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = CordovaLib/CordovaLib.xcodeproj; sourceTree = "<group>"; }; + 301BF56E109A69640062928A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; path = www; sourceTree = SOURCE_ROOT; }; + 302D95EE14D2391D003F00A1 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = "<group>"; }; + 302D95EF14D2391D003F00A1 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = "<group>"; }; + 302D95F014D2391D003F00A1 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = "<group>"; }; + 3047A50F1AB8059700498E2A /* build-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-debug.xcconfig"; path = "cordova/build-debug.xcconfig"; sourceTree = SOURCE_ROOT; }; + 3047A5101AB8059700498E2A /* build-release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "build-release.xcconfig"; path = "cordova/build-release.xcconfig"; sourceTree = SOURCE_ROOT; }; + 3047A5111AB8059700498E2A /* build.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = build.xcconfig; path = cordova/build.xcconfig; sourceTree = SOURCE_ROOT; }; + 32CA4F630368D1EE00C91783 /* StoneIsland-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "StoneIsland-Prefix.pch"; sourceTree = "<group>"; }; + 35EFE29EB7AE4309ADF38AAA /* IonicKeyboard.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = IonicKeyboard.h; path = "ionic-plugin-keyboard/IonicKeyboard.h"; sourceTree = "<group>"; }; + 4D25F885BC814573A6D59B5D /* CDVLocation.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVLocation.m; path = "cordova-plugin-geolocation/CDVLocation.m"; sourceTree = "<group>"; }; + 5926D5097DD7450CB02A01D9 /* NSString+URLEncoding.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "NSString+URLEncoding.h"; path = "cordova-plugin-x-socialsharing/NSString+URLEncoding.h"; sourceTree = "<group>"; }; + 627C28C432CD42769B32D8CF /* CDVSplashScreen.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVSplashScreen.h; path = "cordova-plugin-splashscreen/CDVSplashScreen.h"; sourceTree = "<group>"; }; + 696034AC75BE4140A0413443 /* CDVStatusBar.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVStatusBar.m; path = "cordova-plugin-statusbar/CDVStatusBar.m"; sourceTree = "<group>"; }; + 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CDVLaunchScreen.storyboard; path = StoneIsland/CDVLaunchScreen.storyboard; sourceTree = SOURCE_ROOT; }; + 6DBA5C36653B434F8585334D /* Social.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; + 7717F7BEA2904E15B4B35ECF /* CDVInAppBrowser.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVInAppBrowser.m; path = "cordova-plugin-inappbrowser/CDVInAppBrowser.m"; sourceTree = "<group>"; }; + 781555BB549646A98D904D14 /* SocialSharing.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = SocialSharing.m; path = "cordova-plugin-x-socialsharing/SocialSharing.m"; sourceTree = "<group>"; }; + 79DF13C832E341A5BD251E84 /* CDVStatusBar.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVStatusBar.h; path = "cordova-plugin-statusbar/CDVStatusBar.h"; sourceTree = "<group>"; }; + 8D1107310486CEB800E47090 /* StoneIsland-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "StoneIsland-Info.plist"; path = "StoneIsland/StoneIsland-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = SOURCE_ROOT; }; + 8DAD8F5836E4E32A95DD0B3C /* libPods-StoneIsland.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-StoneIsland.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8E5B33239793468E9B7D1CBB /* CDVDevice.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVDevice.m; path = "cordova-plugin-device/CDVDevice.m"; sourceTree = "<group>"; }; + 95B50A14B8F44B85AB61955A /* CDVLogger.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVLogger.m; path = "cordova-plugin-console/CDVLogger.m"; sourceTree = "<group>"; }; + A2D5950B013941CC8A1043A4 /* SystemConfiguration.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + A8419C664AF14800B4B53BE0 /* IonicKeyboard.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = IonicKeyboard.m; path = "ionic-plugin-keyboard/IonicKeyboard.m"; sourceTree = "<group>"; }; + B45AB7E9062A4BC288E48830 /* CDVConnection.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVConnection.h; path = "cordova-plugin-network-information/CDVConnection.h"; sourceTree = "<group>"; }; + B640CAC684304164A3BC4DE4 /* CDVNotification.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVNotification.h; path = "cordova-plugin-dialogs/CDVNotification.h"; sourceTree = "<group>"; }; + BA686B6DC79249608477A4F3 /* CoreTelephony.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; + BD679850B5694C5B98AB2B7A /* CDVConnection.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVConnection.m; path = "cordova-plugin-network-information/CDVConnection.m"; sourceTree = "<group>"; }; + C0A85B8C7E5C4E1FA2311456 /* CDVInAppBrowser.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVInAppBrowser.h; path = "cordova-plugin-inappbrowser/CDVInAppBrowser.h"; sourceTree = "<group>"; }; + CD33519C2F2341279074C41B /* CDVReachability.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = CDVReachability.h; path = "cordova-plugin-network-information/CDVReachability.h"; sourceTree = "<group>"; }; + D53C0162FCFD416C89470C39 /* CDVNotification.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVNotification.m; path = "cordova-plugin-dialogs/CDVNotification.m"; sourceTree = "<group>"; }; + D92ECC88E3FD4166AF2E3FFE /* MessageUI.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + EB0886FCD9794E64A2662E05 /* SocialSharing.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = SocialSharing.h; path = "cordova-plugin-x-socialsharing/SocialSharing.h"; sourceTree = "<group>"; }; + EB87FDF31871DA8E0020F90C /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = "<group>"; }; + EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = "<group>"; }; + ECDF3D7961FD46EFB2BD1E3B /* CDVSplashScreen.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = CDVSplashScreen.m; path = "cordova-plugin-splashscreen/CDVSplashScreen.m"; sourceTree = "<group>"; }; + ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; }; + F2080D56CCF24C34B80747B8 /* AudioToolbox.framework */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + F36E9943F38A40AABE1C336D /* CDVNotification.bundle */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.plug-in"; path = CDVNotification.bundle; sourceTree = "<group>"; }; + F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = StoneIsland/config.xml; sourceTree = "<group>"; }; + FD4C6CF5A2E747BCA98D155A /* CDVViewController+SplashScreen.m */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.objc; name = "CDVViewController+SplashScreen.m"; path = "cordova-plugin-splashscreen/CDVViewController+SplashScreen.m"; sourceTree = "<group>"; }; + 8D5057B0E0AE4510B8FE8763 /* AppDelegate+notification.m */ = {isa = PBXFileReference; name = "AppDelegate+notification.m"; path = "phonegap-plugin-push/AppDelegate+notification.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; }; + A81AE493A34A4F35A1128D88 /* PushPlugin.m */ = {isa = PBXFileReference; name = "PushPlugin.m"; path = "phonegap-plugin-push/PushPlugin.m"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; }; + 3AE610BB7E1A4FF4AF41CFB8 /* AppDelegate+notification.h */ = {isa = PBXFileReference; name = "AppDelegate+notification.h"; path = "phonegap-plugin-push/AppDelegate+notification.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; }; + 9AC0D8AC435E43348B735E8D /* PushPlugin.h */ = {isa = PBXFileReference; name = "PushPlugin.h"; path = "phonegap-plugin-push/PushPlugin.h"; sourceTree = "<group>"; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 301BF552109A68D80062928A /* libCordova.a in Frameworks */, + 8155B29FFB944377B9649923 /* AudioToolbox.framework in Frameworks */, + 8FD0703756394FC98D0FCE9D /* CoreLocation.framework in Frameworks */, + ACAA9D904BEF4A0A9377F6E0 /* SystemConfiguration.framework in Frameworks */, + E9403FA0D84C47D88ADE3C19 /* CoreTelephony.framework in Frameworks */, + 506254402AA543DEA633AE93 /* Social.framework in Frameworks */, + EE53AAF2C95F486184E667E0 /* MessageUI.framework in Frameworks */, + CFF445E2198FA7B5B3AF9189 /* libPods-StoneIsland.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 302D95EE14D2391D003F00A1 /* MainViewController.h */, + 302D95EF14D2391D003F00A1 /* MainViewController.m */, + 302D95F014D2391D003F00A1 /* MainViewController.xib */, + 1D3623240D0F684500981E51 /* AppDelegate.h */, + 1D3623250D0F684500981E51 /* AppDelegate.m */, + ); + name = Classes; + path = StoneIsland/Classes; + sourceTree = SOURCE_ROOT; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* StoneIsland.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + EB87FDF41871DAF40020F90C /* config.xml */, + EB87FDF31871DA8E0020F90C /* www */, + EB87FDF11871DA420020F90C /* Staging */, + 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */, + 080E96DDFE201D6D7F000001 /* Classes */, + 307C750510C5A3420062BCA9 /* Plugins */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + E7345ABD9A2E6AF96AAAEAAD /* Pods */, + ); + name = CustomTemplate; + sourceTree = "<group>"; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* StoneIsland-Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */, + ); + name = "Other Sources"; + path = StoneIsland; + sourceTree = "<group>"; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 0207DA571B56EA530066E2B4 /* Images.xcassets */, + 3047A50E1AB8057F00498E2A /* config */, + 8D1107310486CEB800E47090 /* StoneIsland-Info.plist */, + 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */, + F36E9943F38A40AABE1C336D /* CDVNotification.bundle */, + ); + name = Resources; + path = StoneIsland/Resources; + sourceTree = "<group>"; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + F2080D56CCF24C34B80747B8 /* AudioToolbox.framework */, + 09F98F5DDE0F4E6F9C33ADFB /* CoreLocation.framework */, + A2D5950B013941CC8A1043A4 /* SystemConfiguration.framework */, + BA686B6DC79249608477A4F3 /* CoreTelephony.framework */, + 6DBA5C36653B434F8585334D /* Social.framework */, + D92ECC88E3FD4166AF2E3FFE /* MessageUI.framework */, + 8DAD8F5836E4E32A95DD0B3C /* libPods-StoneIsland.a */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 301BF52E109A57CC0062928A /* Products */ = { + isa = PBXGroup; + children = ( + 301BF535109A57CC0062928A /* libCordova.a */, + CE9F4EEB1F79C085005FBFFB /* Cordova.framework */, + ); + name = Products; + sourceTree = "<group>"; + }; + 3047A50E1AB8057F00498E2A /* config */ = { + isa = PBXGroup; + children = ( + 3047A50F1AB8059700498E2A /* build-debug.xcconfig */, + 3047A5101AB8059700498E2A /* build-release.xcconfig */, + 3047A5111AB8059700498E2A /* build.xcconfig */, + ); + name = config; + sourceTree = "<group>"; + }; + 307C750510C5A3420062BCA9 /* Plugins */ = { + isa = PBXGroup; + children = ( + 95B50A14B8F44B85AB61955A /* CDVLogger.m */, + 1A746E0151894DCBA5328D06 /* CDVLogger.h */, + 8E5B33239793468E9B7D1CBB /* CDVDevice.m */, + 141FBCADBB214798B2EE0707 /* CDVDevice.h */, + D53C0162FCFD416C89470C39 /* CDVNotification.m */, + B640CAC684304164A3BC4DE4 /* CDVNotification.h */, + 4D25F885BC814573A6D59B5D /* CDVLocation.m */, + 25D4EF773A41429FA399CF0E /* CDVLocation.h */, + 7717F7BEA2904E15B4B35ECF /* CDVInAppBrowser.m */, + C0A85B8C7E5C4E1FA2311456 /* CDVInAppBrowser.h */, + BD679850B5694C5B98AB2B7A /* CDVConnection.m */, + 0A41B2893F76498BBFADEA98 /* CDVReachability.m */, + B45AB7E9062A4BC288E48830 /* CDVConnection.h */, + CD33519C2F2341279074C41B /* CDVReachability.h */, + ECDF3D7961FD46EFB2BD1E3B /* CDVSplashScreen.m */, + FD4C6CF5A2E747BCA98D155A /* CDVViewController+SplashScreen.m */, + 627C28C432CD42769B32D8CF /* CDVSplashScreen.h */, + 215170862E93414E832DCE85 /* CDVViewController+SplashScreen.h */, + 696034AC75BE4140A0413443 /* CDVStatusBar.m */, + 79DF13C832E341A5BD251E84 /* CDVStatusBar.h */, + 1D7CE6CDDD014138932DD949 /* NSString+URLEncoding.m */, + 781555BB549646A98D904D14 /* SocialSharing.m */, + 5926D5097DD7450CB02A01D9 /* NSString+URLEncoding.h */, + EB0886FCD9794E64A2662E05 /* SocialSharing.h */, + A8419C664AF14800B4B53BE0 /* IonicKeyboard.m */, + 35EFE29EB7AE4309ADF38AAA /* IonicKeyboard.h */, + 8D5057B0E0AE4510B8FE8763 /* AppDelegate+notification.m */, + A81AE493A34A4F35A1128D88 /* PushPlugin.m */, + 3AE610BB7E1A4FF4AF41CFB8 /* AppDelegate+notification.h */, + 9AC0D8AC435E43348B735E8D /* PushPlugin.h */, + ); + name = Plugins; + path = StoneIsland/Plugins; + sourceTree = SOURCE_ROOT; + }; + E7345ABD9A2E6AF96AAAEAAD /* Pods */ = { + isa = PBXGroup; + children = ( + ); + name = Pods; + sourceTree = "<group>"; + }; + EB87FDF11871DA420020F90C /* Staging */ = { + isa = PBXGroup; + children = ( + F840E1F0165FE0F500CFE078 /* config.xml */, + 301BF56E109A69640062928A /* www */, + ); + name = Staging; + sourceTree = "<group>"; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* StoneIsland */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "StoneIsland" */; + buildPhases = ( + 0443B583E30D3C8863EE16BD /* [CP] Check Pods Manifest.lock */, + 304B58A110DAC018002A0835 /* Copy www directory */, + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + A536A2455C3DF4DEC16A80A4 /* [CP] Embed Pods Frameworks */, + 32F8C17FA552F43290A7F0F0 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 301BF551109A68C00062928A /* PBXTargetDependency */, + ); + name = StoneIsland; + productName = StoneIsland; + productReference = 1D6058910D05DD3D006BFB54 /* StoneIsland.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 510; + TargetAttributes = { + 1D6058900D05DD3D006BFB54 = { + DevelopmentTeam = C6JQTPGJ97; + }; + }; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "StoneIsland" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + en, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + productRefGroup = 19C28FACFE9D520D11CA2CBB /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 301BF52E109A57CC0062928A /* Products */; + ProjectRef = 301BF52D109A57CC0062928A /* CordovaLib/CordovaLib.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* StoneIsland */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 301BF535109A57CC0062928A /* libCordova.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libCordova.a; + remoteRef = 301BF534109A57CC0062928A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + CE9F4EEB1F79C085005FBFFB /* Cordova.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Cordova.framework; + remoteRef = CE9F4EEA1F79C085005FBFFB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 302D95F214D2391D003F00A1 /* MainViewController.xib in Resources */, + 0207DA581B56EA530066E2B4 /* Images.xcassets in Resources */, + 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */, + C4BF606CD2554E8FB391C75F /* CDVNotification.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 0443B583E30D3C8863EE16BD /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../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"; + showEnvVarsInLog = 0; + }; + 304B58A110DAC018002A0835 /* Copy www directory */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy www directory"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "NODEJS_PATH=/usr/local/bin; NVM_NODE_PATH=~/.nvm/versions/node/`nvm version 2>/dev/null`/bin; N_NODE_PATH=`find /usr/local/n/versions/node/* -maxdepth 0 -type d 2>/dev/null | tail -1`/bin; XCODE_NODE_PATH=`xcode-select --print-path`/usr/share/xcs/Node/bin; PATH=$NODEJS_PATH:$NVM_NODE_PATH:$N_NODE_PATH:$XCODE_NODE_PATH:$PATH && node cordova/lib/copy-www-build-step.js"; + showEnvVarsInLog = 0; + }; + 32F8C17FA552F43290A7F0F0 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + A536A2455C3DF4DEC16A80A4 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, + 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */, + 7E53F00CCE0F42CA88ECD332 /* CDVLogger.m in Sources */, + DDB4744E4087413EA8CE0714 /* CDVDevice.m in Sources */, + 1D00BC1B95F14E568B0D22E6 /* CDVNotification.m in Sources */, + 287D4ED79FF44FB9935043DE /* CDVLocation.m in Sources */, + C57B06064D4840A282C9600B /* CDVInAppBrowser.m in Sources */, + F8445B8587004A8FB4A12400 /* CDVConnection.m in Sources */, + B0D3AAA1CF7B4C4B947FFDD0 /* CDVReachability.m in Sources */, + 6D4B1D64786A4DE9BBFF4576 /* CDVSplashScreen.m in Sources */, + D8A2A80915824415A559EEA6 /* CDVViewController+SplashScreen.m in Sources */, + 1B127F71B7964A91A580846F /* CDVStatusBar.m in Sources */, + BF92C97528124CB9B0AD21E3 /* NSString+URLEncoding.m in Sources */, + 19B92E24D7334971979147BD /* SocialSharing.m in Sources */, + 92094E30447348219495635B /* IonicKeyboard.m in Sources */, + D3B2B19A337B42188C5DEA9A /* AppDelegate+notification.m in Sources */, + EF9DEB21F5DC449C92C000C8 /* PushPlugin.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 301BF551109A68C00062928A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = CordovaLib; + targetProxy = 301BF550109A68C00062928A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3047A50F1AB8059700498E2A /* build-debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = C6JQTPGJ97; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + ); + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "StoneIsland/StoneIsland-Prefix.pch"; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + INFOPLIST_FILE = "StoneIsland/StoneIsland-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + PRODUCT_NAME = StoneIsland; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3047A5101AB8059700498E2A /* build-release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = YES; + DEVELOPMENT_TEAM = C6JQTPGJ97; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + "\"StoneIsland/Plugins/cordova-plugin-firebase\"", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "StoneIsland/StoneIsland-Prefix.pch"; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + INFOPLIST_FILE = "StoneIsland/StoneIsland-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + PRODUCT_NAME = StoneIsland; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SKIP_INSTALL = NO; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3047A5111AB8059700498E2A /* build.xcconfig */; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_THUMB_SUPPORT = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + SDKROOT = iphoneos; + SKIP_INSTALL = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "StoneIsland" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "StoneIsland" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/GoogleService-Info.plist b/StoneIsland/platforms/ios/StoneIsland.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist index 5516ebf3..8fb433a9 100644 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/GoogleService-Info.plist +++ b/StoneIsland/platforms/ios/StoneIsland.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -2,5 +2,13 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> + <key>SchemeUserState</key> + <dict> + <key>StoneIsland.xcscheme</key> + <dict> + <key>orderHint</key> + <integer>6</integer> + </dict> + </dict> </dict> -</plist>
\ No newline at end of file +</plist> diff --git a/StoneIsland/platforms/ios/Stone Island.xcworkspace/contents.xcworkspacedata b/StoneIsland/platforms/ios/StoneIsland.xcworkspace/contents.xcworkspacedata index b3b64d39..441154ad 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcworkspace/contents.xcworkspacedata +++ b/StoneIsland/platforms/ios/StoneIsland.xcworkspace/contents.xcworkspacedata @@ -2,7 +2,7 @@ <Workspace version = "1.0"> <FileRef - location = "group:Stone Island.xcodeproj"> + location = "group:StoneIsland.xcodeproj"> </FileRef> <FileRef location = "group:Pods/Pods.xcodeproj"> diff --git a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcshareddata/xcschemes/Stone Island.xcscheme b/StoneIsland/platforms/ios/StoneIsland.xcworkspace/xcshareddata/xcschemes/StoneIsland.xcscheme index 769f0221..b0ec3207 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcworkspace/xcshareddata/xcschemes/Stone Island.xcscheme +++ b/StoneIsland/platforms/ios/StoneIsland.xcworkspace/xcshareddata/xcschemes/StoneIsland.xcscheme @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <Scheme - LastUpgradeVersion = "0900" + LastUpgradeVersion = "0730" version = "1.3"> <BuildAction parallelizeBuildables = "YES" @@ -15,9 +15,9 @@ <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1D6058900D05DD3D006BFB54" - BuildableName = "Stone Island.app" - BlueprintName = "Stone Island" - ReferencedContainer = "container:Stone Island.xcodeproj"> + BuildableName = "StoneIsland.app" + BlueprintName = "StoneIsland" + ReferencedContainer = "container:StoneIsland.xcodeproj"> </BuildableReference> </BuildActionEntry> </BuildActionEntries> @@ -26,7 +26,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> </Testables> @@ -34,9 +33,9 @@ <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1D6058900D05DD3D006BFB54" - BuildableName = "Stone Island.app" - BlueprintName = "Stone Island" - ReferencedContainer = "container:Stone Island.xcodeproj"> + BuildableName = "StoneIsland.app" + BlueprintName = "StoneIsland" + ReferencedContainer = "container:StoneIsland.xcodeproj"> </BuildableReference> </MacroExpansion> <AdditionalOptions> @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" @@ -58,9 +56,9 @@ <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1D6058900D05DD3D006BFB54" - BuildableName = "Stone Island.app" - BlueprintName = "Stone Island" - ReferencedContainer = "container:Stone Island.xcodeproj"> + BuildableName = "StoneIsland.app" + BlueprintName = "StoneIsland" + ReferencedContainer = "container:StoneIsland.xcodeproj"> </BuildableReference> </BuildableProductRunnable> <AdditionalOptions> @@ -77,9 +75,9 @@ <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1D6058900D05DD3D006BFB54" - BuildableName = "Stone Island.app" - BlueprintName = "Stone Island" - ReferencedContainer = "container:Stone Island.xcodeproj"> + BuildableName = "StoneIsland.app" + BlueprintName = "StoneIsland" + ReferencedContainer = "container:StoneIsland.xcodeproj"> </BuildableReference> </BuildableProductRunnable> </ProfileAction> diff --git a/StoneIsland/platforms/ios/StoneIsland.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate b/StoneIsland/platforms/ios/StoneIsland.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate Binary files differnew file mode 100644 index 00000000..5e4035d5 --- /dev/null +++ b/StoneIsland/platforms/ios/StoneIsland.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate diff --git a/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist b/StoneIsland/platforms/ios/StoneIsland.xcworkspace/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist index b41bffe9..2365d4cb 100644 --- a/StoneIsland/platforms/ios/Stone Island.xcodeproj/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/StoneIsland/platforms/ios/StoneIsland.xcworkspace/xcuserdata/user.xcuserdatad/xcschemes/xcschememanagement.plist @@ -4,19 +4,11 @@ <dict> <key>SchemeUserState</key> <dict> - <key>Stone Island.xcscheme</key> + <key>StoneIsland.xcscheme_^#shared#^_</key> <dict> <key>orderHint</key> <integer>0</integer> </dict> </dict> - <key>SuppressBuildableAutocreation</key> - <dict> - <key>1D6058900D05DD3D006BFB54</key> - <dict> - <key>primary</key> - <true/> - </dict> - </dict> </dict> </plist> diff --git a/StoneIsland/platforms/ios/Stone Island/.gitignore b/StoneIsland/platforms/ios/StoneIsland/.gitignore index cc76483f..cc76483f 100644 --- a/StoneIsland/platforms/ios/Stone Island/.gitignore +++ b/StoneIsland/platforms/ios/StoneIsland/.gitignore diff --git a/StoneIsland/platforms/ios/Stone Island/Bridging-Header.h b/StoneIsland/platforms/ios/StoneIsland/Bridging-Header.h index 5d8abc98..5d8abc98 100644 --- a/StoneIsland/platforms/ios/Stone Island/Bridging-Header.h +++ b/StoneIsland/platforms/ios/StoneIsland/Bridging-Header.h diff --git a/StoneIsland/platforms/ios/Stone Island/CDVLaunchScreen.storyboard b/StoneIsland/platforms/ios/StoneIsland/CDVLaunchScreen.storyboard index 51cdcf6d..51cdcf6d 100644 --- a/StoneIsland/platforms/ios/Stone Island/CDVLaunchScreen.storyboard +++ b/StoneIsland/platforms/ios/StoneIsland/CDVLaunchScreen.storyboard diff --git a/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.h b/StoneIsland/platforms/ios/StoneIsland/Classes/AppDelegate.h index 69ba6c08..c13c9090 100644 --- a/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.h +++ b/StoneIsland/platforms/ios/StoneIsland/Classes/AppDelegate.h @@ -19,7 +19,7 @@ // // AppDelegate.h -// Stone Island +// StoneIsland // // Created by ___FULLUSERNAME___ on ___DATE___. // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. diff --git a/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.m b/StoneIsland/platforms/ios/StoneIsland/Classes/AppDelegate.m index bc84bed9..98ba189d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Classes/AppDelegate.m +++ b/StoneIsland/platforms/ios/StoneIsland/Classes/AppDelegate.m @@ -19,7 +19,7 @@ // // AppDelegate.m -// Stone Island +// StoneIsland // // Created by ___FULLUSERNAME___ on ___DATE___. // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. diff --git a/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.h b/StoneIsland/platforms/ios/StoneIsland/Classes/MainViewController.h index a9aaeeaf..e91f2f08 100644 --- a/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.h +++ b/StoneIsland/platforms/ios/StoneIsland/Classes/MainViewController.h @@ -19,7 +19,7 @@ // // MainViewController.h -// Stone Island +// StoneIsland // // Created by ___FULLUSERNAME___ on ___DATE___. // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. diff --git a/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.m b/StoneIsland/platforms/ios/StoneIsland/Classes/MainViewController.m index 3f3a0c8e..ed5b31e4 100644 --- a/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.m +++ b/StoneIsland/platforms/ios/StoneIsland/Classes/MainViewController.m @@ -19,7 +19,7 @@ // // MainViewController.h -// Stone Island +// StoneIsland // // Created by ___FULLUSERNAME___ on ___DATE___. // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. @@ -92,7 +92,12 @@ return[super newCordovaViewWithFrame:bounds]; } -- (NSUInteger)supportedInterfaceOrientations +// CB-12098 +#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000 +- (NSUInteger)supportedInterfaceOrientations +#else +- (UIInterfaceOrientationMask)supportedInterfaceOrientations +#endif { return [super supportedInterfaceOrientations]; } diff --git a/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.xib b/StoneIsland/platforms/ios/StoneIsland/Classes/MainViewController.xib index e45d65c6..e45d65c6 100644 --- a/StoneIsland/platforms/ios/Stone Island/Classes/MainViewController.xib +++ b/StoneIsland/platforms/ios/StoneIsland/Classes/MainViewController.xib diff --git a/StoneIsland/platforms/ios/Stone Island/Entitlements-Debug.plist b/StoneIsland/platforms/ios/StoneIsland/Entitlements-Debug.plist index 018a6e20..018a6e20 100644 --- a/StoneIsland/platforms/ios/Stone Island/Entitlements-Debug.plist +++ b/StoneIsland/platforms/ios/StoneIsland/Entitlements-Debug.plist diff --git a/StoneIsland/platforms/ios/Stone Island/Entitlements-Release.plist b/StoneIsland/platforms/ios/StoneIsland/Entitlements-Release.plist index dec5aa2e..dec5aa2e 100644 --- a/StoneIsland/platforms/ios/Stone Island/Entitlements-Release.plist +++ b/StoneIsland/platforms/ios/StoneIsland/Entitlements-Release.plist diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/Contents.json b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/Contents.json index d19e65fd..d19e65fd 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-40.png Binary files differindex d2617e23..d2617e23 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-40.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40@2x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-40@2x.png Binary files differindex 1813fa48..1813fa48 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-40@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-40@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-50.png Binary files differindex 531435f3..531435f3 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-50.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50@2x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-50@2x.png Binary files differindex dffdf8ba..dffdf8ba 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-50@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-50@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-60.png Binary files differindex dd612e83..dd612e83 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-60.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@2x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-60@2x.png Binary files differindex 23c5b259..23c5b259 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-60@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@3x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-60@3x.png Binary files differindex da2863a4..da2863a4 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-60@3x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-60@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-72.png Binary files differindex 3094af16..3094af16 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-72.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72@2x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-72@2x.png Binary files differindex 9515e8dc..9515e8dc 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-72@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-72@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-76.png Binary files differindex 93e7a05d..93e7a05d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-76.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76@2x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-76@2x.png Binary files differindex 351f06c9..351f06c9 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-76@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-76@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png Binary files differindex 52bafc1d..52bafc1d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-83.5@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-small.png Binary files differindex cbe03b26..cbe03b26 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-small.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@2x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-small@2x.png Binary files differindex 8e3a96d6..8e3a96d6 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-small@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@3x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-small@3x.png Binary files differindex a40b6358..a40b6358 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon-small@3x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon-small@3x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon.png Binary files differindex 2c9b6664..2c9b6664 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon@2x.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon@2x.png Binary files differindex cf5b68db..cf5b68db 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/AppIcon.appiconset/icon@2x.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/AppIcon.appiconset/icon@2x.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/Contents.json b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/Contents.json index da4a164c..da4a164c 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/Contents.json +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/Contents.json diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Contents.json b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Contents.json index 175f378c..175f378c 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Contents.json diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png Binary files differindex db85b885..db85b885 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-568h@2x~iphone.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-667h.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-667h.png Binary files differindex b299cefa..b299cefa 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-667h.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-667h.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-736h.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-736h.png Binary files differindex 6c83b6af..6c83b6af 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-736h.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-736h.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png Binary files differindex 50dcc57f..50dcc57f 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Landscape-736h.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png Binary files differindex 33bf55d9..33bf55d9 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Landscape@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png Binary files differindex 076dffbc..076dffbc 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Landscape~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png Binary files differindex b4f2ea21..b4f2ea21 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Portrait@2x~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png Binary files differindex 0f28a4c8..0f28a4c8 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default-Portrait~ipad.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png Binary files differindex 371b1241..371b1241 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default@2x~iphone.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default~iphone.png b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default~iphone.png Binary files differindex d898d145..d898d145 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchImage.launchimage/Default~iphone.png +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchImage.launchimage/Default~iphone.png diff --git a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Contents.json b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchStoryboard.imageset/Contents.json index 621019de..621019de 100644 --- a/StoneIsland/platforms/ios/Stone Island/Images.xcassets/LaunchStoryboard.imageset/Contents.json +++ b/StoneIsland/platforms/ios/StoneIsland/Images.xcassets/LaunchStoryboard.imageset/Contents.json diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/README b/StoneIsland/platforms/ios/StoneIsland/Plugins/README index 87df09f2..87df09f2 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/README +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/README diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-console/CDVLogger.h index 7cfb3063..7cfb3063 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-console/CDVLogger.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-console/CDVLogger.m index ccfa3a51..ccfa3a51 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-console/CDVLogger.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-console/CDVLogger.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-device/CDVDevice.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-device/CDVDevice.h index a146d882..a146d882 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-device/CDVDevice.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-device/CDVDevice.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-device/CDVDevice.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-device/CDVDevice.m index 4d75a574..4d75a574 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-device/CDVDevice.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-device/CDVDevice.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-dialogs/CDVNotification.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-dialogs/CDVNotification.h index 9253f6a9..9253f6a9 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-dialogs/CDVNotification.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-dialogs/CDVNotification.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-dialogs/CDVNotification.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-dialogs/CDVNotification.m index 0dd3d2cb..0dd3d2cb 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-dialogs/CDVNotification.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-dialogs/CDVNotification.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-geolocation/CDVLocation.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-geolocation/CDVLocation.h index cce2738f..cce2738f 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-geolocation/CDVLocation.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-geolocation/CDVLocation.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-geolocation/CDVLocation.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-geolocation/CDVLocation.m index e4b34a11..e4b34a11 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-geolocation/CDVLocation.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-geolocation/CDVLocation.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.h index 6bb0ec16..6bb0ec16 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.m index b342ca73..b342ca73 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-inappbrowser/CDVInAppBrowser.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-network-information/CDVConnection.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-network-information/CDVConnection.h index 8add0279..8add0279 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-network-information/CDVConnection.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-network-information/CDVConnection.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-network-information/CDVConnection.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-network-information/CDVConnection.m index 6715322a..6715322a 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-network-information/CDVConnection.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-network-information/CDVConnection.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-network-information/CDVReachability.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-network-information/CDVReachability.h index 01a95c35..01a95c35 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-network-information/CDVReachability.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-network-information/CDVReachability.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-network-information/CDVReachability.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-network-information/CDVReachability.m index 1399867e..1399867e 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-network-information/CDVReachability.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-network-information/CDVReachability.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.h index ec5d6022..ec5d6022 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m index 8ad8116b..8ad8116b 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVViewController+SplashScreen.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-splashscreen/CDVViewController+SplashScreen.h index a948ea31..a948ea31 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVViewController+SplashScreen.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-splashscreen/CDVViewController+SplashScreen.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVViewController+SplashScreen.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-splashscreen/CDVViewController+SplashScreen.m index e483def6..e483def6 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-splashscreen/CDVViewController+SplashScreen.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-splashscreen/CDVViewController+SplashScreen.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-statusbar/CDVStatusBar.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-statusbar/CDVStatusBar.h index 0be08cc3..0be08cc3 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-statusbar/CDVStatusBar.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-statusbar/CDVStatusBar.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-statusbar/CDVStatusBar.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-statusbar/CDVStatusBar.m index 58fbc296..58fbc296 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-statusbar/CDVStatusBar.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-statusbar/CDVStatusBar.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-x-socialsharing/NSString+URLEncoding.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-x-socialsharing/NSString+URLEncoding.h index d7da331d..d7da331d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-x-socialsharing/NSString+URLEncoding.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-x-socialsharing/NSString+URLEncoding.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-x-socialsharing/NSString+URLEncoding.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-x-socialsharing/NSString+URLEncoding.m index b737626c..b737626c 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-x-socialsharing/NSString+URLEncoding.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-x-socialsharing/NSString+URLEncoding.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h index 0c731450..0c731450 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-x-socialsharing/SocialSharing.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m index 014925bd..014925bd 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/cordova-plugin-x-socialsharing/SocialSharing.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/ionic-plugin-keyboard/IonicKeyboard.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/ionic-plugin-keyboard/IonicKeyboard.h index 63935dc3..63935dc3 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/ionic-plugin-keyboard/IonicKeyboard.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/ionic-plugin-keyboard/IonicKeyboard.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/ionic-plugin-keyboard/IonicKeyboard.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/ionic-plugin-keyboard/IonicKeyboard.m index d072ca7f..d072ca7f 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/ionic-plugin-keyboard/IonicKeyboard.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/ionic-plugin-keyboard/IonicKeyboard.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/AppDelegate+notification.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/phonegap-plugin-push/AppDelegate+notification.h index 9970762b..9970762b 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/AppDelegate+notification.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/phonegap-plugin-push/AppDelegate+notification.h diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/AppDelegate+notification.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/phonegap-plugin-push/AppDelegate+notification.m index fc18dd79..fc18dd79 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/AppDelegate+notification.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/phonegap-plugin-push/AppDelegate+notification.m diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.h b/StoneIsland/platforms/ios/StoneIsland/Plugins/phonegap-plugin-push/PushPlugin.h index 276a0080..4cc1dcb0 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.h +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/phonegap-plugin-push/PushPlugin.h @@ -29,7 +29,7 @@ @protocol GGLInstanceIDDelegate; @protocol GCMReceiverDelegate; -@interface PushPlugin : CDVPlugin<GGLInstanceIDDelegate, GCMReceiverDelegate> +@interface PushPlugin : CDVPlugin { NSDictionary *notificationMessage; BOOL isInline; @@ -68,13 +68,12 @@ - (void)didSendDataMessageWithID:(NSString *)messageID; - (void)didDeleteMessagesOnServer; -// GCM Features -@property(nonatomic, assign) BOOL usesGCM; -@property(nonatomic, strong) NSNumber* gcmSandbox; -@property(nonatomic, strong) NSString *gcmSenderId; -@property(nonatomic, strong) NSDictionary *gcmRegistrationOptions; -@property(nonatomic, strong) void (^gcmRegistrationHandler) (NSString *registrationToken, NSError *error); -@property(nonatomic, strong) NSString *gcmRegistrationToken; -@property(nonatomic, strong) NSArray *gcmTopics; +// FCM Features +@property(nonatomic, assign) BOOL usesFCM; +@property(nonatomic, strong) NSNumber *fcmSandbox; +@property(nonatomic, strong) NSString *fcmSenderId; +@property(nonatomic, strong) NSDictionary *fcmRegistrationOptions; +@property(nonatomic, strong) NSString *fcmRegistrationToken; +@property(nonatomic, strong) NSArray *fcmTopics; @end diff --git a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.m b/StoneIsland/platforms/ios/StoneIsland/Plugins/phonegap-plugin-push/PushPlugin.m index a176b9af..90475d10 100644 --- a/StoneIsland/platforms/ios/Stone Island/Plugins/phonegap-plugin-push/PushPlugin.m +++ b/StoneIsland/platforms/ios/StoneIsland/Plugins/phonegap-plugin-push/PushPlugin.m @@ -27,8 +27,9 @@ #define GMP_NO_MODULES true #import "PushPlugin.h" -#import "GoogleCloudMessaging.h" -#import "GGLInstanceIDHeaders.h" +@import FirebaseInstanceID; +@import FirebaseMessaging; +@import FirebaseAnalytics; @implementation PushPlugin : CDVPlugin @@ -42,78 +43,62 @@ @synthesize clearBadge; @synthesize handlerObj; -@synthesize usesGCM; -@synthesize gcmSandbox; -@synthesize gcmSenderId; -@synthesize gcmRegistrationOptions; -@synthesize gcmRegistrationHandler; -@synthesize gcmRegistrationToken; -@synthesize gcmTopics; +@synthesize usesFCM; +@synthesize fcmSandbox; +@synthesize fcmSenderId; +@synthesize fcmRegistrationOptions; +@synthesize fcmRegistrationToken; +@synthesize fcmTopics; --(void)initGCMRegistrationHandler; +-(void)initRegistration; { - __weak __block PushPlugin *weakSelf = self; - gcmRegistrationHandler = ^(NSString *registrationToken, NSError *error){ - if (registrationToken != nil) { - NSLog(@"GCM Registration Token: %@", registrationToken); - [weakSelf setGcmRegistrationToken: registrationToken]; + NSString * registrationToken = [[FIRInstanceID instanceID] token]; - id topics = [weakSelf gcmTopics]; - if (topics != nil) { - for (NSString *topic in topics) { - NSLog(@"subscribe from topic: %@", topic); - id pubSub = [GCMPubSub sharedInstance]; - [pubSub subscribeWithToken: [weakSelf gcmRegistrationToken] - topic:[NSString stringWithFormat:@"/topics/%@", topic] - options:nil - handler:^void(NSError *error) { - if (error) { - if (error.code == 3001) { - NSLog(@"Already subscribed to %@", topic); - } else { - NSLog(@"Failed to subscribe to topic %@: %@", topic, error); - } - } - else { - NSLog(@"Successfully subscribe to topic %@", topic); - } - }]; - } - } + if (registrationToken != nil) { + NSLog(@"FCM Registration Token: %@", registrationToken); + [self setFcmRegistrationToken: registrationToken]; - [weakSelf registerWithToken:registrationToken]; - } else { - NSLog(@"Registration to GCM failed with error: %@", error.localizedDescription); - [weakSelf failWithMessage:self.callbackId withMsg:@"" withError:error]; + id topics = [self fcmTopics]; + if (topics != nil) { + for (NSString *topic in topics) { + NSLog(@"subscribe to topic: %@", topic); + id pubSub = [FIRMessaging messaging]; + [pubSub subscribeToTopic:topic]; + } } - }; + + [self registerWithToken:registrationToken]; + } else { + NSLog(@"FCM token is null"); + } + } -// GCM refresh token +// FCM refresh token // Unclear how this is testable under normal circumstances - (void)onTokenRefresh { #if !TARGET_IPHONE_SIMULATOR // A rotation of the registration tokens is happening, so the app needs to request a new token. - NSLog(@"The GCM registration token needs to be changed."); - [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:[self gcmSenderId] - scope:kGGLInstanceIDScopeGCM - options:[self gcmRegistrationOptions] - handler:[self gcmRegistrationHandler]]; + NSLog(@"The FCM registration token needs to be changed."); + [[FIRInstanceID instanceID] token]; + [self initRegistration]; #endif } -- (void)willSendDataMessageWithID:(NSString *)messageID error:(NSError *)error { - NSLog(@"willSendDataMessageWithID"); - if (error) { - // Failed to send the message. - } else { - // Will send message, you can save the messageID to track the message - } +// contains error info +- (void)sendDataMessageFailure:(NSNotification *)notification { + NSLog(@"sendDataMessageFailure"); +} +- (void)sendDataMessageSuccess:(NSNotification *)notification { + NSLog(@"sendDataMessageSuccess"); +} + +- (void)didSendDataMessageWithID:messageID { + NSLog(@"didSendDataMessageWithID"); } -- (void)didSendDataMessageWithID:(NSString *)messageID { +- (void)willSendDataMessageWithID:messageID error:error { NSLog(@"willSendDataMessageWithID"); - // Did successfully send message identified by messageID } - (void)didDeleteMessagesOnServer { @@ -128,20 +113,10 @@ NSArray* topics = [command argumentAtIndex:0]; if (topics != nil) { - id pubSub = [GCMPubSub sharedInstance]; + id pubSub = [FIRMessaging messaging]; for (NSString *topic in topics) { NSLog(@"unsubscribe from topic: %@", topic); - [pubSub unsubscribeWithToken: [self gcmRegistrationToken] - topic:[NSString stringWithFormat:@"/topics/%@", topic] - options:nil - handler:^void(NSError *error) { - if (error) { - NSLog(@"Failed to unsubscribe from topic %@: %@", topic, error); - } - else { - NSLog(@"Successfully unsubscribe from topic %@", topic); - } - }]; + [pubSub unsubscribeFromTopic:topic]; } } else { [[UIApplication sharedApplication] unregisterForRemoteNotifications]; @@ -155,25 +130,10 @@ if (topic != nil) { NSLog(@"subscribe from topic: %@", topic); - id pubSub = [GCMPubSub sharedInstance]; - [pubSub subscribeWithToken: [self gcmRegistrationToken] - topic:[NSString stringWithFormat:@"/topics/%@", topic] - options:nil - handler:^void(NSError *error) { - if (error) { - if (error.code == 3001) { - NSLog(@"Already subscribed to %@", topic); - [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Already subscribed to %@", topic]]; - } else { - NSLog(@"Failed to subscribe to topic %@: %@", topic, error); - [self failWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Failed to subscribe to topic %@", topic] withError:error]; - } - } - else { - NSLog(@"Successfully subscribe to topic %@", topic); - [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully subscribe to topic %@", topic]]; - } - }]; + id pubSub = [FIRMessaging messaging]; + [pubSub subscribeToTopic:topic]; + NSLog(@"Successfully subscribe to topic %@", topic); + [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully subscribe to topic %@", topic]]; } else { NSLog(@"There is no topic to subscribe"); [self successWithMessage:command.callbackId withMsg:@"There is no topic to subscribe"]; @@ -186,19 +146,10 @@ if (topic != nil) { NSLog(@"unsubscribe from topic: %@", topic); - id pubSub = [GCMPubSub sharedInstance]; - [pubSub unsubscribeWithToken: [self gcmRegistrationToken] - topic:[NSString stringWithFormat:@"/topics/%@", topic] - options:nil - handler:^void(NSError *error) { - if (error) { - NSLog(@"Failed to unsubscribe to topic %@: %@", topic, error); - [self failWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Failed to unsubscribe to topic %@", topic] withError:error]; - } else { - NSLog(@"Successfully unsubscribe to topic %@", topic); - [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully unsubscribe to topic %@", topic]]; - } - }]; + id pubSub = [FIRMessaging messaging]; + [pubSub unsubscribeFromTopic:topic]; + NSLog(@"Successfully unsubscribe from topic %@", topic); + [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully unsubscribe from topic %@", topic]]; } else { NSLog(@"There is no topic to unsubscribe"); [self successWithMessage:command.callbackId withMsg:@"There is no topic to unsubscribe"]; @@ -207,6 +158,22 @@ - (void)init:(CDVInvokedUrlCommand*)command; { + [[NSNotificationCenter defaultCenter] + addObserver:self selector:@selector(onTokenRefresh) + name:kFIRInstanceIDTokenRefreshNotification object:nil]; + + [[NSNotificationCenter defaultCenter] + addObserver:self selector:@selector(sendDataMessageFailure:) + name:FIRMessagingSendErrorNotification object:nil]; + + [[NSNotificationCenter defaultCenter] + addObserver:self selector:@selector(sendDataMessageSuccess:) + name:FIRMessagingSendSuccessNotification object:nil]; + + [[NSNotificationCenter defaultCenter] + addObserver:self selector:@selector(didDeleteMessagesOnServer) + name:FIRMessagingMessagesDeletedNotification object:nil]; + [self.commandDelegate runInBackground:^ { NSLog(@"Push Plugin register called"); @@ -215,13 +182,10 @@ NSMutableDictionary* options = [command.arguments objectAtIndex:0]; NSMutableDictionary* iosOptions = [options objectForKey:@"ios"]; - NSArray* topics = [iosOptions objectForKey:@"topics"]; - [self setGcmTopics:topics]; + NSArray* topics = [iosOptions objectForKey:@"topics"]; + [self setFcmTopics:topics]; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UIUserNotificationType UserNotificationTypes = UIUserNotificationTypeNone; -#endif - UIRemoteNotificationType notificationTypes = UIRemoteNotificationTypeNone; id badgeArg = [iosOptions objectForKey:@"badge"]; id soundArg = [iosOptions objectForKey:@"sound"]; @@ -230,32 +194,20 @@ if (([badgeArg isKindOfClass:[NSString class]] && [badgeArg isEqualToString:@"true"]) || [badgeArg boolValue]) { - notificationTypes |= UIRemoteNotificationTypeBadge; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeBadge; -#endif } if (([soundArg isKindOfClass:[NSString class]] && [soundArg isEqualToString:@"true"]) || [soundArg boolValue]) { - notificationTypes |= UIRemoteNotificationTypeSound; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeSound; -#endif } if (([alertArg isKindOfClass:[NSString class]] && [alertArg isEqualToString:@"true"]) || [alertArg boolValue]) { - notificationTypes |= UIRemoteNotificationTypeAlert; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeAlert; -#endif } - notificationTypes |= UIRemoteNotificationTypeNewsstandContentAvailability; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationActivationModeBackground; -#endif if (clearBadgeArg == nil || ([clearBadgeArg isKindOfClass:[NSString class]] && [clearBadgeArg isEqualToString:@"false"]) || ![clearBadgeArg boolValue]) { NSLog(@"PushPlugin.register: setting badge to false"); @@ -267,12 +219,8 @@ } NSLog(@"PushPlugin.register: clear badge is set to %d", clearBadge); - if (notificationTypes == UIRemoteNotificationTypeNone) - NSLog(@"PushPlugin.register: Push notification type is set to none"); - isInline = NO; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 NSLog(@"PushPlugin.register: better button setup"); // setup action buttons NSMutableSet *categories = [[NSMutableSet alloc] init]; @@ -329,45 +277,46 @@ } } -#else - NSLog(@"PushPlugin.register: action buttons only supported on iOS8 and above"); -#endif - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 if ([[UIApplication sharedApplication]respondsToSelector:@selector(registerUserNotificationSettings:)]) { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UserNotificationTypes categories:categories]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; [[UIApplication sharedApplication] registerForRemoteNotifications]; - } else { - [[UIApplication sharedApplication] registerForRemoteNotificationTypes: - (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; } -#else - [[UIApplication sharedApplication] registerForRemoteNotificationTypes: - (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; -#endif + + // Read GoogleService-Info.plist + NSString *path = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; + + // Load the file content and read the data into arrays + NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path]; + fcmSenderId = [dict objectForKey:@"GCM_SENDER_ID"]; + BOOL isGcmEnabled = [[dict valueForKey:@"IS_GCM_ENABLED"] boolValue]; + + NSLog(@"FCM Sender ID %@", fcmSenderId); // GCM options - [self setGcmSenderId: [iosOptions objectForKey:@"senderID"]]; - NSLog(@"GCM Sender ID %@", gcmSenderId); - if([[self gcmSenderId] length] > 0) { - NSLog(@"Using GCM Notification"); - [self setUsesGCM: YES]; - [self initGCMRegistrationHandler]; + [self setFcmSenderId: fcmSenderId]; + if(isGcmEnabled && [[self fcmSenderId] length] > 0) { + NSLog(@"Using FCM Notification"); + [self setUsesFCM: YES]; + dispatch_async(dispatch_get_main_queue(), ^{ + if([FIRApp defaultApp] == nil) + [FIRApp configure]; + [self initRegistration]; + }); } else { NSLog(@"Using APNS Notification"); - [self setUsesGCM:NO]; + [self setUsesFCM:NO]; } - id gcmSandBoxArg = [iosOptions objectForKey:@"gcmSandbox"]; + id fcmSandboxArg = [iosOptions objectForKey:@"fcmSandbox"]; - [self setGcmSandbox:@NO]; - if ([self usesGCM] && - (([gcmSandBoxArg isKindOfClass:[NSString class]] && [gcmSandBoxArg isEqualToString:@"true"]) || - [gcmSandBoxArg boolValue])) + [self setFcmSandbox:@NO]; + if ([self usesFCM] && + (([fcmSandboxArg isKindOfClass:[NSString class]] && [fcmSandboxArg isEqualToString:@"true"]) || + [fcmSandboxArg boolValue])) { - NSLog(@"Using GCM Sandbox"); - [self setGcmSandbox:@YES]; + NSLog(@"Using FCM Sandbox"); + [self setFcmSandbox:@YES]; } if (notificationMessage) { // if there is a pending startup notification @@ -422,14 +371,8 @@ [results setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"appVersion"]; // Check what Notifications the user has turned on. We registered for all three, but they may have manually disabled some or all of them. -#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) - NSUInteger rntypes; - if (!SYSTEM_VERSION_LESS_THAN(@"8.0")) { - rntypes = [[[UIApplication sharedApplication] currentUserNotificationSettings] types]; - } else { - rntypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; - } + NSUInteger rntypes = [[[UIApplication sharedApplication] currentUserNotificationSettings] types]; // Set the defaults to disabled unless we find otherwise... NSString *pushBadge = @"disabled"; @@ -440,13 +383,13 @@ // one is actually disabled. So we are literally checking to see if rnTypes matches what is turned on, instead of by number. The "tricky" part is that the // single notification types will only match if they are the ONLY one enabled. Likewise, when we are checking for a pair of notifications, it will only be // true if those two notifications are on. This is why the code is written this way - if(rntypes & UIRemoteNotificationTypeBadge){ + if(rntypes & UIUserNotificationTypeBadge){ pushBadge = @"enabled"; } - if(rntypes & UIRemoteNotificationTypeAlert) { + if(rntypes & UIUserNotificationTypeAlert) { pushAlert = @"enabled"; } - if(rntypes & UIRemoteNotificationTypeSound) { + if(rntypes & UIUserNotificationTypeSound) { pushSound = @"enabled"; } @@ -460,24 +403,7 @@ [results setValue:dev.model forKey:@"deviceModel"]; [results setValue:dev.systemVersion forKey:@"deviceSystemVersion"]; - if([self usesGCM]) { - GGLInstanceIDConfig *instanceIDConfig = [GGLInstanceIDConfig defaultConfig]; - instanceIDConfig.delegate = self; - [[GGLInstanceID sharedInstance] startWithConfig:instanceIDConfig]; - - [self setGcmRegistrationOptions: @{kGGLInstanceIDRegisterAPNSOption:deviceToken, - kGGLInstanceIDAPNSServerTypeSandboxOption:[self gcmSandbox]}]; - - [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:[self gcmSenderId] - scope:kGGLInstanceIDScopeGCM - options:[self gcmRegistrationOptions] - handler:[self gcmRegistrationHandler]]; - - GCMConfig *gcmConfig = [GCMConfig defaultConfig]; - gcmConfig.receiverDelegate = self; - [[GCMService sharedInstance] startWithConfig:gcmConfig]; - - } else { + if(![self usesFCM]) { [self registerWithToken: token]; } #endif @@ -610,31 +536,36 @@ [self.commandDelegate sendPluginResult:commandResult callbackId:command.callbackId]; } --(void)successWithMessage:(NSString *)callbackId withMsg:(NSString *)message +-(void)successWithMessage:(NSString *)myCallbackId withMsg:(NSString *)message { - if (callbackId != nil) + if (myCallbackId != nil) { CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message]; - [self.commandDelegate sendPluginResult:commandResult callbackId:callbackId]; + [self.commandDelegate sendPluginResult:commandResult callbackId:myCallbackId]; } } -(void)registerWithToken:(NSString*)token; { // Send result to trigger 'registration' event but keep callback - NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:1]; + NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:2]; [message setObject:token forKey:@"registrationId"]; + if ([self usesFCM]) { + [message setObject:@"FCM" forKey:@"registrationType"]; + } else { + [message setObject:@"APNS" forKey:@"registrationType"]; + } CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:message]; [pluginResult setKeepCallbackAsBool:YES]; [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; } --(void)failWithMessage:(NSString *)callbackId withMsg:(NSString *)message withError:(NSError *)error +-(void)failWithMessage:(NSString *)myCallbackId withMsg:(NSString *)message withError:(NSError *)error { NSString *errorMessage = (error) ? [NSString stringWithFormat:@"%@ - %@", message, [error localizedDescription]] : message; CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:errorMessage]; - [self.commandDelegate sendPluginResult:commandResult callbackId:callbackId]; + [self.commandDelegate sendPluginResult:commandResult callbackId:myCallbackId]; } -(void) finish:(CDVInvokedUrlCommand*)command diff --git a/StoneIsland/platforms/ios/Stone Island/Resources/CDVNotification.bundle/beep.wav b/StoneIsland/platforms/ios/StoneIsland/Resources/CDVNotification.bundle/beep.wav Binary files differindex 05f5997f..05f5997f 100644 --- a/StoneIsland/platforms/ios/Stone Island/Resources/CDVNotification.bundle/beep.wav +++ b/StoneIsland/platforms/ios/StoneIsland/Resources/CDVNotification.bundle/beep.wav diff --git a/StoneIsland/platforms/ios/Stone Island/Resources/GoogleService-Info.plist b/StoneIsland/platforms/ios/StoneIsland/Resources/Resources/GoogleService-Info.plist index 0d23216d..0d23216d 100644 --- a/StoneIsland/platforms/ios/Stone Island/Resources/GoogleService-Info.plist +++ b/StoneIsland/platforms/ios/StoneIsland/Resources/Resources/GoogleService-Info.plist diff --git a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist b/StoneIsland/platforms/ios/StoneIsland/StoneIsland-Info.plist index 016faa32..8a6a8cb7 100644 --- a/StoneIsland/platforms/ios/Stone Island/Stone Island-Info.plist +++ b/StoneIsland/platforms/ios/StoneIsland/StoneIsland-Info.plist @@ -35,10 +35,6 @@ </array> <key>CFBundleVersion</key> <string>0.9.0</string> - <key>GCM_SENDER_ID</key> - <string>XXXXXXX</string> - <key>IS_GCM_ENABLED</key> - <true/> <key>LSRequiresIPhoneOS</key> <true/> <key>NSAppTransportSecurity</key> @@ -48,12 +44,10 @@ </dict> <key>NSLocationWhenInUseUsageDescription</key> <string/> + <key>NSMainNibFile</key> + <string/> <key>NSMainNibFile~ipad</key> <string/> - <key>UIBackgroundModes</key> - <array> - <string>remote-notification</string> - </array> <key>UIInterfaceOrientation</key> <array> <string>UIInterfaceOrientationPortrait</string> @@ -70,5 +64,9 @@ <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> </array> + <key>UIBackgroundModes</key> + <array> + <string>remote-notification</string> + </array> </dict> </plist>
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/Stone Island/Stone Island-Prefix.pch b/StoneIsland/platforms/ios/StoneIsland/StoneIsland-Prefix.pch index d1b4e1e8..3e592f8f 100644 --- a/StoneIsland/platforms/ios/Stone Island/Stone Island-Prefix.pch +++ b/StoneIsland/platforms/ios/StoneIsland/StoneIsland-Prefix.pch @@ -17,7 +17,7 @@ under the License. */ // -// Prefix header for all source files of the 'Stone Island' target in the 'Stone Island' project +// Prefix header for all source files of the 'StoneIsland' target in the 'StoneIsland' project // #ifdef __OBJC__ diff --git a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/config.xml b/StoneIsland/platforms/ios/StoneIsland/config.xml index 409c6a57..f3d3cf56 100755 --- a/StoneIsland/platforms/ios/Stone Island.xcarchive/Products/Applications/Stone Island.app/config.xml +++ b/StoneIsland/platforms/ios/StoneIsland/config.xml @@ -37,6 +37,10 @@ <param name="ios-package" value="CDVSplashScreen" /> <param name="onload" value="true" /> </feature> + <feature name="StatusBar"> + <param name="ios-package" value="CDVStatusBar" /> + <param name="onload" value="true" /> + </feature> <feature name="SocialSharing"> <param name="ios-package" value="SocialSharing" /> <param name="onload" value="true" /> @@ -47,14 +51,7 @@ <feature name="PushNotification"> <param name="ios-package" value="PushPlugin" /> </feature> - <feature name="UniversalAnalytics"> - <param name="ios-package" value="UniversalAnalyticsPlugin" /> - </feature> - <feature name="StatusBar"> - <param name="ios-package" value="CDVStatusBar" /> - <param name="onload" value="true" /> - </feature> - <name>Stone Island</name> + <name>StoneIsland</name> <description> Stone Island </description> diff --git a/StoneIsland/platforms/ios/Stone Island/main.m b/StoneIsland/platforms/ios/StoneIsland/main.m index 2c0b35c3..c0689058 100644 --- a/StoneIsland/platforms/ios/Stone Island/main.m +++ b/StoneIsland/platforms/ios/StoneIsland/main.m @@ -18,7 +18,7 @@ */ // // main.m -// Stone Island +// StoneIsland // // Created by ___FULLUSERNAME___ on ___DATE___. // Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved. diff --git a/StoneIsland/platforms/ios/cordova/lib/Podfile.js b/StoneIsland/platforms/ios/cordova/lib/Podfile.js index 2cf254cc..084c10c3 100755 --- a/StoneIsland/platforms/ios/cordova/lib/Podfile.js +++ b/StoneIsland/platforms/ios/cordova/lib/Podfile.js @@ -66,7 +66,7 @@ Podfile.prototype.__parseForPods = function(text) { // pod 'Foobar', '1.2' // pod 'Foobar', 'abc 123 1.2' // pod 'PonyDebugger', :configurations => ['Debug', 'Beta'] - var podRE = new RegExp('pod \'(\\w+)\'\\s*,?\\s*(.*)'); + var podRE = new RegExp('pod \'([^\']*)\'\\s*,?\\s*(.*)'); // only grab lines that don't have the pod spec' return arr.filter(function(line) { diff --git a/StoneIsland/platforms/ios/cordova/lib/build.js b/StoneIsland/platforms/ios/cordova/lib/build.js index c40bfe8b..29d808ab 100755 --- a/StoneIsland/platforms/ios/cordova/lib/build.js +++ b/StoneIsland/platforms/ios/cordova/lib/build.js @@ -53,7 +53,33 @@ var buildFlagMatchers = { 'shared_precomps_dir' : /^(SHARED_PRECOMPS_DIR=.*)/ }; +/** + * Returns a promise that resolves to the default simulator target; the logic here + * matches what `cordova emulate ios` does. + * + * The return object has two properties: `name` (the Xcode destination name), + * `identifier` (the simctl identifier), and `simIdentifier` (essentially the cordova emulate target) + * + * @return {Promise} + */ +function getDefaultSimulatorTarget() { + return require('./list-emulator-build-targets').run() + .then(function (emulators) { + var targetEmulator; + if (emulators.length > 0) { + targetEmulator = emulators[0]; + } + emulators.forEach(function (emulator) { + if (emulator.name.indexOf('iPhone') === 0) { + targetEmulator = emulator; + } + }); + return targetEmulator; + }); +} + module.exports.run = function (buildOpts) { + var emulatorTarget = ''; buildOpts = buildOpts || {}; @@ -93,6 +119,22 @@ return require('./list-devices').run() return check_reqs.check_ios_deploy(); } }).then(function () { + // CB-12287: Determine the device we should target when building for a simulator + if (!buildOpts.device) { + var promise; + if (buildOpts.target) { + // a target was given to us, find the matching Xcode destination name + promise = require('./list-emulator-build-targets').targetForSimIdentifier(buildOpts.target); + } else { + // no target provided, pick a default one (matching our emulator logic) + promise = getDefaultSimulatorTarget(); + } + return promise.then(function(theTarget) { + emulatorTarget = theTarget.name; + events.emit('log', 'Building for ' + emulatorTarget + ' Simulator'); + }); + } + }).then(function () { return check_reqs.run(); }).then(function () { return findXCodeProjectIn(projectPath); @@ -120,12 +162,12 @@ return require('./list-devices').run() events.emit('log','\tConfiguration: ' + configuration); events.emit('log','\tPlatform: ' + (buildOpts.device ? 'device' : 'emulator')); - var buildOutputDir = path.join(projectPath, 'build', 'device'); + var buildOutputDir = path.join(projectPath, 'build', (buildOpts.device ? 'device' : 'emulator')); // remove the build/device folder before building return spawn('rm', [ '-rf', buildOutputDir ], projectPath) .then(function() { - var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device, buildOpts.buildFlag); + var xcodebuildArgs = getXcodeBuildArgs(projectName, projectPath, configuration, buildOpts.device, buildOpts.buildFlag, emulatorTarget); return spawn('xcodebuild', xcodebuildArgs, projectPath); }); @@ -165,35 +207,9 @@ return require('./list-devices').run() return spawn('xcodebuild', xcodearchiveArgs, projectPath); } - function unpackIPA() { - var ipafile = path.join(buildOutputDir, projectName + '.ipa'); - - // unpack the existing platform/ios/build/device/appname.ipa (zipfile), will create a Payload folder - return spawn('unzip', [ '-o', '-qq', ipafile ], buildOutputDir); - } - - function moveApp() { - var appFileInflated = path.join(buildOutputDir, 'Payload', projectName + '.app'); - var appFile = path.join(buildOutputDir, projectName + '.app'); - var payloadFolder = path.join(buildOutputDir, 'Payload'); - - // delete the existing platform/ios/build/device/appname.app - return spawn('rm', [ '-rf', appFile ], buildOutputDir) - .then(function() { - // move the platform/ios/build/device/Payload/appname.app to parent - return spawn('mv', [ '-f', appFileInflated, buildOutputDir ], buildOutputDir); - }) - .then(function() { - // delete the platform/ios/build/device/Payload folder - return spawn('rm', [ '-rf', payloadFolder ], buildOutputDir); - }); - } - return Q.nfcall(fs.writeFile, exportOptionsPath, exportOptionsPlist, 'utf-8') .then(checkSystemRuby) - .then(packageArchive) - .then(unpackIPA) - .then(moveApp); + .then(packageArchive); }); }; @@ -224,13 +240,15 @@ module.exports.findXCodeProjectIn = findXCodeProjectIn; /** * Returns array of arguments for xcodebuild - * @param {String} projectName Name of xcode project - * @param {String} projectPath Path to project file. Will be used to set CWD for xcodebuild - * @param {String} configuration Configuration name: debug|release - * @param {Boolean} isDevice Flag that specify target for package (device/emulator) - * @return {Array} Array of arguments that could be passed directly to spawn method + * @param {String} projectName Name of xcode project + * @param {String} projectPath Path to project file. Will be used to set CWD for xcodebuild + * @param {String} configuration Configuration name: debug|release + * @param {Boolean} isDevice Flag that specify target for package (device/emulator) + * @param {Array} buildFlags + * @param {String} emulatorTarget Target for emulator (rather than default) + * @return {Array} Array of arguments that could be passed directly to spawn method */ -function getXcodeBuildArgs(projectName, projectPath, configuration, isDevice, buildFlags) { +function getXcodeBuildArgs(projectName, projectPath, configuration, isDevice, buildFlags, emulatorTarget) { var xcodebuildArgs; var options; var buildActions; @@ -274,7 +292,7 @@ function getXcodeBuildArgs(projectName, projectPath, configuration, isDevice, bu '-scheme', customArgs.scheme || projectName, '-configuration', customArgs.configuration || configuration, '-sdk', customArgs.sdk || 'iphonesimulator', - '-destination', customArgs.destination || 'platform=iOS Simulator,name=iPhone 5s' + '-destination', customArgs.destination || 'platform=iOS Simulator,name=' + emulatorTarget ]; buildActions = [ 'build' ]; settings = [ @@ -341,6 +359,7 @@ module.exports.help = function help() { console.log('Usage: build [--debug | --release] [--archs=\"<list of architectures...>\"]'); console.log(' [--device | --simulator] [--codeSignIdentity=\"<identity>\"]'); console.log(' [--codeSignResourceRules=\"<resourcerules path>\"]'); + console.log(' [--developmentTeam=\"<Team ID>\"]'); console.log(' [--provisioningProfile=\"<provisioning profile>\"]'); console.log(' --help : Displays this dialog.'); console.log(' --debug : Builds project in debug mode. (Default)'); @@ -352,6 +371,8 @@ module.exports.help = function help() { console.log(' : Specifies, what type of project to build'); console.log(' --codeSignIdentity : Type of signing identity used for code signing.'); console.log(' --codeSignResourceRules : Path to ResourceRules.plist.'); + console.log(' --developmentTeam : New for Xcode 8. The development team (Team ID)'); + console.log(' to use for code signing.'); console.log(' --provisioningProfile : UUID of the profile.'); console.log(' --device --noSign : Builds project without application signing.'); console.log(''); diff --git a/StoneIsland/platforms/ios/cordova/lib/list-emulator-build-targets b/StoneIsland/platforms/ios/cordova/lib/list-emulator-build-targets new file mode 100755 index 00000000..d17fc8ca --- /dev/null +++ b/StoneIsland/platforms/ios/cordova/lib/list-emulator-build-targets @@ -0,0 +1,108 @@ +#!/usr/bin/env node + +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ + +/*jshint node: true*/ + +var Q = require('q'), + exec = require('child_process').exec; + +/** + * Returns a list of available simulator build targets of the form + * + * [ + * { name: <xcode-destination-name>, + * identifier: <simctl-identifier>, + * simIdentifier: <cordova emulate target> + * } + * ] + * + */ +function listEmulatorBuildTargets () { + return Q.nfcall(exec, 'xcrun simctl list --json') + .then(function(stdio) { + return JSON.parse(stdio[0]); + }) + .then(function(simInfo) { + var devices = simInfo.devices; + var deviceTypes = simInfo.devicetypes; + return deviceTypes.reduce(function (typeAcc, deviceType) { + if (!deviceType.name.match(/^[iPad|iPhone]/)) { + // ignore targets we don't support (like Apple Watch or Apple TV) + return typeAcc; + } + var availableDevices = Object.keys(devices).reduce(function (availAcc, deviceCategory) { + var availableDevicesInCategory = devices[deviceCategory]; + availableDevicesInCategory.forEach(function (device) { + if (device.name === deviceType.name.replace(/\-inch/g, ' inch') && + device.availability.toLowerCase().indexOf('unavailable') < 0) { + availAcc.push(device); + } + }); + return availAcc; + }, []); + // we only want device types that have at least one available device + // (regardless of OS); this filters things out like iPhone 4s, which + // is present in deviceTypes, but probably not available on the user's + // system. + if (availableDevices.length > 0) { + typeAcc.push(deviceType); + } + return typeAcc; + }, []); + }) + .then(function(filteredTargets) { + // the simIdentifier, or cordova emulate target name, is the very last part + // of identifier. + return filteredTargets.map(function (target) { + var identifierPieces = target.identifier.split("."); + target.simIdentifier = identifierPieces[identifierPieces.length-1]; + return target; + }); + }); +} + +exports.run = listEmulatorBuildTargets; + +/** + * Given a simIdentifier, return the matching target. + * + * @param {string} simIdentifier a target, like "iPhone-SE" + * @return {Object} the matching target, or undefined if no match + */ +exports.targetForSimIdentifier = function(simIdentifier) { + return listEmulatorBuildTargets() + .then(function(targets) { + return targets.reduce(function(acc, target) { + if (!acc && target.simIdentifier.toLowerCase() === simIdentifier.toLowerCase()) { + acc = target; + } + return acc; + }, undefined); + }); +} + +// Check if module is started as separate script. +// If so, then invoke main method and print out results. +if (!module.parent) { + listEmulatorBuildTargets().then(function (targets) { + console.log(JSON.stringify(targets, null, 2)); + }); +} diff --git a/StoneIsland/platforms/ios/cordova/lib/plugman/pluginHandlers.js b/StoneIsland/platforms/ios/cordova/lib/plugman/pluginHandlers.js index 297e3863..416aba96 100755 --- a/StoneIsland/platforms/ios/cordova/lib/plugman/pluginHandlers.js +++ b/StoneIsland/platforms/ios/cordova/lib/plugman/pluginHandlers.js @@ -14,10 +14,11 @@ specific language governing permissions and limitations under the License. */ - +'use strict'; var fs = require('fs'); var path = require('path'); var shell = require('shelljs'); +var util = require('util'); var events = require('cordova-common').events; var CordovaError = require('cordova-common').CordovaError; @@ -48,25 +49,44 @@ var handlers = { 'resource-file':{ install:function(obj, plugin, project, options) { var src = obj.src, - srcFile = path.resolve(plugin.dir, src), - destFile = path.resolve(project.resources_dir, path.basename(src)); - if (!fs.existsSync(srcFile)) throw new CordovaError('Cannot find resource file "' + srcFile + '" for plugin ' + plugin.id + ' in iOS platform'); - if (fs.existsSync(destFile)) throw new CordovaError('File already exists at detination "' + destFile + '" for resource file specified by plugin ' + plugin.id + ' in iOS platform'); - project.xcode.addResourceFile(path.join('Resources', path.basename(src))); + target = obj.target, + srcFile = path.resolve(plugin.dir, src); + + if (!target) { + target = path.basename(src); + } + var destFile = path.resolve(project.resources_dir, target); + + if (!fs.existsSync(srcFile)) { + throw new CordovaError('Cannot find resource file "' + srcFile + '" for plugin ' + plugin.id + ' in iOS platform'); + } + if (fs.existsSync(destFile)) { + throw new CordovaError('File already exists at destination "' + destFile + '" for resource file specified by plugin ' + plugin.id + ' in iOS platform'); + } + project.xcode.addResourceFile(path.join('Resources', target)); var link = !!(options && options.link); copyFile(plugin.dir, src, project.projectDir, destFile, link); }, uninstall:function(obj, plugin, project, options) { var src = obj.src, - destFile = path.resolve(project.resources_dir, path.basename(src)); - project.xcode.removeResourceFile(path.join('Resources', path.basename(src))); + target = obj.target; + + if (!target) { + target = path.basename(src); + } + var destFile = path.resolve(project.resources_dir, target); + + project.xcode.removeResourceFile(path.join('Resources', target)); shell.rm('-rf', destFile); } }, 'framework':{ // CB-5238 custom frameworks only install:function(obj, plugin, project, options) { var src = obj.src, - custom = obj.custom; + custom = !!(obj.custom), // convert to boolean (if truthy/falsy) + embed = !!(obj.embed), // convert to boolean (if truthy/falsy) + link = !embed; // either link or embed can be true, but not both. the other has to be false + if (!custom) { var keepFrameworks = keep_these_frameworks; @@ -76,7 +96,10 @@ var handlers = { } else { project.frameworks[src] = project.frameworks[src] || 0; project.frameworks[src]++; - project.xcode.addFramework(src, {weak: obj.weak}); + let opt = { customFramework: false, embed: false, link: true, weak: obj.weak }; + events.emit('verbose', util.format('Adding non-custom framework to project... %s -> %s', src, JSON.stringify(opt))); + project.xcode.addFramework(src, opt); + events.emit('verbose', util.format('Non-custom framework added to project. %s -> %s', src, JSON.stringify(opt))); } } return; @@ -85,14 +108,20 @@ var handlers = { targetDir = path.resolve(project.plugins_dir, plugin.id, path.basename(src)); if (!fs.existsSync(srcFile)) throw new CordovaError('Cannot find framework "' + srcFile + '" for plugin ' + plugin.id + ' in iOS platform'); if (fs.existsSync(targetDir)) throw new CordovaError('Framework "' + targetDir + '" for plugin ' + plugin.id + ' already exists in iOS platform'); - var link = !!(options && options.link); - copyFile(plugin.dir, src, project.projectDir, targetDir, link); // frameworks are directories + var symlink = !!(options && options.link); + copyFile(plugin.dir, src, project.projectDir, targetDir, symlink); // frameworks are directories // CB-10773 translate back slashes to forward on win32 var project_relative = fixPathSep(path.relative(project.projectDir, targetDir)); - var pbxFile = project.xcode.addFramework(project_relative, {customFramework: true}); - if (pbxFile) { - project.xcode.addToPbxEmbedFrameworksBuildPhase(pbxFile); + // CB-11233 create Embed Frameworks Build Phase if does not exist + var existsEmbedFrameworks = project.xcode.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Frameworks'); + if (!existsEmbedFrameworks && embed) { + events.emit('verbose', '"Embed Frameworks" Build Phase (Embedded Binaries) does not exist, creating it.'); + project.xcode.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Embed Frameworks', null, 'frameworks'); } + let opt = { customFramework: true, embed: embed, link: link, sign: true }; + events.emit('verbose', util.format('Adding custom framework to project... %s -> %s', src, JSON.stringify(opt))); + project.xcode.addFramework(project_relative, opt); + events.emit('verbose', util.format('Custom framework added to project. %s -> %s', src, JSON.stringify(opt))); }, uninstall:function(obj, plugin, project, options) { var src = obj.src; @@ -304,7 +333,7 @@ function copyFile (plugin_dir, src, project_dir, dest, link) { shell.mkdir('-p', path.dirname(dest)); if (link) { - symlinkFileOrDirTree(src, dest); + linkFileOrDirTree(src, dest); } else if (fs.statSync(src).isDirectory()) { // XXX shelljs decides to create a directory when -R|-r is used which sucks. http://goo.gl/nbsjq shell.cp('-Rf', path.join(src, '/*'), dest); @@ -322,7 +351,7 @@ function copyNewFile (plugin_dir, src, project_dir, dest, link) { copyFile(plugin_dir, src, project_dir, dest, !!link); } -function symlinkFileOrDirTree(src, dest) { +function linkFileOrDirTree(src, dest) { if (fs.existsSync(dest)) { shell.rm('-Rf', dest); } @@ -330,11 +359,11 @@ function symlinkFileOrDirTree(src, dest) { if (fs.statSync(src).isDirectory()) { shell.mkdir('-p', dest); fs.readdirSync(src).forEach(function(entry) { - symlinkFileOrDirTree(path.join(src, entry), path.join(dest, entry)); + linkFileOrDirTree(path.join(src, entry), path.join(dest, entry)); }); } else { - fs.symlinkSync(path.relative(fs.realpathSync(path.dirname(dest)), src), dest); + fs.linkSync(src, dest); } } diff --git a/StoneIsland/platforms/ios/cordova/lib/prepare.js b/StoneIsland/platforms/ios/cordova/lib/prepare.js index d8f52ac9..c02c187f 100755 --- a/StoneIsland/platforms/ios/cordova/lib/prepare.js +++ b/StoneIsland/platforms/ios/cordova/lib/prepare.js @@ -17,6 +17,7 @@ under the License. */ +'use strict'; var Q = require('q'); var fs = require('fs'); var path = require('path'); @@ -33,6 +34,7 @@ var PlatformJson = require('cordova-common').PlatformJson; var PlatformMunger = require('cordova-common').ConfigChanges.PlatformMunger; var PluginInfoProvider = require('cordova-common').PluginInfoProvider; var FileUpdater = require('cordova-common').FileUpdater; +var projectFile = require('./projectFile'); // launch storyboard and related constants var LAUNCHIMAGE_BUILD_SETTING = 'ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME'; @@ -62,6 +64,7 @@ module.exports.prepare = function (cordovaProject, options) { updateIcons(cordovaProject, self.locations); updateSplashScreens(cordovaProject, self.locations); updateLaunchStoryboardImages(cordovaProject, self.locations); + updateFileResources(cordovaProject, self.locations); }) .then(function () { events.emit('verbose', 'Prepared iOS project successfully'); @@ -88,6 +91,7 @@ module.exports.clean = function (options) { cleanIcons(projectRoot, projectConfig, self.locations); cleanSplashScreens(projectRoot, projectConfig, self.locations); cleanLaunchStoryboardImages(projectRoot, projectConfig, self.locations); + cleanFileResources(projectRoot, projectConfig, self.locations); }); }; @@ -452,6 +456,75 @@ function cleanSplashScreens(projectRoot, projectConfig, locations) { } } +function updateFileResources(cordovaProject, locations) { + const platformDir = path.relative(cordovaProject.root, locations.root); + const files = cordovaProject.projectConfig.getFileResources('ios'); + + const project = projectFile.parse(locations); + + // if there are resource-file elements in config.xml + if (files.length === 0) { + events.emit('verbose', 'This app does not have additional resource files defined'); + return; + } + + let resourceMap = {}; + files.forEach(function(res) { + let src = res.src, + target = res.target; + + if (!target) { + target = src; + } + + let targetPath = path.join(project.resources_dir, target); + targetPath = path.relative(cordovaProject.root, targetPath); + + const resfile = path.join('Resources', path.relative(project.resources_dir, targetPath)); + project.xcode.addResourceFile(resfile); + + resourceMap[targetPath] = src; + }); + + events.emit('verbose', 'Updating resource files at ' + platformDir); + FileUpdater.updatePaths( + resourceMap, { rootDir: cordovaProject.root }, logFileOp); + + project.write(); +} + +function cleanFileResources(projectRoot, projectConfig, locations) { + const platformDir = path.relative(projectRoot, locations.root); + const files = projectConfig.getFileResources('ios'); + if (files.length > 0) { + events.emit('verbose', 'Cleaning resource files at ' + platformDir); + + const project = projectFile.parse(locations); + + var resourceMap = {}; + files.forEach(function(res) { + let src = res.src, + target = res.target; + + if (!target) { + target = src; + } + + let targetPath = path.join(project.resources_dir, target); + targetPath = path.relative(projectRoot, targetPath); + const resfile = path.join('Resources', path.basename(targetPath)); + project.xcode.removeResourceFile(resfile); + + resourceMap[targetPath] = null; + }); + + FileUpdater.updatePaths( + resourceMap, { rootDir: projectRoot, all: true}, logFileOp); + + project.write(); + } +} + /** * Returns an array of images for each possible idiom, scale, and size class. The images themselves are * located in the platform's splash images by their pattern (@scale~idiom~sizesize). All possible diff --git a/StoneIsland/platforms/ios/cordova/lib/run.js b/StoneIsland/platforms/ios/cordova/lib/run.js index 68c315a5..0caadf06 100755 --- a/StoneIsland/platforms/ios/cordova/lib/run.js +++ b/StoneIsland/platforms/ios/cordova/lib/run.js @@ -69,10 +69,37 @@ module.exports.run = function (runOptions) { return build.findXCodeProjectIn(projectPath); }).then(function (projectName) { var appPath = path.join(projectPath, 'build', 'emulator', projectName + '.app'); + var buildOutputDir = path.join(projectPath, 'build', 'device'); + // select command to run and arguments depending whether // we're running on device/emulator if (useDevice) { - return checkDeviceConnected().then(function () { + return checkDeviceConnected() + .then(function() { + // Unpack IPA + var ipafile = path.join(buildOutputDir, projectName + '.ipa'); + + // unpack the existing platform/ios/build/device/appname.ipa (zipfile), will create a Payload folder + return spawn('unzip', [ '-o', '-qq', ipafile ], buildOutputDir); + }) + .then(function() { + // Uncompress IPA (zip file) + var appFileInflated = path.join(buildOutputDir, 'Payload', projectName + '.app'); + var appFile = path.join(buildOutputDir, projectName + '.app'); + var payloadFolder = path.join(buildOutputDir, 'Payload'); + + // delete the existing platform/ios/build/device/appname.app + return spawn('rm', [ '-rf', appFile ], buildOutputDir) + .then(function() { + // move the platform/ios/build/device/Payload/appname.app to parent + return spawn('mv', [ '-f', appFileInflated, buildOutputDir ], buildOutputDir); + }) + .then(function() { + // delete the platform/ios/build/device/Payload folder + return spawn('rm', [ '-rf', payloadFolder ], buildOutputDir); + }); + }) + .then(function() { appPath = path.join(projectPath, 'build', 'device', projectName + '.app'); var extraArgs = []; if (runOptions.argv) { diff --git a/StoneIsland/platforms/ios/cordova/node_modules/nopt/package.json b/StoneIsland/platforms/ios/cordova/node_modules/nopt/package.json index 727d271a..6d6a39a7 100755 --- a/StoneIsland/platforms/ios/cordova/node_modules/nopt/package.json +++ b/StoneIsland/platforms/ios/cordova/node_modules/nopt/package.json @@ -15,8 +15,9 @@ ], "_from": "nopt@>=3.0.6 <4.0.0", "_id": "nopt@3.0.6", + "_inBundle": true, "_inCache": true, - "_location": "/nopt", + "_location": "/cordova-ios/nopt", "_nodeVersion": "4.2.1", "_npmUser": { "name": "othiym23", @@ -34,7 +35,7 @@ "type": "range" }, "_requiredBy": [ - "/" + "/cordova-ios" ], "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9", @@ -84,7 +85,6 @@ ], "name": "nopt", "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/npm/nopt.git" diff --git a/StoneIsland/platforms/ios/cordova/node_modules/q/package.json b/StoneIsland/platforms/ios/cordova/node_modules/q/package.json index f17a9377..49ad3b60 100755 --- a/StoneIsland/platforms/ios/cordova/node_modules/q/package.json +++ b/StoneIsland/platforms/ios/cordova/node_modules/q/package.json @@ -15,8 +15,9 @@ ], "_from": "q@>=1.4.1 <2.0.0", "_id": "q@1.4.1", + "_inBundle": true, "_inCache": true, - "_location": "/q", + "_location": "/cordova-ios/q", "_nodeVersion": "1.8.1", "_npmUser": { "name": "kriskowal", @@ -34,8 +35,8 @@ "type": "range" }, "_requiredBy": [ - "/", - "/cordova-common" + "/cordova-ios", + "/cordova-ios/cordova-common" ], "_resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", "_shasum": "55705bcd93c5f3673530c2c2cbc0c2b3addc286e", @@ -136,7 +137,6 @@ } } }, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/kriskowal/q.git" diff --git a/StoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json b/StoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json index fd830f8e..43438d32 100755 --- a/StoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json +++ b/StoneIsland/platforms/ios/cordova/node_modules/shelljs/package.json @@ -15,8 +15,9 @@ ], "_from": "shelljs@>=0.5.3 <0.6.0", "_id": "shelljs@0.5.3", + "_inBundle": true, "_inCache": true, - "_location": "/shelljs", + "_location": "/cordova-ios/shelljs", "_nodeVersion": "1.2.0", "_npmUser": { "name": "artur", @@ -34,8 +35,8 @@ "type": "range" }, "_requiredBy": [ - "/", - "/cordova-common" + "/cordova-ios", + "/cordova-ios/cordova-common" ], "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", "_shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", @@ -85,7 +86,6 @@ ], "name": "shelljs", "optionalDependencies": {}, - "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/arturadib/shelljs.git" diff --git a/StoneIsland/platforms/ios/cordova/version b/StoneIsland/platforms/ios/cordova/version index 9f3eb479..7b7d0c06 100755 --- a/StoneIsland/platforms/ios/cordova/version +++ b/StoneIsland/platforms/ios/cordova/version @@ -26,7 +26,7 @@ */ // Coho updates this line -var VERSION="4.3.1"; +var VERSION="4.4.0"; module.exports.version = VERSION; diff --git a/StoneIsland/platforms/ios/frameworks.json b/StoneIsland/platforms/ios/frameworks.json index 6cb97880..c60636db 100644 --- a/StoneIsland/platforms/ios/frameworks.json +++ b/StoneIsland/platforms/ios/frameworks.json @@ -1,11 +1,8 @@ { "AudioToolbox.framework": 1, "CoreLocation.framework": 1, - "Social.framework": 1, "SystemConfiguration.framework": 1, "CoreTelephony.framework": 1, - "MessageUI.framework": 1, - "AddressBook.framework": 1, - "libsqlite3.tbd": 1, - "libz.tbd": 1 + "Social.framework": 1, + "MessageUI.framework": 1 }
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/ios.json b/StoneIsland/platforms/ios/ios.json index 2db25e88..047f4cc2 100644 --- a/StoneIsland/platforms/ios/ios.json +++ b/StoneIsland/platforms/ios/ios.json @@ -5,6 +5,42 @@ }, "config_munge": { "files": { + "*-Info.plist": { + "parents": { + "CFBundleName": [ + { + "xml": "<string>Stone Island</string>", + "count": 1 + } + ], + "CFBundleDisplayName": [ + { + "xml": "<string>Stone Island</string>", + "count": 1 + } + ], + "CFBundleURLTypes": [ + { + "xml": "<array><dict><key>CFBundleURLSchemes</key><array><string>stoneisland</string></array></dict></array>", + "count": 1 + } + ], + "NSLocationWhenInUseUsageDescription": [ + { + "xml": "<string />", + "count": 1 + } + ], + "UIBackgroundModes": [ + { + "xml": "<array><string>remote-notification</string></array>", + "count": 1 + } + ], + "GCM_SENDER_ID": [], + "IS_GCM_ENABLED": [] + } + }, "config.xml": { "parents": { "/*": [ @@ -37,18 +73,6 @@ "count": 1 }, { - "xml": "<feature name=\"SocialSharing\"><param name=\"ios-package\" value=\"SocialSharing\" /><param name=\"onload\" value=\"true\" /></feature>", - "count": 1 - }, - { - "xml": "<feature name=\"Keyboard\"><param name=\"ios-package\" onload=\"true\" value=\"IonicKeyboard\" /></feature>", - "count": 1 - }, - { - "xml": "<feature name=\"PushNotification\"><param name=\"ios-package\" value=\"PushPlugin\" /></feature>", - "count": 1 - }, - { "xml": "<feature name=\"StatusBar\"><param name=\"ios-package\" value=\"CDVStatusBar\" /><param name=\"onload\" value=\"true\" /></feature>", "count": 1 }, @@ -61,79 +85,31 @@ "count": 1 }, { - "xml": "<feature name=\"FirebasePlugin\"><param name=\"ios-package\" value=\"FirebasePlugin\" /><param name=\"onload\" value=\"true\" /></feature>", - "count": 1 - } - ] - } - }, - "*-Info.plist": { - "parents": { - "CFBundleURLTypes": [ - { - "xml": "<array><dict><key>CFBundleURLSchemes</key><array><string>stoneisland</string></array></dict></array>", - "count": 1 - } - ], - "NSLocationWhenInUseUsageDescription": [ - { - "xml": "<string />", - "count": 1 - } - ], - "UIBackgroundModes": [ - { - "xml": "<array><string>remote-notification</string></array>", - "count": 1 - } - ], - "GCM_SENDER_ID": [ - { - "xml": "<string>XXXXXXX</string>", - "count": 1 - } - ], - "IS_GCM_ENABLED": [ - { - "xml": "<true />", + "xml": "<feature name=\"SocialSharing\"><param name=\"ios-package\" value=\"SocialSharing\" /><param name=\"onload\" value=\"true\" /></feature>", "count": 1 - } - ], - "CFBundleName": [ + }, { - "xml": "<string>Stone Island</string>", + "xml": "<feature name=\"Keyboard\"><param name=\"ios-package\" onload=\"true\" value=\"IonicKeyboard\" /></feature>", "count": 1 - } - ], - "CFBundleDisplayName": [ + }, { - "xml": "<string>Stone Island</string>", + "xml": "<feature name=\"PushNotification\"><param name=\"ios-package\" value=\"PushPlugin\" /></feature>", "count": 1 } ] } }, - "*-Debug.plist": { + "*/Entitlements-Debug.plist": { "parents": { - "aps-environment": [ - { - "xml": "<string>development</string>", - "count": 1 - } - ] + "aps-environment": [] } }, - "*-Release.plist": { + "*/Entitlements-Release.plist": { "parents": { - "aps-environment": [ - { - "xml": "<string>production</string>", - "count": 1 - } - ] + "aps-environment": [] } }, - "*/Entitlements-Debug.plist": { + "*-Debug.plist": { "parents": { "aps-environment": [ { @@ -143,7 +119,7 @@ ] } }, - "*/Entitlements-Release.plist": { + "*-Release.plist": { "parents": { "aps-environment": [ { @@ -156,6 +132,10 @@ } }, "installed_plugins": { + "cordova-plugin-app-name": { + "APP_NAME": "Stone Island", + "PACKAGE_NAME": "us.okfoc.stoneisland" + }, "cordova-plugin-compat": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, @@ -184,6 +164,9 @@ "cordova-plugin-splashscreen": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, + "cordova-plugin-statusbar": { + "PACKAGE_NAME": "us.okfoc.stoneisland" + }, "cordova-plugin-whitelist": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, @@ -194,17 +177,6 @@ "PACKAGE_NAME": "us.okfoc.stoneisland" }, "phonegap-plugin-push": { - "SENDER_ID": "XXXXXXX", - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, - "cordova-plugin-statusbar": { - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, - "cordova-plugin-firebase": { - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, - "cordova-plugin-app-name": { - "APP_NAME": "Stone Island", "PACKAGE_NAME": "us.okfoc.stoneisland" } }, @@ -317,6 +289,14 @@ ] }, { + "id": "cordova-plugin-statusbar.statusbar", + "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", + "pluginId": "cordova-plugin-statusbar", + "clobbers": [ + "window.StatusBar" + ] + }, + { "id": "cordova-plugin-x-socialsharing.SocialSharing", "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js", "pluginId": "cordova-plugin-x-socialsharing", @@ -340,25 +320,10 @@ "clobbers": [ "PushNotification" ] - }, - { - "id": "cordova-plugin-statusbar.statusbar", - "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", - "pluginId": "cordova-plugin-statusbar", - "clobbers": [ - "window.StatusBar" - ] - }, - { - "id": "cordova-plugin-firebase.FirebasePlugin", - "file": "plugins/cordova-plugin-firebase/www/firebase.js", - "pluginId": "cordova-plugin-firebase", - "clobbers": [ - "FirebasePlugin" - ] } ], "plugin_metadata": { + "cordova-plugin-app-name": "1.0.4", "cordova-plugin-compat": "1.1.0", "cordova-plugin-console": "1.0.4", "cordova-plugin-customurlscheme": "4.2.0", @@ -368,12 +333,10 @@ "cordova-plugin-inappbrowser": "1.5.0", "cordova-plugin-network-information": "1.3.0", "cordova-plugin-splashscreen": "4.0.0", + "cordova-plugin-statusbar": "2.2.3", "cordova-plugin-whitelist": "1.3.0", "cordova-plugin-x-socialsharing": "5.1.3", "ionic-plugin-keyboard": "2.2.1", - "phonegap-plugin-push": "1.9.2", - "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24", - "cordova-plugin-app-name": "1.0.4" + "phonegap-plugin-push": "2.0.0" } }
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/platform_www/cordova.js b/StoneIsland/platforms/ios/platform_www/cordova.js index 29be9099..3540a020 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova.js +++ b/StoneIsland/platforms/ios/platform_www/cordova.js @@ -1,5 +1,5 @@ // Platform: ios -// a3732cb71d9b1dd590338e8cf44196f366d46da3 +// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '4.3.1'; +var PLATFORM_VERSION_BUILD_LABEL = '4.4.0'; // file: src/scripts/require.js /*jshint -W079 */ diff --git a/StoneIsland/platforms/ios/platform_www/cordova_plugins.js b/StoneIsland/platforms/ios/platform_www/cordova_plugins.js index 9005406d..5d4c04be 100644 --- a/StoneIsland/platforms/ios/platform_www/cordova_plugins.js +++ b/StoneIsland/platforms/ios/platform_www/cordova_plugins.js @@ -107,6 +107,14 @@ module.exports = [ ] }, { + "id": "cordova-plugin-statusbar.statusbar", + "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", + "pluginId": "cordova-plugin-statusbar", + "clobbers": [ + "window.StatusBar" + ] + }, + { "id": "cordova-plugin-x-socialsharing.SocialSharing", "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js", "pluginId": "cordova-plugin-x-socialsharing", @@ -130,27 +138,12 @@ module.exports = [ "clobbers": [ "PushNotification" ] - }, - { - "id": "cordova-plugin-statusbar.statusbar", - "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", - "pluginId": "cordova-plugin-statusbar", - "clobbers": [ - "window.StatusBar" - ] - }, - { - "id": "cordova-plugin-firebase.FirebasePlugin", - "file": "plugins/cordova-plugin-firebase/www/firebase.js", - "pluginId": "cordova-plugin-firebase", - "clobbers": [ - "FirebasePlugin" - ] } ]; module.exports.metadata = // TOP OF METADATA { + "cordova-plugin-app-name": "1.0.4", "cordova-plugin-compat": "1.1.0", "cordova-plugin-console": "1.0.4", "cordova-plugin-customurlscheme": "4.2.0", @@ -160,13 +153,11 @@ module.exports.metadata = "cordova-plugin-inappbrowser": "1.5.0", "cordova-plugin-network-information": "1.3.0", "cordova-plugin-splashscreen": "4.0.0", + "cordova-plugin-statusbar": "2.2.3", "cordova-plugin-whitelist": "1.3.0", "cordova-plugin-x-socialsharing": "5.1.3", "ionic-plugin-keyboard": "2.2.1", - "phonegap-plugin-push": "1.9.2", - "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24", - "cordova-plugin-app-name": "1.0.4" + "phonegap-plugin-push": "2.0.0" }; // BOTTOM OF METADATA });
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-firebase/www/firebase.js b/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-firebase/www/firebase.js deleted file mode 100644 index e1e423d1..00000000 --- a/StoneIsland/platforms/ios/platform_www/plugins/cordova-plugin-firebase/www/firebase.js +++ /dev/null @@ -1,124 +0,0 @@ -cordova.define("cordova-plugin-firebase.FirebasePlugin", function(require, exports, module) { -var exec = require('cordova/exec'); - -exports.getInstanceId = function(success, error) { - exec(success, error, "FirebasePlugin", "getInstanceId", []); -}; - -exports.getToken = function(success, error) { - exec(success, error, "FirebasePlugin", "getToken", []); -}; - -exports.onNotificationOpen = function(success, error) { - exec(success, error, "FirebasePlugin", "onNotificationOpen", []); -}; - -exports.onTokenRefresh = function(success, error) { - exec(success, error, "FirebasePlugin", "onTokenRefresh", []); -}; - -exports.grantPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "grantPermission", []); -}; - -exports.hasPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "hasPermission", []); -}; - -exports.setBadgeNumber = function(number, success, error) { - exec(success, error, "FirebasePlugin", "setBadgeNumber", [number]); -}; - -exports.getBadgeNumber = function(success, error) { - exec(success, error, "FirebasePlugin", "getBadgeNumber", []); -}; - -exports.subscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "subscribe", [topic]); -}; - -exports.unsubscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "unsubscribe", [topic]); -}; - -exports.unregister = function(success, error) { - exec(success, error, "FirebasePlugin", "unregister", []); -}; - -exports.logEvent = function(name, params, success, error) { - exec(success, error, "FirebasePlugin", "logEvent", [name, params]); -}; - -exports.logError = function(message, success, error) { - exec(success, error, "FirebasePlugin", "logError", [message]); -}; - -exports.setScreenName = function(name, success, error) { - exec(success, error, "FirebasePlugin", "setScreenName", [name]); -}; - -exports.setUserId = function(id, success, error) { - exec(success, error, "FirebasePlugin", "setUserId", [id]); -}; - -exports.setUserProperty = function(name, value, success, error) { - exec(success, error, "FirebasePlugin", "setUserProperty", [name, value]); -}; - -exports.activateFetched = function (success, error) { - exec(success, error, "FirebasePlugin", "activateFetched", []); -}; - -exports.fetch = function (cacheExpirationSeconds, success, error) { - var args = []; - if (typeof cacheExpirationSeconds === 'number') { - args.push(cacheExpirationSeconds); - } else { - error = success; - success = cacheExpirationSeconds; - } - exec(success, error, "FirebasePlugin", "fetch", args); -}; - -exports.getByteArray = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getByteArray", args); -}; - -exports.getValue = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getValue", args); -}; - -exports.getInfo = function (success, error) { - exec(success, error, "FirebasePlugin", "getInfo", []); -}; - -exports.setConfigSettings = function (settings, success, error) { - exec(success, error, "FirebasePlugin", "setConfigSettings", [settings]); -}; - -exports.setDefaults = function (defaults, namespace, success, error) { - var args = [defaults]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "setDefaults", args); -}; - -}); diff --git a/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-push/www/push.js index a5315486..7234d474 100644 --- a/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-push/www/push.js +++ b/StoneIsland/platforms/ios/platform_www/plugins/phonegap-plugin-push/www/push.js @@ -1,4 +1,16 @@ cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { +/** +* This file has been generated by Babel. +* +* DO NOT EDIT IT DIRECTLY +* +* Edit the JS source file src/js/push.js +**/'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + /* global cordova:false */ /* globals window */ @@ -8,322 +20,358 @@ cordova.define("phonegap-plugin-push.PushNotification", function(require, export var exec = cordova.require('cordova/exec'); -/** - * PushNotification constructor. - * - * @param {Object} options to initiate Push Notifications. - * @return {PushNotification} instance that can be monitored and cancelled. - */ +var PushNotification = function () { + /** + * PushNotification constructor. + * + * @param {Object} options to initiate Push Notifications. + * @return {PushNotification} instance that can be monitored and cancelled. + */ + function PushNotification(options) { + var _this = this; + + _classCallCheck(this, PushNotification); -var PushNotification = function(options) { - this._handlers = { - 'registration': [], - 'notification': [], - 'error': [] + this.handlers = { + registration: [], + notification: [], + error: [] }; // require options parameter if (typeof options === 'undefined') { - throw new Error('The options argument is required.'); + throw new Error('The options argument is required.'); } // store the options to this object instance this.options = options; // triggered on registration and notification - var that = this; - var success = function(result) { - if (result && typeof result.registrationId !== 'undefined') { - that.emit('registration', result); - } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { - var executeFuctionOrEmitEventByName = function(callbackName, context, arg) { - var namespaces = callbackName.split('.'); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } + var success = function success(result) { + if (result && typeof result.registrationId !== 'undefined') { + _this.emit('registration', result); + } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { + var executeFuctionOrEmitEventByName = function executeFuctionOrEmitEventByName(functionName, context) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } - if (typeof context[func] === 'function') { - context[func].call(context, arg); - } else { - that.emit(callbackName, arg); - } - }; + var namespaces = functionName.split('.'); + var func = namespaces.pop(); + for (var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } - executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); - } else if (result) { - that.emit('notification', result); - } + if (typeof context[func] === 'function') { + context[func].call(context, args); + } else { + _this.emit(functionName, args); + } + }; + + executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); + } else if (result) { + _this.emit('notification', result); + } }; // triggered on error - var fail = function(msg) { - var e = (typeof msg === 'string') ? new Error(msg) : msg; - that.emit('error', e); + var fail = function fail(msg) { + var e = typeof msg === 'string' ? new Error(msg) : msg; + _this.emit('error', e); }; // wait at least one process tick to allow event subscriptions - setTimeout(function() { - exec(success, fail, 'PushNotification', 'init', [options]); + setTimeout(function () { + exec(success, fail, 'PushNotification', 'init', [options]); }, 10); -}; + } + + /** + * Unregister from push notifications + */ -/** - * Unregister from push notifications - */ -PushNotification.prototype.unregister = function(successCallback, errorCallback, options) { - if (!errorCallback) { errorCallback = function() {}; } + _createClass(PushNotification, [{ + key: 'unregister', + value: function unregister(successCallback) { + var _this2 = this; - if (typeof errorCallback !== 'function') { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var options = arguments[2]; + + if (typeof errorCallback !== 'function') { console.log('PushNotification.unregister failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unregister failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unregister failure: success callback parameter ' + ' must be a function'); return; - } + } - var that = this; - var cleanHandlersAndPassThrough = function() { + var cleanHandlersAndPassThrough = function cleanHandlersAndPassThrough() { if (!options) { - that._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; + _this2.handlers = { + registration: [], + notification: [], + error: [] + }; } successCallback(); - }; + }; - exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); -}; + exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); + } -/** - * subscribe to a topic - * @param {String} topic topic to subscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.subscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + /** + * subscribe to a topic + * @param {String} topic topic to subscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + + }, { + key: 'subscribe', + value: function subscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.subscribe failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.subscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'success callback parameter must be a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); } - exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); -}; + /** + * unsubscribe to a topic + * @param {String} topic topic to unsubscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ -/** - * unsubscribe to a topic - * @param {String} topic topic to unsubscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.unsubscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'unsubscribe', + value: function unsubscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('PushNotification.unsubscribe failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: ' + 'success callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); + } -/** - * Call this to set the application icon badge - */ + /** + * Call this to set the application icon badge + */ -PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'setApplicationIconBadgeNumber', + value: function setApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var badge = arguments[2]; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{badge: badge}]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{ badge: badge }]); + } -/** - * Get the application icon badge - */ + /** + * Get the application icon badge + */ -PushNotification.prototype.getApplicationIconBadgeNumber = function(successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'getApplicationIconBadgeNumber', + value: function getApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); -}; + exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); + } -/** - * Get the application icon badge - */ + /** + * Clear all notifications + */ -PushNotification.prototype.clearAllNotifications = function(successCallback, errorCallback) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'clearAllNotifications', + value: function clearAllNotifications() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: failure parameter ' + 'not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: success callback ' + 'parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); -}; - -/** - * Listen for an event. - * - * Any event is supported, but the following are built-in: - * - * - registration - * - notification - * - error - * - * @param {String} eventName to subscribe to. - * @param {Function} callback triggered on the event. - */ + exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); + } + /** + * Listen for an event. + * + * The following events are supported: + * + * - registration + * - notification + * - error + * + * @param {String} eventName to subscribe to. + * @param {Function} callback triggered on the event. + */ -PushNotification.prototype.on = function(eventName, callback) { - if (!this._handlers.hasOwnProperty(eventName)) { - this._handlers[eventName] = []; + }, { + key: 'on', + value: function on(eventName, callback) { + if (!this.handlers.hasOwnProperty(eventName)) { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(callback); } - this._handlers[eventName].push(callback); -}; -/** - * Remove event listener. - * - * @param {String} eventName to match subscription. - * @param {Function} handle function associated with event. - */ + /** + * Remove event listener. + * + * @param {String} eventName to match subscription. + * @param {Function} handle function associated with event. + */ -PushNotification.prototype.off = function (eventName, handle) { - if (this._handlers.hasOwnProperty(eventName)) { - var handleIndex = this._handlers[eventName].indexOf(handle); + }, { + key: 'off', + value: function off(eventName, handle) { + if (this.handlers.hasOwnProperty(eventName)) { + var handleIndex = this.handlers[eventName].indexOf(handle); if (handleIndex >= 0) { - this._handlers[eventName].splice(handleIndex, 1); + this.handlers[eventName].splice(handleIndex, 1); } + } } -}; -/** - * Emit an event. - * - * This is intended for internal use only. - * - * @param {String} eventName is the event to trigger. - * @param {*} all arguments are passed to the event listeners. - * - * @return {Boolean} is true when the event is triggered otherwise false. - */ + /** + * Emit an event. + * + * This is intended for internal use only. + * + * @param {String} eventName is the event to trigger. + * @param {*} all arguments are passed to the event listeners. + * + * @return {Boolean} is true when the event is triggered otherwise false. + */ -PushNotification.prototype.emit = function() { - var args = Array.prototype.slice.call(arguments); - var eventName = args.shift(); + }, { + key: 'emit', + value: function emit() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - if (!this._handlers.hasOwnProperty(eventName)) { + var eventName = args.shift(); + + if (!this.handlers.hasOwnProperty(eventName)) { return false; - } + } - for (var i = 0, length = this._handlers[eventName].length; i < length; i++) { - var callback = this._handlers[eventName][i]; + for (var i = 0, length = this.handlers[eventName].length; i < length; i++) { + var callback = this.handlers[eventName][i]; if (typeof callback === 'function') { - callback.apply(undefined,args); + callback.apply(undefined, args); } else { - console.log('event handler: ' + eventName + ' must be a function'); + console.log('event handler: ' + eventName + ' must be a function'); } - } + } - return true; -}; - -PushNotification.prototype.finish = function(successCallback, errorCallback, id) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - if (!id) { id = 'handler'; } + return true; + } + }, { + key: 'finish', + value: function finish() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'handler'; - if (typeof successCallback !== 'function') { + if (typeof successCallback !== 'function') { console.log('finish failure: success callback parameter must be a function'); return; - } + } - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('finish failure: failure parameter not a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); } + }]); - exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); -}; + return PushNotification; +}(); /*! * Push Notification Plugin. */ module.exports = { - /** - * Register for Push Notifications. - * - * This method will instantiate a new copy of the PushNotification object - * and start the registration process. - * - * @param {Object} options - * @return {PushNotification} instance - */ - - init: function(options) { - return new PushNotification(options); - }, + /** + * Register for Push Notifications. + * + * This method will instantiate a new copy of the PushNotification object + * and start the registration process. + * + * @param {Object} options + * @return {PushNotification} instance + */ - hasPermission: function(successCallback, errorCallback) { - exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); - }, + init: function init(options) { + return new PushNotification(options); + }, - /** - * PushNotification Object. - * - * Expose the PushNotification object for direct use - * and testing. Typically, you should use the - * .init helper method. - */ + hasPermission: function hasPermission(successCallback, errorCallback) { + exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); + }, - PushNotification: PushNotification + /** + * PushNotification Object. + * + * Expose the PushNotification object for direct use + * and testing. Typically, you should use the + * .init helper method. + */ + PushNotification: PushNotification }; - }); diff --git a/StoneIsland/platforms/ios/pods-debug.xcconfig b/StoneIsland/platforms/ios/pods-debug.xcconfig index 26ab303d..da523c74 100644 --- a/StoneIsland/platforms/ios/pods-debug.xcconfig +++ b/StoneIsland/platforms/ios/pods-debug.xcconfig @@ -1,2 +1,2 @@ // DO NOT MODIFY -- auto-generated by Apache Cordova -#include "Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island.debug.xcconfig"
\ No newline at end of file +#include "Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland.debug.xcconfig"
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/pods-release.xcconfig b/StoneIsland/platforms/ios/pods-release.xcconfig index 454bd453..b7edfeb8 100644 --- a/StoneIsland/platforms/ios/pods-release.xcconfig +++ b/StoneIsland/platforms/ios/pods-release.xcconfig @@ -1,2 +1,2 @@ // DO NOT MODIFY -- auto-generated by Apache Cordova -#include "Pods/Target Support Files/Pods-Stone Island/Pods-Stone Island.release.xcconfig"
\ No newline at end of file +#include "Pods/Target Support Files/Pods-StoneIsland/Pods-StoneIsland.release.xcconfig"
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/pods.json b/StoneIsland/platforms/ios/pods.json index 7c0157c5..4fe84812 100644 --- a/StoneIsland/platforms/ios/pods.json +++ b/StoneIsland/platforms/ios/pods.json @@ -1,14 +1,8 @@ { - "GoogleCloudMessaging": { - "name": "GoogleCloudMessaging", + "FirebaseMessaging": { + "name": "FirebaseMessaging", "type": "podspec", - "spec": "~> 1.2.0", - "count": 1 - }, - "GGLInstanceID": { - "name": "GGLInstanceID", - "type": "podspec", - "spec": "~> 1.2.1", + "spec": "~> 2.0.0", "count": 1 } }
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/cordova.js b/StoneIsland/platforms/ios/www/cordova.js index 29be9099..3540a020 100644 --- a/StoneIsland/platforms/ios/www/cordova.js +++ b/StoneIsland/platforms/ios/www/cordova.js @@ -1,5 +1,5 @@ // Platform: ios -// a3732cb71d9b1dd590338e8cf44196f366d46da3 +// 7c5fcc5a5adfbf3fb8ceaf36fbdd4bd970bd9c20 /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ under the License. */ ;(function() { -var PLATFORM_VERSION_BUILD_LABEL = '4.3.1'; +var PLATFORM_VERSION_BUILD_LABEL = '4.4.0'; // file: src/scripts/require.js /*jshint -W079 */ diff --git a/StoneIsland/platforms/ios/www/cordova_plugins.js b/StoneIsland/platforms/ios/www/cordova_plugins.js index 9005406d..5d4c04be 100644 --- a/StoneIsland/platforms/ios/www/cordova_plugins.js +++ b/StoneIsland/platforms/ios/www/cordova_plugins.js @@ -107,6 +107,14 @@ module.exports = [ ] }, { + "id": "cordova-plugin-statusbar.statusbar", + "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", + "pluginId": "cordova-plugin-statusbar", + "clobbers": [ + "window.StatusBar" + ] + }, + { "id": "cordova-plugin-x-socialsharing.SocialSharing", "file": "plugins/cordova-plugin-x-socialsharing/www/SocialSharing.js", "pluginId": "cordova-plugin-x-socialsharing", @@ -130,27 +138,12 @@ module.exports = [ "clobbers": [ "PushNotification" ] - }, - { - "id": "cordova-plugin-statusbar.statusbar", - "file": "plugins/cordova-plugin-statusbar/www/statusbar.js", - "pluginId": "cordova-plugin-statusbar", - "clobbers": [ - "window.StatusBar" - ] - }, - { - "id": "cordova-plugin-firebase.FirebasePlugin", - "file": "plugins/cordova-plugin-firebase/www/firebase.js", - "pluginId": "cordova-plugin-firebase", - "clobbers": [ - "FirebasePlugin" - ] } ]; module.exports.metadata = // TOP OF METADATA { + "cordova-plugin-app-name": "1.0.4", "cordova-plugin-compat": "1.1.0", "cordova-plugin-console": "1.0.4", "cordova-plugin-customurlscheme": "4.2.0", @@ -160,13 +153,11 @@ module.exports.metadata = "cordova-plugin-inappbrowser": "1.5.0", "cordova-plugin-network-information": "1.3.0", "cordova-plugin-splashscreen": "4.0.0", + "cordova-plugin-statusbar": "2.2.3", "cordova-plugin-whitelist": "1.3.0", "cordova-plugin-x-socialsharing": "5.1.3", "ionic-plugin-keyboard": "2.2.1", - "phonegap-plugin-push": "1.9.2", - "cordova-plugin-statusbar": "2.2.3", - "cordova-plugin-firebase": "0.1.24", - "cordova-plugin-app-name": "1.0.4" + "phonegap-plugin-push": "2.0.0" }; // BOTTOM OF METADATA });
\ No newline at end of file diff --git a/StoneIsland/platforms/ios/www/js/lib/_router.js b/StoneIsland/platforms/ios/www/js/lib/_router.js index 43438854..19bd3247 100755 --- a/StoneIsland/platforms/ios/www/js/lib/_router.js +++ b/StoneIsland/platforms/ios/www/js/lib/_router.js @@ -88,7 +88,7 @@ var SiteRouter = Router.extend({ app.view = app[name] } - window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) + // window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) app.header.set_back( !! app.view.back ) app.view.show() diff --git a/StoneIsland/platforms/ios/www/js/lib/etc/push.js b/StoneIsland/platforms/ios/www/js/lib/etc/push.js index 00a2e839..f3f3132e 100755 --- a/StoneIsland/platforms/ios/www/js/lib/etc/push.js +++ b/StoneIsland/platforms/ios/www/js/lib/etc/push.js @@ -7,7 +7,7 @@ var push = (function(){ push.disabled = true return } - + pushPlugin = PushNotification.init({ ios: { alert: true, @@ -130,9 +130,10 @@ var push = (function(){ if (push_obj.additionalData.foreground === false) { // TODO: route the user to the uri in push_obj pushPlugin.finish(function(){}, function(){}) - } - else if (push_obj.additionalData.url) { - app.router.go(push_obj.additionalData.url) + + if (push_obj.additionalData.url) { + app.router.go(push_obj.additionalData.url) + } } else if (is_hub) { app.router.go("hub") diff --git a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js index 2743946a..6972b436 100755 --- a/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js +++ b/StoneIsland/platforms/ios/www/js/lib/products/ProductView.js @@ -167,7 +167,7 @@ var ProductView = ScrollableView.extend({ this.$price.html(price) this.$body.html(body) - window.FirebasePlugin && window.FirebasePlugin.setScreenName('product:' + code) + // window.FirebasePlugin && window.FirebasePlugin.setScreenName('product:' + code) this.$productHeader.toggleClass("wide", title.length > 48) diff --git a/StoneIsland/platforms/ios/www/plugins/cordova-plugin-firebase/www/firebase.js b/StoneIsland/platforms/ios/www/plugins/cordova-plugin-firebase/www/firebase.js deleted file mode 100644 index e1e423d1..00000000 --- a/StoneIsland/platforms/ios/www/plugins/cordova-plugin-firebase/www/firebase.js +++ /dev/null @@ -1,124 +0,0 @@ -cordova.define("cordova-plugin-firebase.FirebasePlugin", function(require, exports, module) { -var exec = require('cordova/exec'); - -exports.getInstanceId = function(success, error) { - exec(success, error, "FirebasePlugin", "getInstanceId", []); -}; - -exports.getToken = function(success, error) { - exec(success, error, "FirebasePlugin", "getToken", []); -}; - -exports.onNotificationOpen = function(success, error) { - exec(success, error, "FirebasePlugin", "onNotificationOpen", []); -}; - -exports.onTokenRefresh = function(success, error) { - exec(success, error, "FirebasePlugin", "onTokenRefresh", []); -}; - -exports.grantPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "grantPermission", []); -}; - -exports.hasPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "hasPermission", []); -}; - -exports.setBadgeNumber = function(number, success, error) { - exec(success, error, "FirebasePlugin", "setBadgeNumber", [number]); -}; - -exports.getBadgeNumber = function(success, error) { - exec(success, error, "FirebasePlugin", "getBadgeNumber", []); -}; - -exports.subscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "subscribe", [topic]); -}; - -exports.unsubscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "unsubscribe", [topic]); -}; - -exports.unregister = function(success, error) { - exec(success, error, "FirebasePlugin", "unregister", []); -}; - -exports.logEvent = function(name, params, success, error) { - exec(success, error, "FirebasePlugin", "logEvent", [name, params]); -}; - -exports.logError = function(message, success, error) { - exec(success, error, "FirebasePlugin", "logError", [message]); -}; - -exports.setScreenName = function(name, success, error) { - exec(success, error, "FirebasePlugin", "setScreenName", [name]); -}; - -exports.setUserId = function(id, success, error) { - exec(success, error, "FirebasePlugin", "setUserId", [id]); -}; - -exports.setUserProperty = function(name, value, success, error) { - exec(success, error, "FirebasePlugin", "setUserProperty", [name, value]); -}; - -exports.activateFetched = function (success, error) { - exec(success, error, "FirebasePlugin", "activateFetched", []); -}; - -exports.fetch = function (cacheExpirationSeconds, success, error) { - var args = []; - if (typeof cacheExpirationSeconds === 'number') { - args.push(cacheExpirationSeconds); - } else { - error = success; - success = cacheExpirationSeconds; - } - exec(success, error, "FirebasePlugin", "fetch", args); -}; - -exports.getByteArray = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getByteArray", args); -}; - -exports.getValue = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getValue", args); -}; - -exports.getInfo = function (success, error) { - exec(success, error, "FirebasePlugin", "getInfo", []); -}; - -exports.setConfigSettings = function (settings, success, error) { - exec(success, error, "FirebasePlugin", "setConfigSettings", [settings]); -}; - -exports.setDefaults = function (defaults, namespace, success, error) { - var args = [defaults]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "setDefaults", args); -}; - -}); diff --git a/StoneIsland/platforms/ios/www/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/platforms/ios/www/plugins/phonegap-plugin-push/www/push.js index a5315486..7234d474 100644 --- a/StoneIsland/platforms/ios/www/plugins/phonegap-plugin-push/www/push.js +++ b/StoneIsland/platforms/ios/www/plugins/phonegap-plugin-push/www/push.js @@ -1,4 +1,16 @@ cordova.define("phonegap-plugin-push.PushNotification", function(require, exports, module) { +/** +* This file has been generated by Babel. +* +* DO NOT EDIT IT DIRECTLY +* +* Edit the JS source file src/js/push.js +**/'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + /* global cordova:false */ /* globals window */ @@ -8,322 +20,358 @@ cordova.define("phonegap-plugin-push.PushNotification", function(require, export var exec = cordova.require('cordova/exec'); -/** - * PushNotification constructor. - * - * @param {Object} options to initiate Push Notifications. - * @return {PushNotification} instance that can be monitored and cancelled. - */ +var PushNotification = function () { + /** + * PushNotification constructor. + * + * @param {Object} options to initiate Push Notifications. + * @return {PushNotification} instance that can be monitored and cancelled. + */ + function PushNotification(options) { + var _this = this; + + _classCallCheck(this, PushNotification); -var PushNotification = function(options) { - this._handlers = { - 'registration': [], - 'notification': [], - 'error': [] + this.handlers = { + registration: [], + notification: [], + error: [] }; // require options parameter if (typeof options === 'undefined') { - throw new Error('The options argument is required.'); + throw new Error('The options argument is required.'); } // store the options to this object instance this.options = options; // triggered on registration and notification - var that = this; - var success = function(result) { - if (result && typeof result.registrationId !== 'undefined') { - that.emit('registration', result); - } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { - var executeFuctionOrEmitEventByName = function(callbackName, context, arg) { - var namespaces = callbackName.split('.'); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } + var success = function success(result) { + if (result && typeof result.registrationId !== 'undefined') { + _this.emit('registration', result); + } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { + var executeFuctionOrEmitEventByName = function executeFuctionOrEmitEventByName(functionName, context) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } - if (typeof context[func] === 'function') { - context[func].call(context, arg); - } else { - that.emit(callbackName, arg); - } - }; + var namespaces = functionName.split('.'); + var func = namespaces.pop(); + for (var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } - executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); - } else if (result) { - that.emit('notification', result); - } + if (typeof context[func] === 'function') { + context[func].call(context, args); + } else { + _this.emit(functionName, args); + } + }; + + executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); + } else if (result) { + _this.emit('notification', result); + } }; // triggered on error - var fail = function(msg) { - var e = (typeof msg === 'string') ? new Error(msg) : msg; - that.emit('error', e); + var fail = function fail(msg) { + var e = typeof msg === 'string' ? new Error(msg) : msg; + _this.emit('error', e); }; // wait at least one process tick to allow event subscriptions - setTimeout(function() { - exec(success, fail, 'PushNotification', 'init', [options]); + setTimeout(function () { + exec(success, fail, 'PushNotification', 'init', [options]); }, 10); -}; + } + + /** + * Unregister from push notifications + */ -/** - * Unregister from push notifications - */ -PushNotification.prototype.unregister = function(successCallback, errorCallback, options) { - if (!errorCallback) { errorCallback = function() {}; } + _createClass(PushNotification, [{ + key: 'unregister', + value: function unregister(successCallback) { + var _this2 = this; - if (typeof errorCallback !== 'function') { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var options = arguments[2]; + + if (typeof errorCallback !== 'function') { console.log('PushNotification.unregister failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unregister failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unregister failure: success callback parameter ' + ' must be a function'); return; - } + } - var that = this; - var cleanHandlersAndPassThrough = function() { + var cleanHandlersAndPassThrough = function cleanHandlersAndPassThrough() { if (!options) { - that._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; + _this2.handlers = { + registration: [], + notification: [], + error: [] + }; } successCallback(); - }; + }; - exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); -}; + exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); + } -/** - * subscribe to a topic - * @param {String} topic topic to subscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.subscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + /** + * subscribe to a topic + * @param {String} topic topic to subscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + + }, { + key: 'subscribe', + value: function subscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.subscribe failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.subscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'success callback parameter must be a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); } - exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); -}; + /** + * unsubscribe to a topic + * @param {String} topic topic to unsubscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ -/** - * unsubscribe to a topic - * @param {String} topic topic to unsubscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.unsubscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'unsubscribe', + value: function unsubscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('PushNotification.unsubscribe failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: ' + 'success callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); + } -/** - * Call this to set the application icon badge - */ + /** + * Call this to set the application icon badge + */ -PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'setApplicationIconBadgeNumber', + value: function setApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var badge = arguments[2]; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{badge: badge}]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{ badge: badge }]); + } -/** - * Get the application icon badge - */ + /** + * Get the application icon badge + */ -PushNotification.prototype.getApplicationIconBadgeNumber = function(successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'getApplicationIconBadgeNumber', + value: function getApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); -}; + exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); + } -/** - * Get the application icon badge - */ + /** + * Clear all notifications + */ -PushNotification.prototype.clearAllNotifications = function(successCallback, errorCallback) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'clearAllNotifications', + value: function clearAllNotifications() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: failure parameter ' + 'not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: success callback ' + 'parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); -}; - -/** - * Listen for an event. - * - * Any event is supported, but the following are built-in: - * - * - registration - * - notification - * - error - * - * @param {String} eventName to subscribe to. - * @param {Function} callback triggered on the event. - */ + exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); + } + /** + * Listen for an event. + * + * The following events are supported: + * + * - registration + * - notification + * - error + * + * @param {String} eventName to subscribe to. + * @param {Function} callback triggered on the event. + */ -PushNotification.prototype.on = function(eventName, callback) { - if (!this._handlers.hasOwnProperty(eventName)) { - this._handlers[eventName] = []; + }, { + key: 'on', + value: function on(eventName, callback) { + if (!this.handlers.hasOwnProperty(eventName)) { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(callback); } - this._handlers[eventName].push(callback); -}; -/** - * Remove event listener. - * - * @param {String} eventName to match subscription. - * @param {Function} handle function associated with event. - */ + /** + * Remove event listener. + * + * @param {String} eventName to match subscription. + * @param {Function} handle function associated with event. + */ -PushNotification.prototype.off = function (eventName, handle) { - if (this._handlers.hasOwnProperty(eventName)) { - var handleIndex = this._handlers[eventName].indexOf(handle); + }, { + key: 'off', + value: function off(eventName, handle) { + if (this.handlers.hasOwnProperty(eventName)) { + var handleIndex = this.handlers[eventName].indexOf(handle); if (handleIndex >= 0) { - this._handlers[eventName].splice(handleIndex, 1); + this.handlers[eventName].splice(handleIndex, 1); } + } } -}; -/** - * Emit an event. - * - * This is intended for internal use only. - * - * @param {String} eventName is the event to trigger. - * @param {*} all arguments are passed to the event listeners. - * - * @return {Boolean} is true when the event is triggered otherwise false. - */ + /** + * Emit an event. + * + * This is intended for internal use only. + * + * @param {String} eventName is the event to trigger. + * @param {*} all arguments are passed to the event listeners. + * + * @return {Boolean} is true when the event is triggered otherwise false. + */ -PushNotification.prototype.emit = function() { - var args = Array.prototype.slice.call(arguments); - var eventName = args.shift(); + }, { + key: 'emit', + value: function emit() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - if (!this._handlers.hasOwnProperty(eventName)) { + var eventName = args.shift(); + + if (!this.handlers.hasOwnProperty(eventName)) { return false; - } + } - for (var i = 0, length = this._handlers[eventName].length; i < length; i++) { - var callback = this._handlers[eventName][i]; + for (var i = 0, length = this.handlers[eventName].length; i < length; i++) { + var callback = this.handlers[eventName][i]; if (typeof callback === 'function') { - callback.apply(undefined,args); + callback.apply(undefined, args); } else { - console.log('event handler: ' + eventName + ' must be a function'); + console.log('event handler: ' + eventName + ' must be a function'); } - } + } - return true; -}; - -PushNotification.prototype.finish = function(successCallback, errorCallback, id) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - if (!id) { id = 'handler'; } + return true; + } + }, { + key: 'finish', + value: function finish() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'handler'; - if (typeof successCallback !== 'function') { + if (typeof successCallback !== 'function') { console.log('finish failure: success callback parameter must be a function'); return; - } + } - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('finish failure: failure parameter not a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); } + }]); - exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); -}; + return PushNotification; +}(); /*! * Push Notification Plugin. */ module.exports = { - /** - * Register for Push Notifications. - * - * This method will instantiate a new copy of the PushNotification object - * and start the registration process. - * - * @param {Object} options - * @return {PushNotification} instance - */ - - init: function(options) { - return new PushNotification(options); - }, + /** + * Register for Push Notifications. + * + * This method will instantiate a new copy of the PushNotification object + * and start the registration process. + * + * @param {Object} options + * @return {PushNotification} instance + */ - hasPermission: function(successCallback, errorCallback) { - exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); - }, + init: function init(options) { + return new PushNotification(options); + }, - /** - * PushNotification Object. - * - * Expose the PushNotification object for direct use - * and testing. Typically, you should use the - * .init helper method. - */ + hasPermission: function hasPermission(successCallback, errorCallback) { + exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); + }, - PushNotification: PushNotification + /** + * PushNotification Object. + * + * Expose the PushNotification object for direct use + * and testing. Typically, you should use the + * .init helper method. + */ + PushNotification: PushNotification }; - }); diff --git a/StoneIsland/platforms/platforms.json b/StoneIsland/platforms/platforms.json index b67069be..32ab0905 100755 --- a/StoneIsland/platforms/platforms.json +++ b/StoneIsland/platforms/platforms.json @@ -1,3 +1,4 @@ { - "android": "6.1.2" + "android": "6.2.3", + "ios": "4.4.0" }
\ No newline at end of file diff --git a/StoneIsland/plugins/android.json b/StoneIsland/plugins/android.json index 6ad5cf91..c72d0395 100755 --- a/StoneIsland/plugins/android.json +++ b/StoneIsland/plugins/android.json @@ -44,19 +44,15 @@ "ionic-plugin-keyboard": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, - "phonegap-plugin-push": { - "SENDER_ID": "XXXXXXX", - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, "cordova-plugin-statusbar": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, - "cordova-plugin-firebase": { - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, "cordova-plugin-app-name": { "APP_NAME": "Stone Island", "PACKAGE_NAME": "us.okfoc.stoneisland" + }, + "phonegap-plugin-push": { + "PACKAGE_NAME": "us.okfoc.stoneisland" } }, "dependent_plugins": { diff --git a/StoneIsland/plugins/cordova-plugin-firebase/LICENSE b/StoneIsland/plugins/cordova-plugin-firebase/LICENSE deleted file mode 100644 index 4a12e4dc..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Robert Arnesson AB - -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: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -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. diff --git a/StoneIsland/plugins/cordova-plugin-firebase/README.md b/StoneIsland/plugins/cordova-plugin-firebase/README.md deleted file mode 100644 index 2fed7ef5..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/README.md +++ /dev/null @@ -1,342 +0,0 @@ -# cordova-plugin-firebase -This plugin brings push notifications, analytics, event tracking, crash reporting and more from Google Firebase to your Cordova project! -Android and iOS supported. - -Donations are welcome and will go towards further development of this project. Use the wallet address below to donate. - -BTC: 1JuXhHMCPHXT2fDfSRUTef9TpE2D67sc9f - -Thank you for your support! - -## Installation -See npm package for versions - https://www.npmjs.com/package/cordova-plugin-firebase - -Install the plugin by adding it your project's config.xml: -``` -<plugin name="cordova-plugin-firebase" spec="0.1.24" /> -``` -or by running: -``` -cordova plugin add cordova-plugin-firebase@0.1.24 --save -``` -Download your Firebase configuration files, GoogleService-Info.plist for ios and google-services.json for android, and place them in the root folder of your cordova project: - -``` -- My Project/ - platforms/ - plugins/ - www/ - config.xml - google-services.json <-- - GoogleService-Info.plist <-- - ... -``` - -See https://support.google.com/firebase/answer/7015592 for details how to download the files from firebase. - -This plugin uses a hook (after prepare) that copies the configuration files to the right place, namely platforms/ios/\<My Project\>/Resources for ios and platforms/android for android. - -**Note that the Firebase SDK requires the configuration files to be present and valid, otherwise your app will crash on boot or Firebase features won't work.** - -## Changing Notification Icon -The plugin will use notification_icon from drawable resources if it exists, otherwise the default app icon will is used. -To set a big icon and small icon for notifications, define them through drawable nodes. -Create the required styles.xml files and add the icons to the -`<projectroot>/res/native/android/res/<drawable-DPI>` folders. - -The example below uses a png named "ic_silhouette.png", the app Icon (@mipmap/icon) and sets a base theme. -From android version 21 (Lollipop) notifications were changed, needing a seperate setting. -If you only target Lollipop and above, you don't need to setup both. -Thankfully using the version dependant asset selections, we can make one build/apk supporting all target platforms. -`<projectroot>/res/native/android/res/values/styles.xml` -``` -<?xml version="1.0" encoding="utf-8" ?> -<resources> - <!-- inherit from the holo theme --> - <style name="AppTheme" parent="android:Theme.Light"> - <item name="android:windowDisablePreview">true</item> - </style> - <drawable name="notification_big">@mipmap/icon</drawable> - <drawable name="notification_icon">@mipmap/icon</drawable> -</resources> -``` -and -`<projectroot>/res/native/android/res/values-v21/styles.xml` -``` -<?xml version="1.0" encoding="utf-8" ?> -<resources> - <!-- inherit from the material theme --> - <style name="AppTheme" parent="android:Theme.Material"> - <item name="android:windowDisablePreview">true</item> - </style> - <drawable name="notification_big">@mipmap/icon</drawable> - <drawable name="notification_icon">@drawable/ic_silhouette</drawable> -</resources> -``` - -## Notification Colors - -On Android Lollipop and above you can also set the accent color for the notification by adding a color setting. - -`<projectroot>/res/native/android/res/values/colors.xml` -``` -<?xml version="1.0" encoding="utf-8"?> -<resources> - <color name="primary">#FFFFFF00</color> - <color name="primary_dark">#FF220022</color> - <color name="accent">#FF00FFFF</color> -</resources> -``` - - -### Notes about PhoneGap Build - -Hooks does not work with PhoneGap Build. This means you will have to manually make sure the configuration files are included. One way to do that is to make a private fork of this plugin and replace the placeholder config files (see src/ios and src/android) with your actual ones, as well as hard coding your app id and api key in plugin.xml. - - -## Methods - -### getToken - -Get the device token (id): -``` -window.FirebasePlugin.getToken(function(token) { - // save this server-side and use it to push notifications to this device - console.log(token); -}, function(error) { - console.error(error); -}); -``` -Note that token will be null if it has not been established yet - -### onTokenRefresh - -Register for token changes: -``` -window.FirebasePlugin.onTokenRefresh(function(token) { - // save this server-side and use it to push notifications to this device - console.log(token); -}, function(error) { - console.error(error); -}); -``` -This is the best way to get a valid token for the device as soon as the token is established - -### onNotificationOpen - -Register notification callback: -``` -window.FirebasePlugin.onNotificationOpen(function(notification) { - console.log(notification); -}, function(error) { - console.error(error); -}); -``` -Notification flow: - -1. App is in foreground: - 1. User receives the notification data in the JavaScript callback without any notification on the device itself (this is the normal behaviour of push notifications, it is up to you, the developer, to notify the user) -2. App is in background: - 1. User receives the notification message in its device notification bar - 2. User taps the notification and the app opens - 3. User receives the notification data in the JavaScript callback - -Notification icon on Android: - -[Changing notification icon](#changing-notification-icon) - -### grantPermission (iOS only) - -Grant permission to recieve push notifications (will trigger prompt): -``` -window.FirebasePlugin.grantPermission(); -``` -### hasPermission - -Check permission to recieve push notifications: -``` -window.FirebasePlugin.hasPermission(function(data){ - console.log(data.isEnabled); -}); -``` - -### setBadgeNumber - -Set a number on the icon badge: -``` -window.FirebasePlugin.setBadgeNumber(3); -``` - -Set 0 to clear the badge -``` -window.FirebasePlugin.setBadgeNumber(0); -``` - -### getBadgeNumber - -Get icon badge number: -``` -window.FirebasePlugin.getBadgeNumber(function(n) { - console.log(n); -}); -``` - -### subscribe - -Subscribe to a topic: -``` -window.FirebasePlugin.subscribe("example"); -``` - -### unsubscribe - -Unsubscribe from a topic: -``` -window.FirebasePlugin.unsubscribe("example"); -``` - -### unregister - -Unregister from firebase, used to stop receiving push notifications. Call this when you logout user from your app. : -``` -window.FirebasePlugin.unregister(); -``` - -### logEvent - -Log an event using Analytics: -``` -window.FirebasePlugin.logEvent("select_content", {content_type: "page_view", item_id: "home"}); -``` - -### setScreenName - -Set the name of the current screen in Analytics: -``` -window.FirebasePlugin.setScreenName("Home"); -``` - -### setUserId - -Set a user id for use in Analytics: -``` -window.FirebasePlugin.setUserId("user_id"); -``` - -### setUserProperty - -Set a user property for use in Analytics: -``` -window.FirebasePlugin.setUserProperty("name", "value"); -``` - -### fetch - -Fetch Remote Config parameter values for your app: -``` -window.FirebasePlugin.fetch(); -// or, specify the cacheExpirationSeconds -window.FirebasePlugin.fetch(600); -``` - -### activateFetched - -Activate the Remote Config fetched config: -``` -window.FirebasePlugin.activateFetched(function(activated) { - // activated will be true if there was a fetched config activated, - // or false if no fetched config was found, or the fetched config was already activated. - console.log(activated); -}, function(error) { - console.error(error); -}); -``` - -### getValue - -Retrieve a Remote Config value: -``` -window.FirebasePlugin.getValue("key", function(value) { - console.log(value); -}, function(error) { - console.error(error); -}); -// or, specify a namespace for the config value -window.FirebasePlugin.getValue("key", "namespace", function(value) { - console.log(value); -}, function(error) { - console.error(error); -}); -``` - -### getByteArray (Android only) -**NOTE: byte array is only available for SDK 19+** -Retrieve a Remote Config byte array: -``` -window.FirebasePlugin.getByteArray("key", function(bytes) { - // a Base64 encoded string that represents the value for "key" - console.log(bytes.base64); - // a numeric array containing the values of the byte array (i.e. [0xFF, 0x00]) - console.log(bytes.array); -}, function(error) { - console.error(error); -}); -// or, specify a namespace for the byte array -window.FirebasePlugin.getByteArray("key", "namespace", function(bytes) { - // a Base64 encoded string that represents the value for "key" - console.log(bytes.base64); - // a numeric array containing the values of the byte array (i.e. [0xFF, 0x00]) - console.log(bytes.array); -}, function(error) { - console.error(error); -}); -``` - -### getInfo (Android only) - -Get the current state of the FirebaseRemoteConfig singleton object: -``` -window.FirebasePlugin.getInfo(function(info) { - // the status of the developer mode setting (true/false) - console.log(info.configSettings.developerModeEnabled); - // the timestamp (milliseconds since epoch) of the last successful fetch - console.log(info.fetchTimeMillis); - // the status of the most recent fetch attempt (int) - console.log(info.lastFetchStatus); -}, function(error) { - console.error(error); -}); -``` - -### setConfigSettings (Android only) - -Change the settings for the FirebaseRemoteConfig object's operations: -``` -var settings = { - developerModeEnabled: true -} -window.FirebasePlugin.setConfigSettings(settings); -``` - -### setDefaults (Android only) - -Set defaults in the Remote Config: -``` -// define defaults -var defaults = { - // map property name to value in Remote Config defaults - mLong: 1000, - mString: 'hello world', - mDouble: 3.14, - mBoolean: true, - // map "mBase64" to a Remote Config byte array represented by a Base64 string - // Note: the Base64 string is in an array in order to differentiate from a string config value - mBase64: ["SGVsbG8gV29ybGQ="], - // map "mBytes" to a Remote Config byte array represented by a numeric array - mBytes: [0xFF, 0x00] -} -// set defaults -window.FirebasePlugin.setDefaults(defaults); -// or, specify a namespace -window.FirebasePlugin.setDefaults(defaults, "namespace"); -``` diff --git a/StoneIsland/plugins/cordova-plugin-firebase/package.json b/StoneIsland/plugins/cordova-plugin-firebase/package.json deleted file mode 100644 index 90b5d164..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "_from": "cordova-plugin-firebase", - "_id": "cordova-plugin-firebase@0.1.24", - "_inBundle": false, - "_integrity": "sha1-qZk6XHZxFQJM2IIJDuiBT6TvuYQ=", - "_location": "/cordova-plugin-firebase", - "_phantomChildren": {}, - "_requested": { - "type": "tag", - "registry": true, - "raw": "cordova-plugin-firebase", - "name": "cordova-plugin-firebase", - "escapedName": "cordova-plugin-firebase", - "rawSpec": "", - "saveSpec": null, - "fetchSpec": "latest" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/cordova-plugin-firebase/-/cordova-plugin-firebase-0.1.24.tgz", - "_shasum": "a9993a5c767115024cd882090ee8814fa4efb984", - "_spec": "cordova-plugin-firebase", - "_where": "/Users/user/Sites/stone-island/StoneIsland/node_modules", - "author": { - "name": "Robert Arnesson" - }, - "bugs": { - "url": "https://github.com/arnesson/cordova-plugin-firebase/issues" - }, - "bundleDependencies": false, - "cordova": { - "id": "cordova-plugin-firebase", - "platforms": [ - "android", - "ios", - "browser" - ] - }, - "deprecated": false, - "description": "Cordova plugin for Google Firebase", - "homepage": "https://github.com/arnesson/cordova-plugin-firebase#readme", - "keywords": [ - "ecosystem:cordova", - "cordova-android", - "cordova-ios", - "cordova-browser", - "firebase", - "push", - "notifications" - ], - "license": "MIT", - "name": "cordova-plugin-firebase", - "repository": { - "type": "git", - "url": "git+https://github.com/arnesson/cordova-plugin-firebase.git" - }, - "version": "0.1.24" -} diff --git a/StoneIsland/plugins/cordova-plugin-firebase/plugin.xml b/StoneIsland/plugins/cordova-plugin-firebase/plugin.xml deleted file mode 100644 index c0cacd43..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/plugin.xml +++ /dev/null @@ -1,108 +0,0 @@ -<?xml version='1.0' encoding='utf-8'?> -<plugin id="cordova-plugin-firebase" version="0.1.24" -xmlns="http://apache.org/cordova/ns/plugins/1.0" -xmlns:android="http://schemas.android.com/apk/res/android"> - <name>Google Firebase Plugin</name> - - <license>MIT</license> - - <engines> - <engine name="cordova" version=">=3.2.0" /> - </engines> - - <platform name="android"> - <js-module name="FirebasePlugin" src="www/firebase.js"> - <clobbers target="FirebasePlugin" /> - </js-module> - <config-file parent="/*" target="res/xml/config.xml"> - <feature name="FirebasePlugin"> - <param name="android-package" value="org.apache.cordova.firebase.FirebasePlugin" /> - <param name="onload" value="true" /> - </feature> - </config-file> - <config-file parent="/resources" target="res/values/strings.xml"> - <string name="google_app_id">@string/google_app_id</string> - </config-file> - <config-file parent="/resources" target="res/values/strings.xml"> - <string name="google_api_key">@string/google_api_key</string> - </config-file> - <config-file target="AndroidManifest.xml" parent="/*"> - <uses-permission android:name="android.permission.INTERNET" /> - <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> - <uses-permission android:name="android.permission.WAKE_LOCK" /> - </config-file> - <config-file target="AndroidManifest.xml" parent="/manifest/application"> - <service android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementService" /> - </config-file> - <config-file target="AndroidManifest.xml" parent="/manifest/application"> - <service android:name="org.apache.cordova.firebase.FirebasePluginMessagingService"> - <intent-filter> - <action android:name="com.google.firebase.MESSAGING_EVENT"/> - </intent-filter> - </service> - <service android:name="org.apache.cordova.firebase.FirebasePluginInstanceIDService"> - <intent-filter> - <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/> - </intent-filter> - </service> - <receiver android:name="org.apache.cordova.firebase.OnNotificationOpenReceiver"></receiver> - </config-file> - <source-file src="src/android/google-services.json" target-dir="." /> - <source-file src="src/android/FirebasePlugin.java" target-dir="src/org/apache/cordova/firebase" /> - <source-file src="src/android/OnNotificationOpenReceiver.java" target-dir="src/org/apache/cordova/firebase" /> - <source-file src="src/android/FirebasePluginInstanceIDService.java" target-dir="src/org/apache/cordova/firebase" /> - <source-file src="src/android/FirebasePluginMessagingService.java" target-dir="src/org/apache/cordova/firebase" /> - <source-file src="src/android/colors.xml" target-dir="res/values" /> - - <framework src="src/android/build.gradle" custom="true" type="gradleReference" /> - <framework src="com.google.gms:google-services:+" /> - <framework src="com.google.firebase:firebase-core:+" /> - <framework src="com.google.firebase:firebase-messaging:+" /> - <framework src="com.google.firebase:firebase-crash:+" /> - <framework src="com.google.firebase:firebase-config:+" /> - </platform> - - <platform name="ios"> - <js-module name="FirebasePlugin" src="www/firebase.js"> - <clobbers target="FirebasePlugin" /> - </js-module> - <config-file parent="/*" target="config.xml"> - <feature name="FirebasePlugin"> - <param name="ios-package" value="FirebasePlugin" /> - <param name="onload" value="true" /> - </feature> - </config-file> - <config-file parent="aps-environment" target="*/Entitlements-Debug.plist"> - <string>development</string> - </config-file> - <config-file parent="aps-environment" target="*/Entitlements-Release.plist"> - <string>production</string> - </config-file> - - <resource-file src="src/ios/GoogleService-Info.plist" /> - - <header-file src="src/ios/AppDelegate+FirebasePlugin.h" /> - <source-file src="src/ios/AppDelegate+FirebasePlugin.m" /> - <header-file src="src/ios/FirebasePlugin.h" /> - <source-file src="src/ios/FirebasePlugin.m" /> - - <header-file src="src/ios/Firebase/Firebase.h" /> - - <framework custom="true" src="src/ios/Firebase/Analytics/FirebaseAnalytics.framework" /> - <framework custom="true" src="src/ios/Firebase/Analytics/FirebaseCore.framework" /> - <framework custom="true" src="src/ios/Firebase/Analytics/FirebaseInstanceID.framework" /> - <framework custom="true" src="src/ios/Firebase/Analytics/GoogleToolboxForMac.framework" /> - <framework custom="true" src="src/ios/Firebase/Messaging/Protobuf.framework" /> - <framework custom="true" src="src/ios/Firebase/Messaging/FirebaseMessaging.framework" /> - <framework custom="true" src="src/ios/Firebase/Crash/FirebaseCrash.framework" /> - <framework custom="true" src="src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework" /> - </platform> - - <platform name="browser"> - <js-module name="FirebasePlugin" src="www/firebase-browser.js"> - <clobbers target="FirebasePlugin" /> - </js-module> - </platform> - - <hook src="scripts/after_prepare.js" type="after_prepare" /> -</plugin> diff --git a/StoneIsland/plugins/cordova-plugin-firebase/scripts/after_prepare.js b/StoneIsland/plugins/cordova-plugin-firebase/scripts/after_prepare.js deleted file mode 100755 index 3f8406c2..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/scripts/after_prepare.js +++ /dev/null @@ -1,134 +0,0 @@ -#!/usr/bin/env node
-'use strict';
-
-/**
- * This hook makes sure projects using [cordova-plugin-firebase](https://github.com/arnesson/cordova-plugin-firebase)
- * will build properly and have the required key files copied to the proper destinations when the app is build on Ionic Cloud using the package command.
- * Credits: https://github.com/arnesson.
- */
-var fs = require('fs');
-var path = require('path');
-
-fs.ensureDirSync = function (dir) {
- if (!fs.existsSync(dir)) {
- dir.split(path.sep).reduce(function (currentPath, folder) {
- currentPath += folder + path.sep;
- if (!fs.existsSync(currentPath)) {
- fs.mkdirSync(currentPath);
- }
- return currentPath;
- }, '');
- }
-};
-
-var config = fs.readFileSync('config.xml').toString();
-var name = getValue(config, 'name');
-
-var IOS_DIR = 'platforms/ios';
-var ANDROID_DIR = 'platforms/android';
-
-var PLATFORM = {
- IOS: {
- dest: [
- IOS_DIR + '/' + name + '/Resources/GoogleService-Info.plist',
- IOS_DIR + '/' + name + '/Resources/Resources/GoogleService-Info.plist'
- ],
- src: [
- 'GoogleService-Info.plist',
- IOS_DIR + '/www/GoogleService-Info.plist',
- 'www/GoogleService-Info.plist'
- ]
- },
- ANDROID: {
- dest: [
- ANDROID_DIR + '/google-services.json'
- ],
- src: [
- 'google-services.json',
- ANDROID_DIR + '/assets/www/google-services.json',
- 'www/google-services.json'
- ],
- stringsXml: ANDROID_DIR + '/res/values/strings.xml'
- }
-};
-
-// Copy key files to their platform specific folders
-if (directoryExists(IOS_DIR)) {
- copyKey(PLATFORM.IOS);
-} else if (directoryExists(ANDROID_DIR)) {
- copyKey(PLATFORM.ANDROID, updateStringsXml)
-}
-
-function updateStringsXml(contents) {
- var json = JSON.parse(contents);
- var strings = fs.readFileSync(PLATFORM.ANDROID.stringsXml).toString();
-
- // strip non-default value
- strings = strings.replace(new RegExp('<string name="google_app_id">([^\@<]+?)</string>', 'i'), '');
-
- // strip non-default value
- strings = strings.replace(new RegExp('<string name="google_api_key">([^\@<]+?)</string>', 'i'), '');
-
- // strip empty lines
- strings = strings.replace(new RegExp('(\r\n|\n|\r)[ \t]*(\r\n|\n|\r)', 'gm'), '$1');
-
- // replace the default value
- strings = strings.replace(new RegExp('<string name="google_app_id">([^<]+?)</string>', 'i'), '<string name="google_app_id">' + json.client[0].client_info.mobilesdk_app_id + '</string>');
-
- // replace the default value
- strings = strings.replace(new RegExp('<string name="google_api_key">([^<]+?)</string>', 'i'), '<string name="google_api_key">' + json.client[0].api_key[0].current_key + '</string>');
-
- fs.writeFileSync(PLATFORM.ANDROID.stringsXml, strings);
-}
-
-function copyKey(platform, callback) {
- for (var i = 0; i < platform.src.length; i++) {
- var file = platform.src[i];
- if (fileExists(file)) {
- try {
- var contents = fs.readFileSync(file).toString();
-
- try {
- platform.dest.forEach(function (destinationPath) {
- var folder = destinationPath.substring(0, destinationPath.lastIndexOf('/'));
- fs.ensureDirSync(folder);
- fs.writeFileSync(destinationPath, contents);
- });
- } catch (e) {
- // skip
- }
-
- callback && callback(contents);
- } catch (err) {
- console.log(err)
- }
-
- break;
- }
- }
-}
-
-function getValue(config, name) {
- var value = config.match(new RegExp('<' + name + '>(.*?)</' + name + '>', 'i'));
- if (value && value[1]) {
- return value[1]
- } else {
- return null
- }
-}
-
-function fileExists(path) {
- try {
- return fs.statSync(path).isFile();
- } catch (e) {
- return false;
- }
-}
-
-function directoryExists(path) {
- try {
- return fs.statSync(path).isDirectory();
- } catch (e) {
- return false;
- }
-}
diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePlugin.java b/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePlugin.java deleted file mode 100755 index 7e4431df..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePlugin.java +++ /dev/null @@ -1,601 +0,0 @@ -package org.apache.cordova.firebase; - -import android.content.Context; -import android.content.Intent; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.support.v4.app.NotificationManagerCompat; -import android.util.Base64; -import android.util.Log; -import com.google.android.gms.tasks.OnCompleteListener; -import com.google.android.gms.tasks.OnFailureListener; -import com.google.android.gms.tasks.Task; -import com.google.firebase.analytics.FirebaseAnalytics; -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.messaging.FirebaseMessaging; -import com.google.firebase.remoteconfig.FirebaseRemoteConfig; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigInfo; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings; -import com.google.firebase.remoteconfig.FirebaseRemoteConfigValue; -import com.google.firebase.crash.FirebaseCrash; -import me.leolin.shortcutbadger.ShortcutBadger; -import org.apache.cordova.CallbackContext; -import org.apache.cordova.CordovaPlugin; -import org.apache.cordova.PluginResult; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -public class FirebasePlugin extends CordovaPlugin { - - private FirebaseAnalytics mFirebaseAnalytics; - private final String TAG = "FirebasePlugin"; - protected static final String KEY = "badge"; - - private static boolean inBackground = true; - private static ArrayList<Bundle> notificationStack = null; - private static CallbackContext notificationCallbackContext; - private static CallbackContext tokenRefreshCallbackContext; - - @Override - protected void pluginInitialize() { - final Context context = this.cordova.getActivity().getApplicationContext(); - final Bundle extras = this.cordova.getActivity().getIntent().getExtras(); - this.cordova.getThreadPool().execute(new Runnable() { - public void run() { - Log.d(TAG, "Starting Firebase plugin"); - mFirebaseAnalytics = FirebaseAnalytics.getInstance(context); - mFirebaseAnalytics.setAnalyticsCollectionEnabled(true); - if (extras != null && extras.size() > 1) { - if (FirebasePlugin.notificationStack == null) { - FirebasePlugin.notificationStack = new ArrayList<Bundle>(); - } - if (extras.containsKey("google.message_id")) { - extras.putBoolean("tap", true); - notificationStack.add(extras); - } - } - } - }); - } - - @Override - public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { - if (action.equals("getInstanceId")) { - this.getInstanceId(callbackContext); - return true; - } else if (action.equals("getToken")) { - this.getToken(callbackContext); - return true; - } else if (action.equals("hasPermission")) { - this.hasPermission(callbackContext); - return true; - } else if (action.equals("setBadgeNumber")) { - this.setBadgeNumber(callbackContext, args.getInt(0)); - return true; - } else if (action.equals("getBadgeNumber")) { - this.getBadgeNumber(callbackContext); - return true; - } else if (action.equals("subscribe")) { - this.subscribe(callbackContext, args.getString(0)); - return true; - } else if (action.equals("unsubscribe")) { - this.unsubscribe(callbackContext, args.getString(0)); - return true; - } else if (action.equals("unregister")) { - this.unregister(callbackContext); - return true; - } else if (action.equals("onNotificationOpen")) { - this.onNotificationOpen(callbackContext); - return true; - } else if (action.equals("onTokenRefresh")) { - this.onTokenRefresh(callbackContext); - return true; - } else if (action.equals("logEvent")) { - this.logEvent(callbackContext, args.getString(0), args.getJSONObject(1)); - return true; - } else if (action.equals("logError")) { - this.logError(callbackContext, args.getString(0)); - return true; - } else if (action.equals("setScreenName")) { - this.setScreenName(callbackContext, args.getString(0)); - return true; - } else if (action.equals("setUserId")) { - this.setUserId(callbackContext, args.getString(0)); - return true; - } else if (action.equals("setUserProperty")) { - this.setUserProperty(callbackContext, args.getString(0), args.getString(1)); - return true; - } else if (action.equals("activateFetched")) { - this.activateFetched(callbackContext); - return true; - } else if (action.equals("fetch")) { - if (args.length() > 0) this.fetch(callbackContext, args.getLong(0)); - else this.fetch(callbackContext); - return true; - } else if (action.equals("getByteArray")) { - if (args.length() > 1) this.getByteArray(callbackContext, args.getString(0), args.getString(1)); - else this.getByteArray(callbackContext, args.getString(0), null); - return true; - } else if (action.equals("getValue")) { - if (args.length() > 1) this.getValue(callbackContext, args.getString(0), args.getString(1)); - else this.getValue(callbackContext, args.getString(0), null); - return true; - } else if (action.equals("getInfo")) { - this.getInfo(callbackContext); - return true; - } else if (action.equals("setConfigSettings")) { - this.setConfigSettings(callbackContext, args.getJSONObject(0)); - return true; - } else if (action.equals("setDefaults")) { - if (args.length() > 1) this.setDefaults(callbackContext, args.getJSONObject(0), args.getString(1)); - else this.setDefaults(callbackContext, args.getJSONObject(0), null); - return true; - } - return false; - } - - @Override - public void onPause(boolean multitasking) { - FirebasePlugin.inBackground = true; - } - - @Override - public void onResume(boolean multitasking) { - FirebasePlugin.inBackground = false; - } - - @Override - public void onReset() { - FirebasePlugin.notificationCallbackContext = null; - FirebasePlugin.tokenRefreshCallbackContext = null; - } - - private void onNotificationOpen(final CallbackContext callbackContext) { - FirebasePlugin.notificationCallbackContext = callbackContext; - if (FirebasePlugin.notificationStack != null) { - for (Bundle bundle : FirebasePlugin.notificationStack) { - FirebasePlugin.sendNotification(bundle); - } - FirebasePlugin.notificationStack.clear(); - } - } - - private void onTokenRefresh(final CallbackContext callbackContext) { - FirebasePlugin.tokenRefreshCallbackContext = callbackContext; - - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - String currentToken = FirebaseInstanceId.getInstance().getToken(); - - if (currentToken != null) { - FirebasePlugin.sendToken(currentToken); - } - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - public static void sendNotification(Bundle bundle) { - if (!FirebasePlugin.hasNotificationsCallback()) { - if (FirebasePlugin.notificationStack == null) { - FirebasePlugin.notificationStack = new ArrayList<Bundle>(); - } - notificationStack.add(bundle); - return; - } - final CallbackContext callbackContext = FirebasePlugin.notificationCallbackContext; - if (callbackContext != null && bundle != null) { - JSONObject json = new JSONObject(); - Set<String> keys = bundle.keySet(); - for (String key : keys) { - try { - json.put(key, bundle.get(key)); - } catch (JSONException e) { - callbackContext.error(e.getMessage()); - return; - } - } - - PluginResult pluginresult = new PluginResult(PluginResult.Status.OK, json); - pluginresult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginresult); - } - } - - public static void sendToken(String token) { - if (FirebasePlugin.tokenRefreshCallbackContext == null) { - return; - } - final CallbackContext callbackContext = FirebasePlugin.tokenRefreshCallbackContext; - if (callbackContext != null && token != null) { - PluginResult pluginresult = new PluginResult(PluginResult.Status.OK, token); - pluginresult.setKeepCallback(true); - callbackContext.sendPluginResult(pluginresult); - } - } - - public static boolean inBackground() { - return FirebasePlugin.inBackground; - } - - public static boolean hasNotificationsCallback() { - return FirebasePlugin.notificationCallbackContext != null; - } - - @Override - public void onNewIntent(Intent intent) { - super.onNewIntent(intent); - final Bundle data = intent.getExtras(); - if (data != null && data.containsKey("google.message_id")) { - data.putBoolean("tap", true); - FirebasePlugin.sendNotification(data); - } - } - - // DEPRECTED - alias of getToken - private void getInstanceId(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - String token = FirebaseInstanceId.getInstance().getToken(); - callbackContext.success(token); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getToken(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - String token = FirebaseInstanceId.getInstance().getToken(); - callbackContext.success(token); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void hasPermission(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - Context context = cordova.getActivity(); - NotificationManagerCompat notificationManagerCompat = NotificationManagerCompat.from(context); - boolean areNotificationsEnabled = notificationManagerCompat.areNotificationsEnabled(); - JSONObject object = new JSONObject(); - object.put("isEnabled", areNotificationsEnabled); - callbackContext.success(object); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setBadgeNumber(final CallbackContext callbackContext, final int number) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - Context context = cordova.getActivity(); - SharedPreferences.Editor editor = context.getSharedPreferences(KEY, Context.MODE_PRIVATE).edit(); - editor.putInt(KEY, number); - editor.apply(); - ShortcutBadger.applyCount(context, number); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getBadgeNumber(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - Context context = cordova.getActivity(); - SharedPreferences settings = context.getSharedPreferences(KEY, Context.MODE_PRIVATE); - int number = settings.getInt(KEY, 0); - callbackContext.success(number); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void subscribe(final CallbackContext callbackContext, final String topic) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseMessaging.getInstance().subscribeToTopic(topic); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void unsubscribe(final CallbackContext callbackContext, final String topic) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseMessaging.getInstance().unsubscribeFromTopic(topic); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void unregister(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseInstanceId.getInstance().deleteInstanceId(); - String currentToken = FirebaseInstanceId.getInstance().getToken(); - if (currentToken != null) { - FirebasePlugin.sendToken(currentToken); - } - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void logEvent(final CallbackContext callbackContext, final String name, final JSONObject params) throws JSONException { - final Bundle bundle = new Bundle(); - Iterator iter = params.keys(); - while (iter.hasNext()) { - String key = (String) iter.next(); - Object value = params.get(key); - - if (value instanceof Integer || value instanceof Double) { - bundle.putFloat(key, ((Number) value).floatValue()); - } else { - bundle.putString(key, value.toString()); - } - } - - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - mFirebaseAnalytics.logEvent(name, bundle); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void logError(final CallbackContext callbackContext, final String message) throws JSONException { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseCrash.report(new Exception(message)); - callbackContext.success(1); - } catch (Exception e) { - FirebaseCrash.log(e.getMessage()); - e.printStackTrace(); - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setScreenName(final CallbackContext callbackContext, final String name) { - // This must be called on the main thread - cordova.getActivity().runOnUiThread(new Runnable() { - public void run() { - try { - mFirebaseAnalytics.setCurrentScreen(cordova.getActivity(), name, null); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setUserId(final CallbackContext callbackContext, final String id) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - mFirebaseAnalytics.setUserId(id); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setUserProperty(final CallbackContext callbackContext, final String name, final String value) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - mFirebaseAnalytics.setUserProperty(name, value); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void activateFetched(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - final boolean activated = FirebaseRemoteConfig.getInstance().activateFetched(); - callbackContext.success(String.valueOf(activated)); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void fetch(CallbackContext callbackContext) { - fetch(callbackContext, FirebaseRemoteConfig.getInstance().fetch()); - } - - private void fetch(CallbackContext callbackContext, long cacheExpirationSeconds) { - fetch(callbackContext, FirebaseRemoteConfig.getInstance().fetch(cacheExpirationSeconds)); - } - - private void fetch(final CallbackContext callbackContext, final Task<Void> task) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - task.addOnCompleteListener(new OnCompleteListener<Void>() { - @Override - public void onComplete(Task<Void> task) { - callbackContext.success(); - } - }).addOnFailureListener(new OnFailureListener() { - @Override - public void onFailure(Exception e) { - callbackContext.error(e.getMessage()); - } - }); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getByteArray(final CallbackContext callbackContext, final String key, final String namespace) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - byte[] bytes = namespace == null ? FirebaseRemoteConfig.getInstance().getByteArray(key) - : FirebaseRemoteConfig.getInstance().getByteArray(key, namespace); - JSONObject object = new JSONObject(); - object.put("base64", Base64.encodeToString(bytes, Base64.DEFAULT)); - object.put("array", new JSONArray(bytes)); - callbackContext.success(object); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getValue(final CallbackContext callbackContext, final String key, final String namespace) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseRemoteConfigValue value = namespace == null ? FirebaseRemoteConfig.getInstance().getValue(key) - : FirebaseRemoteConfig.getInstance().getValue(key, namespace); - callbackContext.success(value.asString()); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void getInfo(final CallbackContext callbackContext) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - FirebaseRemoteConfigInfo remoteConfigInfo = FirebaseRemoteConfig.getInstance().getInfo(); - JSONObject info = new JSONObject(); - - JSONObject settings = new JSONObject(); - settings.put("developerModeEnabled", remoteConfigInfo.getConfigSettings().isDeveloperModeEnabled()); - info.put("configSettings", settings); - - info.put("fetchTimeMillis", remoteConfigInfo.getFetchTimeMillis()); - info.put("lastFetchStatus", remoteConfigInfo.getLastFetchStatus()); - - callbackContext.success(info); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setConfigSettings(final CallbackContext callbackContext, final JSONObject config) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - boolean devMode = config.getBoolean("developerModeEnabled"); - FirebaseRemoteConfigSettings.Builder settings = new FirebaseRemoteConfigSettings.Builder() - .setDeveloperModeEnabled(devMode); - FirebaseRemoteConfig.getInstance().setConfigSettings(settings.build()); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private void setDefaults(final CallbackContext callbackContext, final JSONObject defaults, final String namespace) { - cordova.getThreadPool().execute(new Runnable() { - public void run() { - try { - if (namespace == null) - FirebaseRemoteConfig.getInstance().setDefaults(defaultsToMap(defaults)); - else - FirebaseRemoteConfig.getInstance().setDefaults(defaultsToMap(defaults), namespace); - callbackContext.success(); - } catch (Exception e) { - callbackContext.error(e.getMessage()); - } - } - }); - } - - private static Map<String, Object> defaultsToMap(JSONObject object) throws JSONException { - final Map<String, Object> map = new HashMap<String, Object>(); - - for (Iterator<String> keys = object.keys(); keys.hasNext(); ) { - String key = keys.next(); - Object value = object.get(key); - - if (value instanceof Integer) { - //setDefaults() should take Longs - value = new Long((Integer) value); - } else if (value instanceof JSONArray) { - JSONArray array = (JSONArray) value; - if (array.length() == 1 && array.get(0) instanceof String) { - //parse byte[] as Base64 String - value = Base64.decode(array.getString(0), Base64.DEFAULT); - } else { - //parse byte[] as numeric array - byte[] bytes = new byte[array.length()]; - for (int i = 0; i < array.length(); i++) - bytes[i] = (byte) array.getInt(i); - value = bytes; - } - } - - map.put(key, value); - } - return map; - } -} diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginInstanceIDService.java b/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginInstanceIDService.java deleted file mode 100755 index 96140f02..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginInstanceIDService.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.apache.cordova.firebase; - -import android.util.Log; - -import com.google.firebase.iid.FirebaseInstanceId; -import com.google.firebase.iid.FirebaseInstanceIdService; - - -public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService { - - private static final String TAG = "FirebasePlugin"; - - /** - * Called if InstanceID token is updated. This may occur if the security of - * the previous token had been compromised. Note that this is called when the InstanceID token - * is initially generated so this is where you would retrieve the token. - */ - @Override - public void onTokenRefresh() { - // Get updated InstanceID token. - String refreshedToken = FirebaseInstanceId.getInstance().getToken(); - Log.d(TAG, "Refreshed token: " + refreshedToken); - - FirebasePlugin.sendToken(refreshedToken); - } -} diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginMessagingService.java b/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginMessagingService.java deleted file mode 100755 index a42ce60e..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/android/FirebasePluginMessagingService.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.apache.cordova.firebase; - -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.media.RingtoneManager; -import android.net.Uri; -import android.os.Bundle; -import android.support.v4.app.NotificationCompat; -import android.util.Log; -import android.app.Notification; -import android.text.TextUtils; - -import com.google.firebase.messaging.FirebaseMessagingService; -import com.google.firebase.messaging.RemoteMessage; - -import java.util.Map; -import java.util.Random; - -public class FirebasePluginMessagingService extends FirebaseMessagingService { - - private static final String TAG = "FirebasePlugin"; - - /** - * Called when message is received. - * - * @param remoteMessage Object representing the message received from Firebase Cloud Messaging. - */ - @Override - public void onMessageReceived(RemoteMessage remoteMessage) { - // [START_EXCLUDE] - // There are two types of messages data messages and notification messages. Data messages are handled - // here in onMessageReceived whether the app is in the foreground or background. Data messages are the type - // traditionally used with GCM. Notification messages are only received here in onMessageReceived when the app - // is in the foreground. When the app is in the background an automatically generated notification is displayed. - // When the user taps on the notification they are returned to the app. Messages containing both notification - // and data payloads are treated as notification messages. The Firebase console always sends notification - // messages. For more see: https://firebase.google.com/docs/cloud-messaging/concept-options - // [END_EXCLUDE] - - // TODO(developer): Handle FCM messages here. - // Not getting messages here? See why this may be: https://goo.gl/39bRNJ - String title; - String text; - String id; - if (remoteMessage.getNotification() != null) { - title = remoteMessage.getNotification().getTitle(); - text = remoteMessage.getNotification().getBody(); - id = remoteMessage.getMessageId(); - } else { - title = remoteMessage.getData().get("title"); - text = remoteMessage.getData().get("text"); - id = remoteMessage.getData().get("id"); - } - - if(TextUtils.isEmpty(id)){ - Random rand = new Random(); - int n = rand.nextInt(50) + 1; - id = Integer.toString(n); - } - - Log.d(TAG, "From: " + remoteMessage.getFrom()); - Log.d(TAG, "Notification Message id: " + id); - Log.d(TAG, "Notification Message Title: " + title); - Log.d(TAG, "Notification Message Body/Text: " + text); - - // TODO: Add option to developer to configure if show notification when app on foreground - if (!TextUtils.isEmpty(text) || !TextUtils.isEmpty(title) || (!remoteMessage.getData().isEmpty())) { - boolean showNotification = (FirebasePlugin.inBackground() || !FirebasePlugin.hasNotificationsCallback()) && (!TextUtils.isEmpty(text) || !TextUtils.isEmpty(title)); - sendNotification(id, title, text, remoteMessage.getData(), showNotification); - } - } - - private void sendNotification(String id, String title, String messageBody, Map<String, String> data, boolean showNotification) { - Bundle bundle = new Bundle(); - for (String key : data.keySet()) { - bundle.putString(key, data.get(key)); - } - if (showNotification) { - Intent intent = new Intent(this, OnNotificationOpenReceiver.class); - intent.putExtras(bundle); - PendingIntent pendingIntent = PendingIntent.getBroadcast(this, id.hashCode(), intent, - PendingIntent.FLAG_UPDATE_CURRENT); - - Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); - NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) - .setContentTitle(title) - .setContentText(messageBody) - .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) - .setStyle(new NotificationCompat.BigTextStyle().bigText(messageBody)) - .setAutoCancel(true) - .setSound(defaultSoundUri) - .setContentIntent(pendingIntent); - - int resID = getResources().getIdentifier("notification_icon", "drawable", getPackageName()); - if (resID != 0) { - notificationBuilder.setSmallIcon(resID); - } else { - notificationBuilder.setSmallIcon(getApplicationInfo().icon); - } - - if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) - { - int accentID = getResources().getIdentifier("accent", "color", getPackageName()); - notificationBuilder.setColor(getResources().getColor(accentID, null)); - } - - Notification notification = notificationBuilder.build(); - if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){ - int iconID = android.R.id.icon; - int notiID = getResources().getIdentifier("notification_big", "drawable", getPackageName()); - if (notification.contentView != null) { - notification.contentView.setImageViewResource(iconID, notiID); - } - } - NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - - notificationManager.notify(id.hashCode(), notification); - } else { - bundle.putBoolean("tap", false); - bundle.putString("title", title); - bundle.putString("body", messageBody); - FirebasePlugin.sendNotification(bundle); - } - } -} diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/OnNotificationOpenReceiver.java b/StoneIsland/plugins/cordova-plugin-firebase/src/android/OnNotificationOpenReceiver.java deleted file mode 100644 index a7f63757..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/android/OnNotificationOpenReceiver.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.apache.cordova.firebase; - -import android.app.PendingIntent; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.os.Bundle; - -public class OnNotificationOpenReceiver extends BroadcastReceiver { - - @Override - public void onReceive(Context context, Intent intent) { - PackageManager pm = context.getPackageManager(); - Intent launchIntent = pm.getLaunchIntentForPackage(context.getPackageName()); - - launchIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); - Bundle data = intent.getExtras(); - data.putBoolean("tap", true); - FirebasePlugin.sendNotification(data); - launchIntent.putExtras(data); - context.startActivity(launchIntent); - } -} diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/build-extras.gradle b/StoneIsland/plugins/cordova-plugin-firebase/src/android/build-extras.gradle deleted file mode 100755 index 67b387f5..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/android/build-extras.gradle +++ /dev/null @@ -1 +0,0 @@ -apply plugin: 'com.google.gms.google-services'
\ No newline at end of file diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/build.gradle b/StoneIsland/plugins/cordova-plugin-firebase/src/android/build.gradle deleted file mode 100755 index d5cb4edd..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/android/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -buildscript {
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath 'com.google.gms:google-services:3.0.0'
- }
-}
-repositories {
- mavenCentral()
-}
-dependencies {
- compile 'me.leolin:ShortcutBadger:1.1.4@aar'
- compile 'com.google.firebase:firebase-crash:+'
-}
diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/colors.xml b/StoneIsland/plugins/cordova-plugin-firebase/src/android/colors.xml deleted file mode 100644 index 6f1665a5..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/android/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <color name="primary">#FFFFFF00</color> - <color name="primary_dark">#FF220022</color> - <color name="accent">#FF00FFFF</color> -</resources>
\ No newline at end of file diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/android/google-services.json b/StoneIsland/plugins/cordova-plugin-firebase/src/android/google-services.json deleted file mode 100644 index e69de29b..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/android/google-services.json +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/AppDelegate+FirebasePlugin.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/AppDelegate+FirebasePlugin.h deleted file mode 100755 index 210cbb65..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/AppDelegate+FirebasePlugin.h +++ /dev/null @@ -1,5 +0,0 @@ -#import "AppDelegate.h"
-
-@interface AppDelegate (FirebasePlugin)
-@property (nonatomic, strong) NSNumber *applicationInBackground;
-@end
diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/AppDelegate+FirebasePlugin.m b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/AppDelegate+FirebasePlugin.m deleted file mode 100755 index c4c45778..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/AppDelegate+FirebasePlugin.m +++ /dev/null @@ -1,132 +0,0 @@ -#import "AppDelegate+FirebasePlugin.h"
-#import "FirebasePlugin.h"
-#import "Firebase.h"
-#import <objc/runtime.h>
-
-#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
-@import UserNotifications;
-#endif
-
-// Implement UNUserNotificationCenterDelegate to receive display notification via APNS for devices
-// running iOS 10 and above. Implement FIRMessagingDelegate to receive data message via FCM for
-// devices running iOS 10 and above.
-#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
-@interface AppDelegate () <UNUserNotificationCenterDelegate, FIRMessagingDelegate>
-@end
-#endif
-
-#define kApplicationInBackgroundKey @"applicationInBackground"
-
-@implementation AppDelegate (FirebasePlugin)
-
-+ (void)load {
- Method original = class_getInstanceMethod(self, @selector(application:didFinishLaunchingWithOptions:));
- Method swizzled = class_getInstanceMethod(self, @selector(application:swizzledDidFinishLaunchingWithOptions:));
- method_exchangeImplementations(original, swizzled);
-}
-
-- (void)setApplicationInBackground:(NSNumber *)applicationInBackground {
- objc_setAssociatedObject(self, kApplicationInBackgroundKey, applicationInBackground, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
-}
-
-- (NSNumber *)applicationInBackground {
- return objc_getAssociatedObject(self, kApplicationInBackgroundKey);
-}
-
-- (BOOL)application:(UIApplication *)application swizzledDidFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- [self application:application swizzledDidFinishLaunchingWithOptions:launchOptions];
-
- if(![FIRApp defaultApp]) {
- [FIRApp configure];
- }
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tokenRefreshNotification:)
- name:kFIRInstanceIDTokenRefreshNotification object:nil];
-
- self.applicationInBackground = @(YES);
-
- return YES;
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application {
- [self connectToFcm];
- self.applicationInBackground = @(NO);
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application {
- [[FIRMessaging messaging] disconnect];
- self.applicationInBackground = @(YES);
- NSLog(@"Disconnected from FCM");
-}
-
-- (void)tokenRefreshNotification:(NSNotification *)notification {
- // Note that this callback will be fired everytime a new token is generated, including the first
- // time. So if you need to retrieve the token as soon as it is available this is where that
- // should be done.
- NSString *refreshedToken = [[FIRInstanceID instanceID] token];
- NSLog(@"InstanceID token: %@", refreshedToken);
-
- // Connect to FCM since connection may have failed when attempted before having a token.
- [self connectToFcm];
-
- [FirebasePlugin.firebasePlugin sendToken:refreshedToken];
-}
-
-- (void)connectToFcm {
- [[FIRMessaging messaging] connectWithCompletion:^(NSError * _Nullable error) {
- if (error != nil) {
- NSLog(@"Unable to connect to FCM. %@", error);
- } else {
- NSLog(@"Connected to FCM.");
- NSString *refreshedToken = [[FIRInstanceID instanceID] token];
- NSLog(@"InstanceID token: %@", refreshedToken);
- }
- }];
-}
-
-- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
- NSDictionary *mutableUserInfo = [userInfo mutableCopy];
-
- [mutableUserInfo setValue:self.applicationInBackground forKey:@"tap"];
-
- // Pring full message.
- NSLog(@"%@", mutableUserInfo);
-
- [FirebasePlugin.firebasePlugin sendNotification:mutableUserInfo];
-}
-
-- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
- fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
-
- NSDictionary *mutableUserInfo = [userInfo mutableCopy];
-
- [mutableUserInfo setValue:self.applicationInBackground forKey:@"tap"];
-
- // Pring full message.
- NSLog(@"%@", mutableUserInfo);
-
- [FirebasePlugin.firebasePlugin sendNotification:mutableUserInfo];
-}
-
-#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
-- (void)userNotificationCenter:(UNUserNotificationCenter *)center
- willPresentNotification:(UNNotification *)notification
- withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler {
- NSDictionary *mutableUserInfo = [notification.request.content.userInfo mutableCopy];
-
- [mutableUserInfo setValue:self.applicationInBackground forKey:@"tap"];
-
- // Pring full message.
- NSLog(@"%@", mutableUserInfo);
-
- [FirebasePlugin.firebasePlugin sendNotification:mutableUserInfo];
-}
-
-// Receive data message on iOS 10 devices.
-- (void)applicationReceivedRemoteMessage:(FIRMessagingRemoteMessage *)remoteMessage {
- // Print full message
- NSLog(@"%@", [remoteMessage appData]);
-}
-#endif
-
-@end
diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics Binary files differdeleted file mode 100755 index 61f61cd1..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/FirebaseAnalytics +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h deleted file mode 100755 index f5023f57..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalytics.h +++ /dev/null @@ -1,102 +0,0 @@ -#import <Foundation/Foundation.h> - -#import "FIREventNames.h" -#import "FIRParameterNames.h" -#import "FIRUserPropertyNames.h" - -NS_ASSUME_NONNULL_BEGIN - -/// The top level Firebase Analytics singleton that provides methods for logging events and setting -/// user properties. See <a href="http://goo.gl/gz8SLz">the developer guides</a> for general -/// information on using Firebase Analytics in your apps. -@interface FIRAnalytics : NSObject - -/// Logs an app event. The event can have up to 25 parameters. Events with the same name must have -/// the same parameters. Up to 500 event names are supported. Using predefined events and/or -/// parameters is recommended for optimal reporting. -/// -/// The following event names are reserved and cannot be used: -/// <ul> -/// <li>app_clear_data</li> -/// <li>app_remove</li> -/// <li>app_update</li> -/// <li>error</li> -/// <li>first_open</li> -/// <li>in_app_purchase</li> -/// <li>notification_dismiss</li> -/// <li>notification_foreground</li> -/// <li>notification_open</li> -/// <li>notification_receive</li> -/// <li>os_update</li> -/// <li>session_start</li> -/// <li>user_engagement</li> -/// </ul> -/// -/// @param name The name of the event. Should contain 1 to 40 alphanumeric characters or -/// underscores. The name must start with an alphabetic character. Some event names are -/// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_" prefix -/// is reserved and should not be used. Note that event names are case-sensitive and that -/// logging two events whose names differ only in case will result in two distinct events. -/// @param parameters The dictionary of event parameters. Passing nil indicates that the event has -/// no parameters. Parameter names can be up to 40 characters long and must start with an -/// alphabetic character and contain only alphanumeric characters and underscores. Only NSString -/// and NSNumber (signed 64-bit integer and 64-bit floating-point number) parameter types are -/// supported. NSString parameter values can be up to 100 characters long. The "firebase_" -/// prefix is reserved and should not be used for parameter names. -+ (void)logEventWithName:(NSString *)name - parameters:(nullable NSDictionary<NSString *, NSObject *> *)parameters; - -/// Sets a user property to a given value. Up to 25 user property names are supported. Once set, -/// user property values persist throughout the app lifecycle and across sessions. -/// -/// The following user property names are reserved and cannot be used: -/// <ul> -/// <li>first_open_time</li> -/// <li>last_deep_link_referrer</li> -/// <li>user_id</li> -/// </ul> -/// -/// @param value The value of the user property. Values can be up to 36 characters long. Setting the -/// value to nil removes the user property. -/// @param name The name of the user property to set. Should contain 1 to 24 alphanumeric characters -/// or underscores and must start with an alphabetic character. The "firebase_" prefix is -/// reserved and should not be used for user property names. -+ (void)setUserPropertyString:(nullable NSString *)value forName:(NSString *)name; - -/// Sets the user ID property. This feature must be used in accordance with -/// <a href="https://www.google.com/policies/privacy">Google's Privacy Policy</a> -/// -/// @param userID The user ID to ascribe to the user of this app on this device, which must be -/// non-empty and no more than 36 characters long. Setting userID to nil removes the user ID. -+ (void)setUserID:(nullable NSString *)userID; - -/// Sets the current screen name, which specifies the current visual context in your app. This helps -/// identify the areas in your app where users spend their time and how they interact with your app. -/// -/// Note that screen reporting is enabled automatically and records the class name of the current -/// UIViewController for you without requiring you to call this method. If you implement -/// viewDidAppear in your UIViewController but do not call [super viewDidAppear:], that screen class -/// will not be automatically tracked. The class name can optionally be overridden by calling this -/// method in the viewDidAppear callback of your UIViewController and specifying the -/// screenClassOverride parameter. -/// -/// If your app does not use a distinct UIViewController for each screen, you should call this -/// method and specify a distinct screenName each time a new screen is presented to the user. -/// -/// The screen name and screen class remain in effect until the current UIViewController changes or -/// a new call to setScreenName:screenClass: is made. -/// -/// @param screenName The name of the current screen. Should contain 1 to 100 characters. Set to nil -/// to clear the current screen name. -/// @param screenClassOverride The name of the screen class. Should contain 1 to 100 characters. By -/// default this is the class name of the current UIViewController. Set to nil to revert to the -/// default class name. -+ (void)setScreenName:(nullable NSString *)screenName - screenClass:(nullable NSString *)screenClassOverride; - -/// The unique ID for this instance of the application. -+ (NSString *)appInstanceID; - -@end - -NS_ASSUME_NONNULL_END diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h deleted file mode 100755 index dc227a4c..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRAnalyticsConfiguration.h +++ /dev/null @@ -1 +0,0 @@ -#import <FirebaseCore/FIRAnalyticsConfiguration.h> diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRApp.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRApp.h deleted file mode 100755 index de24da17..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRApp.h +++ /dev/null @@ -1 +0,0 @@ -#import <FirebaseCore/FIRApp.h> diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRConfiguration.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRConfiguration.h deleted file mode 100755 index be2ff7bf..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRConfiguration.h +++ /dev/null @@ -1 +0,0 @@ -#import <FirebaseCore/FIRConfiguration.h> diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIROptions.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIROptions.h deleted file mode 100755 index 126824b0..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIROptions.h +++ /dev/null @@ -1 +0,0 @@ -#import <FirebaseCore/FIROptions.h> diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h deleted file mode 100755 index a43e3473..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRParameterNames.h +++ /dev/null @@ -1,369 +0,0 @@ -/// @file FIRParameterNames.h -/// -/// Predefined event parameter names. -/// -/// Params supply information that contextualize Events. You can associate up to 25 unique Params -/// with each Event type. Some Params are suggested below for certain common Events, but you are -/// not limited to these. You may supply extra Params for suggested Events or custom Params for -/// Custom events. Param names can be up to 40 characters long, may only contain alphanumeric -/// characters and underscores ("_"), and must start with an alphabetic character. Param values can -/// be up to 100 characters long. The "firebase_" prefix is reserved and should not be used. - -/// Game achievement ID (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterAchievementID : @"10_matches_won", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterAchievementID = @"achievement_id"; - -/// Ad Network Click ID (NSString). Used for network-specific click IDs which vary in format. -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterAdNetworkClickID : @"1234567", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterAdNetworkClickID = @"aclid"; - -/// The individual campaign name, slogan, promo code, etc. Some networks have pre-defined macro to -/// capture campaign information, otherwise can be populated by developer. Highly Recommended -/// (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterCampaign : @"winter_promotion", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterCampaign = @"campaign"; - -/// Character used in game (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterCharacter : @"beat_boss", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterCharacter = @"character"; - -/// Campaign content (NSString). -static NSString *const kFIRParameterContent = @"content"; - -/// Type of content selected (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterContentType : @"news article", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterContentType = @"content_type"; - -/// Coupon code for a purchasable item (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterCoupon : @"zz123", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterCoupon = @"coupon"; - -/// Campaign custom parameter (NSString). Used as a method of capturing custom data in a campaign. -/// Use varies by network. -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterCP1 : @"custom_data", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterCP1 = @"cp1"; - -/// Purchase currency in 3-letter <a href="http://en.wikipedia.org/wiki/ISO_4217#Active_codes"> -/// ISO_4217</a> format (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterCurrency : @"USD", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterCurrency = @"currency"; - -/// Flight or Travel destination (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterDestination : @"Mountain View, CA", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterDestination = @"destination"; - -/// The arrival date, check-out date or rental end date for the item. This should be in -/// YYYY-MM-DD format (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterEndDate : @"2015-09-14", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterEndDate = @"end_date"; - -/// Flight number for travel events (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterFlightNumber : @"ZZ800", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterFlightNumber = @"flight_number"; - -/// Group/clan/guild ID (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterGroupID : @"g1", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterGroupID = @"group_id"; - -/// Item category (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterItemCategory : @"t-shirts", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterItemCategory = @"item_category"; - -/// Item ID (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterItemID : @"p7654", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterItemID = @"item_id"; - -/// The Google <a href="https://developers.google.com/places/place-id">Place ID</a> (NSString) that -/// corresponds to the associated item. Alternatively, you can supply your own custom Location ID. -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterItemLocationID : @"ChIJiyj437sx3YAR9kUWC8QkLzQ", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterItemLocationID = @"item_location_id"; - -/// Item name (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterItemName : @"abc", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterItemName = @"item_name"; - -/// Level in game (signed 64-bit integer as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterLevel : @(42), -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterLevel = @"level"; - -/// Location (NSString). The Google <a href="https://developers.google.com/places/place-id">Place ID -/// </a> that corresponds to the associated event. Alternatively, you can supply your own custom -/// Location ID. -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterLocation : @"ChIJiyj437sx3YAR9kUWC8QkLzQ", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterLocation = @"location"; - -/// The advertising or marketing medium, for example: cpc, banner, email, push. Highly recommended -/// (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterMedium : @"email", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterMedium = @"medium"; - -/// Number of nights staying at hotel (signed 64-bit integer as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterNumberOfNights : @(3), -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterNumberOfNights = @"number_of_nights"; - -/// Number of passengers traveling (signed 64-bit integer as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterNumberOfPassengers : @(11), -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterNumberOfPassengers = @"number_of_passengers"; - -/// Number of rooms for travel events (signed 64-bit integer as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterNumberOfRooms : @(2), -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterNumberOfRooms = @"number_of_rooms"; - -/// Flight or Travel origin (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterOrigin : @"Mountain View, CA", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterOrigin = @"origin"; - -/// Purchase price (double as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterPrice : @(1.0), -/// kFIRParameterCurrency : @"USD", // e.g. $1.00 USD -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterPrice = @"price"; - -/// Purchase quantity (signed 64-bit integer as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterQuantity : @(1), -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterQuantity = @"quantity"; - -/// Score in game (signed 64-bit integer as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterScore : @(4200), -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterScore = @"score"; - -/// The search string/keywords used (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterSearchTerm : @"periodic table", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterSearchTerm = @"search_term"; - -/// Shipping cost (double as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterShipping : @(9.50), -/// kFIRParameterCurrency : @"USD", // e.g. $9.50 USD -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterShipping = @"shipping"; - -/// Sign up method (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterSignUpMethod : @"google", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterSignUpMethod = @"sign_up_method"; - -/// The origin of your traffic, such as an Ad network (for example, google) or partner (urban -/// airship). Identify the advertiser, site, publication, etc. that is sending traffic to your -/// property. Highly recommended (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterSource : @"InMobi", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterSource = @"source"; - -/// The departure date, check-in date or rental start date for the item. This should be in -/// YYYY-MM-DD format (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterStartDate : @"2015-09-14", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterStartDate = @"start_date"; - -/// Tax amount (double as NSNumber). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterTax : @(1.0), -/// kFIRParameterCurrency : @"USD", // e.g. $1.00 USD -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterTax = @"tax"; - -/// If you're manually tagging keyword campaigns, you should use utm_term to specify the keyword -/// (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterTerm : @"game", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterTerm = @"term"; - -/// A single ID for a ecommerce group transaction (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterTransactionID : @"ab7236dd9823", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterTransactionID = @"transaction_id"; - -/// Travel class (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterTravelClass : @"business", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterTravelClass = @"travel_class"; - -/// A context-specific numeric value which is accumulated automatically for each event type. This is -/// a general purpose parameter that is useful for accumulating a key metric that pertains to an -/// event. Examples include revenue, distance, time and points. Value should be specified as signed -/// 64-bit integer or double as NSNumber. Notes: Values for pre-defined currency-related events -/// (such as @c kFIREventAddToCart) should be supplied using double as NSNumber and must be -/// accompanied by a @c kFIRParameterCurrency parameter. The valid range of accumulated values is -/// [-9,223,372,036,854.77, 9,223,372,036,854.77]. -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterValue : @(3.99), -/// kFIRParameterCurrency : @"USD", // e.g. $3.99 USD -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterValue = @"value"; - -/// Name of virtual currency type (NSString). -/// <pre> -/// NSDictionary *params = @{ -/// kFIRParameterVirtualCurrencyName : @"virtual_currency_name", -/// // ... -/// }; -/// </pre> -static NSString *const kFIRParameterVirtualCurrencyName = @"virtual_currency_name"; diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h deleted file mode 100755 index 54cf1c20..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FIRUserPropertyNames.h +++ /dev/null @@ -1,13 +0,0 @@ -/// @file FIRUserPropertyNames.h -/// -/// Predefined user property names. -/// -/// A UserProperty is an attribute that describes the app-user. By supplying UserProperties, you can -/// later analyze different behaviors of various segments of your userbase. You may supply up to 25 -/// unique UserProperties per app, and you can use the name and value of your choosing for each one. -/// UserProperty names can be up to 24 characters long, may only contain alphanumeric characters and -/// underscores ("_"), and must start with an alphabetic character. UserProperty values can be up to -/// 36 characters long. The "firebase_" prefix is reserved and should not be used. - -/// The method used to sign in. For example, "google", "facebook" or "twitter". -static NSString *const kFIRUserPropertySignUpMethod = @"sign_up_method"; diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h deleted file mode 100755 index 3142c97b..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Headers/FirebaseAnalytics.h +++ /dev/null @@ -1,9 +0,0 @@ -#import "FIRAnalyticsConfiguration.h" -#import "FIRApp.h" -#import "FIRConfiguration.h" -#import "FIROptions.h" -#import "FIRAnalytics+AppDelegate.h" -#import "FIRAnalytics.h" -#import "FIREventNames.h" -#import "FIRParameterNames.h" -#import "FIRUserPropertyNames.h" diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap deleted file mode 100755 index c9bd66bc..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseAnalytics.framework/Modules/module.modulemap +++ /dev/null @@ -1,10 +0,0 @@ -framework module FirebaseAnalytics { - umbrella header "FirebaseAnalytics.h" - export * - module * { export *} - link "sqlite3" - link "z" - link framework "CoreGraphics" - link framework "Foundation" - link framework "UIKit" -}
\ No newline at end of file diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/FirebaseCore b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/FirebaseCore Binary files differdeleted file mode 100755 index 364c6d67..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/FirebaseCore +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h deleted file mode 100755 index a25647b4..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRConfiguration.h +++ /dev/null @@ -1,52 +0,0 @@ -#import <Foundation/Foundation.h> - -#import "FIRAnalyticsConfiguration.h" -#import "FIRLoggerLevel.h" - -/** - * The log levels used by FIRConfiguration. - */ -typedef NS_ENUM(NSInteger, FIRLogLevel) { - /** Error */ - kFIRLogLevelError __deprecated = 0, - /** Warning */ - kFIRLogLevelWarning __deprecated, - /** Info */ - kFIRLogLevelInfo __deprecated, - /** Debug */ - kFIRLogLevelDebug __deprecated, - /** Assert */ - kFIRLogLevelAssert __deprecated, - /** Max */ - kFIRLogLevelMax __deprecated = kFIRLogLevelAssert -} DEPRECATED_MSG_ATTRIBUTE( - "Use -FIRDebugEnabled and -FIRDebugDisabled or setLoggerLevel. See FIRApp.h for more details."); - -/** - * This interface provides global level properties that the developer can tweak, and the singleton - * of the Firebase Analytics configuration class. - */ -@interface FIRConfiguration : NSObject - -/** Returns the shared configuration object. */ -+ (FIRConfiguration *)sharedInstance; - -/** The configuration class for Firebase Analytics. */ -@property(nonatomic, readwrite) FIRAnalyticsConfiguration *analyticsConfiguration; - -/** Global log level. Defaults to kFIRLogLevelError. */ -@property(nonatomic, readwrite, assign) FIRLogLevel logLevel DEPRECATED_MSG_ATTRIBUTE( - "Use -FIRDebugEnabled and -FIRDebugDisabled or setLoggerLevel. See FIRApp.h for more details."); - -/** - * Sets the logging level for internal Firebase logging. Firebase will only log messages - * that are logged at or below loggerLevel. The messages are logged both to the Xcode - * console and to the device's log. Note that if an app is running from AppStore, it will - * never log above FIRLoggerLevelNotice even if loggerLevel is set to a higher (more verbose) - * setting. - * - * @param loggerLevel The maximum logging level. The default level is set to FIRLoggerLevelNotice. - */ -- (void)setLoggerLevel:(FIRLoggerLevel)loggerLevel; - -@end diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h deleted file mode 100755 index ddf683f7..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIRLoggerLevel.h +++ /dev/null @@ -1,12 +0,0 @@ -/** - * The log levels used by internal logging. - */ -typedef NS_ENUM(NSInteger, FIRLoggerLevel) { - FIRLoggerLevelError = 3 /*ASL_LEVEL_ERR*/, - FIRLoggerLevelWarning = 4 /*ASL_LEVEL_WARNING*/, - FIRLoggerLevelNotice = 5 /*ASL_LEVEL_NOTICE*/, - FIRLoggerLevelInfo = 6 /*ASL_LEVEL_INFO*/, - FIRLoggerLevelDebug = 7 /*ASL_LEVEL_DEBUG*/, - FIRLoggerLevelMin = FIRLoggerLevelError, - FIRLoggerLevelMax = FIRLoggerLevelDebug -}; diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h deleted file mode 100755 index 083082ab..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FIROptions.h +++ /dev/null @@ -1,93 +0,0 @@ -#import <Foundation/Foundation.h> - -/** - * This class provides constant fields of Google APIs. - */ -@interface FIROptions : NSObject<NSCopying> - -/** - * Returns the default options. - */ -+ (FIROptions *)defaultOptions; - -/** - * An iOS API key used for authenticating requests from your app, e.g. - * @"AIzaSyDdVgKwhZl0sTTTLZ7iTmt1r3N2cJLnaDk", used to identify your app to Google servers. - */ -@property(nonatomic, readonly, copy) NSString *APIKey; - -/** - * The OAuth2 client ID for iOS application used to authenticate Google users, for example - * @"12345.apps.googleusercontent.com", used for signing in with Google. - */ -@property(nonatomic, readonly, copy) NSString *clientID; - -/** - * The tracking ID for Google Analytics, e.g. @"UA-12345678-1", used to configure Google Analytics. - */ -@property(nonatomic, readonly, copy) NSString *trackingID; - -/** - * The Project Number from the Google Developer's console, for example @"012345678901", used to - * configure Google Cloud Messaging. - */ -@property(nonatomic, readonly, copy) NSString *GCMSenderID; - -/** - * The Project ID from the Firebase console, for example @"abc-xyz-123". Currently only populated - * when using [FIROptions defaultOptions]. - */ -@property(nonatomic, readonly, copy) NSString *projectID; - -/** - * The Android client ID used in Google AppInvite when an iOS app has its Android version, for - * example @"12345.apps.googleusercontent.com". - */ -@property(nonatomic, readonly, copy) NSString *androidClientID; - -/** - * The Google App ID that is used to uniquely identify an instance of an app. - */ -@property(nonatomic, readonly, copy) NSString *googleAppID; - -/** - * The database root URL, e.g. @"http://abc-xyz-123.firebaseio.com". - */ -@property(nonatomic, readonly, copy) NSString *databaseURL; - -/** - * The URL scheme used to set up Durable Deep Link service. - */ -@property(nonatomic, readwrite, copy) NSString *deepLinkURLScheme; - -/** - * The Google Cloud Storage bucket name, e.g. @"abc-xyz-123.storage.firebase.com". - */ -@property(nonatomic, readonly, copy) NSString *storageBucket; - -/** - * Initializes a customized instance of FIROptions with keys. googleAppID, bundleID and GCMSenderID - * are required. Other keys may required for configuring specific services. - */ -- (instancetype)initWithGoogleAppID:(NSString *)googleAppID - bundleID:(NSString *)bundleID - GCMSenderID:(NSString *)GCMSenderID - APIKey:(NSString *)APIKey - clientID:(NSString *)clientID - trackingID:(NSString *)trackingID - androidClientID:(NSString *)androidClientID - databaseURL:(NSString *)databaseURL - storageBucket:(NSString *)storageBucket - deepLinkURLScheme:(NSString *)deepLinkURLScheme; - -/** - * Initializes a customized instance of FIROptions from the file at the given plist file path. - * For example, - * NSString *filePath = - * [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; - * FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath]; - * Returns nil if the plist file does not exist or is invalid. - */ -- (instancetype)initWithContentsOfFile:(NSString *)plistPath; - -@end diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h deleted file mode 100755 index 52a222f5..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseCore.framework/Headers/FirebaseCore.h +++ /dev/null @@ -1,5 +0,0 @@ -#import "FIRAnalyticsConfiguration.h" -#import "FIRApp.h" -#import "FIRConfiguration.h" -#import "FIRLoggerLevel.h" -#import "FIROptions.h" diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID Binary files differdeleted file mode 100755 index 2ebc6e68..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/FirebaseInstanceID +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h deleted file mode 100755 index 5ff8372e..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FIRInstanceID.h +++ /dev/null @@ -1,245 +0,0 @@ -#import <Foundation/Foundation.h> - -/** - * @memberof FIRInstanceID - * - * The scope to be used when fetching/deleting a token for Firebase Messaging. - */ -FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDScopeFirebaseMessaging; - -/** - * Called when the system determines that tokens need to be refreshed. - * This method is also called if Instance ID has been reset in which - * case, tokens and FCM topic subscriptions also need to be refreshed. - * - * Instance ID service will throttle the refresh event across all devices - * to control the rate of token updates on application servers. - */ -FOUNDATION_EXPORT NSString * __nonnull const kFIRInstanceIDTokenRefreshNotification; - -/** - * @related FIRInstanceID - * - * The completion handler invoked when the InstanceID token returns. If - * the call fails we return the appropriate `error code` as described below. - * - * @param token The valid token as returned by InstanceID backend. - * - * @param error The error describing why generating a new token - * failed. See the error codes below for a more detailed - * description. - */ -typedef void(^FIRInstanceIDTokenHandler)( NSString * __nullable token, NSError * __nullable error); - - -/** - * @related FIRInstanceID - * - * The completion handler invoked when the InstanceID `deleteToken` returns. If - * the call fails we return the appropriate `error code` as described below - * - * @param error The error describing why deleting the token failed. - * See the error codes below for a more detailed description. - */ -typedef void(^FIRInstanceIDDeleteTokenHandler)(NSError * __nullable error); - -/** - * @related FIRInstanceID - * - * The completion handler invoked when the app identity is created. If the - * identity wasn't created for some reason we return the appropriate error code. - * - * @param identity A valid identity for the app instance, nil if there was an error - * while creating an identity. - * @param error The error if fetching the identity fails else nil. - */ -typedef void(^FIRInstanceIDHandler)(NSString * __nullable identity, NSError * __nullable error); - -/** - * @related FIRInstanceID - * - * The completion handler invoked when the app identity and all the tokens associated - * with it are deleted. Returns a valid error object in case of failure else nil. - * - * @param error The error if deleting the identity and all the tokens associated with - * it fails else nil. - */ -typedef void(^FIRInstanceIDDeleteHandler)(NSError * __nullable error); - -/** - * @enum FIRInstanceIDError - */ -typedef NS_ENUM(NSUInteger, FIRInstanceIDError) { - // Http related errors. - - /// Unknown error. - FIRInstanceIDErrorUnknown = 0, - - /// Auth Error -- GCM couldn't validate request from this client. - FIRInstanceIDErrorAuthentication = 1, - - /// NoAccess -- InstanceID service cannot be accessed. - FIRInstanceIDErrorNoAccess = 2, - - /// Timeout -- Request to InstanceID backend timed out. - FIRInstanceIDErrorTimeout = 3, - - /// Network -- No network available to reach the servers. - FIRInstanceIDErrorNetwork = 4, - - /// OperationInProgress -- Another similar operation in progress, - /// bailing this one. - FIRInstanceIDErrorOperationInProgress = 5, - - /// InvalidRequest -- Some parameters of the request were invalid. - FIRInstanceIDErrorInvalidRequest = 7, -}; - -/** - * The APNS token type for the app. If the token type is set to `UNKNOWN` - * InstanceID will implicitly try to figure out what the actual token type - * is from the provisioning profile. - */ -typedef NS_ENUM(NSInteger, FIRInstanceIDAPNSTokenType) { - /// Unknown token type. - FIRInstanceIDAPNSTokenTypeUnknown, - /// Sandbox token type. - FIRInstanceIDAPNSTokenTypeSandbox, - /// Production token type. - FIRInstanceIDAPNSTokenTypeProd, -}; - -/** - * Instance ID provides a unique identifier for each app instance and a mechanism - * to authenticate and authorize actions (for example, sending a GCM message). - * - * Instance ID is long lived but, may be reset if the device is not used for - * a long time or the Instance ID service detects a problem. - * If Instance ID is reset, the app will be notified via - * `kFIRInstanceIDTokenRefreshNotification`. - * - * If the Instance ID has become invalid, the app can request a new one and - * send it to the app server. - * To prove ownership of Instance ID and to allow servers to access data or - * services associated with the app, call - * `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. - */ -@interface FIRInstanceID : NSObject - -/** - * FIRInstanceID. - * - * @return A shared instance of FIRInstanceID. - */ -+ (nonnull instancetype)instanceID NS_SWIFT_NAME(instanceID()); - -/** - * Unavailable. Use +instanceID instead. - */ -- (nonnull instancetype)init __attribute__((unavailable("Use +instanceID instead."))); - -/** - * Set APNS token for the application. This APNS token will be used to register - * with Firebase Messaging using `token` or - * `tokenWithAuthorizedEntity:scope:options:handler`. If the token type is set to - * `FIRInstanceIDAPNSTokenTypeUnknown` InstanceID will read the provisioning profile - * to find out the token type. - * - * @param token The APNS token for the application. - * @param type The APNS token type for the above token. - */ -- (void)setAPNSToken:(nonnull NSData *)token - type:(FIRInstanceIDAPNSTokenType)type; - -#pragma mark - Tokens - -/** - * Returns a Firebase Messaging scoped token for the firebase app. - * - * @return Null Returns null if the device has not yet been registerd with - * Firebase Message else returns a valid token. - */ -- (nullable NSString *)token; - -/** - * Returns a token that authorizes an Entity (example: cloud service) to perform - * an action on behalf of the application identified by Instance ID. - * - * This is similar to an OAuth2 token except, it applies to the - * application instance instead of a user. - * - * This is an asynchronous call. If the token fetching fails for some reason - * we invoke the completion callback with nil `token` and the appropriate - * error. - * - * Note, you can only have one `token` or `deleteToken` call for a given - * authorizedEntity and scope at any point of time. Making another such call with the - * same authorizedEntity and scope before the last one finishes will result in an - * error with code `OperationInProgress`. - * - * @see FIRInstanceID deleteTokenWithAuthorizedEntity:scope:handler: - * - * @param authorizedEntity Entity authorized by the token. - * @param scope Action authorized for authorizedEntity. - * @param options The extra options to be sent with your token request. The - * value for the `apns_token` should be the NSData object - * passed to UIApplication's - * `didRegisterForRemoteNotificationsWithDeviceToken` method. - * All other keys and values in the options dict need to be - * instances of NSString or else they will be discarded. Bundle - * keys starting with 'GCM.' and 'GOOGLE.' are reserved. - * @param handler The callback handler which is invoked when the token is - * successfully fetched. In case of success a valid `token` and - * `nil` error are returned. In case of any error the `token` - * is nil and a valid `error` is returned. The valid error - * codes have been documented above. - */ -- (void)tokenWithAuthorizedEntity:(nonnull NSString *)authorizedEntity - scope:(nonnull NSString *)scope - options:(nullable NSDictionary *)options - handler:(nonnull FIRInstanceIDTokenHandler)handler; - -/** - * Revokes access to a scope (action) for an entity previously - * authorized by `[FIRInstanceID tokenWithAuthorizedEntity:scope:options:handler]`. - * - * This is an asynchronous call. Call this on the main thread since InstanceID lib - * is not thread safe. In case token deletion fails for some reason we invoke the - * `handler` callback passed in with the appropriate error code. - * - * Note, you can only have one `token` or `deleteToken` call for a given - * authorizedEntity and scope at a point of time. Making another such call with the - * same authorizedEntity and scope before the last one finishes will result in an error - * with code `OperationInProgress`. - * - * @param authorizedEntity Entity that must no longer have access. - * @param scope Action that entity is no longer authorized to perform. - * @param handler The handler that is invoked once the unsubscribe call ends. - * In case of error an appropriate error object is returned - * else error is nil. - */ -- (void)deleteTokenWithAuthorizedEntity:(nonnull NSString *)authorizedEntity - scope:(nonnull NSString *)scope - handler:(nonnull FIRInstanceIDDeleteTokenHandler)handler; - -#pragma mark - Identity - -/** - * Asynchronously fetch a stable identifier that uniquely identifies the app - * instance. If the identifier has been revoked or has expired, this method will - * return a new identifier. - * - * - * @param handler The handler to invoke once the identifier has been fetched. - * In case of error an appropriate error object is returned else - * a valid identifier is returned and a valid identifier for the - * application instance. - */ -- (void)getIDWithHandler:(nonnull FIRInstanceIDHandler)handler; - -/** - * Resets Instance ID and revokes all tokens. - */ -- (void)deleteIDWithHandler:(nonnull FIRInstanceIDDeleteHandler)handler; - -@end diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h deleted file mode 100755 index 053ec2b1..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/FirebaseInstanceID.framework/Headers/FirebaseInstanceID.h +++ /dev/null @@ -1 +0,0 @@ -#import "FIRInstanceID.h" diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac Binary files differdeleted file mode 100644 index 345b889c..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Analytics/GoogleToolboxForMac.framework/GoogleToolboxForMac +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/FirebaseCrash b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/FirebaseCrash Binary files differdeleted file mode 100755 index 7cf08c10..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/FirebaseCrash +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrashLog.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrashLog.h deleted file mode 100755 index ac446a62..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FIRCrashLog.h +++ /dev/null @@ -1,164 +0,0 @@ -#import <Foundation/Foundation.h> - -NS_ASSUME_NONNULL_BEGIN - -/** - * @abstract Logs a message to the Firebase Crash Reporter system. - * - * @discussion This method adds a message to the crash reporter - * logging system. The recent logs will be sent with the crash - * report when the application exits abnormally. Note that the - * timestamp of this message and the timestamp of the console - * message may differ by a few milliseconds. - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @warning Raises an NSInvalidArgumentException if @p format is nil. - * - * @param format A format string. - * - * @param ap A variable argument list. - */ -FOUNDATION_EXTERN NS_FORMAT_FUNCTION(1, 0) -void FIRCrashLogv(NSString *format, va_list ap); - -/** - * @abstract Logs a message to the Firebase Crash Reporter system. - * - * @discussion This method adds a message to the crash reporter - * logging system. The recent logs will be sent with the crash - * report when the application exits abnormally. Note that the - * timestamp of this message and the timestamp of the console - * message may differ by a few milliseconds. - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @warning Raises an NSInvalidArgumentException if @p format is nil. - * - * @param format A format string. - * - * @param ... A comma-separated list of arguments to substitute into - * format. - * - * @see FIRCrashLogv(format, ap) - */ -FOUNDATION_STATIC_INLINE NS_FORMAT_FUNCTION(1, 2) -void FIRCrashLog(NSString *format, ...) { - va_list ap; - - va_start(ap, format); - FIRCrashLogv(format, ap); - va_end(ap); -} - -/** - * @abstract Logs a message to the Firebase Crash Reporter system as - * well as <code>NSLog()</code>. - * - * @discussion This method adds a message to the crash reporter - * logging system. The recent logs will be sent with the crash - * report when the application exits abnormally. Note that the - * timestamp of this message and the timestamp of the console - * message may differ by a few milliseconds. - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @warning Raises an NSInvalidArgumentException if @p format is nil. - * - * @param format A format string. - * - * @param ap A variable argument list. - */ -FOUNDATION_STATIC_INLINE NS_FORMAT_FUNCTION(1, 0) -void FIRCrashNSLogv(NSString *format, va_list ap) { - va_list ap2; - - va_copy(ap2, ap); - NSLogv(format, ap); - FIRCrashLogv(format, ap2); - va_end(ap2); -} - -/** - * @abstract Logs a message to the Firebase Crash Reporter system as - * well as <code>NSLog()</code>. - * - * @discussion This method adds a message to the crash reporter - * logging system. The recent logs will be sent with the crash - * report when the application exits abnormally. Note that the - * timestamp of this message and the timestamp of the console - * message may differ by a few milliseconds. - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @warning Raises an NSInvalidArgumentException if @p format is nil. - * - * @param format A format string. - * - * @param ... A comma-separated list of arguments to substitute into - * format. - * - * @see FIRCrashLogv(format, ap) - */ -FOUNDATION_STATIC_INLINE NS_FORMAT_FUNCTION(1, 2) -void FIRCrashNSLog(NSString *format, ...) { - va_list ap; - - va_start(ap, format); - FIRCrashNSLogv(format, ap); - va_end(ap); -} - -/** - * @abstract Logs a message to the Firebase Crash Reporter system in - * a way that is easily called from Swift code. - * - * @discussion This method adds a message to the crash reporter - * logging system. Similar to FIRCrashLog, but with a call signature - * that is more Swift friendly. Unlike FIRCrashLog, callers - * use string interpolation instead of formatting arguments. - * - * @code - * public func mySwiftFunction() { - * let unexpected_number = 10; - * FIRCrashMessage("This number doesn't seem right: \(unexpected_number)"); - * } - * @endcode - * - * Messages should be brief as the total size of the message payloads - * is limited by the uploader and may change between releases of the - * crash reporter. Excessively long messages will be truncated - * safely but that will introduce a delay in submitting the message. - * - * @param Message A log message - * - * @see FIRCrashLog(format, ...) - */ -FOUNDATION_STATIC_INLINE -void FIRCrashMessage(NSString *message) { - FIRCrashLog(@"%@", message); -} - -NS_ASSUME_NONNULL_END - -#ifdef FIRCRASH_REPLACE_NSLOG -#if defined(DEBUG) || defined(FIRCRASH_LOG_TO_CONSOLE) -#define NSLog(...) FIRCrashNSLog(__VA_ARGS__) -#define NSLogv(...) FIRCrashNSLogv(__VA_ARGS__) -#else -#define NSLog(...) FIRCrashLog(__VA_ARGS__) -#define NSLogv(...) FIRCrashLogv(__VA_ARGS__) -#endif -#endif diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FirebaseCrash.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FirebaseCrash.h deleted file mode 100755 index 18659214..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Headers/FirebaseCrash.h +++ /dev/null @@ -1 +0,0 @@ -#import "FIRCrashLog.h" diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Modules/module.modulemap b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Modules/module.modulemap deleted file mode 100755 index 537a790a..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/FirebaseCrash.framework/Modules/module.modulemap +++ /dev/null @@ -1,12 +0,0 @@ -framework module FirebaseCrash { - umbrella header "FirebaseCrash.h" - export * - module * { export *} - link "sqlite3" - link "z" - link framework "CoreGraphics" - link framework "CoreTelephony" - link framework "Foundation" - link framework "SystemConfiguration" - link framework "UIKit" -}
\ No newline at end of file diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/Protobuf.framework/Protobuf b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/Protobuf.framework/Protobuf Binary files differdeleted file mode 100644 index 546e02ec..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/Protobuf.framework/Protobuf +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/batch-upload b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/batch-upload deleted file mode 100755 index 053a3ee7..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/batch-upload +++ /dev/null @@ -1,416 +0,0 @@ -#!/bin/bash - -usage () { - echo >&2 "usage: ${0##*/} [-hv] [-p google-service] [-i info] service-account-file {mach-o file|uuid} ..." -} - -help () { - usage - cat >&2 <<EOF - --h Show this help. --p Location of GoogleService-Info.plist. --i Location of Info.plist. --v Be verbose. - -account JSON file containing account information. -mach-o A path to an executable, dSYM file, library, - or other Mach-O object. -uuid A dSYM file's UUID (searches for the file). - -Processes one or more Mach-O files for use with the Firebase Crash -Reporter. dSYM bundles may be specified by full path to the dSYM -companion file (usually found under "DWARF") or by UUID. - -For applications and frameworks, please use the full path to the -Mach-O file. For frameworks, this will be "Blah.framework/Blah". -For applications, this will be "Blah.app/Blah". - -Useful environment variables: - - SERVICE_PLIST - path to GoogleService-Info.plist (-p command-line option) - INFO_PLIST - path to Info.plist (-i command-line option) - DUMP_SYMS - path to dump_syms executable - FCR_BUNDLE_ID - CFBundleIdentifier (build version) from Info.plist - FCR_PROD_VERS - CFBundleShortVersionString from Info.plist - FIREBASE_API_KEY - API key from GoogleService-Info.plist - FIREBASE_APP_ID - App ID from GoogleService-Info.plist - SWIFT_DEMANGLE - path to swift-demangle executable - -Setting any of the above prevents this script from searching for the -values. Specifically, the SERVICE_PLIST and INFO_PLIST files are not -required if FCR_* and FIREBASE_* environment variables are not empty. - -EOF -} - -KEEP_TEMPORARIES=false # mostly for debugging (not documented) - -while getopts hi:kp:v-: OPT; do - case ${OPT} in - h) help; exit 0;; - i) INFO_PLIST="${OPTARG}";; - k) KEEP_TEMPORARIES=true;; - p) SERVICE_PLIST="${OPTARG}";; - v) ((VERBOSE+=1));; - -) case "${OPTARG}" in - help) help; exit 0;; - info=*) INFO_PLIST="${OPTARG#info=}";; - service=*) SERVICE_PLIST="${OPTARG#service=}";; - verbose) ((VERBOSE+=1));; - *) usage; exit 2;; - esac;; - ?) usage; exit 2;; - esac -done - -shift $((OPTIND - 1)) - -. "$(dirname "$0")/upload-sym-util.bash" - -var_check () { - for VAR; do - if [[ "${!VAR}" =~ \$\(.*\) ]]; then - xcwarning "${VAR} (== \"${!VAR}\") appears to have unexpanded variables." - xcnote "Consider specifying it through an environment variable." - fi - done -} - -SERVICE_ACCOUNT_FILE="$1" - -if [[ ! -f "${SERVICE_ACCOUNT_FILE}" ]]; then - xcwarning "The first argument does not look like a service account file." - xcdebug "Will attempt to extract account file from legacy cache." - unset SERVICE_ACCOUNT_FILE -else - shift -fi - -if (( $# == 0 )); then - usage - exit 2 -fi - -if [[ "${INFO_PLIST}" && -f "${INFO_PLIST%/*}/GoogleService-Info.plist" ]]; then - : "${SERVICE_PLIST:="${INFO_PLIST%/*}/GoogleService-Info.plist"}" -fi - -if [[ "${SERVICE_PLIST}" && -f "${SERVICE_PLIST%/*}/Info.plist" ]]; then - : "${INFO_PLIST:="${SERVICE_PLIST%/*}/Info.plist"}" -fi - -xcdebug "SERVICE_PLIST = ${SERVICE_PLIST:="$(find . -name GoogleService-Info.plist | head -n1)"}" - -xcdebug "INFO_PLIST = ${INFO_PLIST:="$(find . -name Info.plist | head -n1)"}" - -if [[ -f "${SERVICE_PLIST}" ]]; then - xcdebug "FIREBASE_API_KEY = ${FIREBASE_API_KEY:="$(/usr/libexec/PlistBuddy -c 'print API_KEY' "${SERVICE_PLIST}")"}" - xcdebug "FIREBASE_APP_ID = ${FIREBASE_APP_ID:="$(/usr/libexec/PlistBuddy -c 'print GOOGLE_APP_ID' "${SERVICE_PLIST}")"}" - xcdebug "FCR_BUNDLE_ID = ${FCR_BUNDLE_ID:="$(/usr/libexec/PlistBuddy -c 'print BUNDLE_ID' "${SERVICE_PLIST}")"}" -fi - -if [[ -f "${INFO_PLIST}" ]]; then - xcdebug "FCR_PROD_VERS = ${FCR_PROD_VERS:="$(/usr/libexec/PlistBuddy -c 'print CFBundleShortVersionString' "${INFO_PLIST}" 2>/dev/null)"}" -fi - -var_check FCR_PROD_VERS FCR_BUNDLE_ID - -ERROR=$'environment variable empty or unset\n\nExplicitly add to environment or set GoogleService-Info.plist (-p)\nand Info.plist (-i) flags to extract values from the files.\n\nTry "'"$0"' -h" for details.' - -: "${FIREBASE_API_KEY:?"${ERROR}"}" "${FIREBASE_APP_ID:?"${ERROR}"}" -: "${FCR_PROD_VERS:?"${ERROR}"}" "${FCR_BUNDLE_ID:?"${ERROR}"}" - -# Extract key from legacy cache. - -if [[ ! "${SERVICE_ACCOUNT_FILE}" ]]; then - xcwarning "Running extract-keys on desktop." - EXTRACT_KEYS="$(script_dir)/extract-keys" - (cd "${HOME}/Desktop"; "${EXTRACT_KEYS}") || exit $? - SERVICE_ACCOUNT_FILE="${HOME}/Desktop/${FIREBASE_APP_ID}.json" - xcdebug "Using ${SERVICE_ACCOUNT_FILE} as account file. Please move this and all other extracted keys to a safe place." -fi - -if [[ ! -f "${SERVICE_ACCOUNT_FILE}" ]]; then - echo >&2 "Unable to find service account file." - echo >&2 - usage - exit 2 -fi - -# usage: extract_symbols_and_upload *dwarf-file* *arch* *exe-file* -# -# Do NOT use the dSYM bundle path. While it may work on occasion, it -# is not guaranteed to do so; the full path to the DWARF companion -# file will always work. (Discovered by Kerem Erkan.) -# -# If the executable is empty, use the DWARF companion file as a proxy -# for the executable. -extract_symbols_and_upload () { - local DWARF_COMPANION="$1" ARCH="$2" EXECUTABLE="$3" - - if [[ ! "${EXECUTABLE}" ]]; then - xcdebug "No executable; using ${DWARF_COMPANION} as symbol source." - - EXECUTABLE="${DWARF_COMPANION}" - unset DWARF_COMPANION - fi - - [[ "${EXECUTABLE}" ]] || return 1 - - if [[ -x "${SWIFT_DEMANGLE:=$(xcrun --find swift-demangle 2>/dev/null)}" ]]; - then - SWIFT_DEMANGLE_COMMAND="${SWIFT_DEMANGLE} -simplified" - else - SWIFT_DEMANGLE_COMMAND=/bin/cat - fi - fcr_mktemp SYMBOL_FILE - - "${DUMP_SYMS:="$(script_dir)/dump_syms"}" -a "${ARCH}" ${DWARF_COMPANION:+-g "${DWARF_COMPANION}"} "${EXECUTABLE}" | ${SWIFT_DEMANGLE_COMMAND} >|"${SYMBOL_FILE}" || return $? - - fcr_upload_files "${SYMBOL_FILE}" || return $? -} - -# usage: is_executable *path* -# -# Check to see if the file is an executable or a dSYM bundle -is_executable () { - [[ -f "$1" || ( -d "$1" && "${1%/}" == *.dSYM ) ]] -} - -# usage: is_uuid *string* -# -# Verify that the argument is a UUID. -is_uuid () { - [[ "$1" =~ ^[[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}$ ]] -} - -# usage: set_uuids_archs *mach-o-file* -# -# side effect: appends to UUIDS, ARCHS -# -# Extract the uuid and architecture information from the given Mach-O -# file and append the information to the UUIDS and ARCHS arrays. -set_uuids_archs () { - eval "$(dwarfdump --uuid "$1" | awk '/^UUID:/ { print "UUIDS+=(" $2 "); ARCHS+=" $3 }')" -} - -# usage: mdls_to_bash -# -# Convert the output of mdls to a string consumable by bash. mdls -# outputs string arrays as quoted strings separated by commas, and -# Unicode characters as '\Uxxxx'. -# -# Note: this is sensitive to the current locale. If the locale is not -# UTF-8, then wide-character warnings will result if the strings -# contain non-ASCII characters. This is actually a desired behavior, -# because bash has issues with non-Unicode encodings for file names. -# (The macOS default is to have UTF-8 enabled, so this should not be a -# problem for the majority of use cases.) -mdls_to_bash () { - perl -C -ple 's/,$//; s/\\U(....)/chr hex $1/ge' -} - -for EXE; do - if is_executable "${EXE}"; then - xcdebug "Assuming ${EXE} is an executable or dSYM bundle." - - # Import architecture UUID information - UUIDS=() ARCHS=() - set_uuids_archs "${EXE}" - - for I in "${!UUIDS[@]}"; do - xcdebug "Found ${UUIDS[$I]} for ${ARCHS[$I]} in ${EXE}" - done - - if ((${#UUIDS[*]} == 0)); then - xcwarning "${EXE} exists, but has no architecture information." - continue - fi - - if [[ "${EXE}" = *.dSYM ]]; then - xcdebug "Removing dSYM bundle as executable target." - unset EXE - fi - - elif is_uuid "${EXE}"; then - xcdebug "${EXE} looks like a UUID to me." - UUIDS=("${EXE}"); unset EXE - - else - xcwarning "${EXE}: not an executable, bundle, or UUID." - continue - fi - - BUNDLES=() - - for UUID in "${UUIDS[@]}"; do - xcdebug "Searching for ${UUID} ..." - - QUERY_UUID="com_apple_xcode_dsym_uuids == '${UUID}'" - QUERY_TYPE="kMDItemContentType == 'com.apple.xcode.dsym' || kMDItemContentType == 'com.apple.xcode.archive'" - QUERY="(${QUERY_UUID}) && (${QUERY_TYPE})" - - if ((VERBOSE > 1)); then - xcnote "Passing query \"${QUERY}\" to mdfind." - fi - - MD_FIND_RESULT=() - - eval "$(mdfind "${QUERY}" -0 | xargs -0 perl -le 'print "MD_FIND_RESULT+=(\Q$_\E)" for @ARGV')" - - xcdebug "mdfind returned (${MD_FIND_RESULT[*]})" - - # BUNDLES should contain no duplicates. - for I in "${!MD_FIND_RESULT[@]}"; do - for BUNDLE in "${BUNDLES[@]}"; do - if [[ "${MD_FIND_RESULT[$I]}" == "$BUNDLE" ]]; then - unset "MD_FIND_RESULT[$I]" - fi - done - done - - BUNDLES+=("${MD_FIND_RESULT[@]}") - done - - if [[ ${#BUNDLES[@]} == 0 && ${#ARCHS[@]} == 0 ]]; then - xcwarning "No executable or bundle found for ${UUIDS[*]}." - xcnote "Try passing in the executable itself instead of a UUID." - continue - fi - - xcdebug "BUNDLES = (${BUNDLES[*]})" - - if [[ ${#BUNDLES[@]} == 0 ]]; then - xcdebug "No dSYM bundle found." - - # The dSYM has to be on a normal volume (not temporary). It - # can, however, be shared among multiple executables. - if [[ ! "${SCRATCH_BUNDLE}" ]]; then - SCRATCH_BUNDLE="${HOME}/com.google.BatchUploadScratchFile.dSYM" - FCR_TEMPORARY_FILES+=("${SCRATCH_BUNDLE}") - fi - - xcdebug "Creating one in ${SCRATCH_BUNDLE}" - - BUNDLES=("${SCRATCH_BUNDLE}") - - # Create the dSYM bundle. This may produce an empty dSYM - # bundle if the executable has no debugging information. - xcrun dsymutil -o "${BUNDLES[0]}" "${EXE}"; STATUS=$? - - if ((STATUS)); then - xcwarning "Command dsymutil failed with exit code ${STATUS}." - continue - fi - - # Import the dSYM bundle. There is a momentary delay between - # creating the bundle and having it indexed; explicitly - # importing guarantees the mds database is up-to-date when we - # ask it for information about UUIDs and paths. - mdimport "${SCRATCH_BUNDLE}"; STATUS=$? - - if ((STATUS)); then - xcwarning "Command mdimport failed with exit code ${STATUS}." - continue - fi - fi - - SEEN_ARCH=() SEEN_PATH=() - - for BUNDLE in "${BUNDLES[@]}"; do - typeset -a BNDL_UUIDS BNDL_PATHS # keeps ShellLint happy - - eval "BNDL_UUIDS=$(mdls -raw -name com_apple_xcode_dsym_uuids "${BUNDLE}" | mdls_to_bash)" - eval "BNDL_PATHS=$(mdls -raw -name com_apple_xcode_dsym_paths "${BUNDLE}" | mdls_to_bash)" - - # Neither of these SHOULD occur, but curious things happen out - # in the field. - if ((${#BNDL_UUIDS[@]} != ${#BNDL_PATHS[@]})); then - xcwarning "${BUNDLE}: Malformed dSYM bundle." - continue - elif ((${#BNDL_UUIDS[@]} == 0)); then - xcwarning "${BUNDLE}: No DWARF information." - continue - fi - - # If no executable was specified, then the UUIDS and ARCHS - # arrays are empty. Populate them with information from the - # bundle. - if [[ ! "${EXE}" ]]; then - # The final UUIDS setting will be the intersection of the - # discovered set and the originally specified UUIDS. This - # is to prevent uploading potentially private information. - SOUGHT_UUIDS=("${UUIDS[@]}") - - UUIDS=() ARCHS=() - for BNDL_PATH in "${BNDL_PATHS[@]}"; do - set_uuids_archs "${BUNDLE}/${BNDL_PATH}" - done - - if ((${#SOUGHT_UUIDS[@]})); then - for I in "${!UUIDS[@]}"; do - for UUID in "${SOUGHT_UUIDS[@]}"; do - if [[ "${UUIDS[$I]}" == "${UUID}" ]]; then - continue 2 - fi - done - - # This is not the DWARF you are looking for... - xcdebug "Rejecting ${UUIDS[$I]} (${ARCHS[$I]}) as candidate DWARF file." - unset "UUIDS[$I]" "ARCHS[$I]" - done - fi - - unset SOUGHT_UUIDS - fi - - for I in "${!BNDL_UUIDS[@]}"; do - # See comment on extract_symbols_and_upload for why the - # full path to the companion file is required. - - BNDL_UUID="${BNDL_UUIDS[$I]}" DWARF_COMPANION="${BUNDLE}/${BNDL_PATHS[$I]}" - - for J in "${!ARCHS[@]}"; do - # A dSYM bundle can contain multiple architectures for - # multiple applications. Make sure we get the right - # one. - if [[ "${BNDL_UUID}" == "${UUIDS[$J]}" ]]; then - ARCH="${ARCHS[$J]}" - break - fi - done - - if [[ ! "${ARCH}" ]]; then - # This is not an error: it is legal for a dSYM bundle - # to contain debugging information for multiple - # executables (such as a framework with multiple - # subframeworks). Just ignore it. - xcdebug "No matching information found in ${DWARF_COMPANION} with UUID ${BNDL_UUID}." - continue - fi - - xcdebug "Found ${UUID} for ${ARCH} in ${DWARF_COMPANION}" - - # Have we already uploaded this file? - for J in "${!SEEN_ARCH[@]}"; do - if [[ "${ARCH}" == "${SEEN_ARCH[$J]}" ]] && cmp -s "${DWARF_COMPANION}" "${SEEN_PATH[$J]}"; then - xcdebug "${DWARF_COMPANION}: copy of ${SEEN_PATH[$J]}; no need to upload." - continue 2 - fi - done - - if [[ -f "${DWARF_COMPANION}" ]]; then - extract_symbols_and_upload "${DWARF_COMPANION}" "${ARCH}" "${EXE}" || exit $? - SEEN_ARCH+=("${ARCH}") SEEN_PATH+=("${DWARF_COMPANION}") - fi - done - done -done - -# For debugging odd cases. -if "${KEEP_TEMPORARIES}"; then - FCR_TEMPORARY_FILES=() -fi - -echo "Done." diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/dump_syms b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/dump_syms Binary files differdeleted file mode 100755 index 8d0ef781..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/dump_syms +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/extract-keys b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/extract-keys deleted file mode 100755 index 0da57003..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/extract-keys +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -PLIST="${HOME}/Library/Preferences/com.google.SymbolUpload.plist" - -[[ -f $PLIST ]] || exit - -defaults read com.google.SymbolUpload | -perl -nle '/"(app_\d+_\d+_ios_.*)"/ and print $1' | -while read KEY; do - APP_ID="${KEY#app_}"; APP_ID="${APP_ID//_/:}" - plutil -extract "${KEY}" json -o "${APP_ID}.json" "${PLIST}" -done diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym deleted file mode 100755 index 1f8327dc..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym +++ /dev/null @@ -1,273 +0,0 @@ -#!/bin/bash - -usage () { - echo >&2 "usage: $0 [-h] [-v] [-w|-e] service-account-file" -} - -help () { - usage - - cat >&2 <<EOF - - -h This message. - -v Increase verbosity. Multiple -v options will provide - increasing details. Use at least '-vv' when reporting bugs. - -w Treat errors as warnings. Does not change the exit status. - -e Treat warnings as errors. Does not change the exit status. - -The service account private key file is downloaded from the Firebase -console. See - - https://firebase.google.com/docs/crash/ios#upload_symbol_files - -for details on retrieving this file. Older keys may still be in the -registry. Consider using extract-keys.pl to retrieve them. - -Execute this script in the final phase of your build. It will not -work outside of Xcode, and should warn you if you try. See the -batch-upload script included in this distribution to upload symbols -outside of an Xcode build. - -Here is an example Run Script Phase you can add to your project -to invoke this script: - - "\${PODS_ROOT}/FirebaseCrashReporting/upload-sym" \\ - "\${HOME}/Library/Developer/My Project-1fad0d0767b42e.json" - -To avoid stopping the build should the upload fail, - - "\${PODS_ROOT}/FirebaseCrashReporting/upload-sym" -w \\ - "\${HOME}/Library/Developer/My Project-1fad0d0767b42e.json" - exit 0 # claim success no matter what - -EOF -} - -# Parse optional command-line flags. - -VERBOSE=0 WARNINGS_ONLY=0 ERRORS_ONLY=0 - -while getopts ehvw OPT; do - case "${OPT}" in - h) help; exit 0;; - v) VERBOSE=$((VERBOSE + 1));; - w) WARNINGS_ONLY=1;; - e) ERRORS_ONLY=1;; - ?) usage; exit 2;; - esac -done - -shift $((OPTIND - 1)) - -if ((WARNINGS_ONLY && ERRORS_ONLY)); then - echo >&2 "Either -w or -e may be specified, but not both." - echo >&2 - usage - exit 2 -fi - -SERVICE_ACCOUNT_FILE="$1"; shift - -if (($#)); then - echo >&2 "Unexpected argument '$1'" - echo >&2 - usage - exit 2 -fi - -export PATH=/bin:/usr/bin # play it safe - -# Load common utility routines. - -. "$(dirname "$0")/upload-sym-util.bash" - -# Make the error output Xcode-friendly. - -# This is a bit of Bash voodoo that cries for an explanation and is -# horribly underdocumented on-line. The construct '>(...)' starts a -# subprocess with its stdin connected to a pipe. After starting the -# subprocess, the parser replaces the construct with the NAME of the -# writable end of the pipe as a named file descriptor '/dev/fd/XX', -# then reevaluates the line. So, after the subprocess is started -# (which filters stdin and outputs to stderr [not stdout]), the line -# "exec 2> /dev/fd/XX" is evaluated. This redirects the main -# process's stderr to the given file descriptor. -# -# The end result is that anything sent to stderr of the form: -# file.in: line 47: blah blah -# is replaced with -# file.in:47: error: blah blah -# which Xcode will detect and emphasize in the formatted output. - -exec 2> >(sed -e 's/: line \([0-9]*\):/:\1: error:/' >&2) - -# Be long-winded about problems. The user may not understand how this -# script works or what prerequisites it has. If the user sees this, -# it is likely that they are executing the script outside of an Xcode -# build. - -ERRMSG=$'Value missing\n\nThis script must be executed as part of an Xcode build stage to have the\nproper environment variables set.' - -# Locate Xcode-generated files. - -: "${TARGET_BUILD_DIR:?"${ERRMSG}"}" -: "${FULL_PRODUCT_NAME:?"${ERRMSG}"}" - -DSYM_BUNDLE="${DWARF_DSYM_FOLDER_PATH?"${ERRMSG}"}/${DWARF_DSYM_FILE_NAME?"${ERRMSG}"}" -[[ -e "${DSYM_BUNDLE}" ]] || unset DSYM_BUNDLE - -EXECUTABLE="${TARGET_BUILD_DIR?"${ERRMSG}"}/${EXECUTABLE_PATH?"${ERRMSG}"}" - -# Locate dump_syms utility. - -if ! [[ -f "${FCR_DUMP_SYMS:=$(script_dir)/dump_syms}" && -x "${FCR_DUMP_SYMS}" ]]; then - xcerror "Cannot find dump_syms." - xcnote "It should have been installed with the Cocoapod. The location of dump_syms can be explicitly set using the environment variable FCR_DUMP_SYMS if you are using a non-standard install." - - exit 2 -fi - -if [[ ! "${FIREBASE_API_KEY}" || ! "${FIREBASE_APP_ID}" ]]; then - : "${SERVICE_PLIST:="$(find "${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}" -name GoogleService-Info.plist | head -n1)"}" - : "${SERVICE_PLIST:?"GoogleService-Info.plist could not be located"}" - : "${FIREBASE_API_KEY:="$(property API_KEY "${SERVICE_PLIST}")"}" - : "${FIREBASE_APP_ID:="$(property GOOGLE_APP_ID "${SERVICE_PLIST}")"}" -fi - -if ! [[ "${FIREBASE_API_KEY}" ]]; then - xcerror "Unable to get API_KEY from ${SERVICE_PLIST}." - xcnote "Specify FIREBASE_API_KEY in environment." - exit 2 -fi - -if ! [[ "${FIREBASE_APP_ID}" ]]; then - xcerror "Unable to get GOOGLE_APP_ID from ${SERVICE_PLIST}." - xcnote "Specify FIREBASE_APP_ID in environment." - exit 2 -fi - -# Load Info.plist values (Bundle ID & version) - -INFOPLIST="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" - -if [[ -f "${INFOPLIST}" ]]; then - : "${FCR_PROD_VERS:="$(property CFBundleShortVersionString "${INFOPLIST}")"}" - : "${FCR_BUNDLE_ID:="$(property CFBundleIdentifier "${INFOPLIST}")"}" -fi - -if ! [[ "${FCR_PROD_VERS}" ]]; then - xcerror "Unable to get CFBundleShortVersionString from Info.plist." - xcnote "Specify FCR_PROD_VERS in environment." - exit 2 -fi - -if ! [[ "${FCR_BUNDLE_ID}" ]]; then - xcerror "Unable to get CFBundleIdentifier from Info.plist." - xcnote "Specify FCR_BUNDLE_ID in environment." - exit 2 -fi - -# Support legacy account file cache before giving up - -if [[ ! -f "${SERVICE_ACCOUNT_FILE}" ]]; then - xcwarning "Unable to find service account JSON file: ${SERVICE_ACCOUNT_FILE}" - "Please ensure you've followed the steps at:" - "https://firebase.google.com/docs/crash/ios#upload_symbol_files" - - xcdebug "Trying to extract JSON file from cache." - - CACHE_PLIST="${HOME}/Library/Preferences/com.google.SymbolUpload.plist" - - if [[ -f "${CACHE_PLIST}" ]]; then - fcr_mktemp SERVICE_ACCOUNT_FILE - /usr/bin/plutil -extract "app_${FIREBASE_APP_ID//:/_}" \ - json -o "${SERVICE_ACCOUNT_FILE}" "${CACHE_PLIST}" >/dev/null 2>&1 - if [[ ! -s "${SERVICE_ACCOUNT_FILE}" ]]; then - xcwarning "${FIREBASE_APP_ID} not found in cache." - /bin/rm -f "${SERVICE_ACCOUNT_FILE}" - else - xcnote "${FIREBASE_APP_ID} found in cache. Consider using extract-keys.pl to reduce reliance on cache." - fi - else - xcnote "No cache file found." - fi -fi - -if [[ ! -f "${SERVICE_ACCOUNT_FILE}" ]]; then - xcerror "All attempts to find the service account JSON file have failed." - xcnote "You must supply it on the command line." - echo >&2 -n "$0:1: note: "; usage - exit 2 -fi - -# Dump collected information if requested - -if ((VERBOSE >= 2)); then - xcnote "FIREBASE_API_KEY = ${FIREBASE_API_KEY}" - xcnote "FIREBASE_APP_ID = ${FIREBASE_APP_ID}" - xcnote "DSYM_BUNDLE = ${DSYM_BUNDLE:-(unset, will use symbols in executable)}" - xcnote "EXECUTABLE = ${EXECUTABLE}" - xcnote "INFOPLIST = ${INFOPLIST}" - xcnote "FCR_PROD_VERS = ${FCR_PROD_VERS}" - xcnote "FCR_BUNDLE_ID = ${FCR_BUNDLE_ID}" -fi - -# Create and upload symbol files for each architecture -if [[ -x "${SWIFT_DEMANGLE:=$(xcrun --find swift-demangle 2>/dev/null)}" ]]; then - SWIFT_DEMANGLE_COMMAND="${SWIFT_DEMANGLE} -simplified" -else - SWIFT_DEMANGLE_COMMAND=/bin/cat -fi - -for ARCH in ${ARCHS?:}; do - SYMBOL_FILE="SYMBOL_FILE_${ARCH}" - fcr_mktemp "${SYMBOL_FILE}" SCRATCH - - # Just because there is a dSYM bundle at that path does not mean - # it is the RIGHT dSYM bundle... - - if [[ -d "${DSYM_BUNDLE}" ]]; then - DSYM_UUID="$(dwarfdump --arch "${ARCH}" --uuid "${DSYM_BUNDLE}" | awk '{print $2}')" - EXE_UUID="$(dwarfdump --arch "${ARCH}" --uuid "${EXECUTABLE}" | awk '{print $2}')" - if ((VERBOSE > 1)); then - xcnote "dSYM bundle UUID: ${DSYM_UUID}" - xcnote "Executable UUID: ${EXE_UUID}" - fi - if [[ "${DSYM_UUID}" != "${EXE_UUID}" ]]; then - xcdebug "Current dSYM bundle is not valid." - unset DSYM_BUNDLE - fi - fi - - if [[ ! -d "${DSYM_BUNDLE}" ]]; then - xcdebug "Extracting dSYM from executable." - fcr_mktempdir TMP_DSYM - DSYM_BUNDLE="${TMP_DSYM}/${EXECUTABLE##*/}.dSYM" - xcrun dsymutil -o "${DSYM_BUNDLE}" "${EXECUTABLE}" - STATUS=$? - if ((STATUS)); then - xcerror "Command dsymutil failed with exit code ${STATUS}." - exit ${STATUS} - fi - fi - - "${FCR_DUMP_SYMS}" -a "${ARCH}" -g "${DSYM_BUNDLE}" "${EXECUTABLE}" >"${SCRATCH}" 2> >(sed -e 's/^/warning: dump_syms: /' | grep -v 'failed to demangle' >&2) - - STATUS=$? - if ((STATUS)); then - xcerror "Command dump_syms failed with exit code ${STATUS}." - exit ${STATUS} - fi - - ${SWIFT_DEMANGLE_COMMAND} <"${SCRATCH}" >|"${!SYMBOL_FILE}" || exit 1 - - if ((VERBOSE >= 2)); then - xcnote "${EXECUTABLE##*/} (architecture ${ARCH}) symbol dump follows (first 20 lines):" - head >&2 -n20 "${!SYMBOL_FILE}" - elif ((VERBOSE >= 1)); then - xcnote "${EXECUTABLE##*/} (architecture ${ARCH}) symbol dump follows (first line only):" - head >&2 -n1 "${!SYMBOL_FILE}" - fi - - fcr_upload_files "${!SYMBOL_FILE}" || exit 1 -done diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym-util.bash b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym-util.bash deleted file mode 100644 index a8f8c655..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym-util.bash +++ /dev/null @@ -1,382 +0,0 @@ -# Output a clickable message. This will not count as a warning or -# error. - -xcnote () { - echo >&2 "${BASH_SOURCE[1]}:${BASH_LINENO[0]}: note: $*" -} - -# Output a clickable message prefixed with a warning symbol (U+26A0) -# and highlighted yellow. This will increase the overall warning -# count. A non-zero value for the variable ERRORS_ONLY will force -# warnings to be treated as errors. - -if ((ERRORS_ONLY)); then - xcwarning () { - echo >&2 "${BASH_SOURCE[1]}:${BASH_LINENO[0]}: error: $*" - } -else - xcwarning () { - echo >&2 "${BASH_SOURCE[1]}:${BASH_LINENO[0]}: warning: $*" - } -fi - -# Output a clickable message prefixed with a halt symbol (U+1F6D1) and -# highlighted red. This will increase the overall error count. Xcode -# will flag the build as failed if the error count is non-zero at the -# end of the build, even if this script returns a successful exit -# code. Set WARNINGS_ONLY to non-zero to prevent this. - -if ((WARNINGS_ONLY)); then - xcerror () { - echo >&2 "${BASH_SOURCE[1]}:${BASH_LINENO[0]}: warning: $*" - } -else - xcerror () { - echo >&2 "${BASH_SOURCE[1]}:${BASH_LINENO[0]}: error: $*" - } -fi - -xcdebug () { - if ((VERBOSE)); then - echo >&2 "${BASH_SOURCE[1]}:${BASH_LINENO[0]}: note: $*" - fi -} - -# Locate the script directory. - -script_dir () { - local SCRIPT="$0" SCRIPT_DIR="$(dirname "$0")" - - while SCRIPT="$(readlink "${SCRIPT}")"; do - [[ "${SCRIPT}" != /* ]] && SCRIPT="${SCRIPT_DIR}/${SCRIPT}" - SCRIPT_DIR="$(dirname "${SCRIPT}")" - done - - ( cd "${SCRIPT_DIR}"; pwd -P ) -} - -# Timestamp needed for various operations. Does not need to be exact, -# but does need to be consistent across web service calls. - -readonly NOW="$(/bin/date +%s)" - -# All files created by fcr_mktemp will be listed in FCR_TEMPORARY_FILES. -# Delete these when the enclosing script exits. (You may manually -# add files to this array as well to have them cleaned up on exit.) - -typeset -a FCR_TEMPORARY_FILES -trap 'STATUS=$?; rm -rf "${FCR_TEMPORARY_FILES[@]}"; exit ${STATUS}' 0 1 2 15 - -# Create a temporary file and add it to the list of files to delete when the -# script finishes. -# -# usage: fcr_mktemp VARNAME... - -fcr_mktemp () { - for VAR; do - eval "${VAR}=\$(mktemp -t com.google.FIRCrash) || return 1" - FCR_TEMPORARY_FILES+=("${!VAR}") - done -} - -# Create a temporary directory and add it to the list of files to -# delete when the script finishes. -# -# usage: fcr_mktempdir VARNAME... - -fcr_mktempdir () { - for VAR; do - eval "${VAR}=\$(mktemp -d -t com.google.FIRCrash) || return 1" - FCR_TEMPORARY_FILES+=("${!VAR}") - done -} - -# The keys we care about in the JSON objects. There are others that -# we do not use. Note that 'expires_at' and 'app_id' are not part of -# the original payload, but are computed from the environment used to -# make the call. - -FCR_SVC_KEYS=(client_email private_key private_key_id token_uri type) -FCR_TOK_KEYS=(access_token expires_at token_type app_id) - -# Extract a value from the property list. -# -# usage: property *name* *file* - -property () { - [[ -f "$2" ]] || echo '{}' >|"$2" # keeps PlistBuddy quiet - /usr/libexec/PlistBuddy "$2" -c "Print :$1" 2>/dev/null -} - -# Retrieve the property from the service account property list. -# -# usage: svc_property *name* - -svc_property () { - property "$1" "${SVC_PLIST}" -} - -# Does the same as svc_property above but for the token cache -# property list. -# -# usage: tok_property *name* - -tok_property () { - property "$1" "${TOK_PLIST}" -} - -# Verify that the service account property list has values for the -# required keys. Does not check the values themselves. - -fcr_verify_svc_plist () { - for key in "${FCR_SVC_KEYS[@]}"; do - if ! svc_property "${key}" >/dev/null; then - xcdebug "${key} not found in ${SVC_PLIST}. Service account invalid." - return 1 - fi - done -} - -# Verify that the token cache property list has values for the -# required keys. If the token_type is incorrect, the expiration date -# has been passed, or the application id does not match, return -# failure. - -fcr_verify_tok_plist () { - for key in "${FCR_TOK_KEYS[@]}"; do - if ! tok_property "${key}" >/dev/null; then - xcdebug "${key} not found in ${TOK_PLIST}. Token invalid." - return 1 - fi - done - - if [[ "$(tok_property token_type)" != "Bearer" ]]; then - xcwarning "Invalid token type '$(tok_property token_type)'." - return 1 - fi - - if (($(tok_property expires_at) <= NOW)); then - xcdebug "Token well-formed but expired at $(date -jf %s "$(tok_property expires_at)")." - echo '{}' >|"${TOK_PLIST}" - return 1 - fi - - if [[ "$(tok_property app_id)" != "${FIREBASE_APP_ID}" ]]; then - xcdebug "Cached token is for a different application." - echo '{}' >|"${TOK_PLIST}" - return 1 - fi -} - -# Convert a JSON certificate file to a PList certificate file. -# -# usage: fcr_load_certificate VARNAME - -fcr_load_certificate () { - : "${SERVICE_ACCOUNT_FILE:?must be the path to the service account JSON file.}" - fcr_mktemp "$1" - - if ! /usr/bin/plutil -convert binary1 "${SERVICE_ACCOUNT_FILE}" -o "${!1}"; then - xcerror "Unable to read service account file ${SERVICE_ACCOUNT_FILE}." - return 2 - fi -} - -# BASE64URL uses a sligtly different character set than BASE64, and -# uses no padding characters. - -function base64url () { - /usr/bin/base64 | sed -e 's/=//g; s/+/-/g; s/\//_/g' -} - -# Assemble the JSON Web Token (RFC 1795) -# -# usage: fcr_create_jwt *client-email* *token-uri* - -fcr_create_jwt () { - local JWT_HEADER="$(base64url <<<'{"alg":"RS256","typ":"JWT"}')" - local JWT_CLAIM="$(base64url <<<'{'"\"iss\":\"${1:?}\",\"aud\":\"${2:?}\",\"exp\":\"$((NOW + 3600))\",\"iat\":\"${NOW}\",\"scope\":\"https://www.googleapis.com/auth/mobilecrashreporting\""'}')" - local JWT_BODY="${JWT_HEADER}.${JWT_CLAIM}" - local JWT_SIG="$(echo -n "${JWT_BODY}" | openssl dgst -sha256 -sign <(svc_property private_key) -binary | base64url)" - - echo "${JWT_BODY}.${JWT_SIG}" -} - -# Set the BEARER_TOKEN variable for authentication. -# -# usage: fcr_authenticate - -fcr_authenticate () { - : "${FIREBASE_APP_ID:?required to select authentication credentials}" - - local SVC_PLIST - - fcr_load_certificate SVC_PLIST || return 2 - - local TOK_PLIST="${HOME}/Library/Preferences/com.google.SymbolUploadToken.plist" - - if ((VERBOSE > 2)); then - CURLOPT='--trace-ascii /dev/fd/2' - elif ((VERBOSE > 1)); then - CURLOPT='--verbose' - else - CURLOPT='' - fi - - # If the token will expire in the next sixty seconds (or already - # has), reload it. - if ! fcr_verify_tok_plist; then - xcdebug "Token cannot be used. Requesting OAuth2 token using installed credentials." - - if ! fcr_verify_svc_plist; then - xcerror "Incorrect/incomplete service account file." - return 2 - else - xcdebug "Certificate information appears valid." - fi - - TOKEN_URI="$(svc_property token_uri)" - CLIENT_EMAIL="$(svc_property client_email)" - - # Assemble the JSON Web Token (RFC 1795) - local JWT="$(fcr_create_jwt "${CLIENT_EMAIL}" "${TOKEN_URI}")" - - fcr_mktemp TOKEN_JSON - - HTTP_STATUS="$(curl ${CURLOPT} -o "${TOKEN_JSON}" -s -d grant_type='urn:ietf:params:oauth:grant-type:jwt-bearer' -d assertion="${JWT}" -w '%{http_code}' "${TOKEN_URI}")" - - if [[ "${HTTP_STATUS}" == 403 ]]; then - xcerror "Invalid certificate. Unable to retrieve OAuth2 token." - return 2 - elif [[ "${HTTP_STATUS}" != 200 ]]; then - cat >&2 "${TOKEN_JSON}" - return 2 - fi - - # Store the token in the preferences directory for future use. - /usr/bin/plutil -convert binary1 "${TOKEN_JSON}" -o "${TOK_PLIST}" - - EXPIRES_IN="$(tok_property expires_in)" - EXPIRES_AT="$((EXPIRES_IN + NOW))" - - /usr/libexec/PlistBuddy \ - -c "Add :app_id string \"${FIREBASE_APP_ID}\"" \ - -c "Add :expires_at integer ${EXPIRES_AT}" \ - -c "Add :expiration_date date $(TZ=GMT date -jf %s ${EXPIRES_AT})" \ - "${TOK_PLIST}" - - if ! fcr_verify_tok_plist; then - ((VERBOSE)) && /usr/libexec/PlistBuddy -c 'Print' "${TOK_PLIST}" - - echo '{}' >|"${TOK_PLIST}" - xcwarning "Token returned is not valid." - xcnote "If this error persists, download a fresh certificate." - - return 2 - fi - else - xcdebug "Token still valid." - EXPIRES_AT="$(tok_property expires_at)" - fi - - xcdebug "Token will expire on $(date -jf %s "${EXPIRES_AT}")." - xcdebug "Using service account with key $(svc_property private_key_id)." - - BEARER_TOKEN="$(tok_property access_token)" - - if [[ ! "${BEARER_TOKEN}" ]]; then - if ((VERBOSE)); then - xcwarning "Current malformed token cache:" - tok_property | while read; do xcnote "${REPLY}"; done - fi - xcerror "Unable to retrieve authentication token from server." - return 2 - fi - - return 0 -} - -# Upload the files to the server. -# -# Arguments: Names of files to upload. - -fcr_upload_files() { - fcr_authenticate || return $? - - : "${FCR_PROD_VERS:?}" - : "${FCR_BUNDLE_ID:?}" - : "${FIREBASE_APP_ID:?}" - : "${FIREBASE_API_KEY:?}" - : "${FCR_BASE_URL:=https://mobilecrashreporting.googleapis.com}" - - fcr_mktemp FILE_UPLOAD_LOCATION_PLIST META_UPLOAD_RESULT_PLIST - - if ((VERBOSE > 2)); then - CURLOPT='--trace-ascii /dev/fd/2' - elif ((VERBOSE > 1)); then - CURLOPT='--verbose' - else - CURLOPT='' - fi - - for FILE; do - xcdebug "Get signed URL for uploading." - - URL="${FCR_BASE_URL}/v1/apps/${FIREBASE_APP_ID}" - - HTTP_STATUS="$(curl ${CURLOPT} -o "${FILE_UPLOAD_LOCATION_PLIST}" -sL -H "X-Ios-Bundle-Identifier: ${FCR_BUNDLE_ID}" -H "Authorization: Bearer ${BEARER_TOKEN}" -X POST -d '' -w '%{http_code}' "${URL}/symbolFileUploadLocation?key=${FIREBASE_API_KEY}")" - STATUS=$? - - if [[ "${STATUS}" == 22 && "${HTTP_STATUS}" == 403 ]]; then - xcerror "Unable to access resource. Token invalid." - xcnote "Please verify the service account file." - return 2 - elif [[ "${STATUS}" != 0 ]]; then - xcerror "curl exited with non-zero status ${STATUS}." - ((STATUS == 22)) && xcerror "HTTP response code is ${HTTP_STATUS}." - return 2 - fi - - /usr/bin/plutil -convert binary1 "${FILE_UPLOAD_LOCATION_PLIST}" || return 1 - - UPLOAD_KEY="$(property uploadKey "${FILE_UPLOAD_LOCATION_PLIST}")" - UPLOAD_URL="$(property uploadUrl "${FILE_UPLOAD_LOCATION_PLIST}")" - ERRMSG="$(property error:message "${FILE_UPLOAD_LOCATION_PLIST}")" - - if [[ "${ERRMSG}" ]]; then - if ((VERBOSE)); then - xcnote "Server response:" - /usr/bin/plutil -p "${FILE_UPLOAD_LOCATION_PLIST}" >&2 - fi - xcerror "symbolFileUploadLocation: ${ERRMSG}" - xcnote "symbolFileUploadLocation: Failed to get upload location." - return 1 - fi - - xcdebug "Upload symbol file." - - HTTP_STATUS=$(curl ${CURLOPT} -sfL -H 'Content-Type: text/plain' -H "Authorization: Bearer ${BEARER_TOKEN}" -w '%{http_code}' -T "${FILE}" "${UPLOAD_URL}") - STATUS=$? - - if ((STATUS == 22)); then # exit code 22 is a non-successful HTTP response - xcerror "upload: Unable to upload symbol file (HTTP Status ${HTTP_STATUS})." - return 1 - elif ((STATUS != 0)); then - xcerror "upload: Unable to upload symbol file (reason unknown)." - return 1 - fi - - xcdebug "Upload metadata information." - - curl ${CURLOPT} -sL -H 'Content-Type: application/json' -H "X-Ios-Bundle-Identifier: ${FCR_BUNDLE_ID}" -H "Authorization: Bearer ${BEARER_TOKEN}" -X POST -d '{"upload_key":"'"${UPLOAD_KEY}"'","symbol_file_mapping":{"symbol_type":2,"app_version":"'"${FCR_PROD_VERS}"'"}}' "${URL}/symbolFileMappings:upsert?key=${FIREBASE_API_KEY}" >|"${META_UPLOAD_RESULT_PLIST}" || return 1 - /usr/bin/plutil -convert binary1 "${META_UPLOAD_RESULT_PLIST}" || return 1 - - ERRMSG="$(property error:message "${META_UPLOAD_RESULT_PLIST}")" - - if [[ "${ERRMSG}" ]]; then - xcerror "symbolFileMappings:upsert: ${ERRMSG}" - xcnote "symbolFileMappings:upsert: The metadata for the symbol file failed to update." - return 1 - fi - done -} diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym.sh b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym.sh deleted file mode 100755 index c0a34e38..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Crash/upload-sym.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -echo "$0:0: error: $0 has been removed. Please use upload-sym instead." -exit 1 diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Firebase.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Firebase.h deleted file mode 100644 index 90798a6a..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Firebase.h +++ /dev/null @@ -1,52 +0,0 @@ -#import <FirebaseAnalytics/FirebaseAnalytics.h> -#import <FirebaseCore/FirebaseCore.h> - -#if !defined(__has_include) - #error "Firebase.h won't import anything if your compiler doesn't support __has_include. Please \ - import the headers individually." -#else - #if __has_include(<FirebaseAppIndexing/FirebaseAppIndexing.h>) - #import <FirebaseAppIndexing/FirebaseAppIndexing.h> - #endif - - #if __has_include(<FirebaseAuth/FirebaseAuth.h>) - #import <FirebaseAuth/FirebaseAuth.h> - #endif - - #if __has_include(<FirebaseCrash/FirebaseCrash.h>) - #import <FirebaseCrash/FirebaseCrash.h> - #endif - - #if __has_include(<FirebaseDatabase/FirebaseDatabase.h>) - #import <FirebaseDatabase/FirebaseDatabase.h> - #endif - - #if __has_include(<FirebaseDynamicLinks/FirebaseDynamicLinks.h>) - #import <FirebaseDynamicLinks/FirebaseDynamicLinks.h> - #endif - - #if __has_include(<FirebaseInstanceID/FirebaseInstanceID.h>) - #import <FirebaseInstanceID/FirebaseInstanceID.h> - #endif - - #if __has_include(<FirebaseInvites/FirebaseInvites.h>) - #import <FirebaseInvites/FirebaseInvites.h> - #endif - - #if __has_include(<FirebaseMessaging/FirebaseMessaging.h>) - #import <FirebaseMessaging/FirebaseMessaging.h> - #endif - - #if __has_include(<FirebaseRemoteConfig/FirebaseRemoteConfig.h>) - #import <FirebaseRemoteConfig/FirebaseRemoteConfig.h> - #endif - - #if __has_include(<FirebaseStorage/FirebaseStorage.h>) - #import <FirebaseStorage/FirebaseStorage.h> - #endif - - #if __has_include(<GoogleMobileAds/GoogleMobileAds.h>) - #import <GoogleMobileAds/GoogleMobileAds.h> - #endif - -#endif // defined(__has_include) diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging Binary files differdeleted file mode 100755 index a0573d06..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/FirebaseMessaging +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h deleted file mode 100755 index a0ae2e90..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FIRMessaging.h +++ /dev/null @@ -1,227 +0,0 @@ -#import <Foundation/Foundation.h> - -/** - * The completion handler invoked once the data connection with FIRMessaging is - * established. The data connection is used to send a continous stream of - * data and all the FIRMessaging data notifications arrive through this connection. - * Once the connection is established we invoke the callback with `nil` error. - * Correspondingly if we get an error while trying to establish a connection - * we invoke the handler with an appropriate error object and do an - * exponential backoff to try and connect again unless successful. - * - * @param error The error object if any describing why the data connection - * to FIRMessaging failed. - */ -typedef void(^FIRMessagingConnectCompletion)(NSError * __nullable error); - -/** - * Notification sent when the upstream message has been delivered - * successfully to the server. The notification object will be the messageID - * of the successfully delivered message. - */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendSuccessNotification; - -/** - * Notification sent when the upstream message was failed to be sent to the - * server. The notification object will be the messageID of the failed - * message. The userInfo dictionary will contain the relevant error - * information for the failure. - */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingSendErrorNotification; - -/** - * Notification sent when the Firebase messaging server deletes pending - * messages due to exceeded storage limits. This may occur, for example, when - * the device cannot be reached for an extended period of time. - * - * It is recommended to retrieve any missing messages directly from the - * server. - */ -FOUNDATION_EXPORT NSString * __nonnull const FIRMessagingMessagesDeletedNotification; - -/** - * @enum FIRMessagingError - */ -typedef NS_ENUM(NSUInteger, FIRMessagingError) { - /// Unknown error. - FIRMessagingErrorUnknown = 0, - - /// FIRMessaging couldn't validate request from this client. - FIRMessagingErrorAuthentication = 1, - - /// InstanceID service cannot be accessed. - FIRMessagingErrorNoAccess = 2, - - /// Request to InstanceID backend timed out. - FIRMessagingErrorTimeout = 3, - - /// No network available to reach the servers. - FIRMessagingErrorNetwork = 4, - - /// Another similar operation in progress, bailing this one. - FIRMessagingErrorOperationInProgress = 5, - - /// Some parameters of the request were invalid. - FIRMessagingErrorInvalidRequest = 7, -}; - -/// Status for the downstream message received by the app. -typedef NS_ENUM(NSInteger, FIRMessagingMessageStatus) { - /// Unknown status. - FIRMessagingMessageStatusUnknown, - /// New downstream message received by the app. - FIRMessagingMessageStatusNew, -}; - -/// Information about a downstream message received by the app. -@interface FIRMessagingMessageInfo : NSObject - -/// The status of the downstream message -@property(nonatomic, readonly, assign) FIRMessagingMessageStatus status; - -@end - -/** - * A remote data message received by the app via FCM (not just the APNs interface). - * - * This is only for devices running iOS 10 or above. To support devices running iOS 9 or below, use - * the local and remote notifications handlers defined in UIApplicationDelegate protocol. - */ -@interface FIRMessagingRemoteMessage : NSObject - -/// The downstream message received by the application. -@property(nonatomic, readonly, strong, nonnull) NSDictionary *appData; - -@end - -/** - * A protocol to receive data message via FCM for devices running iOS 10 or above. - * - * To support devices running iOS 9 or below, use the local and remote notifications handlers - * defined in UIApplicationDelegate protocol. - */ -@protocol FIRMessagingDelegate <NSObject> - -/// The callback to handle data message received via FCM for devices running iOS 10 or above. -- (void)applicationReceivedRemoteMessage:(nonnull FIRMessagingRemoteMessage *)remoteMessage; - -@end - -/** - * Firebase Messaging lets you reliably deliver messages at no cost. - * - * To send or receive messages, the app must get a - * registration token from FIRInstanceID. This token authorizes an - * app server to send messages to an app instance. - * - * In order to receive FIRMessaging messages, declare `application:didReceiveRemoteNotification:`. - * - * - */ -@interface FIRMessaging : NSObject - -/** - * Delegate to handle remote data messages received via FCM for devices running iOS 10 or above. - */ -@property(nonatomic, weak, nullable) id<FIRMessagingDelegate> remoteMessageDelegate; - -/** - * FIRMessaging - * - * @return An instance of FIRMessaging. - */ -+ (nonnull instancetype)messaging NS_SWIFT_NAME(messaging()); - -/** - * Unavailable. Use +messaging instead. - */ -- (nonnull instancetype)init __attribute__((unavailable("Use +messaging instead."))); - -#pragma mark - Connect - -/** - * Create a FIRMessaging data connection which will be used to send the data notifications - * sent by your server. It will also be used to send ACKS and other messages based - * on the FIRMessaging ACKS and other messages based on the FIRMessaging protocol. - * - * - * @param handler The handler to be invoked once the connection is established. - * If the connection fails we invoke the handler with an - * appropriate error code letting you know why it failed. At - * the same time, FIRMessaging performs exponential backoff to retry - * establishing a connection and invoke the handler when successful. - */ -- (void)connectWithCompletion:(nonnull FIRMessagingConnectCompletion)handler; - -/** - * Disconnect the current FIRMessaging data connection. This stops any attempts to - * connect to FIRMessaging. Calling this on an already disconnected client is a no-op. - * - * Call this before `teardown` when your app is going to the background. - * Since the FIRMessaging connection won't be allowed to live when in background it is - * prudent to close the connection. - */ -- (void)disconnect; - -#pragma mark - Topics - -/** - * Asynchronously subscribes to a topic. - * - * @param topic The name of the topic, for example, @"sports". - */ -- (void)subscribeToTopic:(nonnull NSString *)topic; - -/** - * Asynchronously unsubscribe from a topic. - * - * @param topic The name of the topic, for example @"sports". - */ -- (void)unsubscribeFromTopic:(nonnull NSString *)topic; - -#pragma mark - Upstream - -/** - * Sends an upstream ("device to cloud") message. - * - * The message is queued if we don't have an active connection. - * You can only use the upstream feature if your FCM implementation - * uses the XMPP server protocol. - * - * @param message Key/Value pairs to be sent. Values must be String, any - * other type will be ignored. - * @param to A string identifying the receiver of the message. For FCM - * project IDs the value is `SENDER_ID@gcm.googleapis.com`. - * @param messageID The ID of the message. This is generated by the application. It - * must be unique for each message generated by this application. - * It allows error callbacks and debugging, to uniquely identify - * each message. - * @param ttl The time to live for the message. In case we aren't able to - * send the message before the TTL expires we will send you a - * callback. If 0, we'll attempt to send immediately and return - * an error if we're not connected. Otherwise, the message will - * be queued. As for server-side messages, we don't return an error - * if the message has been dropped because of TTL; this can happen - * on the server side, and it would require extra communication. - */ -- (void)sendMessage:(nonnull NSDictionary *)message - to:(nonnull NSString *)receiver - withMessageID:(nonnull NSString *)messageID - timeToLive:(int64_t)ttl; - -#pragma mark - Analytics - -/** - * Use this to track message delivery and analytics for messages, typically - * when you receive a notification in `application:didReceiveRemoteNotification:`. - * However, you only need to call this if you set the `FirebaseAppDelegateProxyEnabled` - * flag to NO in your Info.plist. If `FirebaseAppDelegateProxyEnabled` is either missing - * or set to YES in your Info.plist, the library will call this automatically. - * - * @param message The downstream message received by the application. - * - * @return Information about the downstream message. - */ -- (nonnull FIRMessagingMessageInfo *)appDidReceiveMessage:(nonnull NSDictionary *)message; - -@end diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h deleted file mode 100755 index ef49e7ff..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/FirebaseMessaging.framework/Headers/FirebaseMessaging.h +++ /dev/null @@ -1 +0,0 @@ -#import "FIRMessaging.h" diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/Protobuf.framework/Protobuf b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/Protobuf.framework/Protobuf Binary files differdeleted file mode 100644 index 546e02ec..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/Messaging/Protobuf.framework/Protobuf +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/FirebaseRemoteConfig b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/FirebaseRemoteConfig Binary files differdeleted file mode 100755 index 45637862..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/FirebaseRemoteConfig +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h deleted file mode 100755 index 395020ca..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FIRRemoteConfig.h +++ /dev/null @@ -1,224 +0,0 @@ -// -// FIRRemoteConfig.h -// Firebase Remote Config service SDK -// Copyright 2016 Google Inc. All rights reserved. -// -#import <Foundation/Foundation.h> - -/// The Firebase Remote Config service default namespace, to be used if the API method does not -/// specify a different namespace. Use the default namespace if configuring from the Google Firebase -/// service. -extern NSString *const __nonnull FIRNamespaceGoogleMobilePlatform; - -/// Key used to manage throttling in NSError user info when the refreshing of Remote Config -/// parameter values (data) is throttled. The value of this key is the elapsed time since 1970, -/// measured in seconds. -extern NSString *const __nonnull FIRRemoteConfigThrottledEndTimeInSecondsKey; - -/// Indicates whether updated data was successfully fetched. -typedef NS_ENUM(NSInteger, FIRRemoteConfigFetchStatus) { - /// Config has never been fetched. - FIRRemoteConfigFetchStatusNoFetchYet, - /// Config fetch succeeded. - FIRRemoteConfigFetchStatusSuccess, - /// Config fetch failed. - FIRRemoteConfigFetchStatusFailure, - /// Config fetch was throttled. - FIRRemoteConfigFetchStatusThrottled, -}; - -/// Remote Config error domain that handles errors when fetching data from the service. -extern NSString *const __nonnull FIRRemoteConfigErrorDomain; -/// Firebase Remote Config service fetch error. -typedef NS_ENUM(NSInteger, FIRRemoteConfigError) { - /// Unknown or no error. - FIRRemoteConfigErrorUnknown = 8001, - /// Frequency of fetch requests exceeds throttled limit. - FIRRemoteConfigErrorThrottled = 8002, - /// Internal error that covers all internal HTTP errors. - FIRRemoteConfigErrorInternalError = 8003, -}; - -/// Enumerated value that indicates the source of Remote Config data. Data can come from -/// the Remote Config service, the DefaultConfig that is available when the app is first installed, -/// or a static initialized value if data is not available from the service or DefaultConfig. -typedef NS_ENUM(NSInteger, FIRRemoteConfigSource) { - FIRRemoteConfigSourceRemote, ///< The data source is the Remote Config service. - FIRRemoteConfigSourceDefault, ///< The data source is the DefaultConfig defined for this app. - FIRRemoteConfigSourceStatic, ///< The data doesn't exist, return a static initialized value. -}; - -/// Completion handler invoked by fetch methods when they get a response from the server. -/// -/// @param status Config fetching status. -/// @param error Error message on failure. -typedef void (^FIRRemoteConfigFetchCompletion)(FIRRemoteConfigFetchStatus status, - NSError *__nullable error); - -#pragma mark - FIRRemoteConfigValue -/// This class provides a wrapper for Remote Config parameter values, with methods to get parameter -/// values as different data types. -@interface FIRRemoteConfigValue : NSObject<NSCopying> -/// Gets the value as a string. -@property(nonatomic, readonly, nullable) NSString *stringValue; -/// Gets the value as a number value. -@property(nonatomic, readonly, nullable) NSNumber *numberValue; -/// Gets the value as a NSData object. -@property(nonatomic, readonly, nonnull) NSData *dataValue; -/// Gets the value as a boolean. -@property(nonatomic, readonly) BOOL boolValue; -/// Identifies the source of the fetched value. -@property(nonatomic, readonly) FIRRemoteConfigSource source; -@end - -#pragma mark - FIRRemoteConfigSettings -/// Firebase Remote Config settings. -@interface FIRRemoteConfigSettings : NSObject -/// Indicates whether Developer Mode is enabled. -@property(nonatomic, readonly) BOOL isDeveloperModeEnabled; -/// Initializes FIRRemoteConfigSettings, which is used to set properties for custom settings. To -/// make custom settings take effect, pass the FIRRemoteConfigSettings instance to the -/// configSettings property of FIRRemoteConfig. -- (nullable FIRRemoteConfigSettings *)initWithDeveloperModeEnabled:(BOOL)developerModeEnabled - NS_DESIGNATED_INITIALIZER; -@end - -#pragma mark - FIRRemoteConfig -/// Firebase Remote Config class. The shared instance method +remoteConfig can be created and used -/// to fetch, activate and read config results and set default config results. -@interface FIRRemoteConfig : NSObject<NSFastEnumeration> -/// Last successful fetch completion time. -@property(nonatomic, readonly, strong, nullable) NSDate *lastFetchTime; -/// Last fetch status. The status can be any enumerated value from FIRRemoteConfigFetchStatus. -@property(nonatomic, readonly, assign) FIRRemoteConfigFetchStatus lastFetchStatus; -/// Config settings are custom settings. -@property(nonatomic, readwrite, strong, nonnull) FIRRemoteConfigSettings *configSettings; - -/// Returns the FIRRemoteConfig instance shared throughout your app. This singleton object contains -/// the complete set of Remote Config parameter values available to the app, including the Active -/// Config and Default Config. This object also caches values fetched from the Remote Config Server -/// until they are copied to the Active Config by calling activateFetched. -/// When you fetch values from the Remote Config Server using the default Firebase namespace -/// service, you should use this class method to create a shared instance of the FIRRemoteConfig -/// object to ensure that your app will function properly with the Remote Config Server and the -/// Firebase service. -+ (nonnull FIRRemoteConfig *)remoteConfig NS_SWIFT_NAME(remoteConfig()); - -/// Unavailable. Use +remoteConfig instead. -- (nonnull instancetype)init __attribute__((unavailable("Use +remoteConfig instead."))); - -#pragma mark - Fetch -/// Fetches Remote Config data with a callback. Call activateFetched to make fetched data available -/// to your app. -/// @param completionHandler Fetch operation callback. -- (void)fetchWithCompletionHandler:(nullable FIRRemoteConfigFetchCompletion)completionHandler; - -/// Fetches Remote Config data and sets a duration that specifies how long config data lasts. -/// Call activateFetched to make fetched data available to your app. -/// @param expirationDuration Duration that defines how long fetched config data is available, in -/// seconds. When the config data expires, a new fetch is required. -/// @param completionHandler Fetch operation callback. -- (void)fetchWithExpirationDuration:(NSTimeInterval)expirationDuration - completionHandler:(nullable FIRRemoteConfigFetchCompletion)completionHandler; - -#pragma mark - Apply -/// Applies Fetched Config data to the Active Config, causing updates to the behavior and appearance -/// of the app to take effect (depending on how config data is used in the app). -/// Returns true if there was a Fetched Config, and it was activated. -/// Returns false if no Fetched Config was found, or the Fetched Config was already activated. -- (BOOL)activateFetched; - -#pragma mark - Get Config -/// Enables access to configuration values by using object subscripting syntax. -/// This is used to get the config value of the default namespace. -/// <pre> -/// // Example: -/// FIRRemoteConfig *config = [FIRRemoteConfig remoteConfig]; -/// FIRRemoteConfigValue *value = config[@"yourKey"]; -/// BOOL b = value.boolValue; -/// NSNumber *number = config[@"yourKey"].numberValue; -/// </pre> -- (nonnull FIRRemoteConfigValue *)objectForKeyedSubscript:(nonnull NSString *)key; - -/// Gets the config value of the default namespace. -/// @param key Config key. -- (nonnull FIRRemoteConfigValue *)configValueForKey:(nullable NSString *)key; - -/// Gets the config value of a given namespace. -/// @param key Config key. -/// @param aNamespace Config results under a given namespace. -- (nonnull FIRRemoteConfigValue *)configValueForKey:(nullable NSString *)key - namespace:(nullable NSString *)aNamespace; - -/// Gets the config value of a given namespace and a given source. -/// @param key Config key. -/// @param aNamespace Config results under a given namespace. -/// @param source Config value source. -- (nonnull FIRRemoteConfigValue *)configValueForKey:(nullable NSString *)key - namespace:(nullable NSString *)aNamespace - source:(FIRRemoteConfigSource)source; - -/// Gets all the parameter keys from a given source and a given namespace. -/// -/// @param source The config data source. -/// @param aNamespace The config data namespace. -/// @return An array of keys under the given source and namespace. -- (nonnull NSArray<NSString *> *)allKeysFromSource:(FIRRemoteConfigSource)source - namespace:(nullable NSString *)aNamespace; - -/// Returns the set of parameter keys that start with the given prefix, from the default namespace -/// in the active config. -/// -/// @param prefix The key prefix to look for. If prefix is nil or empty, returns all the -/// keys. -/// @return The set of parameter keys that start with the specified prefix. -- (nonnull NSSet<NSString *> *)keysWithPrefix:(nullable NSString *)prefix; - -/// Returns the set of parameter keys that start with the given prefix, from the given namespace in -/// the active config. -/// -/// @param prefix The key prefix to look for. If prefix is nil or empty, returns all the -/// keys in the given namespace. -/// @param aNamespace The namespace in which to look up the keys. If the namespace is invalid, -/// returns an empty set. -/// @return The set of parameter keys that start with the specified prefix. -- (nonnull NSSet<NSString *> *)keysWithPrefix:(nullable NSString *)prefix - namespace:(nullable NSString *)aNamespace; - -#pragma mark - Defaults -/// Sets config defaults for parameter keys and values in the default namespace config. -/// -/// @param defaultConfig A dictionary mapping a NSString * key to a NSObject * value. -- (void)setDefaults:(nullable NSDictionary<NSString *, NSObject *> *)defaults; - -/// Sets config defaults for parameter keys and values in the default namespace config. -/// -/// @param defaultConfig A dictionary mapping a NSString * key to a NSObject * value. -/// @param aNamespace Config under a given namespace. -- (void)setDefaults:(nullable NSDictionary<NSString *, NSObject *> *)defaultConfig - namespace:(nullable NSString *)aNamespace; - -/// Sets default configs from plist for default namespace; -/// @param fileName The plist file name, with no file name extension. For example, if the plist file -/// is defaultSamples.plist, call: -/// [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:@"defaultSamples"]; -- (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName; - -/// Sets default configs from plist for a given namespace; -/// @param fileName The plist file name, with no file name extension. For example, if the plist file -/// is defaultSamples.plist, call: -/// [[FIRRemoteConfig remoteConfig] setDefaultsFromPlistFileName:@"defaultSamples"]; -/// @param aNamespace The namespace where the default config is set. -- (void)setDefaultsFromPlistFileName:(nullable NSString *)fileName - namespace:(nullable NSString *)aNamespace; - -/// Returns the default value of a given key and a given namespace from the default config. -/// -/// @param key The parameter key of default config. -/// @param aNamespace The namespace of default config. -/// @return Returns the default value of the specified key and namespace. Returns -/// nil if the key or namespace doesn't exist in the default config. -- (nullable FIRRemoteConfigValue *)defaultValueForKey:(nullable NSString *)key - namespace:(nullable NSString *)aNamespace; - -@end diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FirebaseRemoteConfig.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FirebaseRemoteConfig.h deleted file mode 100755 index eedc4fce..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Headers/FirebaseRemoteConfig.h +++ /dev/null @@ -1 +0,0 @@ -#import "FIRRemoteConfig.h" diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Modules/module.modulemap b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Modules/module.modulemap deleted file mode 100755 index a6627f5e..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/FirebaseRemoteConfig.framework/Modules/module.modulemap +++ /dev/null @@ -1,11 +0,0 @@ -framework module FirebaseRemoteConfig { - umbrella header "FirebaseRemoteConfig.h" - export * - module * { export *} - link "c++" - link "sqlite3" - link "z" - link framework "CoreGraphics" - link framework "Foundation" - link framework "UIKit" -}
\ No newline at end of file diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/Protobuf.framework/Protobuf b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/Protobuf.framework/Protobuf Binary files differdeleted file mode 100644 index 546e02ec..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/Firebase/RemoteConfig/Protobuf.framework/Protobuf +++ /dev/null diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/FirebasePlugin.h b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/FirebasePlugin.h deleted file mode 100755 index 93542737..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/FirebasePlugin.h +++ /dev/null @@ -1,30 +0,0 @@ -#import <Cordova/CDV.h>
-#import "AppDelegate.h"
-
-@interface FirebasePlugin : CDVPlugin
-+ (FirebasePlugin *) firebasePlugin;
-- (void)getInstanceId:(CDVInvokedUrlCommand*)command;
-- (void)getToken:(CDVInvokedUrlCommand*)command;
-- (void)grantPermission:(CDVInvokedUrlCommand*)command;
-- (void)hasPermission:(CDVInvokedUrlCommand*)command;
-- (void)setBadgeNumber:(CDVInvokedUrlCommand*)command;
-- (void)getBadgeNumber:(CDVInvokedUrlCommand*)command;
-- (void)subscribe:(CDVInvokedUrlCommand*)command;
-- (void)unsubscribe:(CDVInvokedUrlCommand*)command;
-- (void)unregister:(CDVInvokedUrlCommand*)command;
-- (void)onNotificationOpen:(CDVInvokedUrlCommand*)command;
-- (void)onTokenRefresh:(CDVInvokedUrlCommand*)command;
-- (void)sendNotification:(NSDictionary*)userInfo;
-- (void)sendToken:(NSString*)token;
-- (void)logEvent:(CDVInvokedUrlCommand*)command;
-- (void)setScreenName:(CDVInvokedUrlCommand*)command;
-- (void)setUserId:(CDVInvokedUrlCommand*)command;
-- (void)setUserProperty:(CDVInvokedUrlCommand*)command;
-- (void)fetch:(CDVInvokedUrlCommand*)command;
-- (void)activateFetched:(CDVInvokedUrlCommand*)command;
-- (void)getValue:(CDVInvokedUrlCommand*)command;
-@property (nonatomic, copy) NSString *notificationCallbackId;
-@property (nonatomic, copy) NSString *tokenRefreshCallbackId;
-@property (nonatomic, retain) NSMutableArray *notificationStack;
-
-@end
diff --git a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/FirebasePlugin.m b/StoneIsland/plugins/cordova-plugin-firebase/src/ios/FirebasePlugin.m deleted file mode 100644 index 580fb760..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/src/ios/FirebasePlugin.m +++ /dev/null @@ -1,331 +0,0 @@ -#import "FirebasePlugin.h" -#import <Cordova/CDV.h> -#import "AppDelegate.h" -#import "Firebase.h" -@import FirebaseInstanceID; -@import FirebaseMessaging; -@import FirebaseAnalytics; -@import FirebaseRemoteConfig; - -#if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 -@import UserNotifications; -#endif - -#ifndef NSFoundationVersionNumber_iOS_9_x_Max -#define NSFoundationVersionNumber_iOS_9_x_Max 1299 -#endif - -@implementation FirebasePlugin - -@synthesize notificationCallbackId; -@synthesize tokenRefreshCallbackId; -@synthesize notificationStack; - -static NSInteger const kNotificationStackSize = 10; -static FirebasePlugin *firebasePlugin; - -+ (FirebasePlugin *) firebasePlugin { - return firebasePlugin; -} - -- (void)pluginInitialize { - NSLog(@"Starting Firebase plugin"); - firebasePlugin = self; -} - -// DEPRECATED - alias of getToken -- (void)getInstanceId:(CDVInvokedUrlCommand *)command { - CDVPluginResult *pluginResult; - - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString: - [[FIRInstanceID instanceID] token]]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)getToken:(CDVInvokedUrlCommand *)command { - CDVPluginResult *pluginResult; - - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString: - [[FIRInstanceID instanceID] token]]; - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} -- (void)hasPermission:(CDVInvokedUrlCommand *)command -{ - BOOL enabled = NO; - UIApplication *application = [UIApplication sharedApplication]; - if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) { - enabled = application.currentUserNotificationSettings.types != UIUserNotificationTypeNone; - } else { -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - enabled = application.enabledRemoteNotificationTypes != UIRemoteNotificationTypeNone; -#pragma GCC diagnostic pop - } - - NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:1]; - [message setObject:[NSNumber numberWithBool:enabled] forKey:@"isEnabled"]; - CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:message]; - [self.commandDelegate sendPluginResult:commandResult callbackId:command.callbackId]; -} -- (void)grantPermission:(CDVInvokedUrlCommand *)command { - if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_9_x_Max) { - if ([[UIApplication sharedApplication]respondsToSelector:@selector(registerUserNotificationSettings:)]) { - UIUserNotificationType notificationTypes = - (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge); - UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil]; - [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; - } else { - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdeprecated-declarations" - [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)]; - #pragma GCC diagnostic pop - } - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - return; - } - - - - #if defined(__IPHONE_10_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 - BOOL isIOS10 = TRUE; - #else - BOOL isIOS10 = FALSE; - #endif - - - if ( !isIOS10 ) { - [[UIApplication sharedApplication] registerForRemoteNotifications]; - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - return; - } - - - - // IOS 10 - UNAuthorizationOptions authOptions = UNAuthorizationOptionAlert|UNAuthorizationOptionSound|UNAuthorizationOptionBadge; - [[UNUserNotificationCenter currentNotificationCenter] - requestAuthorizationWithOptions:authOptions - completionHandler:^(BOOL granted, NSError * _Nullable error) { - - if ( ![NSThread isMainThread] ) { - dispatch_sync(dispatch_get_main_queue(), ^{ - [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; - [[FIRMessaging messaging] setRemoteMessageDelegate:self]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus: granted ? CDVCommandStatus_OK : CDVCommandStatus_ERROR]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }); - } - else { - [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; - [[FIRMessaging messaging] setRemoteMessageDelegate:self]; - [[UIApplication sharedApplication] registerForRemoteNotifications]; - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - } - ]; - - return; -} - -- (void)setBadgeNumber:(CDVInvokedUrlCommand *)command { - int number = [[command.arguments objectAtIndex:0] intValue]; - - [self.commandDelegate runInBackground:^{ - [[UIApplication sharedApplication] setApplicationIconBadgeNumber:number]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)getBadgeNumber:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - long badge = [[UIApplication sharedApplication] applicationIconBadgeNumber]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:badge]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)subscribe:(CDVInvokedUrlCommand *)command { - NSString* topic = [NSString stringWithFormat:@"/topics/%@", [command.arguments objectAtIndex:0]]; - - [[FIRMessaging messaging] subscribeToTopic: topic]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)unsubscribe:(CDVInvokedUrlCommand *)command { - NSString* topic = [NSString stringWithFormat:@"/topics/%@", [command.arguments objectAtIndex:0]]; - - [[FIRMessaging messaging] unsubscribeFromTopic: topic]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)unregister:(CDVInvokedUrlCommand *)command { - [[FIRInstanceID instanceID] deleteIDWithHandler:^void(NSError *_Nullable error){ - if (error) { - NSLog(@"Unable to delete instance"); - } else { - NSString* currentToken = [[FIRInstanceID instanceID] token]; - if (currentToken != nil) { - [self sendToken:currentToken]; - } - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - }]; -} - -- (void)onNotificationOpen:(CDVInvokedUrlCommand *)command { - self.notificationCallbackId = command.callbackId; - - if (self.notificationStack != nil && [self.notificationStack count]) { - for (NSDictionary *userInfo in self.notificationStack) { - [self sendNotification:userInfo]; - } - [self.notificationStack removeAllObjects]; - } -} - -- (void)onTokenRefresh:(CDVInvokedUrlCommand *)command { - self.tokenRefreshCallbackId = command.callbackId; - NSString* currentToken = [[FIRInstanceID instanceID] token]; - if (currentToken != nil) { - [self sendToken:currentToken]; - } -} - -- (void)sendNotification:(NSDictionary *)userInfo { - if (self.notificationCallbackId != nil) { - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:userInfo]; - [pluginResult setKeepCallbackAsBool:YES]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:self.notificationCallbackId]; - } else { - if (!self.notificationStack) { - self.notificationStack = [[NSMutableArray alloc] init]; - } - - // stack notifications until a callback has been registered - [self.notificationStack addObject:userInfo]; - - if ([self.notificationStack count] >= kNotificationStackSize) { - [self.notificationStack removeLastObject]; - } - } -} - -- (void)sendToken:(NSString *)token { - if (self.tokenRefreshCallbackId != nil) { - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:token]; - [pluginResult setKeepCallbackAsBool:YES]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:self.tokenRefreshCallbackId]; - } -} - -- (void)logEvent:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - NSString* name = [command.arguments objectAtIndex:0]; - NSDictionary* parameters = [command.arguments objectAtIndex:1]; - - [FIRAnalytics logEventWithName:name parameters:parameters]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)setScreenName:(CDVInvokedUrlCommand *)command { - NSString* name = [command.arguments objectAtIndex:0]; - - [FIRAnalytics setScreenName:name screenClass:NULL]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; -} - -- (void)setUserId:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - NSString* id = [command.arguments objectAtIndex:0]; - - [FIRAnalytics setUserID:id]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)setUserProperty:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - NSString* name = [command.arguments objectAtIndex:0]; - NSString* value = [command.arguments objectAtIndex:1]; - - [FIRAnalytics setUserPropertyString:value forName:name]; - - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)fetch:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - FIRRemoteConfig* remoteConfig = [FIRRemoteConfig remoteConfig]; - - if ([command.arguments count] > 0){ - int expirationDuration = [[command.arguments objectAtIndex:0] intValue]; - - [remoteConfig fetchWithExpirationDuration:expirationDuration completionHandler:^(FIRRemoteConfigFetchStatus status, NSError * _Nullable error) { - if (status == FIRRemoteConfigFetchStatusSuccess) { - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - }]; - } else { - [remoteConfig fetchWithCompletionHandler:^(FIRRemoteConfigFetchStatus status, NSError * _Nullable error) { - if (status == FIRRemoteConfigFetchStatusSuccess) { - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - } - }]; - } - }]; -} - -- (void)activateFetched:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - FIRRemoteConfig* remoteConfig = [FIRRemoteConfig remoteConfig]; - BOOL activated = [remoteConfig activateFetched]; - CDVPluginResult *pluginResult; - if (activated) { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; - } else { - pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR]; - } - - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -- (void)getValue:(CDVInvokedUrlCommand *)command { - [self.commandDelegate runInBackground:^{ - NSString* key = [command.arguments objectAtIndex:0]; - FIRRemoteConfig* remoteConfig = [FIRRemoteConfig remoteConfig]; - NSString* value = remoteConfig[key].stringValue; - CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:value]; - [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId]; - }]; -} - -@end diff --git a/StoneIsland/plugins/cordova-plugin-firebase/www/firebase-browser.js b/StoneIsland/plugins/cordova-plugin-firebase/www/firebase-browser.js deleted file mode 100755 index 93e3936f..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/www/firebase-browser.js +++ /dev/null @@ -1,119 +0,0 @@ -exports.getInstanceId = function(success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.getToken = function(success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.onNotificationOpen = function(success, error) {
-};
-
-exports.onTokenRefresh = function(success, error) {
-};
-
-exports.grantPermission = function(success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.setBadgeNumber = function(number, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.getBadgeNumber = function(success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.subscribe = function(topic, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.unsubscribe = function(topic, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.logEvent = function(name, params, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.logError = function(message, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.setScreenName = function(name, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.setUserId = function(id, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.setUserProperty = function(name, value, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.activateFetched = function (success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.fetch = function (cacheExpirationSeconds, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.getByteArray = function (key, namespace, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.getValue = function (key, namespace, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.getInfo = function (success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.setConfigSettings = function (settings, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
-
-exports.setDefaults = function (defaults, namespace, success, error) {
- if (typeof success === 'function') {
- success();
- }
-};
diff --git a/StoneIsland/plugins/cordova-plugin-firebase/www/firebase.js b/StoneIsland/plugins/cordova-plugin-firebase/www/firebase.js deleted file mode 100644 index cf67c884..00000000 --- a/StoneIsland/plugins/cordova-plugin-firebase/www/firebase.js +++ /dev/null @@ -1,121 +0,0 @@ -var exec = require('cordova/exec'); - -exports.getInstanceId = function(success, error) { - exec(success, error, "FirebasePlugin", "getInstanceId", []); -}; - -exports.getToken = function(success, error) { - exec(success, error, "FirebasePlugin", "getToken", []); -}; - -exports.onNotificationOpen = function(success, error) { - exec(success, error, "FirebasePlugin", "onNotificationOpen", []); -}; - -exports.onTokenRefresh = function(success, error) { - exec(success, error, "FirebasePlugin", "onTokenRefresh", []); -}; - -exports.grantPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "grantPermission", []); -}; - -exports.hasPermission = function(success, error) { - exec(success, error, "FirebasePlugin", "hasPermission", []); -}; - -exports.setBadgeNumber = function(number, success, error) { - exec(success, error, "FirebasePlugin", "setBadgeNumber", [number]); -}; - -exports.getBadgeNumber = function(success, error) { - exec(success, error, "FirebasePlugin", "getBadgeNumber", []); -}; - -exports.subscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "subscribe", [topic]); -}; - -exports.unsubscribe = function(topic, success, error) { - exec(success, error, "FirebasePlugin", "unsubscribe", [topic]); -}; - -exports.unregister = function(success, error) { - exec(success, error, "FirebasePlugin", "unregister", []); -}; - -exports.logEvent = function(name, params, success, error) { - exec(success, error, "FirebasePlugin", "logEvent", [name, params]); -}; - -exports.logError = function(message, success, error) { - exec(success, error, "FirebasePlugin", "logError", [message]); -}; - -exports.setScreenName = function(name, success, error) { - exec(success, error, "FirebasePlugin", "setScreenName", [name]); -}; - -exports.setUserId = function(id, success, error) { - exec(success, error, "FirebasePlugin", "setUserId", [id]); -}; - -exports.setUserProperty = function(name, value, success, error) { - exec(success, error, "FirebasePlugin", "setUserProperty", [name, value]); -}; - -exports.activateFetched = function (success, error) { - exec(success, error, "FirebasePlugin", "activateFetched", []); -}; - -exports.fetch = function (cacheExpirationSeconds, success, error) { - var args = []; - if (typeof cacheExpirationSeconds === 'number') { - args.push(cacheExpirationSeconds); - } else { - error = success; - success = cacheExpirationSeconds; - } - exec(success, error, "FirebasePlugin", "fetch", args); -}; - -exports.getByteArray = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getByteArray", args); -}; - -exports.getValue = function (key, namespace, success, error) { - var args = [key]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "getValue", args); -}; - -exports.getInfo = function (success, error) { - exec(success, error, "FirebasePlugin", "getInfo", []); -}; - -exports.setConfigSettings = function (settings, success, error) { - exec(success, error, "FirebasePlugin", "setConfigSettings", [settings]); -}; - -exports.setDefaults = function (defaults, namespace, success, error) { - var args = [defaults]; - if (typeof namespace === 'string') { - args.push(namespace); - } else { - error = success; - success = namespace; - } - exec(success, error, "FirebasePlugin", "setDefaults", args); -}; diff --git a/StoneIsland/plugins/fetch.json b/StoneIsland/plugins/fetch.json index 4d0eafbb..13e90dc5 100755 --- a/StoneIsland/plugins/fetch.json +++ b/StoneIsland/plugins/fetch.json @@ -97,16 +97,6 @@ "is_top_level": true, "variables": {} }, - "phonegap-plugin-push": { - "source": { - "type": "registry", - "id": "phonegap-plugin-push@1.9.2" - }, - "is_top_level": true, - "variables": { - "SENDER_ID": "XXXXXXX" - } - }, "cordova-plugin-statusbar": { "source": { "type": "registry", @@ -115,14 +105,6 @@ "is_top_level": true, "variables": {} }, - "cordova-plugin-firebase": { - "source": { - "type": "registry", - "id": "cordova-plugin-firebase@0.1.24" - }, - "is_top_level": true, - "variables": {} - }, "cordova-plugin-app-name": { "source": { "type": "registry", @@ -132,5 +114,13 @@ "variables": { "APP_NAME": "Stone Island" } + }, + "phonegap-plugin-push": { + "source": { + "type": "registry", + "id": "phonegap-plugin-push@2.0.0" + }, + "is_top_level": true, + "variables": {} } }
\ No newline at end of file diff --git a/StoneIsland/plugins/ios.json b/StoneIsland/plugins/ios.json index 7ac7caec..c354d0dc 100644 --- a/StoneIsland/plugins/ios.json +++ b/StoneIsland/plugins/ios.json @@ -7,6 +7,10 @@ "files": {} }, "installed_plugins": { + "cordova-plugin-app-name": { + "APP_NAME": "Stone Island", + "PACKAGE_NAME": "us.okfoc.stoneisland" + }, "cordova-plugin-console": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, @@ -32,6 +36,9 @@ "cordova-plugin-splashscreen": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, + "cordova-plugin-statusbar": { + "PACKAGE_NAME": "us.okfoc.stoneisland" + }, "cordova-plugin-whitelist": { "PACKAGE_NAME": "us.okfoc.stoneisland" }, @@ -42,17 +49,6 @@ "PACKAGE_NAME": "us.okfoc.stoneisland" }, "phonegap-plugin-push": { - "SENDER_ID": "XXXXXXX", - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, - "cordova-plugin-statusbar": { - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, - "cordova-plugin-firebase": { - "PACKAGE_NAME": "us.okfoc.stoneisland" - }, - "cordova-plugin-app-name": { - "APP_NAME": "Stone Island", "PACKAGE_NAME": "us.okfoc.stoneisland" } }, diff --git a/StoneIsland/plugins/phonegap-plugin-push/CHANGELOG.md b/StoneIsland/plugins/phonegap-plugin-push/CHANGELOG.md index e46cdae8..1d66c3ac 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/CHANGELOG.md +++ b/StoneIsland/plugins/phonegap-plugin-push/CHANGELOG.md @@ -1,5 +1,587 @@ # Change Log +## [v2.0.0-rc5](https://github.com/phonegap/phonegap-plugin-push/tree/v2.0.0-rc5) (2017-06-20) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v2.0.0-rc4...v2.0.0-rc5) + +- 2.0.0-rc5 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a5dfcb4e364a1b31d98d4b9683d9e4fe2e0e5d2d) +- :bookmark: Bumping plugin version to 2.0.0-rc5 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4bb16bea611e9c472f34c3ede9a1a6d00a8e4c4d) +- :arrow_up: Bump FCM to 11.0.1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/576135bf576be6e2cd183101d3d7219b4d297030) +- :penguin: Issue #1796: Remove hook from 2.0.0 version [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/464636b9ae257afc712cfebcc1ed11425590c509) +- :memo: Issue #1552: library not found for -lPods-Appname [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/95b23cdf5ae68faf714d63ac69cfe71ce7034dba) +- :checkered_flag: Issue #1670: Subscribe and Unsubscribe for windows [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/228cdb4062f6019f878c456b89ef0685955ac7ed) +- :memo: Issue #1760: fcmSandbox vs gcmSandbox [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/64562177a6d32f34b29f2a97fcc8846db9926a1c) +- :bug: Issue #1785: plugin fails to install on windows using plugman [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/156adfc70e85a21cb9f3134de72781db405c5e07) +- :memo: Issue #1767: Ionic 2 Android build fails with error (Can't find google-services.json file) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fa9625e7530f4c2280804fc0fcd52a7b7476e5eb) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6f98be137f997c2bbd32e5c192c1e928e4e1f2c9) + +## [v2.0.0-rc4](https://github.com/phonegap/phonegap-plugin-push/tree/v2.0.0-rc4) (2017-06-01) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v2.0.0-rc3...v2.0.0-rc4) + +- 2.0.0-rc4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/65f2e4c56b0ed440b8668986114c2c84b49e9c68) +- :bookmark: Bumping plugin version to 2.0.0-rc4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4e887023484cb5d6dd92524e05a6490d22eb3974) +- Update push.js [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a7cc5bdb8d149a3f6e7e9d918ecd9bb27c34009f) +- :memo: Issue #1679: Please clarify the use of content-available in the payload doc [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/23f7965e26d48b43c09921138b1290a658a41528) +- Update INSTALLATION.md (#1745) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f3e94bbc1dd79bf830a2342ce3d6ca0d0e1cf9a2) +- Fixing 404 link to definition file [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9df6b4de82047a30b8322eb635c581de6c7252aa) +- :bug::wrench: Issue #1744: The plugin installs npm in my local node_modules [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/06bb2b207848e2dc993c28052f3ad29bf84d88c4) +- :bug: Issue #1725: Provide default for applicationServerKey [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d63bbe949edd21e86d886baf9aa00aab30f0ca95) +- :wrench: use Node 4 on Travis [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2da999beffe2ef043767c8c979ca4e7ae7a069c6) +- Fix INSTALLATION.md docs for v2.0.0 and Firebase Cloud Messaging (#1741) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/32ff975ea1318f6194ac01477ca563cfe4a0218a) +- update FirebaseMessaging podspec (#1742) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1842f7ade4643ad733c18f80b0daa211147ab72c) +- :art: Fix merge conflicts [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3efba512317119ea2d54473c7e164a6c24db3ca3) +- Merge v2.0.x into master (#1736) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d07fdf031e052f9c457319e6aaa9d7bfb72d1224) +- Fixes #1716 - Incomplete CocoaPods installation steps (#1738) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/525816cb0fd591b49f51b2844ac04e55397b6b8b) +- docs updated (#1727) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4234bfe9dab6e9f72b2ff52c3a94287154d39229) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e7cbe6ea8c863b0096425836473f2fa05a0da048) +- 1.10.4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ec7c3ea1fafbf3fafe502d278af218715aebb909) +- :bookmark: Bumping plugin version to 1.10.4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b1efe1fa069c034aaf465e040300fd2884d46075) +- :penguin::bug: Issue #1710: Notification message key overwritten [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/911a1d4fe5d3a05e0012ee8121464cfb8974ce23) +- :penguin::bug: Issue #1710: Notification message key overwritten [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4eadccd93d6daa81a05396a93fdc2033a4c90b12) +- :penguin: Fix issue #1663 by allowing message as the data payload key (#1666) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f8ac07399905fb9c6b0ab48139fa76066c5e190f) +- [typo] Small fix to payload doc [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5a4a04b1be5a7dd30a9c577441b241767ec20500) +- 2.0.0-rc3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b393a9d932aee66da277b404c2475cb77195d8d8) +- :bookmark: Bumping plugin version to 2.0.0-rc3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8003110d0757107ad211cd0e0b9c175e60dcd7ed) +- :package: update www/push.js [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c0a3a4c6d578b2ee14a82f167934ecc8a7672557) +- :wrench: Update cordovaDependencies [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/969d546c3dc96efb59a226ee5df38de6e66e4de4) +- :memo: update readme [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0cbb7a92946ac9febb5ac5960291928d539c0fe6) +- :memo: Fix PAYLOAD.md regarding "drawable" directory name (#1711) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a27a62d6e346b1e61ffe2ffaae482461cf970c03) +- Bump requirements [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/85e6419cbad124eaa3eac1c1c515aa684ccf4393) +- Add resource-file way of copying google services files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/46ba2745f0ebc08cc3b12f9c51177247130b592c) +- Merge branch 'v2.0.x' of https://github.com/phonegap/phonegap-plugin-push into v2.0.x [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a5c9e456ce333b3387b2e4412248cdf45d26334c) +- Fixing package.json from failed merge/rebase. [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/974d2e218bcc8ab8ebf779ef18df74622702eb0e) +- Remove hook and use resource-file tag to copy google services file [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/86763c7f2cc15eae39972e4137813edb5cd8b838) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9850b1b180c3b66f64edc1680d358a7b1df58b95) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/15a68ed070d611f0569c90adaa062099120a7817) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/784b7355a62490a5ce6229292213e22e671873c8) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9b9df30cf65a275c0d4727a2854b12792ec905a2) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/620af90cdda85f64aa65cc0fc0de051cb13980ba) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ee9ecc957d8961e2a0ae884f55ee5abc71652885) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c7545607bb23ea801f7a167d3408b112e4a6e812) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2ac7442de047ecedf4a6d2c66591889e14bdafc4) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5c2fc51055343467e51f6facbd690e71273cbac2) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d1b4f51fb2cd6e9ee8447fee0ce4a5e9eba0a52d) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0169587f198d0b44a06f408d803bbdac0fb1d079) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/38bd3581663ccd85b2daed7b9833571a4adbc99e) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9d5dbb196763e399d5177c0d4802ecc043cfc270) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/24f0a77bac10e0d8e4ff837a165a3d69c3447601) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2535a189caddba2a41f9e002930541c55360047d) +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8aa6f717db7dd534c97ad559307d391788e13e47) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/740cfe2bda63548a0e9cbf62b1833a4945eb432f) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/704b3635764700d5fc06f2e9c8c6a657ea4b7f29) +- :pencil2: fixing error in CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/68b045e6e40cdf1d5b9ed84136bebdf5f7874b8a) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d8c4d002e4b6c6b399e5c5e5456012a121ee7b20) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/632a4f1d87ff306bbc8920133e96b84125e44468) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4fb78566b5ebbbf2f04268b91f9c8cbc7193601e) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e93f04a87763a762d581a18439b2de808fc81a2c) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8f827a9678dac02887872bd7374fde1c40caeb90) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/64044115de796c52132e60719d5e93fc16594002) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d1f8f8e55af40a16129cdc362e179f0c7ef60bd0) +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/05c52e22945c0405b76a6d10d837ae6b015e661b) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/600f6050a2c3899559148579c5bc32c1e56449fa) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2660a8620874d520e2f3f3217cf20ea369affada) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3f043c21a608fdea4436409b68fbcf2c822d6c0a) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/97a1615a79ab0317a5dae27b7124dbaec7bc71c7) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e04b175c72d0680b3b618fdbcce80f9f9d470055) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d21632fd2acf90847c67b0c70f0b740ed3d367a7) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b41580f7476a34014ceb03976f25989f98cbde6a) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f84574aeffc958b6ec152ca36c2ea595418e901c) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/326943dadc29fe662ce4925b8141960e31d78dd3) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b5c0156bb13a22e11cf6f174a7307e404ed6d154) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/006ca17a7482490fbbfc67faa88a4c60d81a49f4) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/102934b167c4e69c9a6a5c7b41d0ca3fba0cfd25) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/bccc1ba887603b8577c01ee5b885bffa0d406028) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7fe0379c6be007817c21355044bcecdd05bcc301) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6c1a5572c420c88772bd3fc89d81fac21027a5be) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/98c100b12613a2885ed1afd417b1e678883d37ee) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7861fd27cd052c7e80736b8da9cba8cfae442e73) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b3dc189600842c6a8e318b032bdf215ea1c9b81f) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ff2dbe0cc5a2dce0a92b6c16f35b1a67ce6a6f18) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/50285f9193f5e6b33e63c2540b8f3c7a257a5221) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f67e30d41f5ea94a60a53b00ed51b995960f89c9) +- Merge branch 'v2.0.x' of https://github.com/phonegap/phonegap-plugin-push into v2.0.x [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/96af63840f28a57d29e21a48cc52533fa0830bea) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7371f3b31ea7a672ec6d43da7ef9475916b6c5c5) +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5099c8fe435bda7d8bc7b2648d078a3b63cf19ea) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/72d29bd4372e6043d38835d07839346ea204390a) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c44be0628bb42ba7ee07456524e9b1fffae64aea) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/95cdee193d2977a17e778bf91ca1bcfc240dc266) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a1fa7cce1168145c77fef2632ad64f8926e71d27) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ef4c7e187f2c5f386d9c844ee7211c8ff1cc214c) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5d52fdaf28f0535ef6dab315abd67141b0fcd0f7) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5d9dfdf179b39312a6382a48dd99d675e642a533) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/057cbd16f10581cd601079a9a10b9338df3c23eb) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/83238fce85413cdd192b5ff33139ba9a0bcd080f) +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9ff3929bed6bff911027bef21168e527ff61fd2c) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/94d8cc7ec8ba3a4d466758ffb2c27104c2cc1ca3) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a837c875d8a30fc4175693dff43139569974ec22) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/49da4ea30af1a2fb479110074ddf5f67e2ba370c) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ebc5d9353bab3917f91c775cf13aec47c5ca1e04) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/505c8da8253cb8562ed16659b5ec2a8e73ec1c23) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/46eafb1e5688ade278086a1644d06de4e36849b5) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f3b01f155f6300dc05c625116e0c374af61d6388) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/453561c8f2dfc4ed09b6a182f6998c90408a3d44) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ba0020349337160f83271b683195693ef0b4f440) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/aee7b93a4d0b0bb0b9c987704c1cde82612e4445) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5e0e7d107b2c9f4aeeda3a7757213e41ac573798) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/172528ea548174fd7be62d0ab2f9816566447a61) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2727d274ef650fb0b4d25786d42f0ee5f72e9730) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/697e592d8225f4e0853a0ea72a598d10a18c832d) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c2987cbee54f04e7d44eec421b2417be5e7d716e) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f358dba691fb39757003326209a232cefce53adf) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7b7de65c2718eccc1ff0eeb2800973cd440c85a7) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8bf4343369e6b12f6ec28a104512cb3ab392e834) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3de63bdf9e5a365e3b3e295f2a305ad66b512917) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b9ad4ebdeee6700d9edf95bf051dabda5923e01a) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c119bf08869d51d5fe23f9a0fb78fd8325b35248) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3a1806aaec5d3c76f7fcd30ddfd85d576fb6d197) +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/471b2aa829cb0ecc93a9a788891602ad17319a47) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7ad471ff45724828fb21630fdfbc244ba037d9d8) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b80dfb12b5053184936a4c6c881f1af55459348f) +- :pencil2: fixing error in CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9796292910f2d600b22d4846c128196cfb54ba7c) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/297b8d28f2d7bf04420744c445e59a527c52d502) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/41c8e66483fc0c5f21da7477d2522a2212a8017a) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/08e496fffc7fa082410f7b16e73e6afe12da194c) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/156718a5800dfe4b87593e0732f4258c7c148bea) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0add758d08657e22501612ed258033e31c394e6a) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1f2fd671ae734201b1260bc3d7878ae9ef28673c) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/70c6e04a3ba072b91b3752173ca2287d4e448b8f) +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7e07d81dbb47babe161f3204cdd06222a1e2ab3c) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f3dffdcf63c3d19b4717eed89eb911b8aecdd25a) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f5182503b241f519c03c872ae12f3489383f2b83) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/27a101f1d35217e0a1b7f0be9ad0607d31ea6c57) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c25a47bd3b5c2437ce3108656449658568f2c053) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/000bc36a8ce2a00e96212b66d69f1597dac68554) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/aa1cc247fcf8b94c4d60d26b18c9229c112e8185) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7f4bcafafe56be18f6dc64f3e634a6de594bc034) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a3f0eee774c7f9791f55f85816b0aeadc5c4fb4c) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6c796a49c3a44b47f58237d7e7760f5ebc34c371) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/10c5153672dc478dd072274c220200526c313604) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/aa6e3ce5449accd5397b4eda8a950fd5cebc4f0e) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b65fe745b5eabbb7437a46b46e747be4aaf5116a) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3b5f3c71657d8af3e4407ac9ea6c36e00988b1cf) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/89040874c530c7f86c2acbcce5c3b88b351e80fb) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a1e90013f8ca8497acc2513f4ce3df1358293d51) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0bc1ca736546242772516334f47fd4ea4f8f5e5f) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f7acf338d5bff2bc25b5c1e2fa681b7e20254cc9) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a65be290d4176c1c0b51b700d673550ae22cf777) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ed630d481b9035eb9df48738c0e77029937fafe9) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c9c53761fa3d6fc99acaa96601e9abc673a62c23) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6c46880b57aa1dee2bbcfeb5a86b497035f46ebe) + +## [v1.10.4](https://github.com/phonegap/phonegap-plugin-push/tree/v1.10.4) (2017-05-17) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.10.3...v1.10.4) + +- 1.10.4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ec7c3ea1fafbf3fafe502d278af218715aebb909) +- :bookmark: Bumping plugin version to 1.10.4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b1efe1fa069c034aaf465e040300fd2884d46075) +- :penguin::bug: Issue #1710: Notification message key overwritten [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/911a1d4fe5d3a05e0012ee8121464cfb8974ce23) +- :penguin::bug: Issue #1710: Notification message key overwritten [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4eadccd93d6daa81a05396a93fdc2033a4c90b12) +- :penguin: Fix issue #1663 by allowing message as the data payload key (#1666) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f8ac07399905fb9c6b0ab48139fa76066c5e190f) +- [typo] Small fix to payload doc [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5a4a04b1be5a7dd30a9c577441b241767ec20500) +- :memo: update readme [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0cbb7a92946ac9febb5ac5960291928d539c0fe6) +- :memo: Fix PAYLOAD.md regarding "drawable" directory name (#1711) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a27a62d6e346b1e61ffe2ffaae482461cf970c03) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cfad83fa420df5ba4ac12f2f3f7fa68fdb22cc03) + +## [v2.0.0-rc3](https://github.com/phonegap/phonegap-plugin-push/tree/v2.0.0-rc3) (2017-05-09) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v2.0.0-rc2...v2.0.0-rc3) + +- 2.0.0-rc3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b393a9d932aee66da277b404c2475cb77195d8d8) +- :bookmark: Bumping plugin version to 2.0.0-rc3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8003110d0757107ad211cd0e0b9c175e60dcd7ed) +- :package: update www/push.js [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c0a3a4c6d578b2ee14a82f167934ecc8a7672557) +- :wrench: Update cordovaDependencies [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/969d546c3dc96efb59a226ee5df38de6e66e4de4) +- Bump requirements [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/85e6419cbad124eaa3eac1c1c515aa684ccf4393) +- Add resource-file way of copying google services files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/46ba2745f0ebc08cc3b12f9c51177247130b592c) +- Merge branch 'v2.0.x' of https://github.com/phonegap/phonegap-plugin-push into v2.0.x [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a5c9e456ce333b3387b2e4412248cdf45d26334c) +- Fixing package.json from failed merge/rebase. [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/974d2e218bcc8ab8ebf779ef18df74622702eb0e) +- Remove hook and use resource-file tag to copy google services file [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/86763c7f2cc15eae39972e4137813edb5cd8b838) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9850b1b180c3b66f64edc1680d358a7b1df58b95) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/15a68ed070d611f0569c90adaa062099120a7817) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/784b7355a62490a5ce6229292213e22e671873c8) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9b9df30cf65a275c0d4727a2854b12792ec905a2) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/620af90cdda85f64aa65cc0fc0de051cb13980ba) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ee9ecc957d8961e2a0ae884f55ee5abc71652885) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c7545607bb23ea801f7a167d3408b112e4a6e812) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2ac7442de047ecedf4a6d2c66591889e14bdafc4) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5c2fc51055343467e51f6facbd690e71273cbac2) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d1b4f51fb2cd6e9ee8447fee0ce4a5e9eba0a52d) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0169587f198d0b44a06f408d803bbdac0fb1d079) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/38bd3581663ccd85b2daed7b9833571a4adbc99e) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9d5dbb196763e399d5177c0d4802ecc043cfc270) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/24f0a77bac10e0d8e4ff837a165a3d69c3447601) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2535a189caddba2a41f9e002930541c55360047d) +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8aa6f717db7dd534c97ad559307d391788e13e47) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/740cfe2bda63548a0e9cbf62b1833a4945eb432f) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/704b3635764700d5fc06f2e9c8c6a657ea4b7f29) +- :pencil2: fixing error in CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/68b045e6e40cdf1d5b9ed84136bebdf5f7874b8a) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d8c4d002e4b6c6b399e5c5e5456012a121ee7b20) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/632a4f1d87ff306bbc8920133e96b84125e44468) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4fb78566b5ebbbf2f04268b91f9c8cbc7193601e) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e93f04a87763a762d581a18439b2de808fc81a2c) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8f827a9678dac02887872bd7374fde1c40caeb90) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/64044115de796c52132e60719d5e93fc16594002) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d1f8f8e55af40a16129cdc362e179f0c7ef60bd0) +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/05c52e22945c0405b76a6d10d837ae6b015e661b) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/600f6050a2c3899559148579c5bc32c1e56449fa) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2660a8620874d520e2f3f3217cf20ea369affada) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3f043c21a608fdea4436409b68fbcf2c822d6c0a) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/97a1615a79ab0317a5dae27b7124dbaec7bc71c7) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e04b175c72d0680b3b618fdbcce80f9f9d470055) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d21632fd2acf90847c67b0c70f0b740ed3d367a7) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b41580f7476a34014ceb03976f25989f98cbde6a) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f84574aeffc958b6ec152ca36c2ea595418e901c) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/326943dadc29fe662ce4925b8141960e31d78dd3) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b5c0156bb13a22e11cf6f174a7307e404ed6d154) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/006ca17a7482490fbbfc67faa88a4c60d81a49f4) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/102934b167c4e69c9a6a5c7b41d0ca3fba0cfd25) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/bccc1ba887603b8577c01ee5b885bffa0d406028) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7fe0379c6be007817c21355044bcecdd05bcc301) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6c1a5572c420c88772bd3fc89d81fac21027a5be) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/98c100b12613a2885ed1afd417b1e678883d37ee) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7861fd27cd052c7e80736b8da9cba8cfae442e73) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b3dc189600842c6a8e318b032bdf215ea1c9b81f) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ff2dbe0cc5a2dce0a92b6c16f35b1a67ce6a6f18) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/50285f9193f5e6b33e63c2540b8f3c7a257a5221) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f67e30d41f5ea94a60a53b00ed51b995960f89c9) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cfad83fa420df5ba4ac12f2f3f7fa68fdb22cc03) +- 1.10.3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1e072b351056d453fd1c1d40d5fcac310f3e107c) +- :bookmark: Bumping plugin version to 1.10.3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/29df66eae54e773925e25bd92299957e4d654723) +- :bug: Handle null in getCircleBitmap (#1705) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3acdfa338d7a8b56ec4dc73c50aa9917ecb3be7c) +- :shirt: Issue #1702: The logging tag can be at most 23 characters, was 40 (PushPlugin_BackgroundActionButtonHandler) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2045873acda2e81d54b2da87cd2d10f056bd90f9) +- Shortened log tag PushPlugin_BackgroundActionButtonHandler to bring u… (#1703) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/dd707122b7aa78649fa6f5f73ba9b05436799926) +- Merge branch 'v2.0.x' of https://github.com/phonegap/phonegap-plugin-push into v2.0.x [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/96af63840f28a57d29e21a48cc52533fa0830bea) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7371f3b31ea7a672ec6d43da7ef9475916b6c5c5) +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5099c8fe435bda7d8bc7b2648d078a3b63cf19ea) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/72d29bd4372e6043d38835d07839346ea204390a) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c44be0628bb42ba7ee07456524e9b1fffae64aea) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/95cdee193d2977a17e778bf91ca1bcfc240dc266) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a1fa7cce1168145c77fef2632ad64f8926e71d27) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ef4c7e187f2c5f386d9c844ee7211c8ff1cc214c) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5d52fdaf28f0535ef6dab315abd67141b0fcd0f7) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5d9dfdf179b39312a6382a48dd99d675e642a533) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/057cbd16f10581cd601079a9a10b9338df3c23eb) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/83238fce85413cdd192b5ff33139ba9a0bcd080f) +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9ff3929bed6bff911027bef21168e527ff61fd2c) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/94d8cc7ec8ba3a4d466758ffb2c27104c2cc1ca3) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a837c875d8a30fc4175693dff43139569974ec22) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/49da4ea30af1a2fb479110074ddf5f67e2ba370c) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ebc5d9353bab3917f91c775cf13aec47c5ca1e04) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/505c8da8253cb8562ed16659b5ec2a8e73ec1c23) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/46eafb1e5688ade278086a1644d06de4e36849b5) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f3b01f155f6300dc05c625116e0c374af61d6388) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/453561c8f2dfc4ed09b6a182f6998c90408a3d44) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ba0020349337160f83271b683195693ef0b4f440) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/aee7b93a4d0b0bb0b9c987704c1cde82612e4445) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5e0e7d107b2c9f4aeeda3a7757213e41ac573798) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/172528ea548174fd7be62d0ab2f9816566447a61) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2727d274ef650fb0b4d25786d42f0ee5f72e9730) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/697e592d8225f4e0853a0ea72a598d10a18c832d) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c2987cbee54f04e7d44eec421b2417be5e7d716e) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f358dba691fb39757003326209a232cefce53adf) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7b7de65c2718eccc1ff0eeb2800973cd440c85a7) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8bf4343369e6b12f6ec28a104512cb3ab392e834) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3de63bdf9e5a365e3b3e295f2a305ad66b512917) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b9ad4ebdeee6700d9edf95bf051dabda5923e01a) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c119bf08869d51d5fe23f9a0fb78fd8325b35248) +- :memo: Docs for interoperability with Firebase (#1693) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cebb6403143047192462f30c22b9510a8c6dbe21) +- fix headline (#1685) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e2e7993544eed544eb7286868b60e2e3efb6275d) +- Fix changelog date [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3140b2b00388785f8056632376b50a1d1ef67b96) +- :arrow_up: update pluginpub to 0.0.8 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cfab7d91556a38ee81550fe47e13f2662ae810db) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/027ea2c17e4b96b848ab29046efea243e6e2da27) +- 1.10.2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b5a7d4ec6e64abaed65de00be3e9bac9ab25791e) +- :bookmark: Bumping plugin version to 1.10.2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5b700ad9927c401081a5de49f2a6a27ba0dfaa9a) +- :arrow_up: update pluginpub to 0.0.7 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/38564ce55e53e018c91f4063d680eedd2631b825) +- Fix the dates on the CHANGELOG (the last 2 version) (#1676) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c0f26192c906bfc1a60390333c96d5dc07433978) +- Vapid Support (#1675) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/384b60bade628035b21d23f07e284eb6e1557a10) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/97d618fb53084cfae78f397def48df791131358f) +- 1.10.1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6211e8c3df8881a90d19b111a0e63f890d435df6) +- :bookmark: Bumping plugin version to 1.10.1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6d710a06681ad84c13273fe5d20feb3033ac67b6) +- :bug: Issue #1655: App opens on clearing notification (Android) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ff417925f6d6678f0fcd8315d5f4b4b08fbb9085) +- :memo: Issue #1118: Problem with notifications stacking [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d669c44a863d86d0bb73b5ae086bc2fe6f8113a9) +- :memo: Issue #1220: [Question] the hook setting seem not work [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4ef137eea370da7c225ab2a5cf63b1e97a68f4a4) +- Set get badge count android (#1644) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/630907cf3d8802bcd5d91b6bd768c989f6ef897a) +- Add plugin typings from DefinitelyTyped (#1654) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6ea70d9984e176a75602e72e1d26f5404c519e29) +- :arrow_up: Issue #1560: setApplicationIconBadgeNumber not working on Android but firing success function [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/700701fd2151667905d860228cf954301186721a) +- :memo: Issue #1618: No notification when app is closed on Android, not at all on iOS [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7f64bf0ffbddf3ef20de2fe540ec2718be5d0c23) +- :arrow_down: Issue #1560: setApplicationIconBadgeNumber not working on Android but firing success function [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e450fd7b623f27f27858a7537ec7950aa0f618b5) +- :arrow_up: Issue #1560: setApplicationIconBadgeNumber not working on Android but firing success function [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4af3472263a5125cab6f08bbb59b83bf957144ec) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ed25a3e3ad9fb6f2af63fd07957944f974eafaa1) +- 1.10.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6b9b862da8566c7717dfc79dd6b32d8a7e6774d8) +- :bookmark: Bumping plugin version to 1.10.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/626e9615fbff6ea225569ab58353ac7f58aef495) +- :heavy_plus_sign: update pluginpub version [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c3c8058ffee888447017eb5d8c0f4f30cbcd090f) +- Issue #1464: Create round bitmap icon for large icon image passed in from local resource or url (#1635) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0dd0d468868f0b13c8d840c78dd89fca5920cd32) +- Receive notification only from SENDER_ID (#1484) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a0d51e54aac39b8c58e4c67080f174c0228947c9) +- Add no-cache flag to payload (#1620) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/42f8cefbd187c36534e6ab59b6611fb7f15b91f0) +- Add dismiss key to on notification data (#1621) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4259bb3cacfe2561ed44e9f16bd74f8d5ae45ae2) +- return true for old android versions, since AppOpsManager is available starting at 19 (#1634) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/945aa2ad6d266e82683e0bee86f53d258f2b31b6) +- :art: remove reference to unused String [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/75f2191632a7a51eda7510a172ae6cc9d477acb9) +- Ability to use custom keys to find message title and text on Android (#1604) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fd366296773906c91d5f8dfa3e8ba813c7c71b85) +- :memo: Fixed URL of apples custom sound documentation (#1600) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8c93f8622eb1c453cb0c681158a07deca32bf200) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/409020c90edf04e0a37232cff8aadb070d4ccaa9) +- 1.9.4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2241c7431cd60a68d2f35e7b4a5bfd797d5161b6) +- Bumping plugin version to 1.9.4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ec47932bf8fdf9cd96db076fe56306ab230048d9) +- Issue #1591: App crashes with the latest updates of Android SDK with plugin v-1.9.2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/514c21366ab37001ca323bec58261e023edaefd7) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3a218e4c68ebc1088461c2cfec966e57eaa24089) +- 1.9.3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/42723d6609862aa950abce67b2a637736bdd9e99) +- :bookmark: Bumping plugin version to 1.9.3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8f7b7dc003a2bc5bab7a316b0e2b0cf475c5a449) +- :wrench: Add valid SPDX license expression [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4274d0759acd7110ed2592ed1d2ce3bf692711d3) +- :memo: Issue #1587: v2.0.0-rc2: .on('notification') event not fired when background notification in Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7e90853a09a2c49f29e12eed03977b08b1295387) +- :arrow_up: Issue #1560: setApplicationIconBadgeNumber not working on Android but firing success function [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3188a3907f50dcf625b7663ecf74ea9a9209d437) +- :memo: Issue #1557: push.on('notification') not triggered - Ionic [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b91e9420fb68c4efc943cc5f8ecbd81274ffcbec) +- :memo: Issue #1407: Uncaught (in promise): Error: Push plugin not found! [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/adf3eabb8871980d2dead7ecb8185ad0da1d6b46) +- Corrected merges usage to prevent possible conflicts with other plugins (#1538) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/00c67cb2c85e97dfe4f7020f28ad4d954458599f) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3a1806aaec5d3c76f7fcd30ddfd85d576fb6d197) +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/471b2aa829cb0ecc93a9a788891602ad17319a47) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7ad471ff45724828fb21630fdfbc244ba037d9d8) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b80dfb12b5053184936a4c6c881f1af55459348f) +- :pencil2: fixing error in CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/9796292910f2d600b22d4846c128196cfb54ba7c) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/297b8d28f2d7bf04420744c445e59a527c52d502) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/41c8e66483fc0c5f21da7477d2522a2212a8017a) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/08e496fffc7fa082410f7b16e73e6afe12da194c) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/156718a5800dfe4b87593e0732f4258c7c148bea) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0add758d08657e22501612ed258033e31c394e6a) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1f2fd671ae734201b1260bc3d7878ae9ef28673c) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/70c6e04a3ba072b91b3752173ca2287d4e448b8f) +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7e07d81dbb47babe161f3204cdd06222a1e2ab3c) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f3dffdcf63c3d19b4717eed89eb911b8aecdd25a) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f5182503b241f519c03c872ae12f3489383f2b83) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/27a101f1d35217e0a1b7f0be9ad0607d31ea6c57) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c25a47bd3b5c2437ce3108656449658568f2c053) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/000bc36a8ce2a00e96212b66d69f1597dac68554) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/aa1cc247fcf8b94c4d60d26b18c9229c112e8185) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7f4bcafafe56be18f6dc64f3e634a6de594bc034) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a3f0eee774c7f9791f55f85816b0aeadc5c4fb4c) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6c796a49c3a44b47f58237d7e7760f5ebc34c371) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/10c5153672dc478dd072274c220200526c313604) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/aa6e3ce5449accd5397b4eda8a950fd5cebc4f0e) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b65fe745b5eabbb7437a46b46e747be4aaf5116a) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3b5f3c71657d8af3e4407ac9ea6c36e00988b1cf) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/89040874c530c7f86c2acbcce5c3b88b351e80fb) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a1e90013f8ca8497acc2513f4ce3df1358293d51) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0bc1ca736546242772516334f47fd4ea4f8f5e5f) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f7acf338d5bff2bc25b5c1e2fa681b7e20254cc9) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a65be290d4176c1c0b51b700d673550ae22cf777) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ed630d481b9035eb9df48738c0e77029937fafe9) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c9c53761fa3d6fc99acaa96601e9abc673a62c23) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6c46880b57aa1dee2bbcfeb5a86b497035f46ebe) +- :penguin: android mixpanel pushnotification suport added (#1523) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/951cb6921a717d847c279ad6896c28772c70103f) +- :memo: Making string replacement clearer [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/abdb656315bd4457c7ae43aaa52e2357df85d139) +- :bug::penguin::memo: Issue #1433: Cordova Push V5 register () crashes App when initialized with topicList [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1d5723c81ad7a1e9d76fdce22161e8e8aa8da262) +- :bug::penguin: Issue #1421: Notification delay caused by icon bitmap timeout [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fb4b533f2b31daebc7ed57c16228458def3d2af9) +- :memo: Issue #1442: CocoaPods support vs requirement [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5912b1ea911fbe3b45a3a47ed005b7048a487ba6) +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/67041a994d70fd3a04149003607b88947e8cc994) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7dea689ba17ebb901ee12da62801f051a99cc368) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ea92e039b1d7640b70ca94e5f8748e7d2abbf13a) +- :pencil2: fixing error in CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/498bb038799bd687d8c492154bd3b34d72edd322) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/74aba315b4cbb1e06c902e76891bce5582cbe690) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e2f8a62c431af26c4d2fa487daa704067a088643) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cb9839740c4cbff5711224eed4b91b55aba77612) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1bef8b37ef7bc017571924edc9e05fe09cd25e29) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ca5c281897c664b0bd98097ec2fc8c19c33b2c63) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/170d7dd43fe047c6caf84ec0f59da6c2c0cdeb6f) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fa4e36606c965504dba609940a2acf24f74ed978) +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/af6c31933e3daedf6e5a7f046e971efcf65cc1ea) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/99742021c8c6c2cd860c40b01db6a3dc18095dbb) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ff14a71b5e365f5c93159e759f989a6bbe89b40a) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/92dca439e1b0a0750a7e466bace2c4cb3acd19d8) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4cbc1cb69203c5a0fab250bd49b99a398ce86558) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7075bc8206641aa6459cf6acc4fe447fb1d57f77) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d043c5f9d7872dc4340151c0645a24716391f58f) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f7a7c5c172190acab17fdfd54ad726a7a2fad701) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/15e68b03956a1dd292fda87e0da4f1ad9700d9c0) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/54aa482fb8af6ac15a60fb06090077e1d68dee6c) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1276d538b80106dd2f3d67996a531e64e7aa4937) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/504f2dcb5b158e0b2e151b255aad28a659bc2c4d) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/97f0aeaa1099b89076b28282b2d2daac7ec62b33) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e11d89f46572d1e4430f1f6a63945d74b56e574c) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fa66ac99685f1f2b580597a45b16315ab7748028) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c539b041cbe2a2b6e9a360a91ee2a9bfdfd16b03) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/dce5e9fb70e4df45a10fd8348a7def64864fdd24) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6f0182aff86b04c22630d1586d6ac6ca617c7e61) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/562a22f45bdafa4e2887996e9c0fa295b8bac886) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f1d14b2615d7c8330afbdbf0faa1d2438473a45d) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7e4c47b5c5647866f24e6c2f47e4c98a1f8e2442) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a02580e19d470919ec61ec489cdf4ee6ca2f0d8c) + +## [v1.10.3](https://github.com/phonegap/phonegap-plugin-push/tree/v1.10.3) (2017-20-04) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.10.2...v1.10.3) + +- 1.10.3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1e072b351056d453fd1c1d40d5fcac310f3e107c) +- :bookmark: Bumping plugin version to 1.10.3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/29df66eae54e773925e25bd92299957e4d654723) +- :bug: Handle null in getCircleBitmap (#1705) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3acdfa338d7a8b56ec4dc73c50aa9917ecb3be7c) +- :shirt: Issue #1702: The logging tag can be at most 23 characters, was 40 (PushPlugin_BackgroundActionButtonHandler) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2045873acda2e81d54b2da87cd2d10f056bd90f9) +- Shortened log tag PushPlugin_BackgroundActionButtonHandler to bring u… (#1703) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/dd707122b7aa78649fa6f5f73ba9b05436799926) +- :memo: Docs for interoperability with Firebase (#1693) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cebb6403143047192462f30c22b9510a8c6dbe21) +- fix headline (#1685) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e2e7993544eed544eb7286868b60e2e3efb6275d) +- Fix changelog date [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3140b2b00388785f8056632376b50a1d1ef67b96) +- :arrow_up: update pluginpub to 0.0.8 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cfab7d91556a38ee81550fe47e13f2662ae810db) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/027ea2c17e4b96b848ab29046efea243e6e2da27) + +## [v1.10.2](https://github.com/phonegap/phonegap-plugin-push/tree/v1.10.2) (2017-04-12) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.10.1...v1.10.2) + +- 1.10.2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b5a7d4ec6e64abaed65de00be3e9bac9ab25791e) +- :bookmark: Bumping plugin version to 1.10.2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5b700ad9927c401081a5de49f2a6a27ba0dfaa9a) +- :arrow_up: update pluginpub to 0.0.7 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/38564ce55e53e018c91f4063d680eedd2631b825) +- Fix the dates on the CHANGELOG (the last 2 version) (#1676) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c0f26192c906bfc1a60390333c96d5dc07433978) +- Vapid Support (#1675) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/384b60bade628035b21d23f07e284eb6e1557a10) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/97d618fb53084cfae78f397def48df791131358f) + +## [v1.10.1](https://github.com/phonegap/phonegap-plugin-push/tree/v1.10.1) (2017-04-07) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.10.0...v1.10.1) + +- 1.10.1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6211e8c3df8881a90d19b111a0e63f890d435df6) +- :bookmark: Bumping plugin version to 1.10.1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6d710a06681ad84c13273fe5d20feb3033ac67b6) +- :bug: Issue #1655: App opens on clearing notification (Android) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ff417925f6d6678f0fcd8315d5f4b4b08fbb9085) +- :memo: Issue #1118: Problem with notifications stacking [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d669c44a863d86d0bb73b5ae086bc2fe6f8113a9) +- :memo: Issue #1220: [Question] the hook setting seem not work [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4ef137eea370da7c225ab2a5cf63b1e97a68f4a4) +- Set get badge count android (#1644) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/630907cf3d8802bcd5d91b6bd768c989f6ef897a) +- Add plugin typings from DefinitelyTyped (#1654) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6ea70d9984e176a75602e72e1d26f5404c519e29) +- :arrow_up: Issue #1560: setApplicationIconBadgeNumber not working on Android but firing success function [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/700701fd2151667905d860228cf954301186721a) +- :memo: Issue #1618: No notification when app is closed on Android, not at all on iOS [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7f64bf0ffbddf3ef20de2fe540ec2718be5d0c23) +- :arrow_down: Issue #1560: setApplicationIconBadgeNumber not working on Android but firing success function [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e450fd7b623f27f27858a7537ec7950aa0f618b5) +- :arrow_up: Issue #1560: setApplicationIconBadgeNumber not working on Android but firing success function [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4af3472263a5125cab6f08bbb59b83bf957144ec) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ed25a3e3ad9fb6f2af63fd07957944f974eafaa1) + +## [v1.10.0](https://github.com/phonegap/phonegap-plugin-push/tree/v1.10.0) (2017-03-10) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.9.4...v1.10.0) + +- 1.10.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6b9b862da8566c7717dfc79dd6b32d8a7e6774d8) +- :bookmark: Bumping plugin version to 1.10.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/626e9615fbff6ea225569ab58353ac7f58aef495) +- :heavy_plus_sign: update pluginpub version [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c3c8058ffee888447017eb5d8c0f4f30cbcd090f) +- Issue #1464: Create round bitmap icon for large icon image passed in from local resource or url (#1635) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/0dd0d468868f0b13c8d840c78dd89fca5920cd32) +- Receive notification only from SENDER_ID (#1484) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a0d51e54aac39b8c58e4c67080f174c0228947c9) +- Add no-cache flag to payload (#1620) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/42f8cefbd187c36534e6ab59b6611fb7f15b91f0) +- Add dismiss key to on notification data (#1621) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4259bb3cacfe2561ed44e9f16bd74f8d5ae45ae2) +- return true for old android versions, since AppOpsManager is available starting at 19 (#1634) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/945aa2ad6d266e82683e0bee86f53d258f2b31b6) +- :art: remove reference to unused String [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/75f2191632a7a51eda7510a172ae6cc9d477acb9) +- Ability to use custom keys to find message title and text on Android (#1604) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fd366296773906c91d5f8dfa3e8ba813c7c71b85) +- :memo: Fixed URL of apples custom sound documentation (#1600) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8c93f8622eb1c453cb0c681158a07deca32bf200) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/409020c90edf04e0a37232cff8aadb070d4ccaa9) + +## [v1.9.4](https://github.com/phonegap/phonegap-plugin-push/tree/v1.9.4) (2016-07-09) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.9.3...v1.9.4) + +- 1.9.4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2241c7431cd60a68d2f35e7b4a5bfd797d5161b6) +- Bumping plugin version to 1.9.4 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ec47932bf8fdf9cd96db076fe56306ab230048d9) +- Issue #1591: App crashes with the latest updates of Android SDK with plugin v-1.9.2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/514c21366ab37001ca323bec58261e023edaefd7) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3a218e4c68ebc1088461c2cfec966e57eaa24089) + +## [v1.9.3](https://github.com/phonegap/phonegap-plugin-push/tree/v1.9.3) (2016-07-09) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.9.2...v1.9.3) + +- 1.9.3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/42723d6609862aa950abce67b2a637736bdd9e99) +- :bookmark: Bumping plugin version to 1.9.3 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8f7b7dc003a2bc5bab7a316b0e2b0cf475c5a449) +- :wrench: Add valid SPDX license expression [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/4274d0759acd7110ed2592ed1d2ce3bf692711d3) +- :memo: Issue #1587: v2.0.0-rc2: .on('notification') event not fired when background notification in Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7e90853a09a2c49f29e12eed03977b08b1295387) +- :arrow_up: Issue #1560: setApplicationIconBadgeNumber not working on Android but firing success function [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/3188a3907f50dcf625b7663ecf74ea9a9209d437) +- :memo: Issue #1557: push.on('notification') not triggered - Ionic [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b91e9420fb68c4efc943cc5f8ecbd81274ffcbec) +- :memo: Issue #1407: Uncaught (in promise): Error: Push plugin not found! [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/adf3eabb8871980d2dead7ecb8185ad0da1d6b46) +- Corrected merges usage to prevent possible conflicts with other plugins (#1538) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/00c67cb2c85e97dfe4f7020f28ad4d954458599f) +- :penguin: android mixpanel pushnotification suport added (#1523) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/951cb6921a717d847c279ad6896c28772c70103f) +- :memo: Making string replacement clearer [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/abdb656315bd4457c7ae43aaa52e2357df85d139) +- :bug::penguin::memo: Issue #1433: Cordova Push V5 register () crashes App when initialized with topicList [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1d5723c81ad7a1e9d76fdce22161e8e8aa8da262) +- :bug::penguin: Issue #1421: Notification delay caused by icon bitmap timeout [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fb4b533f2b31daebc7ed57c16228458def3d2af9) +- :memo: Issue #1442: CocoaPods support vs requirement [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5912b1ea911fbe3b45a3a47ed005b7048a487ba6) +- make google_app_id non translatable string (#1485) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d9890fa52ecdb41b344f06f1dd081d05ea784bea) +- :penguin::bug: Issue #1474: Android: force-start starts the app in Foreground instead of Background [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2bb5f53a8478353ed1f5f97756adff336fb9a710) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e02ff6703a53cb18e53060e2d7f6f64ebc8588b6) + +## [v2.0.0-rc2](https://github.com/phonegap/phonegap-plugin-push/tree/v2.0.0-rc2) (2016-07-09) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v2.0.0-rc1...v2.0.0-rc2) + +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/67041a994d70fd3a04149003607b88947e8cc994) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7dea689ba17ebb901ee12da62801f051a99cc368) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ea92e039b1d7640b70ca94e5f8748e7d2abbf13a) +- :pencil2: fixing error in CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/498bb038799bd687d8c492154bd3b34d72edd322) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/74aba315b4cbb1e06c902e76891bce5582cbe690) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e2f8a62c431af26c4d2fa487daa704067a088643) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cb9839740c4cbff5711224eed4b91b55aba77612) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1bef8b37ef7bc017571924edc9e05fe09cd25e29) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ca5c281897c664b0bd98097ec2fc8c19c33b2c63) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/170d7dd43fe047c6caf84ec0f59da6c2c0cdeb6f) + +## [v2.0.0-rc1](https://github.com/phonegap/phonegap-plugin-push/tree/v2.0.0-rc1) (2016-07-09) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.9.1...v2.0.0-rc1) + +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/46a44f92ca8f94c991a564a5a8ff1e424c4b7f7f) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b952330124ab76d6a8ec88ebdb7eac0a614f8c38) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6ec1beb2ab13d6333122b76122ae4eb2e60dfb55) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fab033596c66ee1c9594d404fec8473a4dd41e77) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/07f28d8dbc477faeb2a8dd8997fde0d088dd191a) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ba16ce363a198edd0d190e9603a5e1363289a893) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a47af30d32c6921b484c1c129cd60582e1b3047b) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c9f4a5d6d6f18082ae9e5a533a700cf3662c2739) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/368f6cbb8095fd742bb39308e02fac7f89379f18) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a3e0eefe09359612d6757d4598eba69e3d68a96b) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d6d527628f8811ab6781591b3c186ce2732c9f37) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/26b0369f148976e4227f73f5883658a726f825dd) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b4d850028b088c38bbd11c1899e28ea69b1c391e) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/417be691c8131f006a7f1bd49bc171faa36ee872) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e34ddc03b01e676382a6d70e1e750a4e64ca6d62) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/732a2bd8efbfbea696db6951439e2472d6dc8e6f) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8d44ccfdfe91831140e4e972d6879b6330a1c613) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a18d50324ab96945db382539ce2ed7a287bed840) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/72875ac0aef0f9d00de6413e0dea4d7533c5eaef) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2bd37d1b31ca0b2c76c89a04a803b22186d1f8ad) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fda1f905c4364a3ac100486dc639fdd5c3bae9ca) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b6acbfeacf851bab256962616ba2bd93150982ba) +- :memo: Issue #1235: SecurityError: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5241a6f3868b4b15f79c6d5c0b5b5ea45e6301f9) +- :memo: Issue #1415: What is the id in push.finish? [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2660b51da66e791ff342d027ea6afa4313281e28) +- :memo: Issue #1420: Update PLATFORM_SUPPORT.md [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/60ad23affaf2dc4c9c2bf48b6cbb702b0217aeb7) +- :memo: Adding more emoji for commit messages [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/eb6b7b7d52770769719392b9b5226ee9a7caef75) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f38fd3d4d9f5f4f8de602b6aa07089b706884ca5) + +## [v2.0.0-rc2](https://github.com/phonegap/phonegap-plugin-push/tree/v2.0.0-rc2) (2016-07-09) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v2.0.0-rc1...v2.0.0-rc2) + +- 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/67041a994d70fd3a04149003607b88947e8cc994) +- Bumping plugin version to 2.0.0-rc2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/7dea689ba17ebb901ee12da62801f051a99cc368) +- :apple::bug: Issue #1497: App crashes after refreshing when using FCM (v2) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ea92e039b1d7640b70ca94e5f8748e7d2abbf13a) +- :pencil2: fixing error in CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/498bb038799bd687d8c492154bd3b34d72edd322) +- :memo: Using a newer version on the examples [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/74aba315b4cbb1e06c902e76891bce5582cbe690) +- :penguin::memo::bug: Issue #1470: Cannot install phonegap-plugin-push on master [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e2f8a62c431af26c4d2fa487daa704067a088643) +- :bug::apple::wrench: Fixing a merge issue where aps-environment was accidentally removed [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/cb9839740c4cbff5711224eed4b91b55aba77612) +- :bug::penguin::memo::arrow_up: #1460: Build Issue Android [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/1bef8b37ef7bc017571924edc9e05fe09cd25e29) +- :bug::apple: Issue #1461: App crashes when initialising with topics (v2.0.0-rc1) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ca5c281897c664b0bd98097ec2fc8c19c33b2c63) +- Fixing my merge error for PR #1378 Optional event emit instead of function call for action buttons [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/170d7dd43fe047c6caf84ec0f59da6c2c0cdeb6f) + +## [v2.0.0-rc1](https://github.com/phonegap/phonegap-plugin-push/tree/v2.0.0-rc1) (2016-07-09) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.9.1...v2.0.0-rc1) + +- 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/46a44f92ca8f94c991a564a5a8ff1e424c4b7f7f) +- :bookmark: Bumping plugin version to 2.0.0-rc1 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b952330124ab76d6a8ec88ebdb7eac0a614f8c38) +- :wrench: add tern to gitignore [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/6ec1beb2ab13d6333122b76122ae4eb2e60dfb55) +- :hammer::wrench::arrow_up: Use Babel to transpile ES2015 code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fab033596c66ee1c9594d404fec8473a4dd41e77) +- :wrench: Add browser platform back for FCM branch [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/07f28d8dbc477faeb2a8dd8997fde0d088dd191a) +- Pin FCM to 9.8.0 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ba16ce363a198edd0d190e9603a5e1363289a893) +- Add empty google services plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a47af30d32c6921b484c1c129cd60582e1b3047b) +- :bug: Issue #1188: Strings.xml google_app_id conflict with google-services.json [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/c9f4a5d6d6f18082ae9e5a533a700cf3662c2739) +- :memo: Update to using fcm-node [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/368f6cbb8095fd742bb39308e02fac7f89379f18) +- Issue #689: Remove sender id from PushNotification init iOS options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a3e0eefe09359612d6757d4598eba69e3d68a96b) +- Issue #689: Remove sender id from PushNotification init Android options [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/d6d527628f8811ab6781591b3c186ce2732c9f37) +- Refactor GCMIntentService to FCMService [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/26b0369f148976e4227f73f5883658a726f825dd) +- Fix topic subscription and unsubscription on FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b4d850028b088c38bbd11c1899e28ea69b1c391e) +- Fix rebase errors [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/417be691c8131f006a7f1bd49bc171faa36ee872) +- Use CocoaPods [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e34ddc03b01e676382a6d70e1e750a4e64ca6d62) +- fixed registration and removed unused code [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/732a2bd8efbfbea696db6951439e2472d6dc8e6f) +- Added hook and resource file to copy GoogleService-Info.plist [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/8d44ccfdfe91831140e4e972d6879b6330a1c613) +- Changed code to work with FCM [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/a18d50324ab96945db382539ce2ed7a287bed840) +- Added .framework files as custom frameworks [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/72875ac0aef0f9d00de6413e0dea4d7533c5eaef) +- Removed GCM files and added FCM files [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2bd37d1b31ca0b2c76c89a04a803b22186d1f8ad) +- Fixed empty token on android first run (#1008) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/fda1f905c4364a3ac100486dc639fdd5c3bae9ca) +- Added partial Android FCM support (#975) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/b6acbfeacf851bab256962616ba2bd93150982ba) +- :memo: Issue #1235: SecurityError: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/5241a6f3868b4b15f79c6d5c0b5b5ea45e6301f9) +- :memo: Issue #1415: What is the id in push.finish? [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/2660b51da66e791ff342d027ea6afa4313281e28) +- :memo: Issue #1420: Update PLATFORM_SUPPORT.md [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/60ad23affaf2dc4c9c2bf48b6cbb702b0217aeb7) +- :memo: Adding more emoji for commit messages [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/eb6b7b7d52770769719392b9b5226ee9a7caef75) +- Updating CHANGELOG [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/f38fd3d4d9f5f4f8de602b6aa07089b706884ca5) + +## [v1.9.2](https://github.com/phonegap/phonegap-plugin-push/tree/v1.9.2) (2016-07-09) +[Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.9.1...v1.9.2) + +- 1.9.2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/ef3de3281205b1fd56c57c71db31dc06a95da7a9) +- :bookmark: Bumping plugin version to 1.9.2 [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/24650bad4db49525505e9a2624ff1b5500e6b3ef) +- Optional event emit instead of function call for action buttons (#1378) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/e92e951e759fe64d17d01e152575b6262973380a) +- Ensures foreground is true when inline is set to true and Android version is earlier than N (#1459) [view commit](http://github.com/phonegap/phonegap-plugin-push/commit/dd61ec34c0ca5c3fadf6797a8e192b9343324f68) + ## [v1.9.1](https://github.com/phonegap/phonegap-plugin-push/tree/v1.9.1) (2016-07-09) [Full Changelog](https://github.com/phonegap/phonegap-plugin-push/compare/v1.9.0...v1.9.1) diff --git a/StoneIsland/plugins/phonegap-plugin-push/MIT-LICENSE b/StoneIsland/plugins/phonegap-plugin-push/MIT-LICENSE index a017eb00..abf9a980 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/MIT-LICENSE +++ b/StoneIsland/plugins/phonegap-plugin-push/MIT-LICENSE @@ -1,4 +1,4 @@ -Copyright 2012-2016 Adobe Systems +Copyright 2012-2017 Adobe Systems Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/StoneIsland/plugins/phonegap-plugin-push/README.md b/StoneIsland/plugins/phonegap-plugin-push/README.md index 8f9ff5e9..93c2b1eb 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/README.md +++ b/StoneIsland/plugins/phonegap-plugin-push/README.md @@ -1,12 +1,16 @@ -#phonegap-plugin-push [](https://travis-ci.org/phonegap/phonegap-plugin-push) +# phonegap-plugin-push [](https://travis-ci.org/phonegap/phonegap-plugin-push) > Register and receive push notifications +# Warning + +The links below take you to the version 2.x documentation which includes a number of breaking API changes from version 1.x, mostly the move from GCM to FCM. If you are using version 1.x please reference the docs in the [v1.x branch](https://github.com/phonegap/phonegap-plugin-push/tree/v1.x). + # What is this? -This plugin offers support to receive and handle native push notifications with a **single unified API**. +This plugin offers support to receive and handle native push notifications with a **single unified API**. -Starting with version `1.9.0`, this plugin will support `CocoaPods` installation of the `Google Cloud Messaging` library. More details are available in the [Installation](docs/INSTALLATION.md#cocoapods) documentation. +Starting with version `2.0.0`, this plugin will support `CocoaPods` installation of the `Firebase Cloud Messaging` library. More details are available in the [Installation](docs/INSTALLATION.md#cocoapods) documentation. - [Reporting Issues](docs/ISSUES.md) - [Installation](docs/INSTALLATION.md) diff --git a/StoneIsland/plugins/phonegap-plugin-push/docs/API.md b/StoneIsland/plugins/phonegap-plugin-push/docs/API.md index e0481af8..866fd28c 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/docs/API.md +++ b/StoneIsland/plugins/phonegap-plugin-push/docs/API.md @@ -11,7 +11,7 @@ - [push.subscribe()](#pushsubscribetopic-successhandler-errorhandler) - [push.unsubscribe()](#pushunsubscribetopic-successhandler-errorhandler) - [push.setApplicationIconBadgeNumber() - iOS & Android only](#pushsetapplicationiconbadgenumbersuccesshandler-errorhandler-count---ios--android-only) -- [push.getApplicationIconBadgeNumber() - iOS only](#pushgetapplicationiconbadgenumbersuccesshandler-errorhandler---ios-only) +- [push.getApplicationIconBadgeNumber() - iOS & Android only](#pushgetapplicationiconbadgenumbersuccesshandler-errorhandler---ios--android-only) - [push.finish() - iOS only](#pushfinishsuccesshandler-errorhandler-id---ios-only) - [push.clearAllNotifications() - iOS & Android only](#pushclearallnotificationssuccesshandler-errorhandler---ios--android-only) @@ -39,7 +39,6 @@ All available option attributes are described bellow. Currently, there are no Wi Attribute | Type | Default | Description --------- | ---- | ------- | ----------- -`android.senderID` | `string` | | Maps to the project number in the Google Developer Console. `android.icon` | `string` | | Optional. The name of a drawable resource to use as the small-icon. The name should not include the extension. `android.iconColor` | `string` | | Optional. Sets the background color of the small icon on Android 5.0 and greater. [Supported Formats](http://developer.android.com/reference/android/graphics/Color.html#parseColor(java.lang.String)) `android.sound` | `boolean` | `true` | Optional. If `true` it plays the sound specified in the push data or the default system sound. @@ -47,13 +46,16 @@ Attribute | Type | Default | Description `android.clearBadge` | `boolean` | `false` | Optional. If `true` the icon badge will be cleared on init and before push messages are processed. `android.clearNotifications` | `boolean` | `true` | Optional. If `true` the app clears all pending notifications when it is closed. `android.forceShow` | `boolean` | `false` | Optional. Controls the behavior of the notification when app is in foreground. If `true` and app is in foreground, it will show a notification in the notification drawer, the same way as when the app is in background (and `on('notification')` callback will be called *only when the user clicks the notification*). When `false` and app is in foreground, the `on('notification')` callback will be called immediately. -`android.topics` | `array` | `[]` | Optional. If the array contains one or more strings each string will be used to subscribe to a GcmPubSub topic. +`android.topics` | `array` | `[]` | Optional. If the array contains one or more strings each string will be used to subscribe to a FcmPubSub topic. +`android.messageKey` | `string` | `message` | Optional. The key to search for text of notification. +`android.titleKey` | `string` | `'title'` | Optional. The key to search for title of notification. #### Browser Attribute | Type | Default | Description --------- | ---- | ------- | ----------- `browser.pushServiceURL` | `string` | `http://push.api.phonegap.com/v1/push` | Optional. URL for the push server you want to use. +`browser.applicationServerKey` | `string` | `` | Optional. Your GCM API key if you are using VAPID keys. #### iOS @@ -73,9 +75,9 @@ The following properties are used if you want use GCM on iOS. Attribute | Type | Default | Description --------- | ---- | ------- | ----------- -`ios.senderID` | `string` | `undefined` (Native) | Maps to the project number in the Google Developer Console. Setting this uses GCM for notifications instead of native -`ios.gcmSandbox` | `boolean` | `false` | Whether to use prod or sandbox GCM setting. Defaults to false. -`ios.topics` | `array` | `[]` | Optional. If the array contains one or more strings each string will be used to subscribe to a GcmPubSub topic. Note: only usable in conjunction with `senderID`. +`ios.fcmSandbox` | `boolean` | `false` | Whether to use prod or sandbox GCM setting. Defaults to false. +options +`ios.topics` | `array` | `[]` | Optional. If the array contains one or more strings each string will be used to subscribe to a FcmPubSub topic. ##### How GCM on iOS works. @@ -85,12 +87,12 @@ What happens is on the device side is that it registers with APNS, then that reg When you send a message to GCM using that ID, what it does is look up the APNS registration ID on it's side and forward the message you sent to GCM on to APSN to deliver to your iOS device. -Make sure that the certificate you build with matches your `gcmSandbox` value. +Make sure that the certificate you build with matches your `fcmSandbox` value. -- If you build your app as development and set `gcmSandbox: false` it will fail. -- If you build your app as production and set `gcmSandbox: true` it will fail. -- If you build your app as development and set `gcmSandbox: true` but haven't uploaded the development certs to Google it will fail. -- If you build your app as production and set `gcmSandbox: false` but haven't uploaded the production certs to Google it will fail. +- If you build your app as development and set `fcmSandbox: false` it will fail. +- If you build your app as production and set `fcmSandbox: true` it will fail. +- If you build your app as development and set `fcmSandbox: true` but haven't uploaded the development certs to Google it will fail. +- If you build your app as production and set `fcmSandbox: false` but haven't uploaded the production certs to Google it will fail. > Note: The integration between GCM and APNS is a bit finicky. Personally, I feel it is much better to send pushes to Android using GCM and pushes to iOS using APNS which this plugin does support. @@ -99,7 +101,6 @@ Make sure that the certificate you build with matches your `gcmSandbox` value. ```javascript var push = PushNotification.init({ android: { - senderID: "12345679" }, browser: { pushServiceURL: 'http://push.api.phonegap.com/v1/push' @@ -159,12 +160,14 @@ The event `registration` will be triggered on each successful registration with Parameter | Type | Description --------- | ---- | ----------- `data.registrationId` | `string` | The registration ID provided by the 3rd party remote push service. +`data.registrationType` | `string` | The registration type of the 3rd party remote push service. Either FCM or APNS. ### Example ```javascript push.on('registration', function(data) { - console.log(data.registrationId); + console.log(data.registrationId); + console.log(data.registrationType); }); ``` @@ -203,6 +206,7 @@ Parameter | Type | Description `data.additionalData` | `Object` | An optional collection of data sent by the 3rd party push service that does not fit in the above properties. `data.additionalData.foreground` | `boolean` | Whether the notification was received while the app was in the foreground `data.additionalData.coldstart` | `boolean` | Will be `true` if the application is started by clicking on the push notification, `false` if the app is already started. +`data.additionalData.dismissed` | `boolean` | Is set to `true` if the notification was dismissed by the user ### Example @@ -352,7 +356,7 @@ push.setApplicationIconBadgeNumber(function() { }, 2); ``` -## push.getApplicationIconBadgeNumber(successHandler, errorHandler) - iOS only +## push.getApplicationIconBadgeNumber(successHandler, errorHandler) - iOS & Android only Get the current badge count visible when the app is not running diff --git a/StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md b/StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md index 8481e7bc..32bc2e5f 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md +++ b/StoneIsland/plugins/phonegap-plugin-push/docs/EXAMPLES.md @@ -11,7 +11,6 @@ phonegap create my-app --template phonegap-template-push ```javascript var push = PushNotification.init({ android: { - senderID: "12345679" }, browser: { pushServiceURL: 'http://push.api.phonegap.com/v1/push' diff --git a/StoneIsland/plugins/phonegap-plugin-push/docs/INSTALLATION.md b/StoneIsland/plugins/phonegap-plugin-push/docs/INSTALLATION.md index 830bbdd7..ea8f6918 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/docs/INSTALLATION.md +++ b/StoneIsland/plugins/phonegap-plugin-push/docs/INSTALLATION.md @@ -4,6 +4,7 @@ - [Android details](#android-details) - [Compilation](#compilation) - [Co-existing with Facebook Plugin](#co-existing-with-facebook-plugin) + - [Co-existing with plugins that use Firebase](#co-existing-with-plugins-that-use-firebase) - [Common errors](#common-errors) - [minSdkVersion === 14](#minsdkversion--14) - [Multidex](#multidex) @@ -16,52 +17,65 @@ - [Bitcode](#bitcode) - [CocoaPods](#cocoapods) - [Common CocoaPod Installation issues](#common-cocoapod-installation-issues) + - [CocoaPod Disk Space](#cocoapod-disk-space) + - [Library not found for -lPods-Appname](#library-not-found-for--lPods-Appname) + - [Library not found for -lGoogleToolboxForMac](#library-not-found-for--lPods-Appname) - [Additional Resources](#additional-resources) ## Installation Requirements Plugin version | Cordova CLI | Cordova Android | Cordova iOS | CocoaPods ---- | ---- | ---- | ---- | ---- +2.0.0 | 7.0.0 | 6.2.1 | 4.4.0 | 1.1.1 1.9.0 | 6.4.0 | 6.0.0 | 4.3.0 | 1.1.1 1.8.0 | 3.6.3 | 4.0.0 | 4.1.0 | N/A To install from the command line: ``` -phonegap plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX" +phonegap plugin add phonegap-plugin-push ``` or ``` -cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX" +cordova plugin add phonegap-plugin-push ``` It is also possible to install via repo url directly ( unstable ) ``` -phonegap plugin add https://github.com/phonegap/phonegap-plugin-push --variable SENDER_ID="XXXXXXX" +phonegap plugin add https://github.com/phonegap/phonegap-plugin-push ``` or ``` -cordova plugin add https://github.com/phonegap/phonegap-plugin-push --variable SENDER_ID="XXXXXXX" +cordova plugin add https://github.com/phonegap/phonegap-plugin-push ``` -Where the `XXXXXXX` in `SENDER_ID="XXXXXXX"` maps to the project number in the [Google Developer Console](https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwikqt3nyPjMAhXJ5iYKHR0qDcsQFggbMAA&url=https%3A%2F%2Fconsole.developers.google.com%2F&usg=AFQjCNF0eH059mv86nMIlRmfsf42kde-wA&sig2=BQ2BJpchw1CpGt87sk5p6w&bvm=bv.122852650,d.eWE). To find the project number login to the Google Developer Console, select your project and click the menu item in the screen shot below to display your project number. +As of version 2.0.0 the SENDER_ID parameter has been removed at install time. Instead you put your google-services.json (Android) and/or GoogleService-Info.plist in the root folder of your project and then add the following lines into your config.xml. - +In the platform tag for Android add the resource-file tag: -If you are not creating an Android application you can put in anything for this value. +``` +<platform name="android"> + <resource-file src="google-services.json" target="google-services.json" /> +</platform> +``` + +In the platform tag for iOS add the resource-file tag: + +``` +<platform name="ios"> + <resource-file src="GoogleService-Info.plist" /> +</platform> +``` > Note: if you are using Ionic you may need to specify the SENDER_ID variable in your package.json. ``` "cordovaPlugins": [ { - "variables": { - "SENDER_ID": "XXXXXXX" - }, "locator": "phonegap-plugin-push" } ] @@ -70,23 +84,17 @@ If you are not creating an Android application you can put in anything for this > Note: You need to specify the SENDER_ID variable in your config.xml if you plan on installing/restoring plugins using the prepare method. The prepare method will skip installing the plugin otherwise. ``` -<plugin name="phonegap-plugin-push" spec="1.6.0"> - <param name="SENDER_ID" value="XXXXXXX" /> -</plugin> +<plugin name="phonegap-plugin-push" spec="2.0.0" /> ``` ## Android details ### Compilation -As of version 1.3.0 the plugin has been switched to using Gradle/Maven for building. - -You will need to ensure that you have installed the following items through the Android SDK Manager: +As of version 2.0.0 the plugin has been switched to using pinned version of Gradle libraries. You will need to ensure that you have installed the following items through the Android SDK Manager: -- Android Support Library version 23 or greater -- Local Maven repository for Support Libraries (formerly Android Support Repository) version 20 or greater -- Google Play Services version 27 or greater -- Google Repository version 22 or greater +- Android Support Library version 25.1.0 +- FirebaseMessaging Library version 9.8.0  @@ -113,6 +121,30 @@ or cordova plugin add --save cordova-plugin-facebook4 --variable APP_ID="App ID" --variable APP_NAME="App Name" ``` +### Co-existing with plugins that use Firebase + +Problems may arise when push plugin is used along plugins that implement Firebase functionality (cordova-plugin-firebase-analytics, for example). Firebase uses `@string/google_app_id`, as does the push plugin, though the value format differs, causing problems like this: `Invalid google_app_id. Firebase Analytics disabled`. + +To make the two work together, you need to migrate your GCM project from Google console to Firebase console: + +1) In Firebase console - [import your existing GCM project](https://firebase.google.com/support/guides/google-android#migrate_your_console_project), don't create a new one. +2) Set your `SENDER_ID` variable to match the id of your imported Firebase project. In case of cordova, your `config.xml` would look something like this: +```xml +<plugin name="phonegap-plugin-push" spec="~1.10.0"> + <variable name="SENDER_ID" value="1:956432534015:android:df201d13e7261425" /> +</plugin> +``` +3) In your JavaScript, when you init the PushPlugin, senderID remains the same format as before: +```javascript +PushNotification.init({ + android: { + senderID: 956432534015 + } +}); +``` + +*Note:* No changes on the back-end side are needed: [even though recommended](https://developers.google.com/cloud-messaging/android/android-migrate-fcm#update_server_endpoints), it isn't yet required and sending messages through GCM gateway should work just fine. + ### Common errors #### minSdkVersion === 14 @@ -223,11 +255,21 @@ cordova platform update ios@4.0.0 ### CocoaPods -Required `cordova-cli` version: `6.4.0` +Required `cordova-cli` minimum version: `6.4.0` + +Required `cordova-ios` minimum version: `4.3.0` + +Required `CocoaPods` minimum version: `1.0.1` -Required `cordova-ios` version: `4.3.0` -Version `1.9.0` (and above) of this plugin supports [CocoaPods](https://cocoapods.org) installation of the [Google Cloud Messaging](https://cocoapods.org/pods/GoogleCloudMessaging) library. +To install CocoaPods, please follow the installation instructions [here](https://guides.cocoapods.org/using/getting-started). After installing CocoaPods, please run: + + pod setup + +This will clone the required CocoaPods specs-repo into your home folder at `~/.cocoapods/repos`, so it might take a while. See the [CocoaPod Disk Space](#cocoapod-disk-space) section below for more information. + + +Version `2.0.0` (and above) of this plugin supports [CocoaPods](https://cocoapods.org) installation of the [Firebase Cloud Messaging](https://cocoapods.org/pods/FirebaseMessaging) library. If you are installing this plugin using `npm`, and you are using version `6.1.0` or greater of the `cordova-cli`, it will automatically download the right version of this plugin for both your platform and cli. @@ -255,59 +297,55 @@ Failed to install 'phonegap-plugin-push':Error: pod: Command failed with exit co Error: pod: Command failed with exit code 1 ``` -Please run the command `pod repo update` and re-install the plugin. +Please run the command `pod repo update` and re-install the plugin. You would only run `pod repo update` if you have the specs-repo already cloned on your machine through `pod setup`. -## Additional Resources +##### CocoaPod Disk Space + +Running `pod setup` can take over 1 GB of disk space and that can take quite some time to download over a slow internet connection. If you are having issues with disk space/network try this neat hack from @VinceOPS. -The push plugin enables you to play sounds and display different icons during push (Android only). These additional resources need to be added to your projects `platforms` directory in order for them to be included into your final application binary. One way of doing it is to create a hook to do the copying for you on each build. +``` +git clone --verbose --depth=1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master +pod setup --verbose +``` -First create a `scripts` directory in the root of your project. Next add a file to the scripts directory called `copy_resource_files.js`. The contents of the file will look something like this: +##### Library not found for -lPods-Appname -```javascript -#!/usr/bin/env node +If you open the app in Xcode and you get an error like: -// each object in the array consists of a key which refers to the source and -// the value which is the destination. -var filestocopy = [{ - "resources/android/images/logo.png": - "platforms/android/res/drawable/logo.png" -}, { - "resources/android/sounds/ring.mp3": - "platforms/android/res/raw/ring.mp3" -}, { - "resources/ios/sounds/ring.caf": - "platforms/ios/YourAppName/ring.caf" -}, ]; +``` +ld: library not found for -lPods-Appname +clang: error: linker command failed with exit code 1 +``` -var fs = require('fs'); -var path = require('path'); +Then you are opening the .xcodeproj file when you should be opening the .xcworkspace file. -// no need to configure below -var rootdir = process.argv[2]; +##### Library not found for -lGoogleToolboxForMac -filestocopy.forEach(function(obj) { - Object.keys(obj).forEach(function(key) { - var val = obj[key]; - var srcfile = path.join(rootdir, key); - var destfile = path.join(rootdir, val); - //console.log("copying "+srcfile+" to "+destfile); - var destdir = path.dirname(destfile); - if (fs.existsSync(srcfile) && fs.existsSync(destdir)) { - fs.createReadStream(srcfile).pipe( - fs.createWriteStream(destfile)); - } - }); -}); +Trying to build for iOS using the latest cocoapods (1.2.1) but failed with the following error (from terminal running cordova build ios): + +``` +ld: library not found for -lGoogleToolboxForMac ``` -Obviously, you'll need to modify the `filestocopy` variable to suit your needs. Pay attention to the destination path on iOS where you will need to replace `YourAppName`. +Workarounds are to add the platform first and install the plugins later, or to manually run pod install on projectName/platforms/ios. + +## Additional Resources -Next open up your `config.xml` file and add the following line: +The push plugin enables you to play sounds and display different icons during push (Android only). These additional resources need to be added to your projects `platforms` directory in order for them to be included into your final application binary. + +You can now use the `resource-file` tag to deliver the image and sound files to your application. For example if you wanted to include an extra image file for only your Android build you would add the `resource-file` tag to your android `platform` tag: -```xml -<hook type="before_build" src="scripts/copy_resource_files.js" /> ``` +<platform name="android"> + <resource-file src="myImage.png" target="res/drawable/myImage.png" /> +</platform> +``` + +or if you wanted to include a sound file for iOS: -Now, when you build your app the files will get copied into your platforms directory for you. -If you are using PhoneGap Build check out these instructions on [Additional Resources](PHONEGAP_BUILD.md#additional-resources) +``` +<platform name="ios"> + <resource-file src="mySound.caf" /> +</platform> +``` diff --git a/StoneIsland/plugins/phonegap-plugin-push/docs/PAYLOAD.md b/StoneIsland/plugins/phonegap-plugin-push/docs/PAYLOAD.md index b446612e..431b5a4e 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/docs/PAYLOAD.md +++ b/StoneIsland/plugins/phonegap-plugin-push/docs/PAYLOAD.md @@ -3,6 +3,7 @@ - [Background Events](#push-message-arrives-with-app-in-background) - [Tap Events](#user-clicks-on-notification-in-notification-center) - [Android Behaviour](#android-behaviour) + - [Notification vs Data Payloads](#notification-vs-data-payloads) - [Localization](#localization) - [Images](#images) - [Sound](#sound) @@ -15,12 +16,14 @@ - [Priority in Notifications](#priority-in-notifications) - [Picture Messages](#picture-messages) - [Background Notifications](#background-notifications) - - [Use of content-available: true](#use-of-content-available-true) + - [Use of content_available: true](#use-of-content-available-true) + - [Caching](#caching) - [Huawei and Xiaomi Phones](#huawei-and-xiaomi-phones) - [Application force closed](#application-force-closed) - [Visibility](#visibility-of-notifications) - [Badges](#badges) - [Support for Twilio Notify](#support-for-twilio-notify) + - [Notification ID](#notification-id) - [iOS Behaviour](#ios-behaviour) - [Sound](#sound-1) - [Background Notifications](#background-notifications-1) @@ -67,6 +70,66 @@ Some ways to handle this *double* event are: # Android Behaviour +## Notification vs Data Payloads + +Notifications behave differently depending on the foreground/background state of the receiving app and the payload you send to the app. + +For instance if you send the following payload: + +``` +{ + "notification": { + "title": "Test Notification", + "body": "This offer expires at 11:30 or whatever", + "notId": 10 + } +} +``` + +When your app is in the foreground any `on('notification')` handlers you have registered will be called. However if your app is in the background the notification will show up in the system tray. Clicking on the notification in the system tray will start the app but your `on('notification')` handler will not be called as messages with only `notification` payloads will not cause the plugins `onMessageReceived` method to be called. + +If you send a payload with a mix of `notification` & `data` objects like this: + +``` +{ + "notification": { + "title": "Test Notification", + "body": "This offer expires at 11:30 or whatever", + "notId": 10 + }, + "data" : { + "surveyID": "ewtawgreg-gragrag-rgarhthgbad" + } +} +``` + +When your app is in the foreground any `on('notification')` handlers you have registered will be called. If your app is in the background the notification will show up in the system tray. Clicking on the notification in the system tray will start the app and your `on('notification')` handler will not be called as messages with only `notification` payloads will not cause the plugins `onMessageReceived` method to be called. + +My recommended format for your push payload when using this plugin (while it differs from Google's docs) works 100% of the time: + +``` +{ + "data" : { + "title": "Test Notification", + "body": "This offer expires at 11:30 or whatever", + "notId": 10, + "surveyID": "ewtawgreg-gragrag-rgarhthgbad" + } +} +``` + +When your app is in the foreground any `on('notification')` handlers you have registered will be called. If your app is in the background the notification will show up in the system tray. Clicking on the notification in the system tray will start the app and your `on('notification')` handler will be called and the event received by your `on('notification')` handler will get the following data: + +``` +{ + "message": "This offer expires at 11:30 or whatever", + "title": "Test Notification", + "additionalData": { + "surveyID": "ewtawgreg-gragrag-rgarhthgbad" + } +} +``` + ## Localization Plugin supported localization from resources for: title, message and summaryText. @@ -95,22 +158,32 @@ Or use localization with formatted constants. } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', {"locKey": "push_app_title"}); -message.addData('message', 'Simple non-localizable text for message!'); -// Constant with formatted params -// message.addData('message', {"locKey": "push_message_fox", "locData": ["fox", "dog"]}); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: {"locKey": "push_app_title"}, + message: 'Simple non-localizable text for message!' + // Constant with formatted params + // message: {"locKey": "push_message_fox", "locData": ["fox", "dog"]}); + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -129,9 +202,8 @@ By default the icon displayed in your push notification will be your apps icon. ```javascript var push = PushNotification.init({ "android": { - "senderID": "12345679" }, - browser: { + "browser": { pushServiceURL: 'http://push.api.phonegap.com/v1/push' }, "ios": { @@ -154,11 +226,10 @@ In order to get a better user experience you can specify an alternate icon and b ```javascript var push = PushNotification.init({ "android": { - "senderID": "123456789", "icon": "phonegap", "iconColor": "blue" }, - browser: { + "browser": { pushServiceURL: 'http://push.api.phonegap.com/v1/push' }, "ios": { @@ -170,7 +241,8 @@ var push = PushNotification.init({ }); ``` -Where *icon* is the name of an image in the Android *drawables* folder. Writing a hook to describe how to copy an image to the Android *drawables* folder is out of scope for this README but there is an [excellent tutorial](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) that you can copy. +Where *icon* is the name of an `.png` image file in the Android `res/drawable` folder. For example: `platforms/android/res/drawable/phonegap.png` +Writing a hook to describe how to copy an image to the Android `res/drawable` folder is out of scope for this README but there is an [excellent tutorial](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/) that you can copy. *iconColor* is one of the supported formats #RRGGBB or #AARRGGBB or one of the following names: 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta', 'yellow', 'lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey', 'aqua', 'fuchsia', 'lime', 'maroon', 'navy', 'olive', 'purple', 'silver', 'teal'. *iconColor* is supported on Android 5.0 and greater. @@ -180,38 +252,48 @@ Please follow the [Android icon design guidelines](https://www.google.com/design Additionally, each push can include a large icon which is used to personalize each push. The location of the image may one of three types. -The first is the *drawables* folder in your app. This JSON sent from GCM: +The first is the `res/drawable` folder in your app. This JSON sent from GCM: ```javascript { "registration_ids": ["my device id"], "data": { "title": "Large Icon", - "message": "Loaded from drawables folder", + "message": "Loaded from drawable folder", "image": "twitter" } } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Large Icon'); -message.addData('message', 'Loaded from drawables folder.'); -message.addData('image', 'twitter'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Large Icon', + message: 'Loaded from drawables folder.', + image: 'twitter' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` -Would look for the *twitter* image in the drawables folder and produce the following notification. +Would look for the *twitter* image in the `res/drawable` folder and produce the following notification.  @@ -228,25 +310,35 @@ The second is the *assets* folder in your app. This JSON sent from GCM: } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Large Icon'); -message.addData('message', 'Loaded from assets folder.'); -message.addData('image', 'www/image/logo.png'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Large Icon', + message: 'Loaded from assets folder.', + image: 'www/image/logo.png' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` -Would look for the *logo.png* file in the assets/www/img folder. Since your apps www folder gets copied into the Android assets folder it is an excellent spot to store the images without needing to write a hook to copy them to the *drawables* folder. It produces the following notification. +Would look for the *logo.png* file in the assets/www/img folder. Since your apps www folder gets copied into the Android assets folder it is an excellent spot to store the images without needing to write a hook to copy them to the `res/drawable` folder. It produces the following notification.  @@ -264,6 +356,52 @@ The third is the remote *URL*. This JSON sent from GCM: } ``` +Here is an example using fcm-node that sends the above JSON: + +```javascript +var FCM = require('fcm-node'); +// Replace these with your own values. +var apiKey = "replace with API key"; +var deviceID = "my device id"; +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Large Icon', + message: 'Loaded from URL', + image: 'https://dl.dropboxusercontent.com/u/887989/antshot.png' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } +}); +``` + +Produces the following notification. + + + +Finally the Material UI guidelines recommend using a circular icon for the large icon if the subject of the image is a person. This JSON sent from GCM: + +```javascript +{ + "registration_ids": ["my device id"], + "data": { + "title": "Large Circular Icon", + "message": "Loaded from URL", + "image": "https://pbs.twimg.com/profile_images/837060031895896065/VHIQ4oUf_400x400.jpg", + "image-type": "circle" + } +} +``` + Here is an example using node-gcm that sends the above JSON: ```javascript @@ -273,9 +411,10 @@ var apiKey = "replace with API key"; var deviceID = "my device id"; var service = new gcm.Sender(apiKey); var message = new gcm.Message(); -message.addData('title', 'Large Icon'); +message.addData('title', 'Large Circular Icon'); message.addData('message', 'Loaded from URL'); -message.addData('image', 'https://dl.dropboxusercontent.com/u/887989/antshot.png'); +message.addData('image', 'https://pbs.twimg.com/profile_images/837060031895896065/VHIQ4oUf_400x400.jpg'); +message.addData('image-type', 'circular'); service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { if(err) console.error(err); else console.log(response); @@ -284,7 +423,7 @@ service.send(message, { registrationTokens: [ deviceID ] }, function (err, respo Produces the following notification. - + ## Sound @@ -339,21 +478,31 @@ In order for your your notification to play a custom sound you will need to add } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Sound Test'); -message.addData('message', 'Loaded res/raw'); -message.addData('soundname', 'test'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Sound Test', + message: 'Loaded res/raw', + soundname: 'test' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -375,20 +524,30 @@ If you want to see multiple notifications in the shade you will need to provide } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Test Push'); -message.addData('message', 'Push number 1'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Test Push', + message: 'Push number 1' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -404,20 +563,30 @@ Followed by: } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Test Push'); -message.addData('message', 'Push number 2'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Test Push', + message: 'Push number 2' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -434,21 +603,31 @@ You will only see "Push number 2" in the shade. However, if you send: } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Test Push'); -message.addData('message', 'Push number 1'); -message.addData('notId', 1); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Test Push', + message: 'Push number 1', + notId: 1 + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -465,21 +644,31 @@ and: } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Test Push'); -message.addData('message', 'Push number 2'); -message.addData('notId', 2); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Test Push', + message: 'Push number 2', + notId: 2 + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -501,22 +690,32 @@ A better alternative to stacking your notifications is to use the inbox style to } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'My Title'); -message.addData('message', 'My first message'); -message.addData('style', 'inbox'); -message.addData('summaryText', 'There are %n% notifications'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'My Title', + message: 'My first message', + style: 'inbox', + summaryText: 'There are %n% notifications' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -538,22 +737,32 @@ But, if you follow it up with subsequent notifications like: } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'My Title'); -message.addData('message', 'My second message'); -message.addData('style', 'inbox'); -message.addData('summaryText', 'There are %n% notifications'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'My Title', + message: 'My second message', + style: 'inbox', + summaryText: 'There are %n% notifications' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -581,24 +790,34 @@ Your notification can include a maximum of three action buttons. If you wish to } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'AUX Scrum'); -message.addData('message', 'Scrum: Daily touchbase @ 10am Please be on time so we can cover everything on the agenda.'); -message.addData('actions', [ - { "icon": "emailGuests", "title": "EMAIL GUESTS", "callback": "app.emailGuests", "foreground": true}, - { "icon": "snooze", "title": "SNOOZE", "callback": "app.snooze", "foreground": false}, -]); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'AUX Scrum', + message: 'Scrum: Daily touchbase @ 10am Please be on time so we can cover everything on the agenda.', + actions: [ + { icon: "emailGuests", title: "EMAIL GUESTS", callback: "app.emailGuests", foreground: true}, + { icon: "snooze", title: "SNOOZE", callback: "app.snooze", foreground: false}, + ] + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -628,24 +847,34 @@ Your notification can include action buttons. If you wish to include an icon alo } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'AUX Scrum'); -message.addData('message', 'Scrum: Daily touchbase @ 10am Please be on time so we can cover everything on the agenda.'); -message.addData('actions', [ - { "icon": "emailGuests", "title": "EMAIL GUESTS", "callback": "app.emailGuests", "foreground": false, "inline": true}, - { "icon": "snooze", "title": "SNOOZE", "callback": "app.snooze", "foreground": false}, -]); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'AUX Scrum', + message: 'Scrum: Daily touchbase @ 10am Please be on time so we can cover everything on the agenda.', + actions: [ + { "icon": "emailGuests", "title": "EMAIL GUESTS", "callback": "app.emailGuests", "foreground": false, "inline": true}, + { "icon": "snooze", "title": "SNOOZE", "callback": "app.snooze", "foreground": false}, + ] + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -712,21 +941,31 @@ You can use a Led notifcation and choose the color of it. Just add a `ledColor` } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Green LED'); -message.addData('message', 'This is my message with a Green LED'); -message.addData('ledColor', [0, 0, 255, 0]); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Green LED', + message: 'This is my message with a Green LED', + ledColor: [0, 0, 255, 0] + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -745,21 +984,31 @@ You can set a Vibration Pattern for your notifications. Just add a `vibrationPat } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Vibration Pattern'); -message.addData('message', 'Device should wait for 2 seconds, vibrate for 1 second then be silent for 500 ms then vibrate for 500 ms'); -message.addData('vibrationPattern', [2000, 1000, 500, 500]); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Vibration Pattern', + message: 'Device should wait for 2 seconds, vibrate for 1 second then be silent for 500 ms then vibrate for 500 ms', + vibrationPattern: [2000, 1000, 500, 500] + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -778,21 +1027,31 @@ You can set a priority parameter for your notifications. This priority value det } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'This is a maximum priority Notification'); -message.addData('message', 'This notification should appear in front of all others'); -message.addData('priority', 2); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'This is a maximum priority Notification', + message: 'This notification should appear in front of all others', + priority: 2 + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -815,23 +1074,32 @@ Perhaps you want to include a large picture in the notification that you are sen } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Big Picture'); -message.addData('message', 'This is my big picture message'); -message.addData('style', 'picture'); -message.addData('picture', 'http://36.media.tumblr.com/c066cc2238103856c9ac506faa6f3bc2/tumblr_nmstmqtuo81tssmyno1_1280.jpg'); -message.addData('summaryText', 'The internet is built on cat pictures'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Big Picture', + message: 'This is my big picture message', + picture: 'http://36.media.tumblr.com/c066cc2238103856c9ac506faa6f3bc2/tumblr_nmstmqtuo81tssmyno1_1280.jpg', + summaryText: 'The internet is built on cat pictures' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -859,22 +1127,32 @@ First the JSON you send from GCM will need to include `"content-available": "1"` } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Test Push'); -message.addData('message', 'Push number 1'); -message.addData('info', 'super secret info'); -message.addData('content-available', '1'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + "to": deviceID, + "data": { + "title": 'Test Push', + "message": 'Push number 1', + "info": 'super secret info', + "content-available": '1' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -891,28 +1169,38 @@ or if you want the payload to be delivered directly to your app without anything } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('info', 'super secret info'); -message.addData('content-available', '1'); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + "to": deviceID, + "data": { + "info": 'super secret info', + "content-available": '1' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` If do not want this type of behaviour just omit `"content-available": 1` from your push data and your `on('notification')` event handler will not be called. -### Use of content-available: true +### Use of content_available: true -The GCM docs will tell you to send a data payload of: +The [GCM docs](https://developers.google.com/cloud-messaging/http-server-ref#downstream-http-messages-json) will tell you to send a data payload of: ```javascript { @@ -926,9 +1214,9 @@ The GCM docs will tell you to send a data payload of: } ``` -Where the `content-available` property is part of the main payload object. Setting the property in this part of the payload will result in the PushPlugin not getting the data correctly. Setting `content-available: true` will cause the Android OS to handle the push payload for you and not pass the data to the PushPlugin. +Where the `content_available` property is part of the main payload object. Setting the property in this part of the payload will result in the PushPlugin not getting the data correctly. Setting `content_available: true` will cause the Android OS to handle the push payload for you and not pass the data to the PushPlugin. -Instead move `content-available: true` into the `data` object of the payload and set it to `1` as per the example below: +Instead move `content_available: true` into the `data` object of the payload. The property name changes slightly to use a `-` instead of an `_`. So, `content_available` becomes `content-available` and `true` becomes `1` as per the example below: ```javascript { @@ -947,7 +1235,8 @@ Instead move `content-available: true` into the `data` object of the payload and These phones have a particular quirk that when the app is force closed that you will no longer be able to receive notifications until the app is restarted. In order for you to receive background notifications: - On your Huawei device go to Settings > Protected apps > check "My App" where. -- On your Xiaomi makes sure your phone has the "Auto-start" property enabled for your app. +- On your Xiaomi make sure your phone has the "Auto-start" property enabled for your app. +- On your Asus make sure your phone has the "Auto-start" property enabled for your app. ### Application force closed @@ -993,24 +1282,50 @@ If you add `force-start: 1` to the data payload the application will be restarte } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Force Start'); -message.addData('message', 'This notification should restart the app'); -message.addData('force-start', 1); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + "data": { + "title": 'Force Start', + "message": 'This notification should restart the app', + "force-start": '1' + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` +### Caching + +By default, when a notification arrives and 'content-available' is set to '1', the plugin will try to deliver the data payload even if the app is not running. In that case, the payload is cached and may be delivered when the app is started again. To disable this behavior, you can set a `no-cache` flag in the notification payload. 0: caching enabled (default), 1: caching disabled. + +```javascript +{ + "registration_ids": ["my device id"], + "data": { + "title": "Push without cache", + "message": "When the app is closed, this notification will not be cached", + "content-available": "1", + "no-cache": "1" + } +} +``` + ## Visibility of Notifications You can set a visibility parameter for your notifications. Just add a `visibility` field in your notification. -1: secret, 0: private (default), 1: public. `Secret` shows only the most minimal information, excluding even the notification's icon. `Private` shows basic information about the existence of this notification, including its icon and the name of the app that posted it. The rest of the notification's details are not displayed. `Public` Shows the notification's full content. @@ -1026,21 +1341,31 @@ You can set a visibility parameter for your notifications. Just add a `visibilit } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'This is a public Notification'); -message.addData('message', 'You should be able to read this notification on your lock screen'); -message.addData('visibility', 1); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'This is a public Notification', + message: 'You should be able to read this notification on your lock screen', + visibility: 1 + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -1061,21 +1386,31 @@ In order to set the badge number you will need to include the `badge` property i } ``` -Here is an example using node-gcm that sends the above JSON: +Here is an example using fcm-node that sends the above JSON: ```javascript -var gcm = require('node-gcm'); +var FCM = require('fcm-node'); // Replace these with your own values. var apiKey = "replace with API key"; var deviceID = "my device id"; -var service = new gcm.Sender(apiKey); -var message = new gcm.Message(); -message.addData('title', 'Badge Test'); -message.addData('message', 'Badges, we don\'t need no stinking badges'); -message.addData('badge', 7); -service.send(message, { registrationTokens: [ deviceID ] }, function (err, response) { - if(err) console.error(err); - else console.log(response); +var fcm = new FCM(apiKey); + +var message = { + to: deviceID, + data: { + title: 'Badge Test', + message: 'Badges, we don\'t need no stinking badges', + badge: 7 + } +}; + +fcm.send(message, function(err, response){ + if (err) { + console.log(err); + console.log("Something has gone wrong!"); + } else { + console.log("Successfully sent with response: ", response); + } }); ``` @@ -1113,11 +1448,17 @@ The JSON received by your app will comply with the standards described in the se Note: "sound" and "soundname" are equivalent and are considered to be the same by the plugin. +## Notification ID + +When setting the notification ID or `notId` please make sure that you are not exceeding the [MAX_INT](https://developer.android.com/reference/java/lang/Integer.html#MAX_VALUE) value for Android. Using a value larger than MAX_INT will throw an exception which will be caught by the plugin and it will use a default value of `0`. + +This means you can't use the JavaScript's `Date.getMilliseconds()` or Java's `System.currentTimeMillis()` as they will give you a value greater than MAX_INT. + # iOS Behaviour ## Sound -In order for your notification to play a custom sound you will need to add the files to root of your iOS project. The files must be in the proper format. See the [Local and Remote Notification Programming Guide](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/IPhoneOSClientImp.html#//apple_ref/doc/uid/TP40008194-CH103-SW6) for more info on proper file formats and how to convert existing sound files. +In order for your notification to play a custom sound you will need to add the files to root of your iOS project. The files must be in the proper format. See the [Local and Remote Notification Programming Guide](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/SupportingNotificationsinYourApp.html#//apple_ref/doc/uid/TP40008194-CH4-SW10) for more info on proper file formats and how to convert existing sound files. Then send the follow JSON from APNS: diff --git a/StoneIsland/plugins/phonegap-plugin-push/docs/PHONEGAP_BUILD.md b/StoneIsland/plugins/phonegap-plugin-push/docs/PHONEGAP_BUILD.md index 8a95d6a1..7f460738 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/docs/PHONEGAP_BUILD.md +++ b/StoneIsland/plugins/phonegap-plugin-push/docs/PHONEGAP_BUILD.md @@ -4,19 +4,20 @@ - [Including the plugin](#including-the-plugin) - [Adding Resources](#adding-resources) - [IntelXDK Support](#intelxdk-support) +- [Ionic Cloud Build](#ionic-cloud-build) ## PhoneGap Build Support -> Currently PhoneGap Build does not support version 1.9.0 of the plugin. Updates are being made to PGB to support the latest release. +> PhoneGap Build now support version 1.9.0 of the plugin. ### Including the plugin -Including this plugin in a project that is built by PhoneGap Build is as easy as adding: +Including this plugin in a project that is built by PhoneGap Build is as easy as adding (replacing `123456789` with your own, that is): ```xml <preference name="android-build-tool" value="gradle" /> <plugin name="phonegap-plugin-push" source="npm"> - <param name="SENDER_ID" value="<Your Sender ID>" /> + <param name="SENDER_ID" value="123456789" /> </plugin> ``` @@ -91,3 +92,25 @@ f. you probably need to install the required gem (`gem install pushmeup`) g. send the notification (`ruby pushAPNS.rb`) 10. See notification on device! + +## Ionic Cloud Build + +Users have reported issues with Ionic Cloud Build. Apparently there are some differences in the way variables are handled. If your app has an issue where the `PushNotification` object can't be found try the following. + +1. Remove the inclusion of `phonegap-plugin-push` from config.xml. That is delete lines that look like this: + +``` +<plugin name="phonegap-plugin-push" spec="~1.9.1"> + <variable name="SENDER_ID" value="xxx"/> +</plugin> +``` +2. Add the following lines into `package.json` in the `cordovaPlugins` array. + +``` +{ + "variables": { + "SENDER_ID": "xxx" + }, + "locator": "phonegap-plugin-push" +} +``` diff --git a/StoneIsland/plugins/phonegap-plugin-push/docs/TYPESCRIPT.md b/StoneIsland/plugins/phonegap-plugin-push/docs/TYPESCRIPT.md index 37117d16..53d215b3 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/docs/TYPESCRIPT.md +++ b/StoneIsland/plugins/phonegap-plugin-push/docs/TYPESCRIPT.md @@ -1,7 +1,7 @@ # Typescript definition file For those of you who use typescript, we're glad to say that we have the complete definition file available at [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped). -Search for `phonegap-plugin-push` there, or simply grab it directly [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/phonegap-plugin-push/phonegap-plugin-push.d.ts). +Search for `phonegap-plugin-push` there, or simply grab it directly [here](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/phonegap-plugin-push/index.d.ts). ## Example usage @@ -11,7 +11,6 @@ All available attributes and properties will have autocomplete support and type ```typescript let push = PushNotification.init({ android: { - senderID: "12345679" }, ios: { alert: "true", @@ -69,4 +68,4 @@ push.on('notification', (data: my.custom.NotificationEventResponse) => { ## Outdated definitions Is our definition file at DefinitelyTyped outdated? Is there any improvements that could be done? -We welcome any contribution, and they should be done through issues created [there](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/new).
\ No newline at end of file +We welcome any contribution, and they should be done through issues created [there](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/new). diff --git a/StoneIsland/plugins/phonegap-plugin-push/hooks/windows/setToastCapable.js b/StoneIsland/plugins/phonegap-plugin-push/hooks/windows/setToastCapable.js index b8cbcbc0..5b784582 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/hooks/windows/setToastCapable.js +++ b/StoneIsland/plugins/phonegap-plugin-push/hooks/windows/setToastCapable.js @@ -1,7 +1,13 @@ module.exports = function(context) { - console.log('Updating appxmanifests with ToastCapable=true...'); + console.log('Updating appxmanifests with ToastCapable=true ...'); var path = require('path'); + var fs = require('fs'); + var platformProjPath = path.join(context.opts.projectRoot, 'platforms/windows'); + if (!fs.existsSync(platformProjPath)) { + platformProjPath = context.opts.projectRoot; + } + var AppxManifest = require(path.join(platformProjPath, 'cordova/lib/AppxManifest')); ['package.phone.appxmanifest', 'package.windows.appxmanifest'].forEach(function(manifestPath) { diff --git a/StoneIsland/plugins/phonegap-plugin-push/package.json b/StoneIsland/plugins/phonegap-plugin-push/package.json index 91983f9a..14f757b2 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/package.json +++ b/StoneIsland/plugins/phonegap-plugin-push/package.json @@ -1,15 +1,35 @@ { - "name": "phonegap-plugin-push", - "description": "Register and receive push notifications.", - "version": "1.9.2", - "homepage": "http://github.com/phonegap/phonegap-plugin-push#readme", - "repository": { - "type": "git", - "url": "git://github.com/phonegap/phonegap-plugin-push.git" + "_from": "phonegap-plugin-push@2.0.0", + "_id": "phonegap-plugin-push@2.0.0", + "_inBundle": false, + "_integrity": "sha1-FhKJtP3r0LUqTVoQUg0VYIPuz3M=", + "_location": "/phonegap-plugin-push", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "phonegap-plugin-push@2.0.0", + "name": "phonegap-plugin-push", + "escapedName": "phonegap-plugin-push", + "rawSpec": "2.0.0", + "saveSpec": null, + "fetchSpec": "2.0.0" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/phonegap-plugin-push/-/phonegap-plugin-push-2.0.0.tgz", + "_shasum": "161289b4fdebd0b52a4d5a10520d156083eecf73", + "_spec": "phonegap-plugin-push@2.0.0", + "_where": "/Users/user/Sites/stone-island/StoneIsland/node_modules", + "author": { + "name": "Adobe PhoneGap Team" }, "bugs": { "url": "https://github.com/phonegap/phonegap-plugin-push/issues" }, + "bundleDependencies": false, "cordova": { "id": "phonegap-plugin-push", "platforms": [ @@ -19,16 +39,26 @@ "browser" ] }, - "keywords": [ - "ecosystem:cordova", - "ecosystem:phonegap", - "cordova-ios", - "cordova-android", - "cordova-windows8", - "cordova-windows", - "cordova-wp8", - "cordova-browser" - ], + "dependencies": { + "babel-plugin-add-header-comment": "^1.0.3", + "install": "^0.8.2" + }, + "deprecated": false, + "description": "Register and receive push notifications.", + "devDependencies": { + "babel-cli": "^6.10.1", + "babel-core": "^6.10.4", + "babel-eslint": "^6.1.0", + "babel-preset-es2015": "^6.9.0", + "eslint": "^2.13.1", + "eslint-config-airbnb": "^9.0.1", + "eslint-plugin-import": "^1.9.2", + "eslint-plugin-jsx-a11y": "^1.5.3", + "eslint-plugin-react": "^5.2.2", + "jasmine-node": "1.14.5", + "nodemon": "^1.9.2", + "pluginpub": "^0.0.8" + }, "engines": { "cordovaDependencies": { "1.8.2": { @@ -36,23 +66,41 @@ "cordova-android": ">=4.0.0", "cordova-ios": ">=4.1.0" }, - "1.9.0": { - "cordova-ios": ">=4.3.0", - "cordova-android": ">=6.0.0", - "cordova": ">=6.4.0" - }, "2.0.0": { - "cordova": ">100" + "cordova": ">=7.0.0", + "cordova-android": ">=6.2.1", + "cordova-ios": ">=4.4.0" + }, + "<2.0.0": { + "cordova": ">=6.4.0", + "cordova-android": ">=6.0.0", + "cordova-ios": ">=4.3.0" } } }, - "author": "Adobe PhoneGap Team", - "license": "APL", + "homepage": "http://github.com/phonegap/phonegap-plugin-push#readme", + "keywords": [ + "ecosystem:cordova", + "ecosystem:phonegap", + "cordova-ios", + "cordova-android", + "cordova-windows8", + "cordova-windows", + "cordova-wp8", + "cordova-browser" + ], + "license": "MIT", + "name": "phonegap-plugin-push", + "repository": { + "type": "git", + "url": "git://github.com/phonegap/phonegap-plugin-push.git" + }, "scripts": { - "test": "jasmine-node --color spec" + "build": "babel src/js --out-dir www", + "build:watch": "nodemon -w ./src/js -e js -x npm run build", + "jasmine": "jasmine-node --color spec", + "test": "npm run build && npm run jasmine" }, - "devDependencies": { - "jasmine-node": "1.14.5", - "pluginpub": "^0.0.5" - } + "types": "./types/index.d.ts", + "version": "2.0.0" } diff --git a/StoneIsland/plugins/phonegap-plugin-push/plugin.xml b/StoneIsland/plugins/phonegap-plugin-push/plugin.xml index bf9c659a..2c507e4d 100755 --- a/StoneIsland/plugins/phonegap-plugin-push/plugin.xml +++ b/StoneIsland/plugins/phonegap-plugin-push/plugin.xml @@ -1,75 +1,60 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads" xmlns:rim="http://www.blackberry.com/ns/widgets" id="phonegap-plugin-push" version="1.9.2"> +<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:amazon="http://schemas.android.com/apk/lib/com.amazon.device.ads" xmlns:rim="http://www.blackberry.com/ns/widgets" id="phonegap-plugin-push" version="2.0.0"> <name>PushPlugin</name> <description> - This plugin allows your application to receive push notifications on Android, iOS and Windows devices. - Android uses Google Cloud Messaging. + This plugin allows your application to receive push notifications on Android, iOS and Windows devices. + Android uses Firebase Cloud Messaging. iOS uses Apple APNS Notifications. Windows uses Microsoft WNS Notifications. - </description> + </description> <license>MIT</license> <js-module src="www/push.js" name="PushNotification"> <clobbers target="PushNotification"/> </js-module> <engines> - <engine name="cordova" version=">=6.4.0"/> - <engine name="cordova-android" version=">=6.0.0"/> - <engine name="cordova-ios" version=">=4.3.0"/> + <engine name="cordova" version=">=7.0.0"/> + <engine name="cordova-android" version=">=6.2.1"/> + <engine name="cordova-ios" version=">=4.4.0"/> </engines> - <preference name="SENDER_ID" default="85075801930"/> <platform name="android"> <config-file target="res/xml/config.xml" parent="/*"> <feature name="PushNotification"> <param name="android-package" value="com.adobe.phonegap.push.PushPlugin"/> </feature> </config-file> - <config-file target="res/values/strings.xml" parent="/resources"> - <string name="google_app_id">$SENDER_ID</string> - </config-file> <config-file target="AndroidManifest.xml" parent="/manifest"> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.VIBRATE"/> - <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/> - <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/> - <uses-permission android:name="${applicationId}.permission.PushHandlerActivity"/> - <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature"/> - <permission android:name="${applicationId}.permission.PushHandlerActivity" android:protectionLevel="signature"/> </config-file> <config-file target="AndroidManifest.xml" parent="/manifest/application"> <activity android:name="com.adobe.phonegap.push.PushHandlerActivity" android:exported="true" android:permission="${applicationId}.permission.PushHandlerActivity"/> <receiver android:name="com.adobe.phonegap.push.BackgroundActionButtonHandler"/> - <receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND"> - <intent-filter> - <action android:name="com.google.android.c2dm.intent.RECEIVE"/> - <category android:name="${applicationId}"/> - </intent-filter> - </receiver> - <service android:name="com.adobe.phonegap.push.GCMIntentService" android:exported="false"> + <receiver android:name="com.adobe.phonegap.push.PushDismissedHandler"/> + <service android:name="com.adobe.phonegap.push.FCMService"> <intent-filter> - <action android:name="com.google.android.c2dm.intent.RECEIVE"/> + <action android:name="com.google.firebase.MESSAGING_EVENT"/> </intent-filter> </service> - <service android:name="com.adobe.phonegap.push.PushInstanceIDListenerService" android:exported="false"> + <service android:name="com.adobe.phonegap.push.PushInstanceIDListenerService"> <intent-filter> - <action android:name="com.google.android.gms.iid.InstanceID"/> + <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/> </intent-filter> </service> - <service android:name="com.adobe.phonegap.push.RegistrationIntentService" android:exported="false"/> </config-file> + <framework src="com.android.support:support-v13:25.1.0"/> + <framework src="me.leolin:ShortcutBadger:1.1.17@aar"/> + <framework src="com.google.firebase:firebase-messaging:11.0.1"/> <framework src="push.gradle" custom="true" type="gradleReference"/> - <framework src="com.android.support:support-v13:23+"/> - <framework src="com.google.android.gms:play-services-gcm:9.8+"/> - <framework src="me.leolin:ShortcutBadger:1.1.11@aar"/> - <source-file src="src/android/com/adobe/phonegap/push/GCMIntentService.java" target-dir="src/com/adobe/phonegap/push/"/> + <source-file src="src/android/com/adobe/phonegap/push/FCMService.java" target-dir="src/com/adobe/phonegap/push/"/> <source-file src="src/android/com/adobe/phonegap/push/PushConstants.java" target-dir="src/com/adobe/phonegap/push/"/> <source-file src="src/android/com/adobe/phonegap/push/PushHandlerActivity.java" target-dir="src/com/adobe/phonegap/push/"/> <source-file src="src/android/com/adobe/phonegap/push/PushInstanceIDListenerService.java" target-dir="src/com/adobe/phonegap/push/"/> <source-file src="src/android/com/adobe/phonegap/push/PushPlugin.java" target-dir="src/com/adobe/phonegap/push/"/> - <source-file src="src/android/com/adobe/phonegap/push/RegistrationIntentService.java" target-dir="src/com/adobe/phonegap/push/"/> <source-file src="src/android/com/adobe/phonegap/push/PermissionUtils.java" target-dir="src/com/adobe/phonegap/push/"/> <source-file src="src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java" target-dir="src/com/adobe/phonegap/push/"/> + <source-file src="src/android/com/adobe/phonegap/push/PushDismissedHandler.java" target-dir="src/com/adobe/phonegap/push/"/> </platform> <platform name="browser"> <js-module src="www/browser/push.js" name="BrowserPush"> @@ -89,12 +74,6 @@ <string>remote-notification</string> </array> </config-file> - <config-file target="*-Info.plist" parent="GCM_SENDER_ID"> - <string>$SENDER_ID</string> - </config-file> - <config-file target="*-Info.plist" parent="IS_GCM_ENABLED"> - <true/> - </config-file> <config-file target="*-Debug.plist" parent="aps-environment"> <string>development</string> </config-file> @@ -105,16 +84,12 @@ <source-file src="src/ios/PushPlugin.m"/> <header-file src="src/ios/AppDelegate+notification.h"/> <header-file src="src/ios/PushPlugin.h"/> - <framework src="AddressBook.framework"/> - <framework src="libsqlite3.tbd"/> - <framework src="libz.tbd"/> - <framework src="GoogleCloudMessaging" type="podspec" spec="~> 1.2.0"/> - <framework src="GGLInstanceID" type="podspec" spec="~> 1.2.1"/> + <framework src="FirebaseMessaging" type="podspec" spec="~> 2.0.0"/> </platform> <platform name="windows"> <hook type="after_plugin_install" src="hooks/windows/setToastCapable.js"/> <js-module src="src/windows/PushPluginProxy.js" name="PushPlugin"> - <merges target=""/> + <runs/> </js-module> <config-file target="config.xml" parent="/*"> <preference name="WindowsToastCapable" value="true"/> diff --git a/StoneIsland/plugins/phonegap-plugin-push/push.gradle b/StoneIsland/plugins/phonegap-plugin-push/push.gradle index 11e735ae..1506191b 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/push.gradle +++ b/StoneIsland/plugins/phonegap-plugin-push/push.gradle @@ -16,6 +16,24 @@ android { } defaultConfig { + multiDexEnabled true applicationId = doExtractStringFromManifest("package") } } + +buildscript { + repositories { + jcenter() + mavenLocal() + } + dependencies { + classpath 'com.android.tools.build:gradle:+' + classpath 'com.google.gms:google-services:3.0.0' + } +} + +// apply plugin: 'com.google.gms.google-services' +// class must be used instead of id(string) to be able to apply plugin from non-root gradle file +ext.postBuildExtras = { + apply plugin: com.google.gms.googleservices.GoogleServicesPlugin +} diff --git a/StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js b/StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js index 8e1c2665..e41accd2 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js +++ b/StoneIsland/plugins/phonegap-plugin-push/spec/index.spec.js @@ -193,7 +193,7 @@ describe('phonegap-plugin-push', function () { push.off('notification', eventHandler); - expect(push._handlers.notification.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.notification.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -208,7 +208,7 @@ describe('phonegap-plugin-push', function () { push.off('registration', eventHandler); - expect(push._handlers.registration.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.registration.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -222,7 +222,7 @@ describe('phonegap-plugin-push', function () { push.on('error', eventHandler); push.off('error', eventHandler); - expect(push._handlers.error.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.error.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -233,19 +233,19 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.registration.length).toEqual(0); + expect(push.handlers.registration.length).toEqual(0); push.on('registration',eventHandler); - expect(push._handlers.registration.length).toEqual(1); - expect(push._handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.registration.length).toEqual(1); + expect(push.handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.registration.length).toEqual(0); - expect(push._handlers.registration.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.registration.length).toEqual(0); + expect(push.handlers.registration.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -255,19 +255,19 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.notification.length).toEqual(0); + expect(push.handlers.notification.length).toEqual(0); push.on('notification', eventHandler); - expect(push._handlers.notification.length).toEqual(1); - expect(push._handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.notification.length).toEqual(1); + expect(push.handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.notification.length).toEqual(0); - expect(push._handlers.notification.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.notification.length).toEqual(0); + expect(push.handlers.notification.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -277,19 +277,19 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.error.length).toEqual(0); + expect(push.handlers.error.length).toEqual(0); push.on('error', eventHandler); - expect(push._handlers.error.length).toEqual(1); - expect(push._handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.error.length).toEqual(1); + expect(push.handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.error.length).toEqual(0); - expect(push._handlers.error.indexOf(eventHandler)).toEqual(-1); + expect(push.handlers.error.length).toEqual(0); + expect(push.handlers.error.indexOf(eventHandler)).toEqual(-1); done(); }); }); @@ -301,21 +301,21 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.registration.length).toEqual(0); + expect(push.handlers.registration.length).toEqual(0); push.on('registration',eventHandler); - expect(push._handlers.registration.length).toEqual(1); - expect(push._handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.registration.length).toEqual(1); + expect(push.handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.registration.length).toEqual(1); - expect(push._handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.registration.length).toEqual(1); + expect(push.handlers.registration.indexOf(eventHandler)).toBeGreaterThan(-1); done(); - }, null, ['foo', 'bar']); + }, function() {}, ['foo', 'bar']); }); it('should not clear "notification" event handlers', function (done) { @@ -323,21 +323,21 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.notification.length).toEqual(0); + expect(push.handlers.notification.length).toEqual(0); push.on('notification', eventHandler); - expect(push._handlers.notification.length).toEqual(1); - expect(push._handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.notification.length).toEqual(1); + expect(push.handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.notification.length).toEqual(1); - expect(push._handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.notification.length).toEqual(1); + expect(push.handlers.notification.indexOf(eventHandler)).toBeGreaterThan(-1); done(); - }, null, ['foo', 'bar']); + }, function() {}, ['foo', 'bar']); }); it('should not clear "error" event handlers', function (done) { @@ -345,21 +345,21 @@ describe('phonegap-plugin-push', function () { eventHandler = function () { }; - expect(push._handlers.error.length).toEqual(0); + expect(push.handlers.error.length).toEqual(0); push.on('error', eventHandler); - expect(push._handlers.error.length).toEqual(1); - expect(push._handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.error.length).toEqual(1); + expect(push.handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); execSpy.andCallFake(function (win, fail, service, id, args) { win(); }); push.unregister(function() { - expect(push._handlers.error.length).toEqual(1); - expect(push._handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); + expect(push.handlers.error.length).toEqual(1); + expect(push.handlers.error.indexOf(eventHandler)).toBeGreaterThan(-1); done(); - }, null, ['foo', 'bar']); + }, function() {}, ['foo', 'bar']); }); }); diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java index 3ccea6cb..4456f525 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java +++ b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/BackgroundActionButtonHandler.java @@ -9,7 +9,7 @@ import android.util.Log; import android.support.v4.app.RemoteInput; public class BackgroundActionButtonHandler extends BroadcastReceiver implements PushConstants { - private static String LOG_TAG = "PushPlugin_BackgroundActionButtonHandler"; + private static String LOG_TAG = "Push_BGActionButton"; @Override public void onReceive(Context context, Intent intent) { @@ -19,7 +19,7 @@ public class BackgroundActionButtonHandler extends BroadcastReceiver implements int notId = intent.getIntExtra(NOT_ID, 0); Log.d(LOG_TAG, "not id = " + notId); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.cancel(GCMIntentService.getAppName(context), notId); + notificationManager.cancel(FCMService.getAppName(context), notId); if (extras != null) { Bundle originalExtras = extras.getBundle(PUSH_BUNDLE); diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/GCMIntentService.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/FCMService.java index e1a2b75c..af328fb2 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/GCMIntentService.java +++ b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/FCMService.java @@ -13,17 +13,23 @@ import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; +import android.graphics.RectF; +import android.graphics.Paint; +import android.graphics.Canvas; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.NotificationCompat; -import android.support.v4.app.NotificationManagerCompat; import android.support.v4.app.NotificationCompat.WearableExtender; import android.support.v4.app.RemoteInput; import android.text.Html; import android.text.Spanned; import android.util.Log; -import com.google.android.gms.gcm.GcmListenerService; +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; import org.json.JSONArray; import org.json.JSONException; @@ -36,12 +42,13 @@ import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; +import java.util.Map; import java.util.Random; @SuppressLint("NewApi") -public class GCMIntentService extends GcmListenerService implements PushConstants { +public class FCMService extends FirebaseMessagingService implements PushConstants { - private static final String LOG_TAG = "PushPlugin_GCMIntentService"; + private static final String LOG_TAG = "Push_FCMService"; private static HashMap<Integer, ArrayList<String>> messageMap = new HashMap<Integer, ArrayList<String>>(); public void setNotification(int notId, String message){ @@ -59,17 +66,31 @@ public class GCMIntentService extends GcmListenerService implements PushConstant } @Override - public void onMessageReceived(String from, Bundle extras) { + public void onMessageReceived(RemoteMessage message){ + + String from = message.getFrom(); Log.d(LOG_TAG, "onMessage - from: " + from); - if (extras != null) { + Bundle extras = new Bundle(); + + if (message.getNotification()!=null) { + extras.putString(TITLE,message.getNotification().getTitle()); + extras.putString(MESSAGE,message.getNotification().getBody()); + } + for (Map.Entry<String, String> entry : message.getData().entrySet()) { + extras.putString(entry.getKey(), entry.getValue()); + } + + if (extras != null && isAvailableSender(from)) { Context applicationContext = getApplicationContext(); SharedPreferences prefs = applicationContext.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); boolean forceShow = prefs.getBoolean(FORCE_SHOW, false); boolean clearBadge = prefs.getBoolean(CLEAR_BADGE, false); + String messageKey = prefs.getString(MESSAGE_KEY, MESSAGE); + String titleKey = prefs.getString(TITLE_KEY, TITLE); - extras = normalizeExtras(applicationContext, extras); + extras = normalizeExtras(applicationContext, extras, messageKey, titleKey); if (clearBadge) { PushPlugin.setApplicationIconBadgeNumber(getApplicationContext(), 0); @@ -167,10 +188,10 @@ public class GCMIntentService extends GcmListenerService implements PushConstant /* * Replace alternate keys with our canonical value */ - private String normalizeKey(String key) { - if (key.equals(BODY) || key.equals(ALERT) || key.equals(GCM_NOTIFICATION_BODY) || key.equals(TWILIO_BODY)) { + private String normalizeKey(String key, String messageKey, String titleKey) { + if (key.equals(BODY) || key.equals(ALERT) || key.equals(MP_MESSAGE) || key.equals(GCM_NOTIFICATION_BODY) || key.equals(TWILIO_BODY) || key.equals(messageKey)) { return MESSAGE; - } else if (key.equals(TWILIO_TITLE)) { + } else if (key.equals(TWILIO_TITLE) || key.equals(SUBJECT) || key.equals(titleKey)) { return TITLE; }else if (key.equals(MSGCNT) || key.equals(BADGE)) { return COUNT; @@ -191,7 +212,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant /* * Parse bundle into normalized keys. */ - private Bundle normalizeExtras(Context context, Bundle extras) { + private Bundle normalizeExtras(Context context, Bundle extras, String messageKey, String titleKey) { Log.d(LOG_TAG, "normalize extras"); Iterator<String> it = extras.keySet().iterator(); Bundle newExtras = new Bundle(); @@ -203,7 +224,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant // If normalizeKeythe key is "data" or "message" and the value is a json object extract // This is to support parse.com and other services. Issue #147 and pull #218 - if (key.equals(PARSE_COM_DATA) || key.equals(MESSAGE)) { + if (key.equals(PARSE_COM_DATA) || key.equals(MESSAGE) || key.equals(messageKey)) { Object json = extras.get(key); // Make sure data is json object stringified if ( json instanceof String && ((String) json).startsWith("{") ) { @@ -211,7 +232,8 @@ public class GCMIntentService extends GcmListenerService implements PushConstant try { // If object contains message keys promote each value to the root of the bundle JSONObject data = new JSONObject((String) json); - if ( data.has(ALERT) || data.has(MESSAGE) || data.has(BODY) || data.has(TITLE) ) { + if ( data.has(ALERT) || data.has(MESSAGE) || data.has(BODY) || data.has(TITLE) || + data.has(messageKey) || data.has(titleKey) ) { Iterator<String> jsonIter = data.keys(); while (jsonIter.hasNext()) { String jsonKey = jsonIter.next(); @@ -219,7 +241,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant Log.d(LOG_TAG, "key = data/" + jsonKey); String value = data.getString(jsonKey); - jsonKey = normalizeKey(jsonKey); + jsonKey = normalizeKey(jsonKey, messageKey, titleKey); value = localizeKey(context, jsonKey, value); newExtras.putString(jsonKey, value); @@ -228,6 +250,10 @@ public class GCMIntentService extends GcmListenerService implements PushConstant } catch( JSONException e) { Log.e(LOG_TAG, "normalizeExtras: JSON exception"); } + } else { + String newKey = normalizeKey(key, messageKey, titleKey); + Log.d(LOG_TAG, "replace key " + key + " with " + newKey); + replaceKey(context, key, newKey, extras, newExtras); } } else if (key.equals(("notification"))) { Bundle value = extras.getBundle(key); @@ -236,7 +262,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant String notifkey = iterator.next(); Log.d(LOG_TAG, "notifkey = " + notifkey); - String newKey = normalizeKey(notifkey); + String newKey = normalizeKey(notifkey, messageKey, titleKey); Log.d(LOG_TAG, "replace key " + notifkey + " with " + newKey); String valueData = value.getString(notifkey); @@ -245,12 +271,17 @@ public class GCMIntentService extends GcmListenerService implements PushConstant newExtras.putString(newKey, valueData); } continue; + // In case we weren't working on the payload data node or the notification node, + // normalize the key. + // This allows to have "message" as the payload data key without colliding + // with the other "message" key (holding the body of the payload) + // See issue #1663 + } else { + String newKey = normalizeKey(key, messageKey, titleKey); + Log.d(LOG_TAG, "replace key " + key + " with " + newKey); + replaceKey(context, key, newKey, extras, newExtras); } - String newKey = normalizeKey(key); - Log.d(LOG_TAG, "replace key " + key + " with " + newKey); - replaceKey(context, key, newKey, extras, newExtras); - } // while return newExtras; @@ -301,15 +332,15 @@ public class GCMIntentService extends GcmListenerService implements PushConstant createNotification(context, extras); } - if(!PushPlugin.isActive() && "1".equals(forceStart)){ + if(!PushPlugin.isActive() && "1".equals(forceStart)){ Log.d(LOG_TAG, "app is not running but we should start it and put in background"); - Intent intent = new Intent(this, PushHandlerActivity.class); + Intent intent = new Intent(this, PushHandlerActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.putExtra(PUSH_BUNDLE, extras); - intent.putExtra(START_IN_BACKGROUND, true); + intent.putExtra(START_IN_BACKGROUND, true); intent.putExtra(FOREGROUND, false); startActivity(intent); - } else if ("1".equals(contentAvailable)) { + } else if ("1".equals(contentAvailable)) { Log.d(LOG_TAG, "app is not running and content available true"); Log.d(LOG_TAG, "send notification event"); PushPlugin.sendExtras(extras); @@ -331,12 +362,22 @@ public class GCMIntentService extends GcmListenerService implements PushConstant int requestCode = new Random().nextInt(); PendingIntent contentIntent = PendingIntent.getActivity(this, requestCode, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT); + Intent dismissedNotificationIntent = new Intent(this, PushDismissedHandler.class); + dismissedNotificationIntent.putExtra(PUSH_BUNDLE, extras); + dismissedNotificationIntent.putExtra(NOT_ID, notId); + dismissedNotificationIntent.putExtra(DISMISSED, true); + dismissedNotificationIntent.setAction(PUSH_DISMISSED); + + requestCode = new Random().nextInt(); + PendingIntent deleteIntent = PendingIntent.getBroadcast(this, requestCode, dismissedNotificationIntent, PendingIntent.FLAG_CANCEL_CURRENT); + NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setWhen(System.currentTimeMillis()) .setContentTitle(fromHtml(extras.getString(TITLE))) .setTicker(fromHtml(extras.getString(TITLE))) .setContentIntent(contentIntent) + .setDeleteIntent(deleteIntent) .setAutoCancel(true); SharedPreferences prefs = context.getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); @@ -690,11 +731,46 @@ public class GCMIntentService extends GcmListenerService implements PushConstant } } + private Bitmap getCircleBitmap(Bitmap bitmap) { + if (bitmap == null) { + return null; + } + + final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); + final Canvas canvas = new Canvas(output); + final int color = Color.RED; + final Paint paint = new Paint(); + final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); + final RectF rectF = new RectF(rect); + + paint.setAntiAlias(true); + canvas.drawARGB(0, 0, 0, 0); + paint.setColor(color); + float cx = bitmap.getWidth()/2; + float cy = bitmap.getHeight()/2; + float radius = cx < cy ? cx : cy; + canvas.drawCircle(cx,cy,radius,paint); + + paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); + canvas.drawBitmap(bitmap, rect, rect, paint); + + bitmap.recycle(); + + return output; + } + private void setNotificationLargeIcon(Bundle extras, String packageName, Resources resources, NotificationCompat.Builder mBuilder) { String gcmLargeIcon = extras.getString(IMAGE); // from gcm + String imageType = extras.getString(IMAGE_TYPE, IMAGE_TYPE_SQUARE); if (gcmLargeIcon != null && !"".equals(gcmLargeIcon)) { if (gcmLargeIcon.startsWith("http://") || gcmLargeIcon.startsWith("https://")) { - mBuilder.setLargeIcon(getBitmapFromURL(gcmLargeIcon)); + Bitmap bitmap = getBitmapFromURL(gcmLargeIcon); + if (IMAGE_TYPE_SQUARE.equalsIgnoreCase(imageType)) { + mBuilder.setLargeIcon(bitmap); + } else { + Bitmap bm = getCircleBitmap(bitmap); + mBuilder.setLargeIcon(bm); + } Log.d(LOG_TAG, "using remote large-icon from gcm"); } else { AssetManager assetManager = getAssets(); @@ -702,7 +778,12 @@ public class GCMIntentService extends GcmListenerService implements PushConstant try { istr = assetManager.open(gcmLargeIcon); Bitmap bitmap = BitmapFactory.decodeStream(istr); - mBuilder.setLargeIcon(bitmap); + if (IMAGE_TYPE_SQUARE.equalsIgnoreCase(imageType)) { + mBuilder.setLargeIcon(bitmap); + } else { + Bitmap bm = getCircleBitmap(bitmap); + mBuilder.setLargeIcon(bm); + } Log.d(LOG_TAG, "using assets large-icon from gcm"); } catch (IOException e) { int largeIconId = 0; @@ -762,6 +843,7 @@ public class GCMIntentService extends GcmListenerService implements PushConstant try { URL url = new URL(strURL); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(15000); connection.setDoInput(true); connection.connect(); InputStream input = connection.getInputStream(); @@ -799,4 +881,11 @@ public class GCMIntentService extends GcmListenerService implements PushConstant else return null; } + + private boolean isAvailableSender(String from) { + SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(PushPlugin.COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); + String savedSenderID = sharedPref.getString(SENDER_ID, ""); + + return from.equals(savedSenderID) || from.startsWith("/topics/"); + } } diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PermissionUtils.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PermissionUtils.java index 6aa5c9bf..41bc6a6f 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PermissionUtils.java +++ b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PermissionUtils.java @@ -10,8 +10,12 @@ import java.lang.reflect.Method; public class PermissionUtils { private static final String CHECK_OP_NO_THROW = "checkOpNoThrow"; + private static final int MIN_API_LEVEL = 19; // required by AppOpsManager public static boolean hasPermission(Context appContext, String appOpsServiceId) throws UnknownError { + if (android.os.Build.VERSION.SDK_INT < MIN_API_LEVEL) { + return true; + } ApplicationInfo appInfo = appContext.getApplicationInfo(); diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushConstants.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushConstants.java index 37874e04..e3aa217c 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushConstants.java +++ b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushConstants.java @@ -3,6 +3,7 @@ package com.adobe.phonegap.push; public interface PushConstants { public static final String COM_ADOBE_PHONEGAP_PUSH = "com.adobe.phonegap.push"; public static final String REGISTRATION_ID = "registrationId"; + public static final String REGISTRATION_TYPE = "registrationType"; public static final String FOREGROUND = "foreground"; public static final String TITLE = "title"; public static final String NOT_ID = "notId"; @@ -55,10 +56,11 @@ public interface PushConstants { public static final String FROM = "from"; public static final String COLLAPSE_KEY = "collapse_key"; public static final String FORCE_SHOW = "forceShow"; - public static final String GCM = "GCM"; + public static final String FCM = "FCM"; public static final String CONTENT_AVAILABLE = "content-available"; public static final String TOPICS = "topics"; public static final String SET_APPLICATION_ICON_BADGE_NUMBER = "setApplicationIconBadgeNumber"; + public static final String GET_APPLICATION_ICON_BADGE_NUMBER = "getApplicationIconBadgeNumber"; public static final String CLEAR_ALL_NOTIFICATIONS = "clearAllNotifications"; public static final String VISIBILITY = "visibility"; public static final String INLINE_REPLY = "inlineReply"; @@ -67,6 +69,18 @@ public interface PushConstants { public static final String TWILIO_BODY = "twi_body"; public static final String TWILIO_TITLE = "twi_title"; public static final String TWILIO_SOUND = "twi_sound"; + public static final String MP_MESSAGE = "mp_message"; public static final String START_IN_BACKGROUND = "cdvStartInBackground"; public static final String FORCE_START = "force-start"; + public static final String MESSAGE_KEY = "messageKey"; + public static final String TITLE_KEY = "titleKey"; + public static final String NO_CACHE = "no-cache"; + public static final String DISMISSED = "dismissed"; + public static final String IMAGE_TYPE = "image-type"; + public static final String IMAGE_TYPE_SQUARE = "square"; + public static final String IMAGE_TYPE_CIRCLE = "circle"; + public static final String SUBJECT = "subject"; + public static final String GOOGLE_APP_ID = "google_app_id"; + public static final String GCM_DEFAULT_SENDER_ID = "gcm_defaultSenderId"; + public static final String PUSH_DISMISSED = "push_dismissed"; } diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushDismissedHandler.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushDismissedHandler.java new file mode 100644 index 00000000..a517bc1e --- /dev/null +++ b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushDismissedHandler.java @@ -0,0 +1,25 @@ +package com.adobe.phonegap.push; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; + +public class PushDismissedHandler extends BroadcastReceiver implements PushConstants { + private static String LOG_TAG = "Push_DismissedHandler"; + + @Override + public void onReceive(Context context, Intent intent) { + Bundle extras = intent.getExtras(); + FCMService fcm = new FCMService(); + String action = intent.getAction(); + int notID = intent.getIntExtra(NOT_ID, 0); + + if (action.equals(PUSH_DISMISSED)) { + Log.d(LOG_TAG, "PushDismissedHandler = " + extras); + Log.d(LOG_TAG, "not id = " + notID); + + fcm.setNotification(notID, ""); + } + } +} diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java index 23682ac8..0d399a61 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java +++ b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushHandlerActivity.java @@ -11,7 +11,7 @@ import android.support.v4.app.RemoteInput; public class PushHandlerActivity extends Activity implements PushConstants { - private static String LOG_TAG = "PushPlugin_PushHandlerActivity"; + private static String LOG_TAG = "Push_HandlerActivity"; /* * this activity will be started if the user touches a notification that we own. @@ -21,7 +21,7 @@ public class PushHandlerActivity extends Activity implements PushConstants { */ @Override public void onCreate(Bundle savedInstanceState) { - GCMIntentService gcm = new GCMIntentService(); + FCMService gcm = new FCMService(); Intent intent = getIntent(); @@ -34,16 +34,18 @@ public class PushHandlerActivity extends Activity implements PushConstants { Log.d(LOG_TAG, "callback = " + callback); boolean foreground = getIntent().getExtras().getBoolean("foreground", true); boolean startOnBackground = getIntent().getExtras().getBoolean(START_IN_BACKGROUND, false); + boolean dismissed = getIntent().getExtras().getBoolean(DISMISSED, false); + Log.d(LOG_TAG, "dismissed = " + dismissed); if(!startOnBackground){ NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); - notificationManager.cancel(GCMIntentService.getAppName(this), notId); + notificationManager.cancel(FCMService.getAppName(this), notId); } boolean isPushPluginActive = PushPlugin.isActive(); boolean inline = processPushBundle(isPushPluginActive, intent); - if(inline && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N){ + if(inline && android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.N && !startOnBackground){ foreground = true; } @@ -51,15 +53,17 @@ public class PushHandlerActivity extends Activity implements PushConstants { finish(); - Log.d(LOG_TAG, "isPushPluginActive = " + isPushPluginActive); - if (!isPushPluginActive && foreground && inline) { - Log.d(LOG_TAG, "forceMainActivityReload"); - forceMainActivityReload(false); - } else if(startOnBackground) { - Log.d(LOG_TAG, "startOnBackgroundTrue"); - forceMainActivityReload(true); - } else { - Log.d(LOG_TAG, "don't want main activity"); + if(!dismissed) { + Log.d(LOG_TAG, "isPushPluginActive = " + isPushPluginActive); + if (!isPushPluginActive && foreground && inline) { + Log.d(LOG_TAG, "forceMainActivityReload"); + forceMainActivityReload(false); + } else if(startOnBackground) { + Log.d(LOG_TAG, "startOnBackgroundTrue"); + forceMainActivityReload(true); + } else { + Log.d(LOG_TAG, "don't want main activity"); + } } } @@ -76,7 +80,9 @@ public class PushHandlerActivity extends Activity implements PushConstants { originalExtras.putBoolean(FOREGROUND, false); originalExtras.putBoolean(COLDSTART, !isPushPluginActive); + originalExtras.putBoolean(DISMISSED, extras.getBoolean(DISMISSED)); originalExtras.putString(ACTION_CALLBACK, extras.getString(CALLBACK)); + originalExtras.remove(NO_CACHE); remoteInput = RemoteInput.getResultsFromIntent(intent); if (remoteInput != null) { diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushInstanceIDListenerService.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushInstanceIDListenerService.java index eaa39a48..176b7419 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushInstanceIDListenerService.java +++ b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushInstanceIDListenerService.java @@ -5,23 +5,22 @@ import android.content.Context; import android.content.SharedPreferences; import android.util.Log; -import com.google.android.gms.iid.InstanceID; -import com.google.android.gms.iid.InstanceIDListenerService; +import com.google.firebase.iid.FirebaseInstanceId; +import com.google.firebase.iid.FirebaseInstanceIdService; import org.json.JSONException; import java.io.IOException; -public class PushInstanceIDListenerService extends InstanceIDListenerService implements PushConstants { - public static final String LOG_TAG = "PushPlugin_PushInstanceIDListenerService"; +public class PushInstanceIDListenerService extends FirebaseInstanceIdService implements PushConstants { + public static final String LOG_TAG = "Push_InsIdService"; @Override public void onTokenRefresh() { - SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); - String senderID = sharedPref.getString(SENDER_ID, ""); - if (!"".equals(senderID)) { - Intent intent = new Intent(this, RegistrationIntentService.class); - startService(intent); - } + // Get updated InstanceID token. + String refreshedToken = FirebaseInstanceId.getInstance().getToken(); + Log.d(LOG_TAG, "Refreshed token: " + refreshedToken); + // TODO: Implement this method to send any registration to your app's servers. + //sendRegistrationToServer(refreshedToken); } } diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushPlugin.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushPlugin.java index f6faaa2b..32f72bf3 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushPlugin.java +++ b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/PushPlugin.java @@ -1,13 +1,14 @@ package com.adobe.phonegap.push; +import android.app.Activity; import android.app.NotificationManager; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.util.Log; -import com.google.android.gms.gcm.GcmPubSub; -import com.google.android.gms.iid.InstanceID; +import com.google.firebase.iid.FirebaseInstanceId; +import com.google.firebase.messaging.FirebaseMessaging; import org.apache.cordova.CallbackContext; import org.apache.cordova.CordovaInterface; @@ -29,7 +30,7 @@ import me.leolin.shortcutbadger.ShortcutBadger; public class PushPlugin extends CordovaPlugin implements PushConstants { - public static final String LOG_TAG = "PushPlugin"; + public static final String LOG_TAG = "Push_Plugin"; private static CallbackContext pushContext; private static CordovaWebView gWebView; @@ -59,6 +60,7 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { Log.v(LOG_TAG, "execute: data=" + data.toString()); SharedPreferences sharedPref = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); + String token = null; String senderID = null; try { @@ -66,15 +68,19 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { Log.v(LOG_TAG, "execute: jo=" + jo.toString()); - senderID = jo.getString(SENDER_ID); + senderID = getStringResourceByName(GCM_DEFAULT_SENDER_ID); Log.v(LOG_TAG, "execute: senderID=" + senderID); - String savedSenderID = sharedPref.getString(SENDER_ID, ""); - registration_id = InstanceID.getInstance(getApplicationContext()).getToken(senderID, GCM); + token = FirebaseInstanceId.getInstance().getToken(); - if (!"".equals(registration_id)) { - JSONObject json = new JSONObject().put(REGISTRATION_ID, registration_id); + if (token == null) { + token = FirebaseInstanceId.getInstance().getToken(senderID,FCM); + } + + if (!"".equals(token)) { + JSONObject json = new JSONObject().put(REGISTRATION_ID, token); + json.put(REGISTRATION_TYPE, FCM); Log.v(LOG_TAG, "onRegistered: " + json.toString()); @@ -83,14 +89,14 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { PushPlugin.sendEvent( json ); } else { - callbackContext.error("Empty registration ID received from GCM"); + callbackContext.error("Empty registration ID received from FCM"); return; } } catch (JSONException e) { Log.e(LOG_TAG, "execute: Got JSON Exception " + e.getMessage()); callbackContext.error(e.getMessage()); } catch (IOException e) { - Log.e(LOG_TAG, "execute: Got JSON Exception " + e.getMessage()); + Log.e(LOG_TAG, "execute: Got IO Exception " + e.getMessage()); callbackContext.error(e.getMessage()); } @@ -118,6 +124,8 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { editor.putBoolean(CLEAR_NOTIFICATIONS, jo.optBoolean(CLEAR_NOTIFICATIONS, true)); editor.putBoolean(FORCE_SHOW, jo.optBoolean(FORCE_SHOW, false)); editor.putString(SENDER_ID, senderID); + editor.putString(MESSAGE_KEY, jo.optString(MESSAGE_KEY)); + editor.putString(TITLE_KEY, jo.optString(TITLE_KEY)); editor.commit(); } @@ -143,7 +151,7 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { if (topics != null && !"".equals(registration_id)) { unsubscribeFromTopics(topics, registration_id); } else { - InstanceID.getInstance(getApplicationContext()).deleteInstanceID(); + FirebaseInstanceId.getInstance().deleteInstanceId(); Log.v(LOG_TAG, "UNREGISTER"); // Remove shared prefs @@ -194,6 +202,13 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { callbackContext.success(); } }); + } else if (GET_APPLICATION_ICON_BADGE_NUMBER.equals(action)) { + cordova.getThreadPool().execute(new Runnable() { + public void run() { + Log.v(LOG_TAG, "getApplicationIconBadgeNumber"); + callbackContext.success(getApplicationIconBadgeNumber(getApplicationContext())); + } + }); } else if (CLEAR_ALL_NOTIFICATIONS.equals(action)) { cordova.getThreadPool().execute(new Runnable() { public void run() { @@ -212,8 +227,6 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { callbackContext.success(); } catch (JSONException e) { callbackContext.error(e.getMessage()); - } catch (IOException e) { - callbackContext.error(e.getMessage()); } } }); @@ -227,8 +240,6 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { callbackContext.success(); } catch (JSONException e) { callbackContext.error(e.getMessage()); - } catch (IOException e) { - callbackContext.error(e.getMessage()); } } }); @@ -259,25 +270,41 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { /* * Sends the pushbundle extras to the client application. - * If the client application isn't currently active, it is cached for later processing. + * If the client application isn't currently active and the no-cache flag is not set, it is cached for later processing. */ public static void sendExtras(Bundle extras) { if (extras != null) { + String noCache = extras.getString(NO_CACHE); if (gWebView != null) { sendEvent(convertBundleToJson(extras)); - } else { + } else if(!"1".equals(noCache)){ Log.v(LOG_TAG, "sendExtras: caching extras to send at a later time."); gCachedExtras.add(extras); } } } + /* + * Retrives badge count from SharedPreferences + */ + public static int getApplicationIconBadgeNumber(Context context){ + SharedPreferences settings = context.getSharedPreferences(BADGE, Context.MODE_PRIVATE); + return settings.getInt(BADGE, 0); + } + + /* + * Sets badge count on application icon and in SharedPreferences + */ public static void setApplicationIconBadgeNumber(Context context, int badgeCount) { if (badgeCount > 0) { ShortcutBadger.applyCount(context, badgeCount); - } else { + }else{ ShortcutBadger.removeCount(context); } + + SharedPreferences.Editor editor = context.getSharedPreferences(BADGE, Context.MODE_PRIVATE).edit(); + editor.putInt(BADGE, Math.max(badgeCount, 0)); + editor.apply(); } @Override @@ -315,23 +342,7 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { notificationManager.cancelAll(); } - /** - * Transform `topic name` to `topic path` - * Normally, the `topic` inputed from end-user is `topic name` only. - * We should convert them to GCM `topic path` - * Example: - * when topic name = 'my-topic' - * then topic path = '/topics/my-topic' - * - * @param String topic The topic name - * @return The topic path - */ - private String getTopicPath(String topic) - { - return "/topics/" + topic; - } - - private void subscribeToTopics(JSONArray topics, String registrationToken) throws IOException { + private void subscribeToTopics(JSONArray topics, String registrationToken) { if (topics != null) { String topic = null; for (int i=0; i<topics.length(); i++) { @@ -341,16 +352,10 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { } } - private void subscribeToTopic(String topic, String registrationToken) throws IOException - { - try { - if (topic != null) { - Log.d(LOG_TAG, "Subscribing to topic: " + topic); - GcmPubSub.getInstance(getApplicationContext()).subscribe(registrationToken, getTopicPath(topic), null); - } - } catch (IOException e) { - Log.e(LOG_TAG, "Failed to subscribe to topic: " + topic, e); - throw e; + private void subscribeToTopic(String topic, String registrationToken) { + if (topic != null) { + Log.d(LOG_TAG, "Subscribing to topic: " + topic); + FirebaseMessaging.getInstance().subscribeToTopic(topic); } } @@ -358,29 +363,20 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { if (topics != null) { String topic = null; for (int i=0; i<topics.length(); i++) { - try { - topic = topics.optString(i, null); - if (topic != null) { - Log.d(LOG_TAG, "Unsubscribing to topic: " + topic); - GcmPubSub.getInstance(getApplicationContext()).unsubscribe(registrationToken, getTopicPath(topic)); - } - } catch (IOException e) { - Log.e(LOG_TAG, "Failed to unsubscribe to topic: " + topic, e); + topic = topics.optString(i, null); + unsubscribeFromTopic(topic, registrationToken); + if (topic != null) { + Log.d(LOG_TAG, "Unsubscribing to topic: " + topic); + FirebaseMessaging.getInstance().unsubscribeFromTopic(topic); } } } } - private void unsubscribeFromTopic(String topic, String registrationToken) throws IOException - { - try { - if (topic != null) { - Log.d(LOG_TAG, "Unsubscribing to topic: " + topic); - GcmPubSub.getInstance(getApplicationContext()).unsubscribe(registrationToken, getTopicPath(topic)); - } - } catch (IOException e) { - Log.e(LOG_TAG, "Failed to unsubscribe to topic: " + topic, e); - throw e; + private void unsubscribeFromTopic(String topic, String registrationToken) { + if (topic != null) { + Log.d(LOG_TAG, "Unsubscribing to topic: " + topic); + FirebaseMessaging.getInstance().unsubscribeFromTopic(topic); } } @@ -413,6 +409,9 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { else if (key.equals(FOREGROUND)) { additionalData.put(key, extras.getBoolean(FOREGROUND)); } + else if (key.equals(DISMISSED)) { + additionalData.put(key, extras.getBoolean(DISMISSED)); + } else if ( value instanceof String ) { String strValue = (String)value; try { @@ -444,6 +443,13 @@ public class PushPlugin extends CordovaPlugin implements PushConstants { return null; } + private String getStringResourceByName(String aString) { + Activity activity = cordova.getActivity(); + String packageName = activity.getPackageName(); + int resId = activity.getResources().getIdentifier(aString, "string", packageName); + return activity.getString(resId); + } + public static boolean isInForeground() { return gForeground; } diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/RegistrationIntentService.java b/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/RegistrationIntentService.java deleted file mode 100644 index b181e88e..00000000 --- a/StoneIsland/plugins/phonegap-plugin-push/src/android/com/adobe/phonegap/push/RegistrationIntentService.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.adobe.phonegap.push; - -import android.content.Context; - -import android.app.IntentService; -import android.content.Intent; -import android.content.SharedPreferences; -import android.util.Log; - -import com.google.android.gms.gcm.GoogleCloudMessaging; -import com.google.android.gms.iid.InstanceID; - -import java.io.IOException; - -public class RegistrationIntentService extends IntentService implements PushConstants { - public static final String LOG_TAG = "PushPlugin_RegistrationIntentService"; - - public RegistrationIntentService() { - super(LOG_TAG); - } - - @Override - protected void onHandleIntent(Intent intent) { - SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(COM_ADOBE_PHONEGAP_PUSH, Context.MODE_PRIVATE); - - try { - InstanceID instanceID = InstanceID.getInstance(this); - String senderID = sharedPreferences.getString(SENDER_ID, ""); - String token = instanceID.getToken(senderID, - GoogleCloudMessaging.INSTANCE_ID_SCOPE, null); - PushPlugin.setRegistrationID(token); - Log.i(LOG_TAG, "new GCM Registration Token: " + token); - - } catch (Exception e) { - Log.d(LOG_TAG, "Failed to complete token refresh", e); - } - } -} diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/browser/manifest.json b/StoneIsland/plugins/phonegap-plugin-push/src/browser/manifest.json index ce8390ab..eff52c74 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/browser/manifest.json +++ b/StoneIsland/plugins/phonegap-plugin-push/src/browser/manifest.json @@ -1,4 +1,4 @@ { "name": "Push Demo", - "gcm_sender_id": "85075801930" + "gcm_sender_id": "996231231186" } diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/ios/PushPlugin.h b/StoneIsland/plugins/phonegap-plugin-push/src/ios/PushPlugin.h index 276a0080..4cc1dcb0 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/ios/PushPlugin.h +++ b/StoneIsland/plugins/phonegap-plugin-push/src/ios/PushPlugin.h @@ -29,7 +29,7 @@ @protocol GGLInstanceIDDelegate; @protocol GCMReceiverDelegate; -@interface PushPlugin : CDVPlugin<GGLInstanceIDDelegate, GCMReceiverDelegate> +@interface PushPlugin : CDVPlugin { NSDictionary *notificationMessage; BOOL isInline; @@ -68,13 +68,12 @@ - (void)didSendDataMessageWithID:(NSString *)messageID; - (void)didDeleteMessagesOnServer; -// GCM Features -@property(nonatomic, assign) BOOL usesGCM; -@property(nonatomic, strong) NSNumber* gcmSandbox; -@property(nonatomic, strong) NSString *gcmSenderId; -@property(nonatomic, strong) NSDictionary *gcmRegistrationOptions; -@property(nonatomic, strong) void (^gcmRegistrationHandler) (NSString *registrationToken, NSError *error); -@property(nonatomic, strong) NSString *gcmRegistrationToken; -@property(nonatomic, strong) NSArray *gcmTopics; +// FCM Features +@property(nonatomic, assign) BOOL usesFCM; +@property(nonatomic, strong) NSNumber *fcmSandbox; +@property(nonatomic, strong) NSString *fcmSenderId; +@property(nonatomic, strong) NSDictionary *fcmRegistrationOptions; +@property(nonatomic, strong) NSString *fcmRegistrationToken; +@property(nonatomic, strong) NSArray *fcmTopics; @end diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/ios/PushPlugin.m b/StoneIsland/plugins/phonegap-plugin-push/src/ios/PushPlugin.m index a176b9af..90475d10 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/ios/PushPlugin.m +++ b/StoneIsland/plugins/phonegap-plugin-push/src/ios/PushPlugin.m @@ -27,8 +27,9 @@ #define GMP_NO_MODULES true #import "PushPlugin.h" -#import "GoogleCloudMessaging.h" -#import "GGLInstanceIDHeaders.h" +@import FirebaseInstanceID; +@import FirebaseMessaging; +@import FirebaseAnalytics; @implementation PushPlugin : CDVPlugin @@ -42,78 +43,62 @@ @synthesize clearBadge; @synthesize handlerObj; -@synthesize usesGCM; -@synthesize gcmSandbox; -@synthesize gcmSenderId; -@synthesize gcmRegistrationOptions; -@synthesize gcmRegistrationHandler; -@synthesize gcmRegistrationToken; -@synthesize gcmTopics; +@synthesize usesFCM; +@synthesize fcmSandbox; +@synthesize fcmSenderId; +@synthesize fcmRegistrationOptions; +@synthesize fcmRegistrationToken; +@synthesize fcmTopics; --(void)initGCMRegistrationHandler; +-(void)initRegistration; { - __weak __block PushPlugin *weakSelf = self; - gcmRegistrationHandler = ^(NSString *registrationToken, NSError *error){ - if (registrationToken != nil) { - NSLog(@"GCM Registration Token: %@", registrationToken); - [weakSelf setGcmRegistrationToken: registrationToken]; + NSString * registrationToken = [[FIRInstanceID instanceID] token]; - id topics = [weakSelf gcmTopics]; - if (topics != nil) { - for (NSString *topic in topics) { - NSLog(@"subscribe from topic: %@", topic); - id pubSub = [GCMPubSub sharedInstance]; - [pubSub subscribeWithToken: [weakSelf gcmRegistrationToken] - topic:[NSString stringWithFormat:@"/topics/%@", topic] - options:nil - handler:^void(NSError *error) { - if (error) { - if (error.code == 3001) { - NSLog(@"Already subscribed to %@", topic); - } else { - NSLog(@"Failed to subscribe to topic %@: %@", topic, error); - } - } - else { - NSLog(@"Successfully subscribe to topic %@", topic); - } - }]; - } - } + if (registrationToken != nil) { + NSLog(@"FCM Registration Token: %@", registrationToken); + [self setFcmRegistrationToken: registrationToken]; - [weakSelf registerWithToken:registrationToken]; - } else { - NSLog(@"Registration to GCM failed with error: %@", error.localizedDescription); - [weakSelf failWithMessage:self.callbackId withMsg:@"" withError:error]; + id topics = [self fcmTopics]; + if (topics != nil) { + for (NSString *topic in topics) { + NSLog(@"subscribe to topic: %@", topic); + id pubSub = [FIRMessaging messaging]; + [pubSub subscribeToTopic:topic]; + } } - }; + + [self registerWithToken:registrationToken]; + } else { + NSLog(@"FCM token is null"); + } + } -// GCM refresh token +// FCM refresh token // Unclear how this is testable under normal circumstances - (void)onTokenRefresh { #if !TARGET_IPHONE_SIMULATOR // A rotation of the registration tokens is happening, so the app needs to request a new token. - NSLog(@"The GCM registration token needs to be changed."); - [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:[self gcmSenderId] - scope:kGGLInstanceIDScopeGCM - options:[self gcmRegistrationOptions] - handler:[self gcmRegistrationHandler]]; + NSLog(@"The FCM registration token needs to be changed."); + [[FIRInstanceID instanceID] token]; + [self initRegistration]; #endif } -- (void)willSendDataMessageWithID:(NSString *)messageID error:(NSError *)error { - NSLog(@"willSendDataMessageWithID"); - if (error) { - // Failed to send the message. - } else { - // Will send message, you can save the messageID to track the message - } +// contains error info +- (void)sendDataMessageFailure:(NSNotification *)notification { + NSLog(@"sendDataMessageFailure"); +} +- (void)sendDataMessageSuccess:(NSNotification *)notification { + NSLog(@"sendDataMessageSuccess"); +} + +- (void)didSendDataMessageWithID:messageID { + NSLog(@"didSendDataMessageWithID"); } -- (void)didSendDataMessageWithID:(NSString *)messageID { +- (void)willSendDataMessageWithID:messageID error:error { NSLog(@"willSendDataMessageWithID"); - // Did successfully send message identified by messageID } - (void)didDeleteMessagesOnServer { @@ -128,20 +113,10 @@ NSArray* topics = [command argumentAtIndex:0]; if (topics != nil) { - id pubSub = [GCMPubSub sharedInstance]; + id pubSub = [FIRMessaging messaging]; for (NSString *topic in topics) { NSLog(@"unsubscribe from topic: %@", topic); - [pubSub unsubscribeWithToken: [self gcmRegistrationToken] - topic:[NSString stringWithFormat:@"/topics/%@", topic] - options:nil - handler:^void(NSError *error) { - if (error) { - NSLog(@"Failed to unsubscribe from topic %@: %@", topic, error); - } - else { - NSLog(@"Successfully unsubscribe from topic %@", topic); - } - }]; + [pubSub unsubscribeFromTopic:topic]; } } else { [[UIApplication sharedApplication] unregisterForRemoteNotifications]; @@ -155,25 +130,10 @@ if (topic != nil) { NSLog(@"subscribe from topic: %@", topic); - id pubSub = [GCMPubSub sharedInstance]; - [pubSub subscribeWithToken: [self gcmRegistrationToken] - topic:[NSString stringWithFormat:@"/topics/%@", topic] - options:nil - handler:^void(NSError *error) { - if (error) { - if (error.code == 3001) { - NSLog(@"Already subscribed to %@", topic); - [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Already subscribed to %@", topic]]; - } else { - NSLog(@"Failed to subscribe to topic %@: %@", topic, error); - [self failWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Failed to subscribe to topic %@", topic] withError:error]; - } - } - else { - NSLog(@"Successfully subscribe to topic %@", topic); - [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully subscribe to topic %@", topic]]; - } - }]; + id pubSub = [FIRMessaging messaging]; + [pubSub subscribeToTopic:topic]; + NSLog(@"Successfully subscribe to topic %@", topic); + [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully subscribe to topic %@", topic]]; } else { NSLog(@"There is no topic to subscribe"); [self successWithMessage:command.callbackId withMsg:@"There is no topic to subscribe"]; @@ -186,19 +146,10 @@ if (topic != nil) { NSLog(@"unsubscribe from topic: %@", topic); - id pubSub = [GCMPubSub sharedInstance]; - [pubSub unsubscribeWithToken: [self gcmRegistrationToken] - topic:[NSString stringWithFormat:@"/topics/%@", topic] - options:nil - handler:^void(NSError *error) { - if (error) { - NSLog(@"Failed to unsubscribe to topic %@: %@", topic, error); - [self failWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Failed to unsubscribe to topic %@", topic] withError:error]; - } else { - NSLog(@"Successfully unsubscribe to topic %@", topic); - [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully unsubscribe to topic %@", topic]]; - } - }]; + id pubSub = [FIRMessaging messaging]; + [pubSub unsubscribeFromTopic:topic]; + NSLog(@"Successfully unsubscribe from topic %@", topic); + [self successWithMessage:command.callbackId withMsg:[NSString stringWithFormat:@"Successfully unsubscribe from topic %@", topic]]; } else { NSLog(@"There is no topic to unsubscribe"); [self successWithMessage:command.callbackId withMsg:@"There is no topic to unsubscribe"]; @@ -207,6 +158,22 @@ - (void)init:(CDVInvokedUrlCommand*)command; { + [[NSNotificationCenter defaultCenter] + addObserver:self selector:@selector(onTokenRefresh) + name:kFIRInstanceIDTokenRefreshNotification object:nil]; + + [[NSNotificationCenter defaultCenter] + addObserver:self selector:@selector(sendDataMessageFailure:) + name:FIRMessagingSendErrorNotification object:nil]; + + [[NSNotificationCenter defaultCenter] + addObserver:self selector:@selector(sendDataMessageSuccess:) + name:FIRMessagingSendSuccessNotification object:nil]; + + [[NSNotificationCenter defaultCenter] + addObserver:self selector:@selector(didDeleteMessagesOnServer) + name:FIRMessagingMessagesDeletedNotification object:nil]; + [self.commandDelegate runInBackground:^ { NSLog(@"Push Plugin register called"); @@ -215,13 +182,10 @@ NSMutableDictionary* options = [command.arguments objectAtIndex:0]; NSMutableDictionary* iosOptions = [options objectForKey:@"ios"]; - NSArray* topics = [iosOptions objectForKey:@"topics"]; - [self setGcmTopics:topics]; + NSArray* topics = [iosOptions objectForKey:@"topics"]; + [self setFcmTopics:topics]; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UIUserNotificationType UserNotificationTypes = UIUserNotificationTypeNone; -#endif - UIRemoteNotificationType notificationTypes = UIRemoteNotificationTypeNone; id badgeArg = [iosOptions objectForKey:@"badge"]; id soundArg = [iosOptions objectForKey:@"sound"]; @@ -230,32 +194,20 @@ if (([badgeArg isKindOfClass:[NSString class]] && [badgeArg isEqualToString:@"true"]) || [badgeArg boolValue]) { - notificationTypes |= UIRemoteNotificationTypeBadge; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeBadge; -#endif } if (([soundArg isKindOfClass:[NSString class]] && [soundArg isEqualToString:@"true"]) || [soundArg boolValue]) { - notificationTypes |= UIRemoteNotificationTypeSound; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeSound; -#endif } if (([alertArg isKindOfClass:[NSString class]] && [alertArg isEqualToString:@"true"]) || [alertArg boolValue]) { - notificationTypes |= UIRemoteNotificationTypeAlert; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationTypeAlert; -#endif } - notificationTypes |= UIRemoteNotificationTypeNewsstandContentAvailability; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 UserNotificationTypes |= UIUserNotificationActivationModeBackground; -#endif if (clearBadgeArg == nil || ([clearBadgeArg isKindOfClass:[NSString class]] && [clearBadgeArg isEqualToString:@"false"]) || ![clearBadgeArg boolValue]) { NSLog(@"PushPlugin.register: setting badge to false"); @@ -267,12 +219,8 @@ } NSLog(@"PushPlugin.register: clear badge is set to %d", clearBadge); - if (notificationTypes == UIRemoteNotificationTypeNone) - NSLog(@"PushPlugin.register: Push notification type is set to none"); - isInline = NO; -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 NSLog(@"PushPlugin.register: better button setup"); // setup action buttons NSMutableSet *categories = [[NSMutableSet alloc] init]; @@ -329,45 +277,46 @@ } } -#else - NSLog(@"PushPlugin.register: action buttons only supported on iOS8 and above"); -#endif - -#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 if ([[UIApplication sharedApplication]respondsToSelector:@selector(registerUserNotificationSettings:)]) { UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UserNotificationTypes categories:categories]; [[UIApplication sharedApplication] registerUserNotificationSettings:settings]; [[UIApplication sharedApplication] registerForRemoteNotifications]; - } else { - [[UIApplication sharedApplication] registerForRemoteNotificationTypes: - (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; } -#else - [[UIApplication sharedApplication] registerForRemoteNotificationTypes: - (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; -#endif + + // Read GoogleService-Info.plist + NSString *path = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"]; + + // Load the file content and read the data into arrays + NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path]; + fcmSenderId = [dict objectForKey:@"GCM_SENDER_ID"]; + BOOL isGcmEnabled = [[dict valueForKey:@"IS_GCM_ENABLED"] boolValue]; + + NSLog(@"FCM Sender ID %@", fcmSenderId); // GCM options - [self setGcmSenderId: [iosOptions objectForKey:@"senderID"]]; - NSLog(@"GCM Sender ID %@", gcmSenderId); - if([[self gcmSenderId] length] > 0) { - NSLog(@"Using GCM Notification"); - [self setUsesGCM: YES]; - [self initGCMRegistrationHandler]; + [self setFcmSenderId: fcmSenderId]; + if(isGcmEnabled && [[self fcmSenderId] length] > 0) { + NSLog(@"Using FCM Notification"); + [self setUsesFCM: YES]; + dispatch_async(dispatch_get_main_queue(), ^{ + if([FIRApp defaultApp] == nil) + [FIRApp configure]; + [self initRegistration]; + }); } else { NSLog(@"Using APNS Notification"); - [self setUsesGCM:NO]; + [self setUsesFCM:NO]; } - id gcmSandBoxArg = [iosOptions objectForKey:@"gcmSandbox"]; + id fcmSandboxArg = [iosOptions objectForKey:@"fcmSandbox"]; - [self setGcmSandbox:@NO]; - if ([self usesGCM] && - (([gcmSandBoxArg isKindOfClass:[NSString class]] && [gcmSandBoxArg isEqualToString:@"true"]) || - [gcmSandBoxArg boolValue])) + [self setFcmSandbox:@NO]; + if ([self usesFCM] && + (([fcmSandboxArg isKindOfClass:[NSString class]] && [fcmSandboxArg isEqualToString:@"true"]) || + [fcmSandboxArg boolValue])) { - NSLog(@"Using GCM Sandbox"); - [self setGcmSandbox:@YES]; + NSLog(@"Using FCM Sandbox"); + [self setFcmSandbox:@YES]; } if (notificationMessage) { // if there is a pending startup notification @@ -422,14 +371,8 @@ [results setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] forKey:@"appVersion"]; // Check what Notifications the user has turned on. We registered for all three, but they may have manually disabled some or all of them. -#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) - NSUInteger rntypes; - if (!SYSTEM_VERSION_LESS_THAN(@"8.0")) { - rntypes = [[[UIApplication sharedApplication] currentUserNotificationSettings] types]; - } else { - rntypes = [[UIApplication sharedApplication] enabledRemoteNotificationTypes]; - } + NSUInteger rntypes = [[[UIApplication sharedApplication] currentUserNotificationSettings] types]; // Set the defaults to disabled unless we find otherwise... NSString *pushBadge = @"disabled"; @@ -440,13 +383,13 @@ // one is actually disabled. So we are literally checking to see if rnTypes matches what is turned on, instead of by number. The "tricky" part is that the // single notification types will only match if they are the ONLY one enabled. Likewise, when we are checking for a pair of notifications, it will only be // true if those two notifications are on. This is why the code is written this way - if(rntypes & UIRemoteNotificationTypeBadge){ + if(rntypes & UIUserNotificationTypeBadge){ pushBadge = @"enabled"; } - if(rntypes & UIRemoteNotificationTypeAlert) { + if(rntypes & UIUserNotificationTypeAlert) { pushAlert = @"enabled"; } - if(rntypes & UIRemoteNotificationTypeSound) { + if(rntypes & UIUserNotificationTypeSound) { pushSound = @"enabled"; } @@ -460,24 +403,7 @@ [results setValue:dev.model forKey:@"deviceModel"]; [results setValue:dev.systemVersion forKey:@"deviceSystemVersion"]; - if([self usesGCM]) { - GGLInstanceIDConfig *instanceIDConfig = [GGLInstanceIDConfig defaultConfig]; - instanceIDConfig.delegate = self; - [[GGLInstanceID sharedInstance] startWithConfig:instanceIDConfig]; - - [self setGcmRegistrationOptions: @{kGGLInstanceIDRegisterAPNSOption:deviceToken, - kGGLInstanceIDAPNSServerTypeSandboxOption:[self gcmSandbox]}]; - - [[GGLInstanceID sharedInstance] tokenWithAuthorizedEntity:[self gcmSenderId] - scope:kGGLInstanceIDScopeGCM - options:[self gcmRegistrationOptions] - handler:[self gcmRegistrationHandler]]; - - GCMConfig *gcmConfig = [GCMConfig defaultConfig]; - gcmConfig.receiverDelegate = self; - [[GCMService sharedInstance] startWithConfig:gcmConfig]; - - } else { + if(![self usesFCM]) { [self registerWithToken: token]; } #endif @@ -610,31 +536,36 @@ [self.commandDelegate sendPluginResult:commandResult callbackId:command.callbackId]; } --(void)successWithMessage:(NSString *)callbackId withMsg:(NSString *)message +-(void)successWithMessage:(NSString *)myCallbackId withMsg:(NSString *)message { - if (callbackId != nil) + if (myCallbackId != nil) { CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message]; - [self.commandDelegate sendPluginResult:commandResult callbackId:callbackId]; + [self.commandDelegate sendPluginResult:commandResult callbackId:myCallbackId]; } } -(void)registerWithToken:(NSString*)token; { // Send result to trigger 'registration' event but keep callback - NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:1]; + NSMutableDictionary* message = [NSMutableDictionary dictionaryWithCapacity:2]; [message setObject:token forKey:@"registrationId"]; + if ([self usesFCM]) { + [message setObject:@"FCM" forKey:@"registrationType"]; + } else { + [message setObject:@"APNS" forKey:@"registrationType"]; + } CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:message]; [pluginResult setKeepCallbackAsBool:YES]; [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId]; } --(void)failWithMessage:(NSString *)callbackId withMsg:(NSString *)message withError:(NSError *)error +-(void)failWithMessage:(NSString *)myCallbackId withMsg:(NSString *)message withError:(NSError *)error { NSString *errorMessage = (error) ? [NSString stringWithFormat:@"%@ - %@", message, [error localizedDescription]] : message; CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:errorMessage]; - [self.commandDelegate sendPluginResult:commandResult callbackId:callbackId]; + [self.commandDelegate sendPluginResult:commandResult callbackId:myCallbackId]; } -(void) finish:(CDVInvokedUrlCommand*)command diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/js/push.js b/StoneIsland/plugins/phonegap-plugin-push/src/js/push.js new file mode 100644 index 00000000..150af344 --- /dev/null +++ b/StoneIsland/plugins/phonegap-plugin-push/src/js/push.js @@ -0,0 +1,316 @@ +/* global cordova:false */ +/* globals window */ + +/*! + * Module dependencies. + */ + +const exec = cordova.require('cordova/exec'); + +class PushNotification { + /** + * PushNotification constructor. + * + * @param {Object} options to initiate Push Notifications. + * @return {PushNotification} instance that can be monitored and cancelled. + */ + constructor(options) { + this.handlers = { + registration: [], + notification: [], + error: [], + }; + + // require options parameter + if (typeof options === 'undefined') { + throw new Error('The options argument is required.'); + } + + // store the options to this object instance + this.options = options; + + // triggered on registration and notification + const success = (result) => { + if (result && typeof result.registrationId !== 'undefined') { + this.emit('registration', result); + } else if (result && result.additionalData && + typeof result.additionalData.actionCallback !== 'undefined') { + const executeFuctionOrEmitEventByName = (functionName, context, ...args) => { + const namespaces = functionName.split('.'); + const func = namespaces.pop(); + for (let i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } + + if (typeof context[func] === 'function') { + context[func].call(context, args); + } else { + this.emit(functionName, args); + } + }; + + executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); + } else if (result) { + this.emit('notification', result); + } + }; + + // triggered on error + const fail = (msg) => { + const e = (typeof msg === 'string') ? new Error(msg) : msg; + this.emit('error', e); + }; + + // wait at least one process tick to allow event subscriptions + setTimeout(() => { + exec(success, fail, 'PushNotification', 'init', [options]); + }, 10); + } + + /** + * Unregister from push notifications + */ + unregister(successCallback, errorCallback = () => {}, options) { + if (typeof errorCallback !== 'function') { + console.log('PushNotification.unregister failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.unregister failure: success callback parameter ' + + ' must be a function'); + return; + } + + const cleanHandlersAndPassThrough = () => { + if (!options) { + this.handlers = { + registration: [], + notification: [], + error: [], + }; + } + successCallback(); + }; + + exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); + } + + /** + * subscribe to a topic + * @param {String} topic topic to subscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + subscribe(topic, successCallback, errorCallback = () => {}) { + if (typeof errorCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + + 'failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + + 'success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); + } + + /** + * unsubscribe to a topic + * @param {String} topic topic to unsubscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + unsubscribe(topic, successCallback, errorCallback = () => {}) { + if (typeof errorCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: failure parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: ' + + 'success callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); + } + + + /** + * Call this to set the application icon badge + */ + setApplicationIconBadgeNumber(successCallback, errorCallback = () => {}, badge) { + if (typeof errorCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: failure ' + + 'parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: success ' + + 'callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', + 'setApplicationIconBadgeNumber', [{ badge }]); + } + + /** + * Get the application icon badge + */ + + getApplicationIconBadgeNumber(successCallback, errorCallback = () => {}) { + if (typeof errorCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: failure ' + + 'parameter not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: success ' + + 'callback parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); + } + + /** + * Clear all notifications + */ + + clearAllNotifications(successCallback = () => {}, errorCallback = () => {}) { + if (typeof errorCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: failure parameter ' + + 'not a function'); + return; + } + + if (typeof successCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: success callback ' + + 'parameter must be a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); + } + /** + * Listen for an event. + * + * The following events are supported: + * + * - registration + * - notification + * - error + * + * @param {String} eventName to subscribe to. + * @param {Function} callback triggered on the event. + */ + + on(eventName, callback) { + if (!this.handlers.hasOwnProperty(eventName)) { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(callback); + } + + /** + * Remove event listener. + * + * @param {String} eventName to match subscription. + * @param {Function} handle function associated with event. + */ + + off(eventName, handle) { + if (this.handlers.hasOwnProperty(eventName)) { + const handleIndex = this.handlers[eventName].indexOf(handle); + if (handleIndex >= 0) { + this.handlers[eventName].splice(handleIndex, 1); + } + } + } + + /** + * Emit an event. + * + * This is intended for internal use only. + * + * @param {String} eventName is the event to trigger. + * @param {*} all arguments are passed to the event listeners. + * + * @return {Boolean} is true when the event is triggered otherwise false. + */ + + emit(...args) { + const eventName = args.shift(); + + if (!this.handlers.hasOwnProperty(eventName)) { + return false; + } + + for (let i = 0, length = this.handlers[eventName].length; i < length; i++) { + const callback = this.handlers[eventName][i]; + if (typeof callback === 'function') { + callback.apply(undefined, args); + } else { + console.log(`event handler: ${eventName} must be a function`); + } + } + + return true; + } + + finish(successCallback = () => {}, errorCallback = () => {}, id = 'handler') { + if (typeof successCallback !== 'function') { + console.log('finish failure: success callback parameter must be a function'); + return; + } + + if (typeof errorCallback !== 'function') { + console.log('finish failure: failure parameter not a function'); + return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); + } +} + +/*! + * Push Notification Plugin. + */ + +module.exports = { + /** + * Register for Push Notifications. + * + * This method will instantiate a new copy of the PushNotification object + * and start the registration process. + * + * @param {Object} options + * @return {PushNotification} instance + */ + + init: (options) => { + return new PushNotification(options); + }, + + hasPermission: (successCallback, errorCallback) => { + exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); + }, + + /** + * PushNotification Object. + * + * Expose the PushNotification object for direct use + * and testing. Typically, you should use the + * .init helper method. + */ + PushNotification, +}; diff --git a/StoneIsland/plugins/phonegap-plugin-push/src/windows/PushPluginProxy.js b/StoneIsland/plugins/phonegap-plugin-push/src/windows/PushPluginProxy.js index ac04f39d..eb552dc0 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/src/windows/PushPluginProxy.js +++ b/StoneIsland/plugins/phonegap-plugin-push/src/windows/PushPluginProxy.js @@ -88,6 +88,12 @@ module.exports = { } catch(ex) { onFail(ex); } + }, + subscribe: function() { + console.log("Subscribe is unsupported"); + }, + unsubscribe: function() { + console.log("Subscribe is unsupported"); } }; require("cordova/exec/proxy").add("PushNotification", module.exports); diff --git a/StoneIsland/plugins/phonegap-plugin-push/types/index.d.ts b/StoneIsland/plugins/phonegap-plugin-push/types/index.d.ts new file mode 100644 index 00000000..b47335c2 --- /dev/null +++ b/StoneIsland/plugins/phonegap-plugin-push/types/index.d.ts @@ -0,0 +1,302 @@ +// Type definitions for phonegap-plugin-push +// Project: https://github.com/phonegap/phonegap-plugin-push +// Definitions by: Frederico Galvão <https://github.com/fredgalvao> +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace PhonegapPluginPush { + type EventResponse = RegistrationEventResponse | NotificationEventResponse | Error + + interface PushNotification { + /** + * The event registration will be triggered on each successful registration with the 3rd party push service. + * @param event + * @param callback + */ + on(event: "registration", callback: (response: RegistrationEventResponse) => any): void + /** + * The event notification will be triggered each time a push notification is received by a 3rd party push service on the device. + * @param event + * @param callback + */ + on(event: "notification", callback: (response: NotificationEventResponse) => any): void + /** + * The event error will trigger when an internal error occurs and the cache is aborted. + * @param event + * @param callback + */ + on(event: "error", callback: (response: Error) => any): void + /** + * + * @param event Name of the event to listen to. See below(above) for all the event names. + * @param callback is called when the event is triggered. + * @param event + * @param callback + */ + on(event: string, callback: (response: EventResponse) => any): void + + off(event: "registration", callback: (response: RegistrationEventResponse) => any): void + off(event: "notification", callback: (response: NotificationEventResponse) => any): void + off(event: "error", callback: (response: Error) => any): void + /** + * As stated in the example, you will have to store your event handler if you are planning to remove it. + * @param event Name of the event type. The possible event names are the same as for the push.on function. + * @param callback handle to the function to get removed. + * @param event + * @param callback + */ + off(event: string, callback: (response: EventResponse) => any): void + + /** + * The unregister method is used when the application no longer wants to receive push notifications. + * Beware that this cleans up all event handlers previously registered, + * so you will need to re-register them if you want them to function again without an application reload. + * @param successHandler + * @param errorHandler + * @param topics + */ + unregister(successHandler: () => any, errorHandler?: () => any, topics?: string[]): void + + /** + * The subscribe method is used when the application wants to subscribe a new topic to receive push notifications. + * @param topic Topic to subscribe to. + * @param successHandler Is called when the api successfully unregisters. + * @param errorHandler Is called when the api encounters an error while unregistering. + */ + subscribe(topic: string, successHandler: () => any, errorHandler: () => any): void; + + /** + * The unsubscribe method is used when the application no longer wants to receive push notifications + * from a specific topic but continue to receive other push messages. + * @param topic Topic to unsubscribe from. + * @param successHandler Is called when the api successfully unregisters. + * @param errorHandler Is called when the api encounters an error while unregistering. + */ + unsubscribe(topic: string, successHandler: () => any, errorHandler: () => any): void; + + /*TODO according to js source code, "errorHandler" is optional, but is "count" also optional? I can't read objetive-C code (can anyone at all? I wonder...)*/ + /** + * Set the badge count visible when the app is not running + * + * The count is an integer indicating what number should show up in the badge. + * Passing 0 will clear the badge. + * Each notification event contains a data.count value which can be used to set the badge to correct number. + * @param successHandler + * @param errorHandler + * @param count + */ + setApplicationIconBadgeNumber(successHandler: () => any, errorHandler: () => any, count: number): void + + /** + * Get the current badge count visible when the app is not running + * successHandler gets called with an integer which is the current badge count + * @param successHandler + * @param errorHandler + */ + getApplicationIconBadgeNumber(successHandler: (count: number) => any, errorHandler: () => any): void + + /** + * iOS only + * Tells the OS that you are done processing a background push notification. + * successHandler gets called when background push processing is successfully completed. + * @param successHandler + * @param errorHandler + * @param id + */ + finish(successHandler?: () => any, errorHandler?: () => any, id?: string): void + + /** + * Tells the OS to clear all notifications from the Notification Center + * @param successHandler Is called when the api successfully clears the notifications. + * @param errorHandler Is called when the api encounters an error when attempting to clears the notifications. + */ + clearAllNotifications(successHandler: () => any, errorHandler: () => any): void + } + + /** + * platform specific initialization options. + */ + interface InitOptions { + /** + * Android specific initialization options. + */ + android?: { + /** + * Maps to the project number in the Google Developer Console. + */ + senderID: string + /** + * The name of a drawable resource to use as the small-icon. The name should not include the extension. + */ + icon?: string + /** + * Sets the background color of the small icon on Android 5.0 and greater. + * Supported Formats - http://developer.android.com/reference/android/graphics/Color.html#parseColor(java.lang.String) + */ + iconColor?: string + /** + * If true it plays the sound specified in the push data or the default system sound. Default is true. + */ + sound?: boolean + /** + * If true the device vibrates on receipt of notification. Default is true. + */ + vibrate?: boolean + /** + * If true the app clears all pending notifications when it is closed. Default is true. + */ + clearNotifications?: boolean + /** + * If true will always show a notification, even when the app is on the foreground. Default is false. + */ + forceShow?: boolean + /** + * If the array contains one or more strings each string will be used to subscribe to a GcmPubSub topic. + */ + topics?: string[] + } + + /** + * iOS specific initialization options. + */ + ios?: { + /** + * If true|"true" the device sets the badge number on receipt of notification. + * Default is false|"false". + * Note: the value you set this option to the first time you call the init method will be how the application always acts. + * Once this is set programmatically in the init method it can only be changed manually by the user in Settings>Notifications>App Name. + * This is normal iOS behaviour. + */ + badge?: boolean | string + /** + * If true|"true" the device plays a sound on receipt of notification. + * Default is false|"false". + * Note: the value you set this option to the first time you call the init method will be how the application always acts. + * Once this is set programmatically in the init method it can only be changed manually by the user in Settings>Notifications>App Name. + * This is normal iOS behaviour. + */ + sound?: boolean | string + /** + * If true|"true" the device shows an alert on receipt of notification. + * Default is false|"false". + * Note: the value you set this option to the first time you call the init method will be how the application always acts. + * Once this is set programmatically in the init method it can only be changed manually by the user in Settings>Notifications>App Name. + * This is normal iOS behaviour. + */ + alert?: boolean | string + /** + * If true|"true" the badge will be cleared on app startup. Default is false|"false". + */ + clearBadge?: boolean | string + /** + * The data required in order to enable Action Buttons for iOS. + * Action Buttons on iOS - https://github.com/phonegap/phonegap-plugin-push/blob/master/docs/PAYLOAD.md#action-buttons-1 + */ + categories?: CategoryArray + /** + * Maps to the project number in the Google Developer Console. Setting this uses GCM for notifications instead of native + */ + senderID?: string + /** + * Whether to use prod or sandbox GCM setting. Defaults to false. + */ + gcmSandbox?: boolean + /** + * If the array contains one or more strings each string will be used to subscribe to a GcmPubSub topic. Note: only usable in conjunction with senderID + */ + topics?: string[] + } + + /** + * Windows specific initialization options. + */ + windows?: { + + } + } + + interface CategoryArray { + [name: string]: CategoryAction + } + + interface CategoryAction { + yes?: CategoryActionData + no?: CategoryActionData + maybe?: CategoryActionData + } + + interface CategoryActionData { + callback: string + title: string + foreground: boolean + destructive: boolean + } + + interface RegistrationEventResponse { + /** + * The registration ID provided by the 3rd party remote push service. + */ + registrationId: string + } + + interface NotificationEventResponse { + /** + * The text of the push message sent from the 3rd party service. + */ + message: string + /** + * The optional title of the push message sent from the 3rd party service. + */ + title?: string + /** + * The number of messages to be displayed in the badge iOS or message count in the notification shade in Android. + * For windows, it represents the value in the badge notification which could be a number or a status glyph. + */ + count: string + /** + * The name of the sound file to be played upon receipt of the notification. + */ + sound: string + /** + * The path of the image file to be displayed in the notification. + */ + image: string + /** + * An optional collection of data sent by the 3rd party push service that does not fit in the above properties. + */ + additionalData: NotificationEventAdditionalData + } + + /** + * TODO: document all possible properties (I only got the android ones) + * + * Loosened up with a dictionary notation, but all non-defined properties need to use (map['prop']) notation + * + * Ideally the developer would overload (merged declaration) this or create a new interface that would extend this one + * so that he could specify any custom code without having to use array notation (map['prop']) for all of them. + */ + interface NotificationEventAdditionalData { + [name: string]: any + + /** + * Whether the notification was received while the app was in the foreground + */ + foreground?: boolean + /** + * Will be true if the application is started by clicking on the push notification, false if the app is already started. (Android/iOS only) + */ + coldstart?: boolean + collapse_key?: string + from?: string + notId?: string + } + + interface PushNotificationStatic { + init(options: InitOptions): PushNotification + new (options: InitOptions): PushNotification + } +} + +interface Window { + PushNotification: PhonegapPluginPush.PushNotificationStatic +} +declare var PushNotification: PhonegapPluginPush.PushNotificationStatic;
\ No newline at end of file diff --git a/StoneIsland/plugins/phonegap-plugin-push/www/browser/push.js b/StoneIsland/plugins/phonegap-plugin-push/www/browser/push.js index 9b74d8a4..1badd77b 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/www/browser/push.js +++ b/StoneIsland/plugins/phonegap-plugin-push/www/browser/push.js @@ -29,6 +29,12 @@ var PushNotification = function(options) { // store the options to this object instance this.options = options; + // subscription options + var subOptions = {userVisibleOnly: true}; + if (this.options.browser && this.options.browser.applicationServerKey) { + subOptions.applicationServerKey = urlBase64ToUint8Array(this.options.browser.applicationServerKey); + } + // triggered on registration and notification var that = this; @@ -50,7 +56,7 @@ var PushNotification = function(options) { }) .then(function(reg) { serviceWorker = reg; - reg.pushManager.subscribe({userVisibleOnly: true}).then(function(sub) { + reg.pushManager.subscribe(subOptions).then(function(sub) { subscription = sub; result = { 'registrationId': sub.endpoint.substring(sub.endpoint.lastIndexOf('/') + 1) }; that.emit('registration', result); @@ -322,6 +328,29 @@ PushNotification.prototype.finish = function(successCallback, errorCallback, id) * Push Notification Plugin. */ +/** + * Converts the server key to an Uint8Array + * + * @param base64String + * + * @returns {Uint8Array} + */ +function urlBase64ToUint8Array(base64String) { + const padding = '='.repeat((4 - base64String.length % 4) % 4); + const base64 = (base64String + padding) + .replace(/\-/g, '+') + .replace(/_/g, '/'); + + const rawData = window.atob(base64); + const outputArray = new Uint8Array(rawData.length); + + for (var i = 0; i < rawData.length; ++i) { + outputArray[i] = rawData.charCodeAt(i); + } + return outputArray; +} + + module.exports = { /** * Register for Push Notifications. diff --git a/StoneIsland/plugins/phonegap-plugin-push/www/push.js b/StoneIsland/plugins/phonegap-plugin-push/www/push.js index 58c686d3..03f02e64 100644 --- a/StoneIsland/plugins/phonegap-plugin-push/www/push.js +++ b/StoneIsland/plugins/phonegap-plugin-push/www/push.js @@ -1,3 +1,15 @@ +/** +* This file has been generated by Babel. +* +* DO NOT EDIT IT DIRECTLY +* +* Edit the JS source file src/js/push.js +**/'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + /* global cordova:false */ /* globals window */ @@ -7,320 +19,357 @@ var exec = cordova.require('cordova/exec'); -/** - * PushNotification constructor. - * - * @param {Object} options to initiate Push Notifications. - * @return {PushNotification} instance that can be monitored and cancelled. - */ +var PushNotification = function () { + /** + * PushNotification constructor. + * + * @param {Object} options to initiate Push Notifications. + * @return {PushNotification} instance that can be monitored and cancelled. + */ + function PushNotification(options) { + var _this = this; -var PushNotification = function(options) { - this._handlers = { - 'registration': [], - 'notification': [], - 'error': [] + _classCallCheck(this, PushNotification); + + this.handlers = { + registration: [], + notification: [], + error: [] }; // require options parameter if (typeof options === 'undefined') { - throw new Error('The options argument is required.'); + throw new Error('The options argument is required.'); } // store the options to this object instance this.options = options; // triggered on registration and notification - var that = this; - var success = function(result) { - if (result && typeof result.registrationId !== 'undefined') { - that.emit('registration', result); - } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { - var executeFuctionOrEmitEventByName = function(callbackName, context, arg) { - var namespaces = callbackName.split('.'); - var func = namespaces.pop(); - for (var i = 0; i < namespaces.length; i++) { - context = context[namespaces[i]]; - } + var success = function success(result) { + if (result && typeof result.registrationId !== 'undefined') { + _this.emit('registration', result); + } else if (result && result.additionalData && typeof result.additionalData.actionCallback !== 'undefined') { + var executeFuctionOrEmitEventByName = function executeFuctionOrEmitEventByName(functionName, context) { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } - if (typeof context[func] === 'function') { - context[func].call(context, arg); - } else { - that.emit(callbackName, arg); - } - }; + var namespaces = functionName.split('.'); + var func = namespaces.pop(); + for (var i = 0; i < namespaces.length; i++) { + context = context[namespaces[i]]; + } - executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); - } else if (result) { - that.emit('notification', result); - } + if (typeof context[func] === 'function') { + context[func].call(context, args); + } else { + _this.emit(functionName, args); + } + }; + + executeFuctionOrEmitEventByName(result.additionalData.actionCallback, window, result); + } else if (result) { + _this.emit('notification', result); + } }; // triggered on error - var fail = function(msg) { - var e = (typeof msg === 'string') ? new Error(msg) : msg; - that.emit('error', e); + var fail = function fail(msg) { + var e = typeof msg === 'string' ? new Error(msg) : msg; + _this.emit('error', e); }; // wait at least one process tick to allow event subscriptions - setTimeout(function() { - exec(success, fail, 'PushNotification', 'init', [options]); + setTimeout(function () { + exec(success, fail, 'PushNotification', 'init', [options]); }, 10); -}; + } -/** - * Unregister from push notifications - */ + /** + * Unregister from push notifications + */ -PushNotification.prototype.unregister = function(successCallback, errorCallback, options) { - if (!errorCallback) { errorCallback = function() {}; } - if (typeof errorCallback !== 'function') { + _createClass(PushNotification, [{ + key: 'unregister', + value: function unregister(successCallback) { + var _this2 = this; + + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var options = arguments[2]; + + if (typeof errorCallback !== 'function') { console.log('PushNotification.unregister failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unregister failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unregister failure: success callback parameter ' + ' must be a function'); return; - } + } - var that = this; - var cleanHandlersAndPassThrough = function() { + var cleanHandlersAndPassThrough = function cleanHandlersAndPassThrough() { if (!options) { - that._handlers = { - 'registration': [], - 'notification': [], - 'error': [] - }; + _this2.handlers = { + registration: [], + notification: [], + error: [] + }; } successCallback(); - }; + }; - exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); -}; + exec(cleanHandlersAndPassThrough, errorCallback, 'PushNotification', 'unregister', [options]); + } -/** - * subscribe to a topic - * @param {String} topic topic to subscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.subscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + /** + * subscribe to a topic + * @param {String} topic topic to subscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ + + }, { + key: 'subscribe', + value: function subscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.subscribe failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.subscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.subscribe failure: ' + 'success callback parameter must be a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); } - exec(successCallback, errorCallback, 'PushNotification', 'subscribe', [topic]); -}; + /** + * unsubscribe to a topic + * @param {String} topic topic to unsubscribe + * @param {Function} successCallback success callback + * @param {Function} errorCallback error callback + * @return {void} + */ -/** - * unsubscribe to a topic - * @param {String} topic topic to unsubscribe - * @param {Function} successCallback success callback - * @param {Function} errorCallback error callback - * @return {void} - */ -PushNotification.prototype.unsubscribe = function(topic, successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'unsubscribe', + value: function unsubscribe(topic, successCallback) { + var errorCallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('PushNotification.unsubscribe failure: failure parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.unsubscribe failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.unsubscribe failure: ' + 'success callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'unsubscribe', [topic]); + } -/** - * Call this to set the application icon badge - */ + /** + * Call this to set the application icon badge + */ -PushNotification.prototype.setApplicationIconBadgeNumber = function(successCallback, errorCallback, badge) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'setApplicationIconBadgeNumber', + value: function setApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var badge = arguments[2]; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.setApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.setApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{badge: badge}]); -}; + exec(successCallback, errorCallback, 'PushNotification', 'setApplicationIconBadgeNumber', [{ badge: badge }]); + } -/** - * Get the application icon badge - */ + /** + * Get the application icon badge + */ -PushNotification.prototype.getApplicationIconBadgeNumber = function(successCallback, errorCallback) { - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'getApplicationIconBadgeNumber', + value: function getApplicationIconBadgeNumber(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: failure ' + 'parameter not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.getApplicationIconBadgeNumber failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.getApplicationIconBadgeNumber failure: success ' + 'callback parameter must be a function'); return; - } + } - exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); -}; + exec(successCallback, errorCallback, 'PushNotification', 'getApplicationIconBadgeNumber', []); + } -/** - * Get the application icon badge - */ + /** + * Clear all notifications + */ -PushNotification.prototype.clearAllNotifications = function(successCallback, errorCallback) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } + }, { + key: 'clearAllNotifications', + value: function clearAllNotifications() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - if (typeof errorCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: failure parameter not a function'); + if (typeof errorCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: failure parameter ' + 'not a function'); return; - } + } - if (typeof successCallback !== 'function') { - console.log('PushNotification.clearAllNotifications failure: success callback parameter must be a function'); + if (typeof successCallback !== 'function') { + console.log('PushNotification.clearAllNotifications failure: success callback ' + 'parameter must be a function'); return; - } - - exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); -}; + } -/** - * Listen for an event. - * - * Any event is supported, but the following are built-in: - * - * - registration - * - notification - * - error - * - * @param {String} eventName to subscribe to. - * @param {Function} callback triggered on the event. - */ + exec(successCallback, errorCallback, 'PushNotification', 'clearAllNotifications', []); + } + /** + * Listen for an event. + * + * The following events are supported: + * + * - registration + * - notification + * - error + * + * @param {String} eventName to subscribe to. + * @param {Function} callback triggered on the event. + */ -PushNotification.prototype.on = function(eventName, callback) { - if (!this._handlers.hasOwnProperty(eventName)) { - this._handlers[eventName] = []; + }, { + key: 'on', + value: function on(eventName, callback) { + if (!this.handlers.hasOwnProperty(eventName)) { + this.handlers[eventName] = []; + } + this.handlers[eventName].push(callback); } - this._handlers[eventName].push(callback); -}; -/** - * Remove event listener. - * - * @param {String} eventName to match subscription. - * @param {Function} handle function associated with event. - */ + /** + * Remove event listener. + * + * @param {String} eventName to match subscription. + * @param {Function} handle function associated with event. + */ -PushNotification.prototype.off = function (eventName, handle) { - if (this._handlers.hasOwnProperty(eventName)) { - var handleIndex = this._handlers[eventName].indexOf(handle); + }, { + key: 'off', + value: function off(eventName, handle) { + if (this.handlers.hasOwnProperty(eventName)) { + var handleIndex = this.handlers[eventName].indexOf(handle); if (handleIndex >= 0) { - this._handlers[eventName].splice(handleIndex, 1); + this.handlers[eventName].splice(handleIndex, 1); } + } } -}; -/** - * Emit an event. - * - * This is intended for internal use only. - * - * @param {String} eventName is the event to trigger. - * @param {*} all arguments are passed to the event listeners. - * - * @return {Boolean} is true when the event is triggered otherwise false. - */ + /** + * Emit an event. + * + * This is intended for internal use only. + * + * @param {String} eventName is the event to trigger. + * @param {*} all arguments are passed to the event listeners. + * + * @return {Boolean} is true when the event is triggered otherwise false. + */ -PushNotification.prototype.emit = function() { - var args = Array.prototype.slice.call(arguments); - var eventName = args.shift(); + }, { + key: 'emit', + value: function emit() { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - if (!this._handlers.hasOwnProperty(eventName)) { + var eventName = args.shift(); + + if (!this.handlers.hasOwnProperty(eventName)) { return false; - } + } - for (var i = 0, length = this._handlers[eventName].length; i < length; i++) { - var callback = this._handlers[eventName][i]; + for (var i = 0, length = this.handlers[eventName].length; i < length; i++) { + var callback = this.handlers[eventName][i]; if (typeof callback === 'function') { - callback.apply(undefined,args); + callback.apply(undefined, args); } else { - console.log('event handler: ' + eventName + ' must be a function'); + console.log('event handler: ' + eventName + ' must be a function'); } - } + } - return true; -}; - -PushNotification.prototype.finish = function(successCallback, errorCallback, id) { - if (!successCallback) { successCallback = function() {}; } - if (!errorCallback) { errorCallback = function() {}; } - if (!id) { id = 'handler'; } + return true; + } + }, { + key: 'finish', + value: function finish() { + var successCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {}; + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var id = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'handler'; - if (typeof successCallback !== 'function') { + if (typeof successCallback !== 'function') { console.log('finish failure: success callback parameter must be a function'); return; - } + } - if (typeof errorCallback !== 'function') { + if (typeof errorCallback !== 'function') { console.log('finish failure: failure parameter not a function'); return; + } + + exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); } + }]); - exec(successCallback, errorCallback, 'PushNotification', 'finish', [id]); -}; + return PushNotification; +}(); /*! * Push Notification Plugin. */ module.exports = { - /** - * Register for Push Notifications. - * - * This method will instantiate a new copy of the PushNotification object - * and start the registration process. - * - * @param {Object} options - * @return {PushNotification} instance - */ - - init: function(options) { - return new PushNotification(options); - }, + /** + * Register for Push Notifications. + * + * This method will instantiate a new copy of the PushNotification object + * and start the registration process. + * + * @param {Object} options + * @return {PushNotification} instance + */ - hasPermission: function(successCallback, errorCallback) { - exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); - }, + init: function init(options) { + return new PushNotification(options); + }, - /** - * PushNotification Object. - * - * Expose the PushNotification object for direct use - * and testing. Typically, you should use the - * .init helper method. - */ + hasPermission: function hasPermission(successCallback, errorCallback) { + exec(successCallback, errorCallback, 'PushNotification', 'hasPermission', []); + }, - PushNotification: PushNotification -}; + /** + * PushNotification Object. + * + * Expose the PushNotification object for direct use + * and testing. Typically, you should use the + * .init helper method. + */ + PushNotification: PushNotification +};
\ No newline at end of file diff --git a/StoneIsland/www/js/lib/_router.js b/StoneIsland/www/js/lib/_router.js index 43438854..19bd3247 100755 --- a/StoneIsland/www/js/lib/_router.js +++ b/StoneIsland/www/js/lib/_router.js @@ -88,7 +88,7 @@ var SiteRouter = Router.extend({ app.view = app[name] } - window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) + // window.FirebasePlugin && window.FirebasePlugin.setScreenName(name) app.header.set_back( !! app.view.back ) app.view.show() diff --git a/StoneIsland/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js index 00a2e839..29d2938f 100755 --- a/StoneIsland/www/js/lib/etc/push.js +++ b/StoneIsland/www/js/lib/etc/push.js @@ -7,7 +7,7 @@ var push = (function(){ push.disabled = true return } - + pushPlugin = PushNotification.init({ ios: { alert: true, @@ -24,7 +24,7 @@ var push = (function(){ pushPlugin.on('notification', push.got_push_notification) } push.did_initialize = function(data) { - console.log(data) + // console.log(data) if (! data.isEnabled) { console.log("push did not initialize") return @@ -47,7 +47,7 @@ var push = (function(){ push.got_registration = function(data){ var registrationId = data.registrationId var oldRegistrationId = localStorage.getItem("yoox.registrationId") - console.log(registrationId, oldRegistrationId) + // console.log(registrationId, oldRegistrationId) if (registrationId !== oldRegistrationId || ! push.settings.requested) { localStorage.setItem("yoox.registrationId", registrationId) @@ -130,9 +130,10 @@ var push = (function(){ if (push_obj.additionalData.foreground === false) { // TODO: route the user to the uri in push_obj pushPlugin.finish(function(){}, function(){}) - } - else if (push_obj.additionalData.url) { - app.router.go(push_obj.additionalData.url) + + if (push_obj.additionalData.url) { + app.router.go(push_obj.additionalData.url) + } } else if (is_hub) { app.router.go("hub") diff --git a/StoneIsland/www/js/lib/products/ProductView.js b/StoneIsland/www/js/lib/products/ProductView.js index 2743946a..6972b436 100755 --- a/StoneIsland/www/js/lib/products/ProductView.js +++ b/StoneIsland/www/js/lib/products/ProductView.js @@ -167,7 +167,7 @@ var ProductView = ScrollableView.extend({ this.$price.html(price) this.$body.html(body) - window.FirebasePlugin && window.FirebasePlugin.setScreenName('product:' + code) + // window.FirebasePlugin && window.FirebasePlugin.setScreenName('product:' + code) this.$productHeader.toggleClass("wide", title.length > 48) |
