agpl_1.0.0_b5da3320/src/tests/t007_g2p.adb

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
with Text_Io; use Text_Io;
with Ada.Exceptions; use Ada.Exceptions;

with Agpl.G2.Packet;
use  Agpl.G2;
with Agpl.Streams;
use  Agpl.Streams;

procedure T007_g2p is
   P : constant Packet.Object := Packet.Create ("ADDTASK");
   C :          Packet.Object := Packet.Create ("DESCR", "asldkfjkldrn");
begin
   P.Add_Child (C);
   declare
      Data : constant Stream_Element_Array := P.To_Stream_Element_Array;
   begin
      Put_Line ("Data length is" & Data'Length'Img);
   end;
exception
   when E : others =>
      Put_Line ("Exception: " & Exception_Information (E));
end T007_g2p;