{"action":"created","comment":{"url":"https://api.github.com/repos/ubtue/ub_tools/pulls/comments/79334720","id":79334720,"diff_hunk":"@@ -0,0 +1,262 @@\n+//\n+// Created by quboo01 on 13.09.16.\n+//\n+#include <iostream>\n+#include <string>\n+#include <vector>\n+\n+#include \"util.h\"\n+#include \"File.h\"\n+#include \"MarcUtil.h\"\n+#include \"MarcWriter.h\"\n+#include \"MarcRecord.h\"\n+#include \"MarcReader.h\"\n+#include \"MarcWriter.h\"\n+#include \"WallClockTimer.h\"\n+\n+void Usage() {\n+    std::cerr << \"usage: \" << progname << \" marc_input marc_output\\n\";\n+\n+    std::exit(EXIT_FAILURE);\n+}\n+\n+static const size_t INSERTED_FIELDS_COUNT = 20;\n+\n+MarcRecord testMarc21(File * const input) {\n+    MarcRecord record = MarcReader::Read(input);\n+    if (not record) { return record; }\n+\n+    record.getControlNumber();\n+    record.getFieldIndex(\"689\");\n+    record.extractFirstSubfield(\"689\", 't');\n+\n+    std::vector<std::string> vector;\n+    size_t count = record.extractAllSubfields(\"100\", &vector, \"a0\");\n+\n+    count = record.extractSubfield(\"689\", '0', &vector);\n+\n+    count = record.extractSubfields(\"689\", \"02\", &vector);\n+\n+    std::vector<std::pair<size_t, size_t>> LOKs;\n+    count = record.findAllLocalDataBlocks(&LOKs);\n+\n+    if (count > 0) {\n+        std::vector <size_t> indizes;\n+        count = record.findFieldsInLocalBlock(\"852\", \"?1\", LOKs[0], &indizes);\n+    }\n+\n+    record.filterTags({\"LOK\"});\n+    count = record.findAllLocalDataBlocks(&LOKs);\n+\n+    Subfields subfields('x', 'y');\n+    subfields.addSubfield('a', \"Test\");\n+    ssize_t index = record.insertField(\"TST\", subfields.toString());\n+    record.extractFirstSubfield(\"TST\", 'a');\n+\n+    Subfields newSubfields('a', 'b');\n+    newSubfields.addSubfield('a', \"FooBar\");\n+    record.updateField(index, newSubfields.toString());\n+    record.extractFirstSubfield(\"TST\", 'a');\n+\n+    record.deleteField(index);\n+    record.getFieldIndex(\"TST\");\n+\n+    for (size_t i = 0; i < INSERTED_FIELDS_COUNT; ++i) {\n+        record.insertField(\"TST\", subfields.toString());\n+    }\n+\n+    return record;\n+}\n+\n+MarcUtil::Record testOldRecord(File * const input) {\n+    MarcUtil::Record record = MarcUtil::Record::BinaryFactory(input);\n+    if (not record) { return record; }\n+\n+    record.getControlNumber();\n+    record.getFieldIndex(\"689\");\n+    record.extractFirstSubfield(\"689\", 't');\n+\n+    std::vector<std::string> vector;\n+    size_t count = record.extractAllSubfields(\"100\", &vector, \"a0\");\n+\n+    count = record.extractSubfield(\"689\", '0', &vector);\n+\n+    count = record.extractSubfields(\"689\", \"02\", &vector);\n+\n+    std::vector<std::pair<size_t, size_t>> LOKs;\n+    count = record.findAllLocalDataBlocks(&LOKs);\n+\n+    if (count > 0) {\n+        std::vector <size_t> indizes;\n+        count = record.findFieldsInLocalBlock(\"852\", \"?1\", LOKs[0], &indizes);\n+    }\n+\n+    record.filterTags({\"LOK\"});\n+    count = record.findAllLocalDataBlocks(&LOKs);\n+\n+    Subfields subfields('x', 'y');\n+    subfields.addSubfield('a', \"Test\");\n+    record.insertField(\"TST\", subfields.toString());\n+    ssize_t index = record.getFieldIndex(\"TST\");\n+    record.extractFirstSubfield(\"TST\", 'a');\n+\n+    Subfields newSubfields('a', 'b');\n+    newSubfields.addSubfield('a', \"FooBar\");\n+    record.updateField(index, newSubfields.toString());\n+    record.extractFirstSubfield(\"TST\", 'a');\n+    record.getFieldIndex(\"TST\");\n+\n+    record.deleteField(index);\n+    record.getFieldIndex(\"TST\");\n+\n+    for (size_t i = 0; i < INSERTED_FIELDS_COUNT; ++i) {\n+        record.insertField(\"TST\", subfields.toString());\n+    }\n+\n+    return record;\n+}\n+\n+void speedTest(const std::string &inputFile) {","path":"cpp/Marc21Tests.cc","position":119,"original_position":119,"commit_id":"a86d86ec5662ee3d6d79a676003c4edb0214ee9f","original_commit_id":"a86d86ec5662ee3d6d79a676003c4edb0214ee9f","user":{"login":"ruschein","id":991243,"avatar_url":"https://avatars.githubusercontent.com/u/991243?v=3","gravatar_id":"","url":"https://api.github.com/users/ruschein","html_url":"https://github.com/ruschein","followers_url":"https://api.github.com/users/ruschein/followers","following_url":"https://api.github.com/users/ruschein/following{/other_user}","gists_url":"https://api.github.com/users/ruschein/gists{/gist_id}","starred_url":"https://api.github.com/users/ruschein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruschein/subscriptions","organizations_url":"https://api.github.com/users/ruschein/orgs","repos_url":"https://api.github.com/users/ruschein/repos","events_url":"https://api.github.com/users/ruschein/events{/privacy}","received_events_url":"https://api.github.com/users/ruschein/received_events","type":"User","site_admin":false},"body":"Variable names, including dummy argument names should be lowercase with underscores.","created_at":"2016-09-19T06:59:44Z","updated_at":"2016-09-19T06:59:45Z","html_url":"https://github.com/ubtue/ub_tools/pull/534#discussion_r79334720","pull_request_url":"https://api.github.com/repos/ubtue/ub_tools/pulls/534","_links":{"self":{"href":"https://api.github.com/repos/ubtue/ub_tools/pulls/comments/79334720"},"html":{"href":"https://github.com/ubtue/ub_tools/pull/534#discussion_r79334720"},"pull_request":{"href":"https://api.github.com/repos/ubtue/ub_tools/pulls/534"}}},"pull_request":{"url":"https://api.github.com/repos/ubtue/ub_tools/pulls/534","id":85724500,"html_url":"https://github.com/ubtue/ub_tools/pull/534","diff_url":"https://github.com/ubtue/ub_tools/pull/534.diff","patch_url":"https://github.com/ubtue/ub_tools/pull/534.patch","issue_url":"https://api.github.com/repos/ubtue/ub_tools/issues/534","number":534,"state":"open","locked":false,"title":"Obenland","user":{"login":"oobenland","id":1352796,"avatar_url":"https://avatars.githubusercontent.com/u/1352796?v=3","gravatar_id":"","url":"https://api.github.com/users/oobenland","html_url":"https://github.com/oobenland","followers_url":"https://api.github.com/users/oobenland/followers","following_url":"https://api.github.com/users/oobenland/following{/other_user}","gists_url":"https://api.github.com/users/oobenland/gists{/gist_id}","starred_url":"https://api.github.com/users/oobenland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oobenland/subscriptions","organizations_url":"https://api.github.com/users/oobenland/orgs","repos_url":"https://api.github.com/users/oobenland/repos","events_url":"https://api.github.com/users/oobenland/events{/privacy}","received_events_url":"https://api.github.com/users/oobenland/received_events","type":"User","site_admin":false},"body":"Was noch zu tun ist:\r\n- add_author_synonyms findet keine Synonyme\r\n- extract_normdata_translations funktioniert nicht immer korrekt (siehe FIXME)\r\n- ixtheo_marc_pipeline_fifo.sh ist noch nicht angepasst","created_at":"2016-09-18T21:59:58Z","updated_at":"2016-09-19T06:59:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c37eb0d8c0195b9ec34cb8eeb97719f70512f69","assignee":{"login":"ruschein","id":991243,"avatar_url":"https://avatars.githubusercontent.com/u/991243?v=3","gravatar_id":"","url":"https://api.github.com/users/ruschein","html_url":"https://github.com/ruschein","followers_url":"https://api.github.com/users/ruschein/followers","following_url":"https://api.github.com/users/ruschein/following{/other_user}","gists_url":"https://api.github.com/users/ruschein/gists{/gist_id}","starred_url":"https://api.github.com/users/ruschein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruschein/subscriptions","organizations_url":"https://api.github.com/users/ruschein/orgs","repos_url":"https://api.github.com/users/ruschein/repos","events_url":"https://api.github.com/users/ruschein/events{/privacy}","received_events_url":"https://api.github.com/users/ruschein/received_events","type":"User","site_admin":false},"assignees":[{"login":"ruschein","id":991243,"avatar_url":"https://avatars.githubusercontent.com/u/991243?v=3","gravatar_id":"","url":"https://api.github.com/users/ruschein","html_url":"https://github.com/ruschein","followers_url":"https://api.github.com/users/ruschein/followers","following_url":"https://api.github.com/users/ruschein/following{/other_user}","gists_url":"https://api.github.com/users/ruschein/gists{/gist_id}","starred_url":"https://api.github.com/users/ruschein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruschein/subscriptions","organizations_url":"https://api.github.com/users/ruschein/orgs","repos_url":"https://api.github.com/users/ruschein/repos","events_url":"https://api.github.com/users/ruschein/events{/privacy}","received_events_url":"https://api.github.com/users/ruschein/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ubtue/ub_tools/pulls/534/commits","review_comments_url":"https://api.github.com/repos/ubtue/ub_tools/pulls/534/comments","review_comment_url":"https://api.github.com/repos/ubtue/ub_tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ubtue/ub_tools/issues/534/comments","statuses_url":"https://api.github.com/repos/ubtue/ub_tools/statuses/a86d86ec5662ee3d6d79a676003c4edb0214ee9f","head":{"label":"ubtue:obenland","ref":"obenland","sha":"a86d86ec5662ee3d6d79a676003c4edb0214ee9f","user":{"login":"ubtue","id":12495698,"avatar_url":"https://avatars.githubusercontent.com/u/12495698?v=3","gravatar_id":"","url":"https://api.github.com/users/ubtue","html_url":"https://github.com/ubtue","followers_url":"https://api.github.com/users/ubtue/followers","following_url":"https://api.github.com/users/ubtue/following{/other_user}","gists_url":"https://api.github.com/users/ubtue/gists{/gist_id}","starred_url":"https://api.github.com/users/ubtue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubtue/subscriptions","organizations_url":"https://api.github.com/users/ubtue/orgs","repos_url":"https://api.github.com/users/ubtue/repos","events_url":"https://api.github.com/users/ubtue/events{/privacy}","received_events_url":"https://api.github.com/users/ubtue/received_events","type":"Organization","site_admin":false},"repo":{"id":35827831,"name":"ub_tools","full_name":"ubtue/ub_tools","owner":{"login":"ubtue","id":12495698,"avatar_url":"https://avatars.githubusercontent.com/u/12495698?v=3","gravatar_id":"","url":"https://api.github.com/users/ubtue","html_url":"https://github.com/ubtue","followers_url":"https://api.github.com/users/ubtue/followers","following_url":"https://api.github.com/users/ubtue/following{/other_user}","gists_url":"https://api.github.com/users/ubtue/gists{/gist_id}","starred_url":"https://api.github.com/users/ubtue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubtue/subscriptions","organizations_url":"https://api.github.com/users/ubtue/orgs","repos_url":"https://api.github.com/users/ubtue/repos","events_url":"https://api.github.com/users/ubtue/events{/privacy}","received_events_url":"https://api.github.com/users/ubtue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubtue/ub_tools","description":"Various C++ utility programs typically relating to MARC 21 manipulation.","fork":false,"url":"https://api.github.com/repos/ubtue/ub_tools","forks_url":"https://api.github.com/repos/ubtue/ub_tools/forks","keys_url":"https://api.github.com/repos/ubtue/ub_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubtue/ub_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubtue/ub_tools/teams","hooks_url":"https://api.github.com/repos/ubtue/ub_tools/hooks","issue_events_url":"https://api.github.com/repos/ubtue/ub_tools/issues/events{/number}","events_url":"https://api.github.com/repos/ubtue/ub_tools/events","assignees_url":"https://api.github.com/repos/ubtue/ub_tools/assignees{/user}","branches_url":"https://api.github.com/repos/ubtue/ub_tools/branches{/branch}","tags_url":"https://api.github.com/repos/ubtue/ub_tools/tags","blobs_url":"https://api.github.com/repos/ubtue/ub_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubtue/ub_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubtue/ub_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubtue/ub_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubtue/ub_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/ubtue/ub_tools/languages","stargazers_url":"https://api.github.com/repos/ubtue/ub_tools/stargazers","contributors_url":"https://api.github.com/repos/ubtue/ub_tools/contributors","subscribers_url":"https://api.github.com/repos/ubtue/ub_tools/subscribers","subscription_url":"https://api.github.com/repos/ubtue/ub_tools/subscription","commits_url":"https://api.github.com/repos/ubtue/ub_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubtue/ub_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubtue/ub_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubtue/ub_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubtue/ub_tools/contents/{+path}","compare_url":"https://api.github.com/repos/ubtue/ub_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubtue/ub_tools/merges","archive_url":"https://api.github.com/repos/ubtue/ub_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubtue/ub_tools/downloads","issues_url":"https://api.github.com/repos/ubtue/ub_tools/issues{/number}","pulls_url":"https://api.github.com/repos/ubtue/ub_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/ubtue/ub_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/ubtue/ub_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubtue/ub_tools/labels{/name}","releases_url":"https://api.github.com/repos/ubtue/ub_tools/releases{/id}","deployments_url":"https://api.github.com/repos/ubtue/ub_tools/deployments","created_at":"2015-05-18T16:02:47Z","updated_at":"2016-07-12T15:32:09Z","pushed_at":"2016-09-18T21:59:59Z","git_url":"git://github.com/ubtue/ub_tools.git","ssh_url":"git@github.com:ubtue/ub_tools.git","clone_url":"https://github.com/ubtue/ub_tools.git","svn_url":"https://github.com/ubtue/ub_tools","homepage":null,"size":68399,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"ubtue:master","ref":"master","sha":"763879f2ee2b4eb03695e7dbe7e37d7afd872d35","user":{"login":"ubtue","id":12495698,"avatar_url":"https://avatars.githubusercontent.com/u/12495698?v=3","gravatar_id":"","url":"https://api.github.com/users/ubtue","html_url":"https://github.com/ubtue","followers_url":"https://api.github.com/users/ubtue/followers","following_url":"https://api.github.com/users/ubtue/following{/other_user}","gists_url":"https://api.github.com/users/ubtue/gists{/gist_id}","starred_url":"https://api.github.com/users/ubtue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubtue/subscriptions","organizations_url":"https://api.github.com/users/ubtue/orgs","repos_url":"https://api.github.com/users/ubtue/repos","events_url":"https://api.github.com/users/ubtue/events{/privacy}","received_events_url":"https://api.github.com/users/ubtue/received_events","type":"Organization","site_admin":false},"repo":{"id":35827831,"name":"ub_tools","full_name":"ubtue/ub_tools","owner":{"login":"ubtue","id":12495698,"avatar_url":"https://avatars.githubusercontent.com/u/12495698?v=3","gravatar_id":"","url":"https://api.github.com/users/ubtue","html_url":"https://github.com/ubtue","followers_url":"https://api.github.com/users/ubtue/followers","following_url":"https://api.github.com/users/ubtue/following{/other_user}","gists_url":"https://api.github.com/users/ubtue/gists{/gist_id}","starred_url":"https://api.github.com/users/ubtue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubtue/subscriptions","organizations_url":"https://api.github.com/users/ubtue/orgs","repos_url":"https://api.github.com/users/ubtue/repos","events_url":"https://api.github.com/users/ubtue/events{/privacy}","received_events_url":"https://api.github.com/users/ubtue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubtue/ub_tools","description":"Various C++ utility programs typically relating to MARC 21 manipulation.","fork":false,"url":"https://api.github.com/repos/ubtue/ub_tools","forks_url":"https://api.github.com/repos/ubtue/ub_tools/forks","keys_url":"https://api.github.com/repos/ubtue/ub_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubtue/ub_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubtue/ub_tools/teams","hooks_url":"https://api.github.com/repos/ubtue/ub_tools/hooks","issue_events_url":"https://api.github.com/repos/ubtue/ub_tools/issues/events{/number}","events_url":"https://api.github.com/repos/ubtue/ub_tools/events","assignees_url":"https://api.github.com/repos/ubtue/ub_tools/assignees{/user}","branches_url":"https://api.github.com/repos/ubtue/ub_tools/branches{/branch}","tags_url":"https://api.github.com/repos/ubtue/ub_tools/tags","blobs_url":"https://api.github.com/repos/ubtue/ub_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubtue/ub_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubtue/ub_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubtue/ub_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubtue/ub_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/ubtue/ub_tools/languages","stargazers_url":"https://api.github.com/repos/ubtue/ub_tools/stargazers","contributors_url":"https://api.github.com/repos/ubtue/ub_tools/contributors","subscribers_url":"https://api.github.com/repos/ubtue/ub_tools/subscribers","subscription_url":"https://api.github.com/repos/ubtue/ub_tools/subscription","commits_url":"https://api.github.com/repos/ubtue/ub_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubtue/ub_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubtue/ub_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubtue/ub_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubtue/ub_tools/contents/{+path}","compare_url":"https://api.github.com/repos/ubtue/ub_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubtue/ub_tools/merges","archive_url":"https://api.github.com/repos/ubtue/ub_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubtue/ub_tools/downloads","issues_url":"https://api.github.com/repos/ubtue/ub_tools/issues{/number}","pulls_url":"https://api.github.com/repos/ubtue/ub_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/ubtue/ub_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/ubtue/ub_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubtue/ub_tools/labels{/name}","releases_url":"https://api.github.com/repos/ubtue/ub_tools/releases{/id}","deployments_url":"https://api.github.com/repos/ubtue/ub_tools/deployments","created_at":"2015-05-18T16:02:47Z","updated_at":"2016-07-12T15:32:09Z","pushed_at":"2016-09-18T21:59:59Z","git_url":"git://github.com/ubtue/ub_tools.git","ssh_url":"git@github.com:ubtue/ub_tools.git","clone_url":"https://github.com/ubtue/ub_tools.git","svn_url":"https://github.com/ubtue/ub_tools","homepage":null,"size":68399,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ubtue/ub_tools/pulls/534"},"html":{"href":"https://github.com/ubtue/ub_tools/pull/534"},"issue":{"href":"https://api.github.com/repos/ubtue/ub_tools/issues/534"},"comments":{"href":"https://api.github.com/repos/ubtue/ub_tools/issues/534/comments"},"review_comments":{"href":"https://api.github.com/repos/ubtue/ub_tools/pulls/534/comments"},"review_comment":{"href":"https://api.github.com/repos/ubtue/ub_tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ubtue/ub_tools/pulls/534/commits"},"statuses":{"href":"https://api.github.com/repos/ubtue/ub_tools/statuses/a86d86ec5662ee3d6d79a676003c4edb0214ee9f"}}}}
{"actor":{"display_login":"ruschein"}}