{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/xcbuild/pulls/comments/83290155","pull_request_review_id":4134347,"id":83290155,"diff_hunk":"@@ -12,22 +12,31 @@\n #include <plist/Dictionary.h>\n #include <plist/String.h>\n #include <plist/Format/Any.h>\n+#include <plist/Keys/Unpack.h>\n \n using xcsdk::SDK::Product;\n using libutil::Filesystem;\n \n-Product::Product()\n+Product::\n+Product()\n {\n }\n \n bool Product::\n parse(plist::Dictionary const *dict)\n {\n-    auto PN   = dict->value <plist::String> (\"ProductName\");\n-    auto PV   = dict->value <plist::String> (\"ProductVersion\");\n-    auto PUVV = dict->value <plist::String> (\"ProductUserVisibleVersion\");\n-    auto PBV  = dict->value <plist::String> (\"ProductBuildVersion\");\n-    auto PC   = dict->value <plist::String> (\"ProductCopyright\");\n+    std::unordered_set<std::string> seen;\n+    auto unpack = plist::Keys::Unpack(\"Product\", dict, &seen);\n+\n+    auto PN   = unpack.cast <plist::String> (\"ProductName\");\n+    auto PV   = unpack.cast <plist::String> (\"ProductVersion\");\n+    auto PUVV = unpack.cast <plist::String> (\"ProductUserVisibleVersion\");\n+    auto PBV  = unpack.cast <plist::String> (\"ProductBuildVersion\");\n+    auto PC   = unpack.cast <plist::String> (\"ProductCopyright\");\n+\n+    if (!unpack.complete(true)) {\n+        fprintf(stderr, \"%s\", unpack.errorText().c_str());","path":"Libraries/xcsdk/Sources/SDK/Product.cpp","position":33,"original_position":33,"commit_id":"e12e193552c4386fed7a4fd40342e60e20c8a0fd","original_commit_id":"e12e193552c4386fed7a4fd40342e60e20c8a0fd","user":{"login":"Ktwu","id":470651,"avatar_url":"https://avatars.githubusercontent.com/u/470651?v=3","gravatar_id":"","url":"https://api.github.com/users/Ktwu","html_url":"https://github.com/Ktwu","followers_url":"https://api.github.com/users/Ktwu/followers","following_url":"https://api.github.com/users/Ktwu/following{/other_user}","gists_url":"https://api.github.com/users/Ktwu/gists{/gist_id}","starred_url":"https://api.github.com/users/Ktwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ktwu/subscriptions","organizations_url":"https://api.github.com/users/Ktwu/orgs","repos_url":"https://api.github.com/users/Ktwu/repos","events_url":"https://api.github.com/users/Ktwu/events{/privacy}","received_events_url":"https://api.github.com/users/Ktwu/received_events","type":"User","site_admin":false},"body":"Once again:  return false?","created_at":"2016-10-13T19:11:51Z","updated_at":"2016-10-13T19:11:51Z","html_url":"https://github.com/facebook/xcbuild/pull/155#discussion_r83290155","pull_request_url":"https://api.github.com/repos/facebook/xcbuild/pulls/155","_links":{"self":{"href":"https://api.github.com/repos/facebook/xcbuild/pulls/comments/83290155"},"html":{"href":"https://github.com/facebook/xcbuild/pull/155#discussion_r83290155"},"pull_request":{"href":"https://api.github.com/repos/facebook/xcbuild/pulls/155"}}},"pull_request":{"url":"https://api.github.com/repos/facebook/xcbuild/pulls/155","id":89089389,"html_url":"https://github.com/facebook/xcbuild/pull/155","diff_url":"https://github.com/facebook/xcbuild/pull/155.diff","patch_url":"https://github.com/facebook/xcbuild/pull/155.patch","issue_url":"https://api.github.com/repos/facebook/xcbuild/issues/155","number":155,"state":"open","locked":false,"title":"Modernize and complete SDK loading.","user":{"login":"grp","id":163390,"avatar_url":"https://avatars.githubusercontent.com/u/163390?v=3","gravatar_id":"","url":"https://api.github.com/users/grp","html_url":"https://github.com/grp","followers_url":"https://api.github.com/users/grp/followers","following_url":"https://api.github.com/users/grp/following{/other_user}","gists_url":"https://api.github.com/users/grp/gists{/gist_id}","starred_url":"https://api.github.com/users/grp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grp/subscriptions","organizations_url":"https://api.github.com/users/grp/orgs","repos_url":"https://api.github.com/users/grp/repos","events_url":"https://api.github.com/users/grp/events{/privacy}","received_events_url":"https://api.github.com/users/grp/received_events","type":"User","site_admin":false},"body":" - Warn about missing keys when parsing; add currently missing keys.\r\n - Use optionals to avoid unsafely assuming parsed values always exist.\r\n - Update style to match other libraries.","created_at":"2016-10-12T20:38:36Z","updated_at":"2016-10-13T19:15:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"765d7a25d11787de930ca32996cecf822f788f84","assignee":{"login":"Ktwu","id":470651,"avatar_url":"https://avatars.githubusercontent.com/u/470651?v=3","gravatar_id":"","url":"https://api.github.com/users/Ktwu","html_url":"https://github.com/Ktwu","followers_url":"https://api.github.com/users/Ktwu/followers","following_url":"https://api.github.com/users/Ktwu/following{/other_user}","gists_url":"https://api.github.com/users/Ktwu/gists{/gist_id}","starred_url":"https://api.github.com/users/Ktwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ktwu/subscriptions","organizations_url":"https://api.github.com/users/Ktwu/orgs","repos_url":"https://api.github.com/users/Ktwu/repos","events_url":"https://api.github.com/users/Ktwu/events{/privacy}","received_events_url":"https://api.github.com/users/Ktwu/received_events","type":"User","site_admin":false},"assignees":[{"login":"Ktwu","id":470651,"avatar_url":"https://avatars.githubusercontent.com/u/470651?v=3","gravatar_id":"","url":"https://api.github.com/users/Ktwu","html_url":"https://github.com/Ktwu","followers_url":"https://api.github.com/users/Ktwu/followers","following_url":"https://api.github.com/users/Ktwu/following{/other_user}","gists_url":"https://api.github.com/users/Ktwu/gists{/gist_id}","starred_url":"https://api.github.com/users/Ktwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ktwu/subscriptions","organizations_url":"https://api.github.com/users/Ktwu/orgs","repos_url":"https://api.github.com/users/Ktwu/repos","events_url":"https://api.github.com/users/Ktwu/events{/privacy}","received_events_url":"https://api.github.com/users/Ktwu/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/xcbuild/pulls/155/commits","review_comments_url":"https://api.github.com/repos/facebook/xcbuild/pulls/155/comments","review_comment_url":"https://api.github.com/repos/facebook/xcbuild/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/xcbuild/issues/155/comments","statuses_url":"https://api.github.com/repos/facebook/xcbuild/statuses/e12e193552c4386fed7a4fd40342e60e20c8a0fd","head":{"label":"facebook:grp/sdk-loading","ref":"grp/sdk-loading","sha":"e12e193552c4386fed7a4fd40342e60e20c8a0fd","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":43019030,"name":"xcbuild","full_name":"facebook/xcbuild","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/xcbuild","description":"Xcode-compatible build tool.","fork":false,"url":"https://api.github.com/repos/facebook/xcbuild","forks_url":"https://api.github.com/repos/facebook/xcbuild/forks","keys_url":"https://api.github.com/repos/facebook/xcbuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/xcbuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/xcbuild/teams","hooks_url":"https://api.github.com/repos/facebook/xcbuild/hooks","issue_events_url":"https://api.github.com/repos/facebook/xcbuild/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/xcbuild/events","assignees_url":"https://api.github.com/repos/facebook/xcbuild/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/xcbuild/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/xcbuild/tags","blobs_url":"https://api.github.com/repos/facebook/xcbuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/xcbuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/xcbuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/xcbuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/xcbuild/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/xcbuild/languages","stargazers_url":"https://api.github.com/repos/facebook/xcbuild/stargazers","contributors_url":"https://api.github.com/repos/facebook/xcbuild/contributors","subscribers_url":"https://api.github.com/repos/facebook/xcbuild/subscribers","subscription_url":"https://api.github.com/repos/facebook/xcbuild/subscription","commits_url":"https://api.github.com/repos/facebook/xcbuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/xcbuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/xcbuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/xcbuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/xcbuild/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/xcbuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/xcbuild/merges","archive_url":"https://api.github.com/repos/facebook/xcbuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/xcbuild/downloads","issues_url":"https://api.github.com/repos/facebook/xcbuild/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/xcbuild/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/xcbuild/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/xcbuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/xcbuild/labels{/name}","releases_url":"https://api.github.com/repos/facebook/xcbuild/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/xcbuild/deployments","created_at":"2015-09-23T18:24:01Z","updated_at":"2016-10-13T09:50:29Z","pushed_at":"2016-10-13T18:28:17Z","git_url":"git://github.com/facebook/xcbuild.git","ssh_url":"git@github.com:facebook/xcbuild.git","clone_url":"https://github.com/facebook/xcbuild.git","svn_url":"https://github.com/facebook/xcbuild","homepage":null,"size":4187,"stargazers_count":1116,"watchers_count":1116,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":33,"forks":63,"open_issues":33,"watchers":1116,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"49f8a5923f1381f87ac03ad4c1b138d1d2b74369","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":43019030,"name":"xcbuild","full_name":"facebook/xcbuild","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/xcbuild","description":"Xcode-compatible build tool.","fork":false,"url":"https://api.github.com/repos/facebook/xcbuild","forks_url":"https://api.github.com/repos/facebook/xcbuild/forks","keys_url":"https://api.github.com/repos/facebook/xcbuild/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/xcbuild/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/xcbuild/teams","hooks_url":"https://api.github.com/repos/facebook/xcbuild/hooks","issue_events_url":"https://api.github.com/repos/facebook/xcbuild/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/xcbuild/events","assignees_url":"https://api.github.com/repos/facebook/xcbuild/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/xcbuild/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/xcbuild/tags","blobs_url":"https://api.github.com/repos/facebook/xcbuild/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/xcbuild/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/xcbuild/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/xcbuild/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/xcbuild/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/xcbuild/languages","stargazers_url":"https://api.github.com/repos/facebook/xcbuild/stargazers","contributors_url":"https://api.github.com/repos/facebook/xcbuild/contributors","subscribers_url":"https://api.github.com/repos/facebook/xcbuild/subscribers","subscription_url":"https://api.github.com/repos/facebook/xcbuild/subscription","commits_url":"https://api.github.com/repos/facebook/xcbuild/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/xcbuild/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/xcbuild/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/xcbuild/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/xcbuild/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/xcbuild/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/xcbuild/merges","archive_url":"https://api.github.com/repos/facebook/xcbuild/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/xcbuild/downloads","issues_url":"https://api.github.com/repos/facebook/xcbuild/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/xcbuild/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/xcbuild/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/xcbuild/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/xcbuild/labels{/name}","releases_url":"https://api.github.com/repos/facebook/xcbuild/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/xcbuild/deployments","created_at":"2015-09-23T18:24:01Z","updated_at":"2016-10-13T09:50:29Z","pushed_at":"2016-10-13T18:28:17Z","git_url":"git://github.com/facebook/xcbuild.git","ssh_url":"git@github.com:facebook/xcbuild.git","clone_url":"https://github.com/facebook/xcbuild.git","svn_url":"https://github.com/facebook/xcbuild","homepage":null,"size":4187,"stargazers_count":1116,"watchers_count":1116,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":33,"forks":63,"open_issues":33,"watchers":1116,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/xcbuild/pulls/155"},"html":{"href":"https://github.com/facebook/xcbuild/pull/155"},"issue":{"href":"https://api.github.com/repos/facebook/xcbuild/issues/155"},"comments":{"href":"https://api.github.com/repos/facebook/xcbuild/issues/155/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/xcbuild/pulls/155/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/xcbuild/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/xcbuild/pulls/155/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/xcbuild/statuses/e12e193552c4386fed7a4fd40342e60e20c8a0fd"}}}}
{"actor":{"display_login":"Ktwu"}}