Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,41 +0,0 @@
|
|||
with Ada.Text_IO;
|
||||
with GNATCOLL.JSON;
|
||||
|
||||
procedure JSON_Test is
|
||||
use Ada.Text_IO;
|
||||
use GNATCOLL.JSON;
|
||||
|
||||
JSON_String : constant String := "{""name"":""Pingu"",""born"":1986}";
|
||||
|
||||
Penguin : JSON_Value := Create_Object;
|
||||
Parents : JSON_Array;
|
||||
begin
|
||||
Penguin.Set_Field (Field_Name => "name",
|
||||
Field => "Linux");
|
||||
|
||||
Penguin.Set_Field (Field_Name => "born",
|
||||
Field => 1992);
|
||||
|
||||
Append (Parents, Create ("Linus Torvalds"));
|
||||
Append (Parents, Create ("Alan Cox"));
|
||||
Append (Parents, Create ("Greg Kroah-Hartman"));
|
||||
|
||||
Penguin.Set_Field (Field_Name => "parents",
|
||||
Field => Parents);
|
||||
|
||||
Put_Line (Penguin.Write);
|
||||
|
||||
Penguin := Read (JSON_String, "json.errors");
|
||||
|
||||
Penguin.Set_Field (Field_Name => "born",
|
||||
Field => 1986);
|
||||
|
||||
Parents := Empty_Array;
|
||||
Append (Parents, Create ("Otmar Gutmann"));
|
||||
Append (Parents, Create ("Silvio Mazzola"));
|
||||
|
||||
Penguin.Set_Field (Field_Name => "parents",
|
||||
Field => Parents);
|
||||
|
||||
Put_Line (Penguin.Write);
|
||||
end JSON_Test;
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
with Ada.Wide_Wide_Text_IO; use Ada.Wide_Wide_Text_IO;
|
||||
with League.JSON.Arrays; use League.JSON.Arrays;
|
||||
with League.JSON.Documents; use League.JSON.Documents;
|
||||
with League.JSON.Objects; use League.JSON.Objects;
|
||||
with League.JSON.Values; use League.JSON.Values;
|
||||
with League.Strings; use League.Strings;
|
||||
|
||||
procedure Main is
|
||||
|
||||
function "+" (Item : Wide_Wide_String) return Universal_String
|
||||
renames To_Universal_String;
|
||||
|
||||
JSON_String : constant Universal_String
|
||||
:= +"{""name"":""Pingu"",""born"":1986}";
|
||||
|
||||
Penguin : JSON_Object;
|
||||
Parents : JSON_Array;
|
||||
|
||||
begin
|
||||
Penguin.Insert (+"name", To_JSON_Value (+"Linux"));
|
||||
Penguin.Insert (+"born", To_JSON_Value (1992));
|
||||
|
||||
Parents.Append (To_JSON_Value (+"Linus Torvalds"));
|
||||
Parents.Append (To_JSON_Value (+"Alan Cox"));
|
||||
Parents.Append (To_JSON_Value (+"Greg Kroah-Hartman"));
|
||||
|
||||
Penguin.Insert (+"parents", To_JSON_Value (Parents));
|
||||
|
||||
Put_Line (To_JSON_Document (Penguin).To_JSON.To_Wide_Wide_String);
|
||||
|
||||
Penguin := From_JSON (JSON_String).To_JSON_Object;
|
||||
|
||||
Parents := Empty_JSON_Array;
|
||||
|
||||
Parents.Append (To_JSON_Value (+"Otmar Gutmann"));
|
||||
Parents.Append (To_JSON_Value (+"Silvio Mazzola"));
|
||||
|
||||
Penguin.Insert (+"parents", To_JSON_Value (Parents));
|
||||
|
||||
Put_Line (To_JSON_Document (Penguin).To_JSON.To_Wide_Wide_String);
|
||||
end Main;
|
||||
Loading…
Add table
Add a link
Reference in a new issue