Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
22
Task/JSON/EGL/json-2.egl
Normal file
22
Task/JSON/EGL/json-2.egl
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
people Person[]; // Array of people
|
||||
|
||||
people.appendElement(new Person { firstName = "Frederick", lastName = "Flintstone", age = 35} );
|
||||
people.appendElement(new Person { firstName = "Wilma", lastName = "Flintstone", age = 34} );
|
||||
people.appendElement(new Person { firstName = "Pebbles", lastName = "Flintstone", age = 2} );
|
||||
people.appendElement(new Person { firstName = "Bernard", lastName = "Rubble", age = 32} );
|
||||
people.appendElement(new Person { firstName = "Elizabeth", lastName = "Rubble", age = 29} );
|
||||
people.appendElement(new Person { firstName = "Bam Bam", lastName = "Rubble", age = 2} );
|
||||
|
||||
family Dictionary; // A dictionary of family members using a uid as key
|
||||
family["1"] = new FamilyMember{ person = people[1], relationships = [new Relationship{ relationshipType="spouse", id = 2 }, new Relationship{ relationshipType="child", id = 3}] };
|
||||
family["2"] = new FamilyMember{ person = people[2], relationships = [new Relationship{ relationshipType="spouse", id = 1 }, new Relationship{ relationshipType="child", id = 3}] };
|
||||
family["3"] = new FamilyMember{ person = people[3], relationships = [new Relationship{ relationshipType="mother", id = 2 }, new Relationship{ relationshipType="father", id = 1}] };
|
||||
family["4"] = new FamilyMember{ person = people[4], relationships = [new Relationship{ relationshipType="spouse", id = 5 }, new Relationship{ relationshipType="child", id = 6}] };
|
||||
family["5"] = new FamilyMember{ person = people[5], relationships = [new Relationship{ relationshipType="spouse", id = 4 }, new Relationship{ relationshipType="child", id = 6}] };
|
||||
family["6"] = new FamilyMember{ person = people[6], relationships = [new Relationship{ relationshipType="mother", id = 5 }, new Relationship{ relationshipType="father", id = 4}] };
|
||||
|
||||
// Convert dictionary of family members to JSON string
|
||||
jsonString string = jsonLib.convertToJSON(family);
|
||||
|
||||
// Show JSON string
|
||||
SysLib.writeStdout(jsonString);
|
||||
Loading…
Add table
Add a link
Reference in a new issue