mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-28 06:12:53 -06:00
reference: JSON
git-svn-id: svn://ultimatepp.org/upp/trunk@4129 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
57e0c1b5c9
commit
5f280aa260
2 changed files with 20 additions and 1 deletions
|
|
@ -1,4 +1,6 @@
|
|||
#include "JSON.h"
|
||||
#include "Core/Core.h"
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
|
|
@ -30,4 +32,19 @@ CONSOLE_APP_MAIN
|
|||
while(p2.Char(','));
|
||||
p2.PassChar(']');
|
||||
}
|
||||
|
||||
LOG("- Composing JSON using support classes");
|
||||
Json json;
|
||||
json
|
||||
("firstName", "Andrew")
|
||||
("secondName", "Smith")
|
||||
("age", 28)
|
||||
("address", Json("streetAddress", "23 3rd Street")("city", "New York"))
|
||||
;
|
||||
JsonArray pn;
|
||||
pn << Json("type", "home")("number", "12312345")
|
||||
<< Json("type", "work")("number", "87126388");
|
||||
json("phoneNumber", pn);
|
||||
DUMP(~json);
|
||||
DUMP(AsJSON(ParseJSON(~json), true));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue