Top sellers


Product Code: jpjson
Availability: In Stock
Built for: Cross-platform Json parser
Product Version: 2.0
Online Demo: http://www.julien-pierron.com/sample?sample=jpdemo
Forum Link: http://www.shivaengine.com/developer/forum/viewtopic.php?f=82&t=29258
Req. ShiVa Version: ShiVa 1.9.2 Engines
Plugin Platform Compatibility: iOS, Android, WinRT ARM/Phone 8, WinRT x86/_64, Windows Legacy, Mac OS X, Linux, Flash, Web Browser, Palm, Marmalade, BlackBerry, Windows Phone 7, Playstation 3, Playstation 4, Xbox 360, Xbox One, Wii, tvOS
Price: $39.00
Seller information: Julien Pierron
Country: France, Metropolitan
Company: Julien Pierron
Qty:     - OR -   Wish List
Json is an alternative to XML. It is a human-readable text format to transmit data objects consisting of attribute–value pairs. It is used primarily to transmit data to/from a server.

The Json format has several advantages over XML:
- It is easier to read as it is not based on tags.
- More compact than XML, resulting on less network consumption to transmit the same data.
- Clever structure based on arrays, maps and standard types (number, boolean, string, null)

Have a look to an XML structure:

<city>New York</city>

Now, look at the equivalent Json structure, with the same data:

"city":"New York",

The Json is roughly 40% lighter and easier to read because it is consisting of attribute–value pairs while XML is based on tags.

JPJson offers 2 ways to create a Json object:
- From a Json string: jJson = JPJson.createFromString ( sJson )
- From a Json you have downloaded: JPJson.receive ( sTag, sURI ) and jJson = JPJson.getFromTag ( sTag )

Now if you want to get the name of the player or its score, it's really easy, look:

local sName = jJson["name"]
local nScore = jJson["score"]

Accessing a sub-element is also a piece of cake:

local sCountry = jJson["location"]["country"]

This was for accessing values contained in maps (or objects as it is commonly named in Json).
Here is how to browse an array (defined with square brackets):

for i = 0, JPJson.getSize ( jJson["friends_id"] ) - 1
local nFriendId = jJson["friends_id"][i]
--Your code here

It is really easy, no need to use the API for browsing the Json element, you can access it directly with keys and indexes!

General information :
- This product is compatible with both ShiVa 1.9.2 and 2.0.

- ShiVa 1.9.2 or greater
- LUA project (not compatible with full c++ projects, compatible with LUA projects that use c++ plugins)

You can find an introduction to the packs and how to load them in your game here:

API & Instructions


Sample projects that use my packs

Write a review

Your Name:

Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:

ShiVa Store © 2019 - Powered By OpenCart