{"_id":"@autoit-gui-skeleton/ags-wrapper-json","_rev":"8-1296e76d678d7a7625a4aa439fc057d3","name":"@autoit-gui-skeleton/ags-wrapper-json","dist-tags":{"latest":"1.0.5"},"versions":{"1.0.0":{"name":"@autoit-gui-skeleton/ags-wrapper-json","version":"1.0.0","description":"A simple *wrapper* of library [JSON.au3](https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn/) created by Ward for simplifiy handling dependencies of an [AGS project](https://v20100v.github.io/autoit-gui-skeleton/).","AGS":{"framework":{"version":"1.0.0"},"AutoIt":{"version":"3.3.14.5"}},"author":{"name":"20100","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"},"license":"MIT","keywords":["AGS","AutoIt","AutoItGUISkeleton","AutoIt GUI Skeleton","AGS wrapper","AGS wrapper JSON","JSON"],"homepage":"https://v20100v.github.io/autoit-gui-skeleton/","_id":"@autoit-gui-skeleton/ags-wrapper-json@1.0.0","dist":{"shasum":"6eae6c3f91e089caef87db1b7bd9de13e92cc947","tarball":"https://registry.npmjs.org/@autoit-gui-skeleton/ags-wrapper-json/-/ags-wrapper-json-1.0.0.tgz","fileCount":6,"unpackedSize":44389,"integrity":"sha512-4fxg9iSUK319lUm5WmNIlttDSlHKG4h5vU3IRyripY19dkcS6XBjq/K5MYXuD3a+uW46UXmc6p+y4xaq2gQE5w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG4H0OhI3P3G4j78xairNj56pDjkC8uIE52JSZrHMFnLAiAED1InyhLmBBjsrEZh+3M/6Z3h7V7Rzbd7JLCd5XE7rg=="}]},"maintainers":[{"name":"v20100v","email":"vb20100bv@gmail.com"}],"_npmUser":{"name":"v20100v","email":"vb20100bv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ags-wrapper-json_1.0.0_1531153483987_0.9586953862269627"},"_hasShrinkwrap":false},"1.0.1":{"name":"@autoit-gui-skeleton/ags-wrapper-json","version":"1.0.1","description":"A simple *wrapper* of library [JSON.au3](https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn/) created by Ward for simplifiy handling dependencies of an [AGS project](https://v20100v.github.io/autoit-gui-skeleton/).","AGS":{"framework":{"version":"1.0.0"},"AutoIt":{"version":"3.3.14.5"}},"author":{"name":"20100","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"},"license":"MIT","keywords":["AGS","AutoIt","AutoItGUISkeleton","AutoIt GUI Skeleton","AGS wrapper","AGS wrapper JSON","JSON"],"homepage":"https://v20100v.github.io/autoit-gui-skeleton/","repository":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json.git","type":"git"},"_id":"@autoit-gui-skeleton/ags-wrapper-json@1.0.1","dist":{"shasum":"e76b545f219a6e25d3efc037b51bbfc340c1734c","tarball":"https://registry.npmjs.org/@autoit-gui-skeleton/ags-wrapper-json/-/ags-wrapper-json-1.0.1.tgz","fileCount":6,"unpackedSize":45354,"integrity":"sha512-gWNMp7RKCGqU0eAVfGM5RUKpppanfsnLcLHtIv9R9EteEiSTa0J1JUoubRX/XTTJuq6OvqdM6YAU87S0MyYxaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAoH+LkVjmfS5B0N8Jk93GPCgzVeW55gW2IjqoKXqbHLAiBZTwct0ob/1ZlBj554NJ3y6/QuPw0V81PpDG6aSt6UXQ=="}]},"maintainers":[{"name":"v20100v","email":"vb20100bv@gmail.com"}],"_npmUser":{"name":"v20100v","email":"vb20100bv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ags-wrapper-json_1.0.1_1531217295648_0.884815306892764"},"_hasShrinkwrap":false},"1.0.2":{"name":"@autoit-gui-skeleton/ags-wrapper-json","version":"1.0.2","description":"A simple wrapper of the library JSON.au3, created by Ward, for simplifiy handling dependencies of an AutoIt project built with AGS framework.","AGS":{"framework":{"version":"1.0.0"},"AutoIt":{"version":"3.3.14.5"}},"author":{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"},"contributors":[{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"}],"license":"MIT","keywords":["AGS","AutoIt","AutoIt-GUI-Skeleton","AGS-wrapper","JSON"],"homepage":"https://autoit-gui-skeleton.github.io/","repository":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json.git","type":"git"},"bugs":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json/issues"},"dependencies":{},"_id":"@autoit-gui-skeleton/ags-wrapper-json@1.0.2","dist":{"shasum":"29bdaef400e37ce69fa579c88e0fc21ea25379a2","tarball":"https://registry.npmjs.org/@autoit-gui-skeleton/ags-wrapper-json/-/ags-wrapper-json-1.0.2.tgz","fileCount":6,"unpackedSize":45920,"integrity":"sha512-v7O18sdkXfiFsIgi6Pp/UFvD9eb5cdQeNIO3ZV56DGte7LVoLxlIG9H5KNyRpHoLJy50U/FJbb57gU+hvb+30Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDckLyTGoBQVso70INLjtvBUm0XWeY89PfvNS+flj7MhQIhAMxWPXdrmDkpEPlx3xifOxtKkoe4wAuwpEqUDqJQ+CJU"}]},"maintainers":[{"name":"v20100v","email":"vb20100bv@gmail.com"}],"_npmUser":{"name":"v20100v","email":"vb20100bv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ags-wrapper-json_1.0.2_1531733076280_0.8516506481859223"},"_hasShrinkwrap":false},"1.0.3":{"name":"@autoit-gui-skeleton/ags-wrapper-json","version":"1.0.3","description":"A simple wrapper of the library JSON.au3, created by Ward, for simplifiy handling dependencies of an AutoIt project built with AGS framework.","author":{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"},"contributors":[{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"}],"license":"MIT","keywords":["AGS","AutoIt","AutoIt-GUI-Skeleton","AGS-wrapper","JSON"],"homepage":"https://autoit-gui-skeleton.github.io/","repository":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json.git","type":"git"},"bugs":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json/issues"},"dependencies":{},"AGS":{"framework":{"version":"1.0.0"},"AutoIt":{"version":"3.3.14.5"},"wrapper":{"main":"JSON.au3"}},"_id":"@autoit-gui-skeleton/ags-wrapper-json@1.0.3","dist":{"shasum":"90a9a02e1aeceeb4ff5d0fa5ff61549c704da8fe","tarball":"https://registry.npmjs.org/@autoit-gui-skeleton/ags-wrapper-json/-/ags-wrapper-json-1.0.3.tgz","fileCount":6,"unpackedSize":54206,"integrity":"sha512-D1+zgJv8d/ped5IKl1JJ3SBKJtrsg4oCzgBy2/GmJBQj4JT8Eygy8rcfoxlpXfDMz8G6gIrFtj9vzfCprOCQ4g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwmJJA40TeD7Z6AcOjT+Rzjv8KMIt7lbGPnApOpI/3sgIhAJe/GF0IzE43j9h2HsxSsF/uxoTEDkP0ce5+UWHvy5oF"}]},"maintainers":[{"name":"v20100v","email":"vb20100bv@gmail.com"}],"_npmUser":{"name":"v20100v","email":"vb20100bv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ags-wrapper-json_1.0.3_1531753135169_0.4687563650535753"},"_hasShrinkwrap":false},"1.0.4":{"name":"@autoit-gui-skeleton/ags-wrapper-json","version":"1.0.4","description":"AGS package for the library JSON.au3, created by Ward. This library allows us to decode/encode JSON with the minimalistic JSON parser jsmn.","author":{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"},"contributors":[{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"}],"license":"MIT","keywords":["AGS","AutoIt","AutoIt-GUI-Skeleton","AGS-wrapper","JSON"],"homepage":"https://autoit-gui-skeleton.github.io/","repository":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json.git","type":"git"},"bugs":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json/issues"},"dependencies":{"@autoit-gui-skeleton/ags-wrapper-binary-call":"^1.0.2"},"AGS":{"framework":{"version":"1.0.0"},"AutoIt":{"version":"3.3.14.5"},"wrapper":{"main":"JSON.au3"}},"_id":"@autoit-gui-skeleton/ags-wrapper-json@1.0.4","dist":{"shasum":"b710538f5f4dd64975355712bb1d39af1b0450bf","tarball":"https://registry.npmjs.org/@autoit-gui-skeleton/ags-wrapper-json/-/ags-wrapper-json-1.0.4.tgz","integrity":"sha512-PXHQFSGAIXLIl38NO5K+0UaRWxqtKmO+gEahOuOjbPVJdOcpEwgi5uMr7HctBs7Ty+awhDBeLwGgd9L6kfskrQ==","fileCount":9,"unpackedSize":55123,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcCopECRA9TVsSAnZWagAAc0cQAJvjLl86ZKccro5E4Tgk\numD0vVFpGQhA5WCI09nte6SaZN2Nz8Xu//GTmGHMW1csHumU/gj89rzlCbNP\nZgIZr3BsnKzg9ZbzFuoA9K7KLgfdjGfsARfjUJPEWc7ujkLh/0zv4O7HwHPd\nonmJjxPx+u7YY5SVh026bdSdK7uCgIhmpJMCODefVxtp+LHUGa+rioklRVa/\n5gCEVg1NAl+aOraHA+6v/SbqrbDfdy7l7lBV5QFRc+s6XLvETdWWYayFvg5K\nE3FPWsyW7N0SWklF2X3MzD+V4itv3ZJKhRGZak33crtb2Zxt1r6GIALxIUbl\n3JE9S6No2EnLFviPmVtkUzHvPvFIwIF9roE0b2ckjaKepjOy5O47NUjHftnY\nU8/3/30TaYbI9rW2g06YtP9dK4p/Y3ypSH+KAxEd6h90EsfTI/56FUrxMjSP\n0MauTa2ZVbBx6pNJqIB/0Jy5oWKzyYZjyzE4ugcEJy4pvoZRJEe7NYzB2IZP\nDs+rvxEzImMSRR9KNfxRLsHWkPvIjHJl8A3/ublBcBVnZdKIFXIBb8PItR6b\ncwvjniuswpIX0x/bvzewNFK4dh5PCOJMum9EeJPReHjA9qIzItrLkqZ9JHRV\nq61+N03yzVNqpM6g/cZho2lsQuD1VQzocroUkjylAkIsuEy3i7WnHhE5Bwh1\n+5ag\r\n=THzu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5oErpvilFLygb0ppMCfqktEcWkTG/TMP5B1fSnrZRPAiBoMucu7O50CmgdGYmp+XxM5cj52eqsJxZDhx0EhM9JqA=="}]},"maintainers":[{"name":"v20100v","email":"vb20100bv@gmail.com"}],"_npmUser":{"name":"v20100v","email":"vb20100bv@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ags-wrapper-json_1.0.4_1544194628222_0.031090731852708053"},"_hasShrinkwrap":false},"1.0.5":{"name":"@autoit-gui-skeleton/ags-wrapper-json","version":"1.0.5","description":"AGS package for the library JSON.au3, created by Ward. This library allows us to decode/encode JSON with the minimalistic JSON parser jsmn.","author":{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"},"contributors":[{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"}],"license":"MIT","keywords":["AGS","AutoIt","AutoIt-GUI-Skeleton","AGS-wrapper","JSON"],"homepage":"https://autoit-gui-skeleton.github.io/","repository":{"url":"git+https://github.com/autoit-gui-skeleton/ags-wrapper-json.git","type":"git"},"bugs":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json/issues"},"dependencies":{"@autoit-gui-skeleton/ags-wrapper-binary-call":"^1.0.2"},"AGS":{"framework":{"version":"1.0.0"},"AutoIt":{"version":"3.3.14.5"},"wrapper":{"main":"JSON.au3"}},"gitHead":"9626436ff5206e8c95342bc95dcbb2963f2a6582","_id":"@autoit-gui-skeleton/ags-wrapper-json@1.0.5","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QQzuvIyCL/waEWyaroUUcjQwWiqP/VEe+/oHF3qab1YnyNetFUSUykt7r08v4Csq1qIS9DyJyIe0JLLLOBURrg==","shasum":"9b9abd25db8dbb0f898a6b2c1a00c44fcc22c31a","tarball":"https://registry.npmjs.org/@autoit-gui-skeleton/ags-wrapper-json/-/ags-wrapper-json-1.0.5.tgz","fileCount":7,"unpackedSize":55416,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm5JNCRA9TVsSAnZWagAAtGAP/i1v135yvrB1xIpWjv+f\nuEe+aNU3+QcUREivSpYrWw3KvxbVGwgqEtaEXdpQQMEycaB3ziDvcH+8te64\n07wqWiFRR3JNgbP5/PEDdMEfIplfzm5xmJXDtRqGzQGKa1gNAoTycGNOv1tC\nckz2gmYrUr1F/aUYMO161jRsKFPMFxA6Ru+4Vr7oHb0wOML7ZU2vP/GS6je1\n40PTI/LTN50vNhb34kp6DSzIo3IOq2tiK5UztG/e1crrFmlNNWzsPyGlF9lS\nFmn4bdc1McuoW7hpWujHDxVMdvGy0txc6fZ3Vk0OQjaA03+ND2N1JbGaxOTQ\nY+UZTOnXCpJVtf0Rz/rvDW52sJQWgzloWc5bZNE0AbMNon3mzGXqcqXsl0s2\ne9GEKIezdVj3bgebg7PXr1sMi+3o0iIQUO5aN12W6aAKF7sM5X23cp6VMilD\nMo6orepK4+0d7rjED5aTsVdliDSoUHrOPxGg2/7O5j5kD/ezy6ZdjMdpdjG7\nIA+ZaCZEzxNwKK18UwCm16uOz4jisz2ILaeLVGL/GyQgYuBCZH0puESfUv1S\nBvItU4y3NoWdFmZ+go43FkWIWEopN5H3jqqHNsKGewX1WlEYQvMrB8c16u45\n/YbkgGh51LU/tEUZ5xyPfmnF6wsGDJt6/+LHhGGzzc+qAqVlI6IhjQoxcXTh\n2LWE\r\n=/QiP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6KdU5EHOZaF5ZcgaZ66oFdwFbh6EupHS9DZg5E1H9MAiAH5MWIf+O8Sh497aF+YWWo6wEknm7o0sfZ5ImbYpSFiQ=="}]},"_npmUser":{"name":"v20100v","email":"vb20100bv@gmail.com"},"directories":{},"maintainers":[{"name":"v20100v","email":"vb20100bv@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ags-wrapper-json_1.0.5_1637585485027_0.3718138200428769"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-09T16:24:43.878Z","1.0.0":"2018-07-09T16:24:44.072Z","modified":"2022-06-12T14:52:37.894Z","1.0.1":"2018-07-10T10:08:15.766Z","1.0.2":"2018-07-16T09:24:36.344Z","1.0.3":"2018-07-16T14:58:56.852Z","1.0.4":"2018-12-07T14:57:08.389Z","1.0.5":"2021-11-22T12:51:25.158Z"},"maintainers":[{"name":"v20100v","email":"vb20100bv@gmail.com"}],"description":"AGS package for the library JSON.au3, created by Ward. This library allows us to decode/encode JSON with the minimalistic JSON parser jsmn.","homepage":"https://autoit-gui-skeleton.github.io/","keywords":["AGS","AutoIt","AutoIt-GUI-Skeleton","AGS-wrapper","JSON"],"author":{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"},"license":"MIT","readme":"AGS-wrapper-json\r\n================\r\n\r\n> [AutoIt Gui Skeleton](https://autoit-gui-skeleton.github.io/) package for wrapping the library [JSON.au3](https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn/) created by [Ward's](https://www.autoitscript.com/forum/profile/10768-ward/). See this package on [npmjs.com](https://www.npmjs.com/package/@autoit-gui-skeleton/ags-wrapper-json/)\r\n\r\n\r\n\r\n<br/>\r\n\r\n## How to install AGS-wrapper-wrapper-json ?\r\n\r\nWe assume that you have already install [Node.js](https://nodejs.org/) and [Yarn](https://yarnpkg.com/lang/en/), for example by taking a [Chocolatey](https://chocolatey.org/). AGS framework use it for manage dependencies.\r\n\r\nTo add this package into your AutoIt project, just type in the root folder of your AGS project where the `package.json` is stored. You can also modify the `dependencies` property of this json file and use the yarn [install](https://yarnpkg.com/en/docs/usage) command. It is easier to use the add command :\r\n\r\n```\r\nλ  yarn add @autoit-gui-skeleton/ags-wrapper-json --modules-folder vendor\r\n```\r\n\r\nThe property `dependencies` of the  `package.json` file is updated consequently, and all package dependencies, as well as daughter dependencies of parent dependencies, are installed in the `./vendor/@autoit-gui-skeleton/` directory. Note that with an AGS project, it is not necessary to explicitly write this option `--modules-folder vendor` on the command line, thanks to the `.yarnrc` file stored at the root of the project. Yarn automatically use `.yarnrc` file to add an additional configuration of options.\r\n\r\n```\r\n #./.yarnrc\r\n --modules-folder vendor\r\n ```\r\n\r\nFinally to use this library in your AutoIt program, you need to include this library in the main program. There is no need for additional configuration to use it.\r\n\r\n```autoit\r\n#include './vendor/@autoit-gui-skeleton/ags-wrapper-json/JSON.au3'\r\n```\r\n\r\n\r\n\r\n<br/>\r\n\r\n## What is AGS (AutoIt Gui Skeleton) ?\r\n\r\n[AutoIt Gui Skeleton](https://autoit-gui-skeleton.github.io/) give an environment for developers, that makes it easy to build AutoIt applications. To do this AGS proposes to use conventions and a standardized architecture in order to simplify the code organization, and thus its maintainability. It also gives tools to help developers in recurring tasks specific to software engineering.\r\n\r\n> More information about [AGS framework](https://autoit-gui-skeleton.github.io/)\r\n\r\nAGS provides a dependency manager for AutoIt library. It uses the Node.js ecosystem and its dependency manager npm and its evolution Yarn. All AGS packages are hosted in npmjs.org repository belong to the [@autoit-gui-skeleton](https://www.npmjs.com/search?q=autoit-gui-skeleton) organization. And in AGS you can find two types of package :\r\n\r\n- An **AGS-component** is an AutoIt library, that you can easy use in your AutoIt project built with the AGS framework. It provides some features for application that can be implement without painless.\r\n- An **AGS-wrapper** is a simple wrapper for an another library created by another team/developer.\r\n\r\n> More information about [dependency manager for AutoIt in AGS](https://autoit-gui-skeleton.github.io//2018/07/10/ags_dependencies_manager_for_AutoIt.html)\r\n\r\n\r\n\r\n<br/>\r\n\r\n## How to decode a JSON ?\r\n\r\n### Decode a JSON file from local\r\n\r\nFor example, create this json file in your `./assets/DROIDS.json` folder of your AGS project.\r\n\r\n```json\r\n{\r\n  \"project\": \"Listing droids\",\r\n  \"version\": \"1.0\",\r\n  \"author\": {\r\n    \"name\": \"Luke\",\r\n    \"mail\": \"luke@2080.org\"\r\n  },\r\n  \"droids\": [\r\n    {\r\n      \"name\": \"R2D2\",\r\n      \"type\": \"Astromecano\",\r\n      \"size\": \"0,96m\"\r\n    },\r\n    {\r\n      \"name\": \"BB8\",\r\n      \"type\": \"Astromecano\",\r\n      \"size\": \"0,67m\"\r\n    },\r\n    {\r\n      \"name\": \"C-3PO\",\r\n      \"type\": \"Social\",\r\n      \"size\": \"1,67m\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nTo decode this local file, we use this bellow function `json_decode_from_file`.\r\n\r\n```autoit\r\n#include 'vendor/@autoit-gui-skeleton/ags-wrapper-json/JSON.au3'\r\n\r\n;====================================================================================\r\n; Decode JSON from a given local file\r\n;\r\n; @param $jsonfilePath (string)\r\n; @return $object (object), instance return by json_decode\r\n;====================================================================================\r\nFunc json_decode_from_file($filePath)\r\n\tLocal $fileOpen, $fileContent, $object\r\n\r\n\t$fileOpen = FileOpen($filePath, $FO_READ)\r\n\tIf $fileOpen = -1 Then\r\n\t\tReturn SetError(1, 0, \"An error occurred when reading the file \" & $filePath)\r\n\tEndIf\r\n\t$fileContent = FileRead($fileOpen)\r\n\tFileClose($fileOpen)\r\n\t$object = Json_Decode($fileContent)\r\n\r\n\tReturn $object\r\nEndFunc\r\n```\r\n\r\nAccording to Ward's documentation.\r\n\r\n> The most JSON data type will be decoded into corresponding AutoIt variable, including 1D array, string, number, true, false, and null. JSON object will be decoded into \"Windows Scripting Dictionary Object\" retuned from `ObjCreate(\"Scripting.Dictionary\")`. AutoIt build-in functions like IsArray, IsBool, etc. can be used to check the returned data type. But for Object and Null, Json_IsObject() and Json_IsNull() should be used.\r\n>\r\n> If the input JSON string is invalid, `@Error` will be set to `$JSMN_ERROR_INVAL`. And if the input JSON string is not finish, `@Error` will be set to `$JSMN_ERROR_PART`.\r\n\r\n\r\n\r\n### Get values from a json object\r\n\r\nTo work with `$jsonObject`, the return of `json_decode_from_file`, you can use `Json_Get` function. To select a JSON variable, both dot notation and square bracket notation can be supported.\r\n\r\n```autoit\r\nLocal $file = @ScriptDir & \"\\assets\\DROIDS.json\"\r\nLocal $jsonObject = json_decode_from_file($file)\r\n\r\n; With dot notation\r\nLocal $project = Json_Get($jsonObject, '.project')     ; Listing droids\r\nLocal $name = Json_Get($jsonObject, '.author.name')    ; Luke\r\nLocal $mail = Json_Get($jsonObject, '.author.mail')    ; luke@2080.org\r\nlocal $test = Json_Get($jsonObject, '.droids[1].name') ; BB8\r\n\r\n; With array notation\r\nLocal $project2 = Json_Get($jsonObject, '[\"project\"]')\r\nLocal $name2 = Json_Get($jsonObject, '[\"author\"][\"name\"]')\r\nLocal $mail2 = Json_Get($jsonObject, '[\"author\"][\"mail\"]')\r\nlocal $test2 = Json_Get($jsonObject, '[\"droids\"][1][\"name\"]')\r\n```\r\n\r\nYou also can use object help functions. These functions are just warps of `Scripting.Dictionary` COM object.\r\n\r\n- Json_ObjCreate()\r\n- Json_ObjPut(ByRef $Object, $Key, $Value)\r\n- Json_ObjGet(ByRef $Object, $Key)\r\n- Json_ObjDelete(ByRef $Object, $Key)\r\n- Json_ObjExists(ByRef $Object, $Key)\r\n- Json_ObjGetCount(ByRef $Object)\r\n- Json_ObjGetKeys(ByRef $Object)\r\n- Json_ObjClear(ByRef $Object)\r\n\r\n\r\n### Work with an object collection, and iterate its items\r\n\r\nTo iterate values from an array json\r\n\r\n```autoit\r\nLocal $file = @ScriptDir & \"\\assets\\DROIDS.json\"\r\nLocal $jsonObject = json_decode_from_file($file)\r\n\r\n; Check if exists an item droid into the collection `droids`\r\nLocal $droids = Json_Get($jsonObject, '.droids')\r\nIf UBound($droids) = 0 Then\r\n    Return SetError(3, 0, \"Array attribute 'droids' is empty.\")\r\nEndIf\r\n\r\n; Iterate items collection to store values into an array\r\nLocal $array[UBound($droids)][3]\r\nFor $i = 0 To UBound($droids) - 1 Step 1\r\n    $array[$i][0] = Json_Get($jsonObject, '.droids' & '[' & $i & '].name')\r\n    $array[$i][1] = Json_Get($jsonObject, '.droids' & '[' & $i & '].type')\r\n    $array[$i][2] = Json_Get($jsonObject, '.droids' & '[' & $i & '].size')\r\nNext\r\n```\r\n\r\n\r\n### Add object into a JSON\r\n\r\nYou can do it with `Json_Put`:\r\n\r\n```àutoit\r\nLocal $Obj\r\nJson_Put($Obj, \".foo\", \"foo\")\r\nJson_Put($Obj, \".bar[0]\", \"bar\")\r\nJson_Put($Obj, \".test[1].foo.bar[2].foo.bar\", \"Test\")\r\n\r\nLocal $Test = Json_Get($Obj, '[\"test\"][1][\"foo\"][\"bar\"][2][\"foo\"][\"bar\"]') ; \"Test\"\r\n```\r\n\r\n\r\n### Decode a JSON file from a remote server\r\n\r\nTo decode a JSON file hosted on a remote server, or built from a webservice or from a REST API, you can use the component [@autoit-gui-skeleton/ags-component-http-request](https://www.npmjs.com/package/@autoit-gui-skeleton/ags-component-http-request) to make HTTP requests to a given URL.\r\n\r\n```autoit\r\n#include 'vendor/@autoit-gui-skeleton/ags-component-http-request/ags-component-http-request.au3'\r\n\r\n;====================================================================================\r\n; Decode JSON from a given URL\r\n;\r\n; @param $jsonfileUrl (string)\r\n; @param $proxy (string), by default we load proxy settings form configuration file\r\n; @return $object (object), instance return by json_decode\r\n;====================================================================================\r\nFunc json_decode_from_url($jsonfileUrl, $proxy = \"\")\r\n\tLocal $response = HttpGET($jsonfileUrl, Default, $proxy)\r\n\tIf (@error) Then\r\n\t\tReturn SetError(@error, $response, _\r\n\t\t    \"Unable to get json file on server \" & $jsonfileUrl & \".\")\r\n\tEndIf\r\n\tLocal $data = $response.ResponseText\r\n\tLocal $object = json_decode($data)\r\n\r\n\tReturn $object\r\nEndFunc\r\n\r\nLocal $jsonObject = json_decode_from_url(https://api.spacexdata.com/v2/info)\r\n\r\nLocal $name = Json_Get($jsonObject, '.name')        ; SpaceX\r\nLocal $founder = Json_Get($jsonObject, '.founder')  ; Elon Musk\r\nLocal $founded = Json_Get($jsonObject, '.founded')  ; 2002\r\n```\r\n\r\n\r\n<br/>\r\n\r\n## How to encode a JSON ?\r\n\r\nAccording to Ward's documentation, you can use `Json_Encode($Data, $Option = 0, $Indent = \"\\t\", $ArraySep = \",\\r\\n\", $ObjectSep = \",\\r\\n\", $ColonSep = \": \")`.\r\n\r\n\r\n> - `$Data` can be a string, number, bool, keyword : default or null, 1D array, or `Scripting.Dictionary` COM object.\r\n> - Binary will be converted to string in UTF8 encoding.\r\n> - Ptr will be converted to number\r\n> - Other unsupported types like 2D array, dllstruct or object will be encoded into null.\r\n>\r\n> `$Option` is bitmask consisting following constant:\r\n>\r\n> - `$JSON_UNESCAPED_ASCII` ; Don't escape ascii charcters between chr(1) ~ chr(0x1f)\r\n> - `$JSON_UNESCAPED_UNICODE` ; Encode multibyte Unicode characters literally\r\n> - `$JSON_UNESCAPED_SLASHES` ; Don't escape /\r\n> - `$JSON_HEX_TAG` ; All < and > are converted to \\u003C and \\u003E\r\n> - `$JSON_HEX_AMP` ; All &amp;amp;amp;amp;s are converted to \\u0026\r\n> - `$JSON_HEX_APOS` ; All ' are converted to \\u0027\r\n> - `$JSON_HEX_QUOT` ; All \" are converted to \\u0022\r\n> - `$JSON_PRETTY_PRINT` ; Use whitespace in returned data to format it\r\n> - `$JSON_STRICT_PRINT` ; Make sure returned JSON string is RFC4627 compliant\r\n> - `$JSON_UNQUOTED_STRING` ; Output unquoted string if possible (conflicting with $JSMN_STRICT_PRINT)\r\n\r\nFor example to encode in JSON:\r\n\r\n```autoit\r\nLocal $file = @ScriptDir & \"\\assets\\DROIDS.json\"\r\nLocal $jsonObject = json_decode_from_file($file)\r\nLocal $jsonEncoded = Json_Encode($jsonObject, $JSON_PRETTY_PRINT)\r\n\r\nConsoleWrite($jsonEncoded)\r\n```\r\n\r\n> Most encoding option have the same means like PHP's json_encode() function. When `$JSON_PRETTY_PRINT` is set, output format can be change by other 4 parameters : `($Indent, $ArraySep, $ObjectSep, $ColonSep)`. Because these 4 output format parameters will be checked inside `Jsmn_Encode()` function, returned string will be always accepted by `Jsmn_Decode()`. $JSON_UNQUOTED_STRING can be used to output unquoted string that also accetped by Jsmn_Decode(). `$JSON_STRICT_PRINT` is used to check output format setting and avoid non-standard JSON output. So this option is conflicting with `$JSON_UNQUOTED_STRING`.\r\n\r\n\r\n\r\n<br/>\r\n\r\n## About\r\n\r\n### Acknowledgments\r\n\r\nAcknowledgments for [Ward's](https://www.autoitscript.com/forum/profile/10768-ward/) work and its library [JSON.au3](https://www.autoitscript.com/forum/topic/148114-a-non-strict-json-udf-jsmn/)\r\n\r\n\r\n### Contributing\r\n\r\nComments, pull-request & stars are always welcome !\r\n\r\n### License\r\n\r\nCopyright (c) 2018 by [v20100v](https://github.com/v20100v). Released under the MIT license.\r\n","readmeFilename":"README.md","repository":{"url":"git+https://github.com/autoit-gui-skeleton/ags-wrapper-json.git","type":"git"},"contributors":[{"name":"v20100v","email":"vb20100bv@gmail.com","url":"https://github.com/v20100v"}],"bugs":{"url":"https://github.com/autoit-gui-skeleton/ags-wrapper-json/issues"}}