{"id":7173,"date":"2015-11-27T09:00:18","date_gmt":"2015-11-27T00:00:18","guid":{"rendered":"http:\/\/www.gesource.jp\/weblog\/?p=7173"},"modified":"2017-09-30T09:46:15","modified_gmt":"2017-09-30T00:46:15","slug":"json%e6%96%87%e5%ad%97%e5%88%97%e3%81%ae%e3%82%a8%e3%82%b9%e3%82%b1%e3%83%bc%e3%83%97%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/www.gesource.jp\/weblog\/?p=7173","title":{"rendered":"JSON\u6587\u5b57\u5217\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u300c<a href=\"http:\/\/www.ietf.org\/rfc\/rfc4627.txt\">cppBuilder &#8211; c++ builder \/ JSON &gt; &quot;\\&quot;\u4ed8\u304d\u306e\u6587\u5b57\u5217\u306e\u6271\u3044\u306b\u5931\u6557\u3059\u308b &gt; &quot;&#92;&quot;\u3067\u306f\u306a\u304f&quot;&#92;&#92;&quot;\u306b\u3059\u308b &#8211; Qiita<\/a>\u300d\u3092\u8aad\u3093\u3067\u3001JSON\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u307f\u305f\u3002<\/p>\n<p>\u53d7\u3051\u53d6\u3063\u305f\u6587\u5b57\u5217\u3092TJSONObject\u306b\u5909\u63db\u3057\u3066\u8868\u793a\u3059\u308b\u95a2\u6570\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre><code>uses\n  System.JSON;\n\nprocedure Print(const JSONStr: string);\nvar\n  JSONValue: TJSONValue;\n  JSONObj: TJSONObject;\n  JSONPair: TJSONPair;\nbegin\n  JSONValue := TJSONObject.ParseJSONValue(JSONStr);\n  if JSONValue = nil then\n    ShowMessage('\u89e3\u6790\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002')\n  else\n  begin\n    JSONObj := JSONValue as TJSONObject;\n    try\n      for JSONPair in JSONObj do\n        ShowMessage(JSONPair.JsonString.Value + '=' + JSONPair.JsonValue.Value);\n    finally\n      JSONObj.Free;\n    end;\n  end;\nend;\n<\/code><\/pre>\n<p>\u6587\u5b57\u5217\u306b\u300c&#92;\u300d\u304c\u306a\u3051\u308c\u3070\u6b63\u5e38\u306b\u52d5\u4f5c\u3059\u308b\u3002<\/p>\n<pre><code>procedure TForm1.Button1Click(Sender: TObject);\nconst\n  JSONStr = '{\"Delphi\":\"Object Pascal\", \"C++Builder\":\"C++\"}';\nbegin\n  Print(JSONStr);\nend;\n<\/code><\/pre>\n<p>\u6587\u5b57\u5217\u306b\u300c&#92;\u300d\u304c\u3042\u308b\u3068\u89e3\u6790\u306b\u5931\u6557\u3059\u308b\u3002<\/p>\n<pre><code>procedure TForm1.Button2Click(Sender: TObject);\nconst\n  JSONStr = '{\"name\":\"C:\\Windows\", \"age\":\"33\"}';\nbegin\n  Print(JSONStr);\nend;\n<\/code><\/pre>\n<p>JSON\u306e\u4ed5\u69d8\u306f<a href=\"https:\/\/tools.ietf.org\/html\/rfc7159\">RFC 7159<\/a>\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3002<br \/>\n\uff08<a href=\"http:\/\/www.ietf.org\/rfc\/rfc4627.txt\">RFC 4627<\/a>\u306f\u53e4\u3044\u4ed5\u69d8\u3067\u3042\u308b\uff09<\/p>\n<p><a href=\"https:\/\/tools.ietf.org\/html\/rfc7159\">RFC 7159<\/a>\u306b\u3088\u308b\u3068\u3001\u300c&#8221;\u300d\u300c&#92;\u300d\u300c\/\u300d\u300cb\u300d\u300cf\u300d\u300cn\u300d\u300cr\u300d\u300ct\u300d\u300cuXXXX\u300d\u306f\u300c&#92;\u300d\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n<pre><code>\"    quotation mark  U+0022\n\\    reverse solidus U+005C\n\/    solidus         U+002F\nb    backspace       U+0008\nf    form feed       U+000C\nn    line feed       U+000A\nr    carriage return U+000D\nt    tab             U+0009\nuXXXX                U+XXXX\n<\/code><\/pre>\n<p>\u3057\u305f\u304c\u3063\u3066\u3001\u5148\u307b\u3069\u89e3\u6790\u306b\u5931\u6557\u3059\u308b\u30b3\u30fc\u30c9\u306f\u300c&#92;\u300d\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u3002<\/p>\n<pre><code>const\n  \/\/JSONStr = '{\"name\":\"C:\\Windows\", \"age\":\"33\"}';\n  JSONStr = '{\"name\":\"C:\\\\Windows\", \"age\":\"33\"}';\n<\/code><\/pre>\n<p>TJSONObject.ParseJSONValue\u95a2\u6570\u306f\u89e3\u6790\u306b\u5931\u6557\u3059\u308b\u3068nil\u3092\u8fd4\u3059\u3002<br \/>\n\u623b\u308a\u5024\u304cnil\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u3044\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306fDelphi 10 Seattle\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>Delphi\u306eJSON\u95a2\u9023\u306e\u8a18\u4e8b<\/h2>\n<ul>\n<li><a href=\"\/weblog\/?p=7163\">SaveState\u3067FireMonkey\u306e\u72b6\u614b\u3092\u4fdd\u5b58\u3059\u308b\u30b5\u30f3\u30d7\u30eb<\/a><\/li>\n<li><a href=\"\/weblog\/?p=7160\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092JSON\u6587\u5b57\u5217\u3084TJSONObject\u306b\u5909\u63db\u3059\u308b<\/a><\/li>\n<li><a href=\"\/weblog\/?p=6859\">Delphi XE7\u306eREST\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u3001\u5929\u6c17\u4e88\u5831\u3092\u53d6\u5f97\u3059\u308b<\/a><\/li>\n<li><a href=\"\/weblog\/?p=6070\">goo.gl(Google \u306e\u77ed\u7e2e URL \u30b5\u30fc\u30d3\u30b9) \u306e API \u3092 Delphi \u3067\u5229\u7528\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<li><a href=\"\/weblog\/?p=6067\">Delphi\u3067JSON\u6587\u5b57\u5217\u3092\u4f5c\u6210\u3059\u308b<\/a><\/li>\n<li><a href=\"\/weblog\/?p=4567\">TJSONObject\u3067JSON\u30c7\u30fc\u30bf\u3092\u89e3\u6790\u3059\u308b<\/a><\/li>\n<li><a href=\"\/weblog\/?p=4568\">\u6771\u4eac\u96fb\u529b\u96fb\u529b\u4f9b\u7d66\u72b6\u6cc1API\u3092\u4f7f\u3063\u305fDelphi\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30b5\u30f3\u30d7\u30eb(DBXJSON\u30e6\u30cb\u30c3\u30c8\u7248)<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u300ccppBuilder &#8211; c++ builder \/ JSON &gt; &quot;\\&quot;\u4ed8\u304d\u306e\u6587\u5b57\u5217\u306e\u6271\u3044\u306b\u5931\u6557\u3059\u308b &gt; &quot;&#92;&quot;\u3067\u306f\u306a\u304f&quot;&#92;&#038; &#8230;<\/p>\n<p><a href=\"https:\/\/www.gesource.jp\/weblog\/?p=7173\" class=\"more-link\">Continue reading &lsquo;JSON\u6587\u5b57\u5217\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u306b\u3064\u3044\u3066&rsquo; &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[48],"tags":[162],"class_list":["post-7173","post","type-post","status-publish","format-standard","hentry","category-delphi","tag-delphi-10-seattle"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/7173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7173"}],"version-history":[{"count":0,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=\/wp\/v2\/posts\/7173\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gesource.jp\/weblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}