reference: JSON

git-svn-id: svn://ultimatepp.org/upp/trunk@4129 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-11-05 12:45:20 +00:00
parent 57e0c1b5c9
commit 5f280aa260
2 changed files with 20 additions and 1 deletions

View file

@ -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));
}