{"action":"created","comment":{"url":"https://api.github.com/repos/hpicgs/libzeug/pulls/comments/25264624","id":25264624,"diff_hunk":"@@ -0,0 +1,197 @@\n+#include <reflectionzeug/JsonPropertyDeserializer.h>\n+\n+#include <iostream>\n+#include <fstream>\n+\n+#include <loggingzeug/logging.h>\n+\n+#include <reflectionzeug/SetValuePropertyVisitor.h>\n+#include <reflectionzeug/Property.h>\n+#include <reflectionzeug/PropertyGroup.h>\n+#include <reflectionzeug/util.h>\n+\n+using namespace loggingzeug;\n+\n+namespace reflectionzeug\n+{\n+\n+JsonPropertyDeserializer::JsonPropertyDeserializer()\n+:   m_rootGroup(nullptr)\n+{\n+}\n+\n+JsonPropertyDeserializer::~JsonPropertyDeserializer()\n+{\n+}\n+\n+bool JsonPropertyDeserializer::deserialize(PropertyGroup & group, const std::string & filePath)\n+{\n+    std::fstream fstream;\n+    fstream.open(filePath, std::ios_base::in);\n+    if (!fstream.is_open())\n+    {\n+        warning() << \"Could not open file \\\"\" << filePath << \"\\\"\" << std::endl;\n+        return false;\n+    }\n+\n+    bool noErrorsOccured = true;\n+    m_rootGroup = &group;\n+\n+    for (std::string line; std::getline(fstream, line);)\n+    {\n+        if (this->isGroupDeclaration(line))\n+            noErrorsOccured = this->updateCurrentGroup(line) && noErrorsOccured;\n+        else if (this->isGroupEnd(line))\n+            this->endGroup();\n+        else if (this->isPropertyDeclaration(line))\n+            noErrorsOccured = this->setPropertyValue(line) && noErrorsOccured;\n+    }","path":"source/reflectionzeug/source/JsonPropertyDeserializer.cpp","position":48,"original_position":48,"commit_id":"0ba1be7bf5c0cf7d16e5ac461fbff0f3e9c13af6","original_commit_id":"0ba1be7bf5c0cf7d16e5ac461fbff0f3e9c13af6","user":{"login":"cgcostume","id":3909980,"avatar_url":"https://avatars.githubusercontent.com/u/3909980?v=3","gravatar_id":"","url":"https://api.github.com/users/cgcostume","html_url":"https://github.com/cgcostume","followers_url":"https://api.github.com/users/cgcostume/followers","following_url":"https://api.github.com/users/cgcostume/following{/other_user}","gists_url":"https://api.github.com/users/cgcostume/gists{/gist_id}","starred_url":"https://api.github.com/users/cgcostume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgcostume/subscriptions","organizations_url":"https://api.github.com/users/cgcostume/orgs","repos_url":"https://api.github.com/users/cgcostume/repos","events_url":"https://api.github.com/users/cgcostume/events{/privacy}","received_events_url":"https://api.github.com/users/cgcostume/received_events","type":"User","site_admin":false},"body":"it should not be required to use ```this->``` here","created_at":"2015-02-24T16:12:31Z","updated_at":"2015-02-24T16:12:31Z","html_url":"https://github.com/hpicgs/libzeug/pull/112#discussion_r25264624","pull_request_url":"https://api.github.com/repos/hpicgs/libzeug/pulls/112","_links":{"self":{"href":"https://api.github.com/repos/hpicgs/libzeug/pulls/comments/25264624"},"html":{"href":"https://github.com/hpicgs/libzeug/pull/112#discussion_r25264624"},"pull_request":{"href":"https://api.github.com/repos/hpicgs/libzeug/pulls/112"}}},"pull_request":{"url":"https://api.github.com/repos/hpicgs/libzeug/pulls/112","id":29603223,"html_url":"https://github.com/hpicgs/libzeug/pull/112","diff_url":"https://github.com/hpicgs/libzeug/pull/112.diff","patch_url":"https://github.com/hpicgs/libzeug/pull/112.patch","issue_url":"https://api.github.com/repos/hpicgs/libzeug/issues/112","number":112,"state":"closed","locked":false,"title":"Property serializer","user":{"login":"apopiak","id":6952290,"avatar_url":"https://avatars.githubusercontent.com/u/6952290?v=3","gravatar_id":"","url":"https://api.github.com/users/apopiak","html_url":"https://github.com/apopiak","followers_url":"https://api.github.com/users/apopiak/followers","following_url":"https://api.github.com/users/apopiak/following{/other_user}","gists_url":"https://api.github.com/users/apopiak/gists{/gist_id}","starred_url":"https://api.github.com/users/apopiak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apopiak/subscriptions","organizations_url":"https://api.github.com/users/apopiak/orgs","repos_url":"https://api.github.com/users/apopiak/repos","events_url":"https://api.github.com/users/apopiak/events{/privacy}","received_events_url":"https://api.github.com/users/apopiak/received_events","type":"User","site_admin":false},"body":"serialize property values to JSON + populate properties from JSON","created_at":"2015-02-19T11:18:49Z","updated_at":"2015-02-24T16:12:31Z","closed_at":"2015-02-24T15:50:00Z","merged_at":null,"merge_commit_sha":"2af773f5f53cad4163ca22656ad1e9f950d35e7c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hpicgs/libzeug/pulls/112/commits","review_comments_url":"https://api.github.com/repos/hpicgs/libzeug/pulls/112/comments","review_comment_url":"https://api.github.com/repos/hpicgs/libzeug/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpicgs/libzeug/issues/112/comments","statuses_url":"https://api.github.com/repos/hpicgs/libzeug/statuses/0ba1be7bf5c0cf7d16e5ac461fbff0f3e9c13af6","head":{"label":"apopiak:propertySerializer","ref":"propertySerializer","sha":"0ba1be7bf5c0cf7d16e5ac461fbff0f3e9c13af6","user":{"login":"apopiak","id":6952290,"avatar_url":"https://avatars.githubusercontent.com/u/6952290?v=3","gravatar_id":"","url":"https://api.github.com/users/apopiak","html_url":"https://github.com/apopiak","followers_url":"https://api.github.com/users/apopiak/followers","following_url":"https://api.github.com/users/apopiak/following{/other_user}","gists_url":"https://api.github.com/users/apopiak/gists{/gist_id}","starred_url":"https://api.github.com/users/apopiak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apopiak/subscriptions","organizations_url":"https://api.github.com/users/apopiak/orgs","repos_url":"https://api.github.com/users/apopiak/repos","events_url":"https://api.github.com/users/apopiak/events{/privacy}","received_events_url":"https://api.github.com/users/apopiak/received_events","type":"User","site_admin":false},"repo":{"id":30237895,"name":"libzeug","full_name":"apopiak/libzeug","owner":{"login":"apopiak","id":6952290,"avatar_url":"https://avatars.githubusercontent.com/u/6952290?v=3","gravatar_id":"","url":"https://api.github.com/users/apopiak","html_url":"https://github.com/apopiak","followers_url":"https://api.github.com/users/apopiak/followers","following_url":"https://api.github.com/users/apopiak/following{/other_user}","gists_url":"https://api.github.com/users/apopiak/gists{/gist_id}","starred_url":"https://api.github.com/users/apopiak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apopiak/subscriptions","organizations_url":"https://api.github.com/users/apopiak/orgs","repos_url":"https://api.github.com/users/apopiak/repos","events_url":"https://api.github.com/users/apopiak/events{/privacy}","received_events_url":"https://api.github.com/users/apopiak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apopiak/libzeug","description":"C++ sanctuary for small but powerful and frequently required, stand alone features.","fork":true,"url":"https://api.github.com/repos/apopiak/libzeug","forks_url":"https://api.github.com/repos/apopiak/libzeug/forks","keys_url":"https://api.github.com/repos/apopiak/libzeug/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apopiak/libzeug/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apopiak/libzeug/teams","hooks_url":"https://api.github.com/repos/apopiak/libzeug/hooks","issue_events_url":"https://api.github.com/repos/apopiak/libzeug/issues/events{/number}","events_url":"https://api.github.com/repos/apopiak/libzeug/events","assignees_url":"https://api.github.com/repos/apopiak/libzeug/assignees{/user}","branches_url":"https://api.github.com/repos/apopiak/libzeug/branches{/branch}","tags_url":"https://api.github.com/repos/apopiak/libzeug/tags","blobs_url":"https://api.github.com/repos/apopiak/libzeug/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apopiak/libzeug/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apopiak/libzeug/git/refs{/sha}","trees_url":"https://api.github.com/repos/apopiak/libzeug/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apopiak/libzeug/statuses/{sha}","languages_url":"https://api.github.com/repos/apopiak/libzeug/languages","stargazers_url":"https://api.github.com/repos/apopiak/libzeug/stargazers","contributors_url":"https://api.github.com/repos/apopiak/libzeug/contributors","subscribers_url":"https://api.github.com/repos/apopiak/libzeug/subscribers","subscription_url":"https://api.github.com/repos/apopiak/libzeug/subscription","commits_url":"https://api.github.com/repos/apopiak/libzeug/commits{/sha}","git_commits_url":"https://api.github.com/repos/apopiak/libzeug/git/commits{/sha}","comments_url":"https://api.github.com/repos/apopiak/libzeug/comments{/number}","issue_comment_url":"https://api.github.com/repos/apopiak/libzeug/issues/comments{/number}","contents_url":"https://api.github.com/repos/apopiak/libzeug/contents/{+path}","compare_url":"https://api.github.com/repos/apopiak/libzeug/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apopiak/libzeug/merges","archive_url":"https://api.github.com/repos/apopiak/libzeug/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apopiak/libzeug/downloads","issues_url":"https://api.github.com/repos/apopiak/libzeug/issues{/number}","pulls_url":"https://api.github.com/repos/apopiak/libzeug/pulls{/number}","milestones_url":"https://api.github.com/repos/apopiak/libzeug/milestones{/number}","notifications_url":"https://api.github.com/repos/apopiak/libzeug/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apopiak/libzeug/labels{/name}","releases_url":"https://api.github.com/repos/apopiak/libzeug/releases{/id}","created_at":"2015-02-03T10:40:54Z","updated_at":"2015-02-03T10:40:55Z","pushed_at":"2015-02-19T11:15:10Z","git_url":"git://github.com/apopiak/libzeug.git","ssh_url":"git@github.com:apopiak/libzeug.git","clone_url":"https://github.com/apopiak/libzeug.git","svn_url":"https://github.com/apopiak/libzeug","homepage":"","size":2395,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hpicgs:master","ref":"master","sha":"d898b03a66c006431c07ceda549a9332162f5c8c","user":{"login":"hpicgs","id":5174012,"avatar_url":"https://avatars.githubusercontent.com/u/5174012?v=3","gravatar_id":"","url":"https://api.github.com/users/hpicgs","html_url":"https://github.com/hpicgs","followers_url":"https://api.github.com/users/hpicgs/followers","following_url":"https://api.github.com/users/hpicgs/following{/other_user}","gists_url":"https://api.github.com/users/hpicgs/gists{/gist_id}","starred_url":"https://api.github.com/users/hpicgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpicgs/subscriptions","organizations_url":"https://api.github.com/users/hpicgs/orgs","repos_url":"https://api.github.com/users/hpicgs/repos","events_url":"https://api.github.com/users/hpicgs/events{/privacy}","received_events_url":"https://api.github.com/users/hpicgs/received_events","type":"Organization","site_admin":false},"repo":{"id":11925159,"name":"libzeug","full_name":"hpicgs/libzeug","owner":{"login":"hpicgs","id":5174012,"avatar_url":"https://avatars.githubusercontent.com/u/5174012?v=3","gravatar_id":"","url":"https://api.github.com/users/hpicgs","html_url":"https://github.com/hpicgs","followers_url":"https://api.github.com/users/hpicgs/followers","following_url":"https://api.github.com/users/hpicgs/following{/other_user}","gists_url":"https://api.github.com/users/hpicgs/gists{/gist_id}","starred_url":"https://api.github.com/users/hpicgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpicgs/subscriptions","organizations_url":"https://api.github.com/users/hpicgs/orgs","repos_url":"https://api.github.com/users/hpicgs/repos","events_url":"https://api.github.com/users/hpicgs/events{/privacy}","received_events_url":"https://api.github.com/users/hpicgs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpicgs/libzeug","description":"C++ sanctuary for small but powerful and frequently required, stand alone features.","fork":false,"url":"https://api.github.com/repos/hpicgs/libzeug","forks_url":"https://api.github.com/repos/hpicgs/libzeug/forks","keys_url":"https://api.github.com/repos/hpicgs/libzeug/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpicgs/libzeug/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpicgs/libzeug/teams","hooks_url":"https://api.github.com/repos/hpicgs/libzeug/hooks","issue_events_url":"https://api.github.com/repos/hpicgs/libzeug/issues/events{/number}","events_url":"https://api.github.com/repos/hpicgs/libzeug/events","assignees_url":"https://api.github.com/repos/hpicgs/libzeug/assignees{/user}","branches_url":"https://api.github.com/repos/hpicgs/libzeug/branches{/branch}","tags_url":"https://api.github.com/repos/hpicgs/libzeug/tags","blobs_url":"https://api.github.com/repos/hpicgs/libzeug/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpicgs/libzeug/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpicgs/libzeug/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpicgs/libzeug/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpicgs/libzeug/statuses/{sha}","languages_url":"https://api.github.com/repos/hpicgs/libzeug/languages","stargazers_url":"https://api.github.com/repos/hpicgs/libzeug/stargazers","contributors_url":"https://api.github.com/repos/hpicgs/libzeug/contributors","subscribers_url":"https://api.github.com/repos/hpicgs/libzeug/subscribers","subscription_url":"https://api.github.com/repos/hpicgs/libzeug/subscription","commits_url":"https://api.github.com/repos/hpicgs/libzeug/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpicgs/libzeug/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpicgs/libzeug/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpicgs/libzeug/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpicgs/libzeug/contents/{+path}","compare_url":"https://api.github.com/repos/hpicgs/libzeug/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpicgs/libzeug/merges","archive_url":"https://api.github.com/repos/hpicgs/libzeug/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpicgs/libzeug/downloads","issues_url":"https://api.github.com/repos/hpicgs/libzeug/issues{/number}","pulls_url":"https://api.github.com/repos/hpicgs/libzeug/pulls{/number}","milestones_url":"https://api.github.com/repos/hpicgs/libzeug/milestones{/number}","notifications_url":"https://api.github.com/repos/hpicgs/libzeug/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpicgs/libzeug/labels{/name}","releases_url":"https://api.github.com/repos/hpicgs/libzeug/releases{/id}","created_at":"2013-08-06T13:50:07Z","updated_at":"2015-02-24T13:56:30Z","pushed_at":"2015-02-24T14:08:35Z","git_url":"git://github.com/hpicgs/libzeug.git","ssh_url":"git@github.com:hpicgs/libzeug.git","clone_url":"https://github.com/hpicgs/libzeug.git","svn_url":"https://github.com/hpicgs/libzeug","homepage":"","size":4738,"stargazers_count":5,"watchers_count":5,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":19,"forks":5,"open_issues":19,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpicgs/libzeug/pulls/112"},"html":{"href":"https://github.com/hpicgs/libzeug/pull/112"},"issue":{"href":"https://api.github.com/repos/hpicgs/libzeug/issues/112"},"comments":{"href":"https://api.github.com/repos/hpicgs/libzeug/issues/112/comments"},"review_comments":{"href":"https://api.github.com/repos/hpicgs/libzeug/pulls/112/comments"},"review_comment":{"href":"https://api.github.com/repos/hpicgs/libzeug/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpicgs/libzeug/pulls/112/commits"},"statuses":{"href":"https://api.github.com/repos/hpicgs/libzeug/statuses/0ba1be7bf5c0cf7d16e5ac461fbff0f3e9c13af6"}}}}