{"action":"created","comment":{"url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/22401955","id":22401955,"diff_hunk":"@@ -0,0 +1,74 @@\n+/*\n+ * This library is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU Lesser General Public\n+ * License as published by the Free Software Foundation; either\n+ * version 2.1 of the License, or (at your option) any later version.\n+ *\n+ * This library is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+ * Lesser General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public\n+ * License along with this library; if not, write to the Free Software\n+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n+ *\n+ * Format.cpp\n+ * Formatting functions for basic types.\n+ * Copyright (C) 2005 Simon Newton\n+ */\n+\n+#include \"ola/strings/Format.h\"\n+\n+#include <iomanip>\n+#include <sstream>\n+#include <string>\n+\n+namespace ola {\n+namespace strings {\n+\n+using std::endl;\n+using std::ostringstream;\n+using std::string;\n+\n+string IntToString(int i) {\n+  ostringstream str;\n+  str << i;\n+  return str.str();\n+}\n+\n+string IntToString(unsigned int i) {\n+  ostringstream str;\n+  str << i;\n+  return str.str();\n+}\n+\n+void FormatData(std::ostream *out,\n+                const uint8_t *data,\n+                unsigned int length,\n+                unsigned int indent,\n+                unsigned int byte_per_line) {\n+  ostringstream raw, ascii;\n+  raw << std::setw(2) << std::hex;\n+  for (unsigned int i = 0; i != length; i++) {\n+    raw << std::setfill('0') << std::setw(2) <<\n+        static_cast<unsigned int>(data[i]) << \" \";\n+    if (isprint(data[i]))","path":"common/strings/Format.cpp","position":56,"original_position":56,"commit_id":"0dd10bacfcfd568d89567e7a14b7a2bb28d3baee","original_commit_id":"0dd10bacfcfd568d89567e7a14b7a2bb28d3baee","user":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2015-01-01T20:01:08Z","updated_at":"2015-01-01T20:01:08Z","html_url":"https://github.com/OpenLightingProject/ola/pull/586#discussion_r22401955","pull_request_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/586","_links":{"self":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/22401955"},"html":{"href":"https://github.com/OpenLightingProject/ola/pull/586#discussion_r22401955"},"pull_request":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/586"}}},"pull_request":{"url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/586","id":26731801,"html_url":"https://github.com/OpenLightingProject/ola/pull/586","diff_url":"https://github.com/OpenLightingProject/ola/pull/586.diff","patch_url":"https://github.com/OpenLightingProject/ola/pull/586.patch","issue_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/586","number":586,"state":"open","locked":false,"title":"Refactor string functions, fix many defects.","user":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-12-31T18:36:30Z","updated_at":"2015-01-01T20:01:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b22c60ea81e8ace2631051f1f80ca9e57fc32a39","assignee":{"login":"peternewman","id":6216436,"avatar_url":"https://avatars.githubusercontent.com/u/6216436?v=3","gravatar_id":"","url":"https://api.github.com/users/peternewman","html_url":"https://github.com/peternewman","followers_url":"https://api.github.com/users/peternewman/followers","following_url":"https://api.github.com/users/peternewman/following{/other_user}","gists_url":"https://api.github.com/users/peternewman/gists{/gist_id}","starred_url":"https://api.github.com/users/peternewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peternewman/subscriptions","organizations_url":"https://api.github.com/users/peternewman/orgs","repos_url":"https://api.github.com/users/peternewman/repos","events_url":"https://api.github.com/users/peternewman/events{/privacy}","received_events_url":"https://api.github.com/users/peternewman/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/586/commits","review_comments_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/586/comments","review_comment_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/586/comments","statuses_url":"https://api.github.com/repos/OpenLightingProject/ola/statuses/0dd10bacfcfd568d89567e7a14b7a2bb28d3baee","head":{"label":"nomis52:master","ref":"master","sha":"0dd10bacfcfd568d89567e7a14b7a2bb28d3baee","user":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"repo":{"id":15822023,"name":"ola","full_name":"nomis52/ola","owner":{"login":"nomis52","id":4355332,"avatar_url":"https://avatars.githubusercontent.com/u/4355332?v=3","gravatar_id":"","url":"https://api.github.com/users/nomis52","html_url":"https://github.com/nomis52","followers_url":"https://api.github.com/users/nomis52/followers","following_url":"https://api.github.com/users/nomis52/following{/other_user}","gists_url":"https://api.github.com/users/nomis52/gists{/gist_id}","starred_url":"https://api.github.com/users/nomis52/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nomis52/subscriptions","organizations_url":"https://api.github.com/users/nomis52/orgs","repos_url":"https://api.github.com/users/nomis52/repos","events_url":"https://api.github.com/users/nomis52/events{/privacy}","received_events_url":"https://api.github.com/users/nomis52/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nomis52/ola","description":"The Open Lighting Architecture","fork":true,"url":"https://api.github.com/repos/nomis52/ola","forks_url":"https://api.github.com/repos/nomis52/ola/forks","keys_url":"https://api.github.com/repos/nomis52/ola/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nomis52/ola/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nomis52/ola/teams","hooks_url":"https://api.github.com/repos/nomis52/ola/hooks","issue_events_url":"https://api.github.com/repos/nomis52/ola/issues/events{/number}","events_url":"https://api.github.com/repos/nomis52/ola/events","assignees_url":"https://api.github.com/repos/nomis52/ola/assignees{/user}","branches_url":"https://api.github.com/repos/nomis52/ola/branches{/branch}","tags_url":"https://api.github.com/repos/nomis52/ola/tags","blobs_url":"https://api.github.com/repos/nomis52/ola/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nomis52/ola/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nomis52/ola/git/refs{/sha}","trees_url":"https://api.github.com/repos/nomis52/ola/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nomis52/ola/statuses/{sha}","languages_url":"https://api.github.com/repos/nomis52/ola/languages","stargazers_url":"https://api.github.com/repos/nomis52/ola/stargazers","contributors_url":"https://api.github.com/repos/nomis52/ola/contributors","subscribers_url":"https://api.github.com/repos/nomis52/ola/subscribers","subscription_url":"https://api.github.com/repos/nomis52/ola/subscription","commits_url":"https://api.github.com/repos/nomis52/ola/commits{/sha}","git_commits_url":"https://api.github.com/repos/nomis52/ola/git/commits{/sha}","comments_url":"https://api.github.com/repos/nomis52/ola/comments{/number}","issue_comment_url":"https://api.github.com/repos/nomis52/ola/issues/comments/{number}","contents_url":"https://api.github.com/repos/nomis52/ola/contents/{+path}","compare_url":"https://api.github.com/repos/nomis52/ola/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nomis52/ola/merges","archive_url":"https://api.github.com/repos/nomis52/ola/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nomis52/ola/downloads","issues_url":"https://api.github.com/repos/nomis52/ola/issues{/number}","pulls_url":"https://api.github.com/repos/nomis52/ola/pulls{/number}","milestones_url":"https://api.github.com/repos/nomis52/ola/milestones{/number}","notifications_url":"https://api.github.com/repos/nomis52/ola/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nomis52/ola/labels{/name}","releases_url":"https://api.github.com/repos/nomis52/ola/releases{/id}","created_at":"2014-01-11T12:21:27Z","updated_at":"2014-12-31T20:23:21Z","pushed_at":"2014-12-31T20:23:21Z","git_url":"git://github.com/nomis52/ola.git","ssh_url":"git@github.com:nomis52/ola.git","clone_url":"https://github.com/nomis52/ola.git","svn_url":"https://github.com/nomis52/ola","homepage":null,"size":16240,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenLightingProject:master","ref":"master","sha":"d76d7a0b73e78c541b03333f4dc768fd9f447d1a","user":{"login":"OpenLightingProject","id":6199314,"avatar_url":"https://avatars.githubusercontent.com/u/6199314?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenLightingProject","html_url":"https://github.com/OpenLightingProject","followers_url":"https://api.github.com/users/OpenLightingProject/followers","following_url":"https://api.github.com/users/OpenLightingProject/following{/other_user}","gists_url":"https://api.github.com/users/OpenLightingProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenLightingProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenLightingProject/subscriptions","organizations_url":"https://api.github.com/users/OpenLightingProject/orgs","repos_url":"https://api.github.com/users/OpenLightingProject/repos","events_url":"https://api.github.com/users/OpenLightingProject/events{/privacy}","received_events_url":"https://api.github.com/users/OpenLightingProject/received_events","type":"Organization","site_admin":false},"repo":{"id":15233168,"name":"ola","full_name":"OpenLightingProject/ola","owner":{"login":"OpenLightingProject","id":6199314,"avatar_url":"https://avatars.githubusercontent.com/u/6199314?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenLightingProject","html_url":"https://github.com/OpenLightingProject","followers_url":"https://api.github.com/users/OpenLightingProject/followers","following_url":"https://api.github.com/users/OpenLightingProject/following{/other_user}","gists_url":"https://api.github.com/users/OpenLightingProject/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenLightingProject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenLightingProject/subscriptions","organizations_url":"https://api.github.com/users/OpenLightingProject/orgs","repos_url":"https://api.github.com/users/OpenLightingProject/repos","events_url":"https://api.github.com/users/OpenLightingProject/events{/privacy}","received_events_url":"https://api.github.com/users/OpenLightingProject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenLightingProject/ola","description":"The Open Lighting Architecture","fork":false,"url":"https://api.github.com/repos/OpenLightingProject/ola","forks_url":"https://api.github.com/repos/OpenLightingProject/ola/forks","keys_url":"https://api.github.com/repos/OpenLightingProject/ola/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenLightingProject/ola/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenLightingProject/ola/teams","hooks_url":"https://api.github.com/repos/OpenLightingProject/ola/hooks","issue_events_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/events{/number}","events_url":"https://api.github.com/repos/OpenLightingProject/ola/events","assignees_url":"https://api.github.com/repos/OpenLightingProject/ola/assignees{/user}","branches_url":"https://api.github.com/repos/OpenLightingProject/ola/branches{/branch}","tags_url":"https://api.github.com/repos/OpenLightingProject/ola/tags","blobs_url":"https://api.github.com/repos/OpenLightingProject/ola/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenLightingProject/ola/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenLightingProject/ola/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenLightingProject/ola/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenLightingProject/ola/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenLightingProject/ola/languages","stargazers_url":"https://api.github.com/repos/OpenLightingProject/ola/stargazers","contributors_url":"https://api.github.com/repos/OpenLightingProject/ola/contributors","subscribers_url":"https://api.github.com/repos/OpenLightingProject/ola/subscribers","subscription_url":"https://api.github.com/repos/OpenLightingProject/ola/subscription","commits_url":"https://api.github.com/repos/OpenLightingProject/ola/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenLightingProject/ola/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenLightingProject/ola/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenLightingProject/ola/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenLightingProject/ola/contents/{+path}","compare_url":"https://api.github.com/repos/OpenLightingProject/ola/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenLightingProject/ola/merges","archive_url":"https://api.github.com/repos/OpenLightingProject/ola/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenLightingProject/ola/downloads","issues_url":"https://api.github.com/repos/OpenLightingProject/ola/issues{/number}","pulls_url":"https://api.github.com/repos/OpenLightingProject/ola/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenLightingProject/ola/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenLightingProject/ola/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenLightingProject/ola/labels{/name}","releases_url":"https://api.github.com/repos/OpenLightingProject/ola/releases{/id}","created_at":"2013-12-16T18:06:52Z","updated_at":"2014-12-31T16:27:52Z","pushed_at":"2014-12-31T16:27:50Z","git_url":"git://github.com/OpenLightingProject/ola.git","ssh_url":"git@github.com:OpenLightingProject/ola.git","clone_url":"https://github.com/OpenLightingProject/ola.git","svn_url":"https://github.com/OpenLightingProject/ola","homepage":null,"size":19316,"stargazers_count":61,"watchers_count":61,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":32,"mirror_url":null,"open_issues_count":72,"forks":32,"open_issues":72,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/586"},"html":{"href":"https://github.com/OpenLightingProject/ola/pull/586"},"issue":{"href":"https://api.github.com/repos/OpenLightingProject/ola/issues/586"},"comments":{"href":"https://api.github.com/repos/OpenLightingProject/ola/issues/586/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/586/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenLightingProject/ola/pulls/586/commits"},"statuses":{"href":"https://api.github.com/repos/OpenLightingProject/ola/statuses/0dd10bacfcfd568d89567e7a14b7a2bb28d3baee"}}}}