Commit 278fbb31 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Update iterators

parent f868ae2c
......@@ -5,6 +5,8 @@ package body ASN1_Iterators.iterators is
-- ASN.1 File dataview-uniq.asn
-- Module TASTE_BasicTypes
package body T_Int_pkg is
function Image(Elm: ASN1_Type) return String is (Elm'Img);
procedure To_ASN1(from: Interfaces.Integer_64; to: out ASN1_Type) is
begin
to := from;
......@@ -18,6 +20,15 @@ package body ASN1_Iterators.iterators is
end loop;
to.length := from.length;
end;
function Image(Elm: ASN1_Type) return String is
(if Elm.Length > 0 then
(Image(Elm.Data(1)) & (if Elm.Length > 1 then "," &
Image(ASN1_Type'(Length => Elm.Length-1,
Data => Elm.Data(2..Elm.Length) &
Elm.Data(1..Elm.Data'Length-Elm.Length+1)))
else ""))
else "");
end;
end;
\ No newline at end of file
......@@ -7,8 +7,11 @@ with asn1_iterators;
pragma Unreferenced (asn1_iterators);
with Interfaces;
use Interfaces;
with Ada.Strings.Unbounded;
package ASN1_Iterators.iterators is
package Str renames Ada.Strings.Unbounded;
use Str;
-- ASN.1 File dataview-uniq.asn
-- Module TASTE_BasicTypes
......@@ -24,13 +27,16 @@ package ASN1_Iterators.iterators is
package It renames Inner.It;
procedure To_ASN1(from: Interfaces.Integer_64; to: out ASN1_Type);
subtype Instance is Inner.Instance;
function Image(Elm: ASN1_Type) return String;
end;
-- Type "T-SeqOf defined at line 6
package T_SeqOf_pkg is
subtype ASN1_Type is asn1SccT_SeqOf;
package Inner is new Generic_SeqOf (Min => 1, Max => 4, Basic => T_Int_Pkg.It);
procedure To_ASN1 (from: Inner.MySeqOf; to: out ASN1_Type);
use T_Int_Pkg;
procedure To_ASN1(from: Inner.MySeqOf; to: out ASN1_Type);
subtype Instance is Inner.Instance;
function Image(Elm: ASN1_Type) return String;
end;
end;
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment