diff options
Diffstat (limited to 'src/fmd.adb')
-rw-r--r-- | src/fmd.adb | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/fmd.adb b/src/fmd.adb index cd512cb..9fbb4e5 100644 --- a/src/fmd.adb +++ b/src/fmd.adb @@ -5,7 +5,8 @@ with Ada.Characters.Latin_1, Ada.Strings.Fixed, Ada.Strings.Maps, - Ada.Text_IO; + Ada.Text_IO, + Datatypes; use @@ -42,13 +43,13 @@ package body FMD is procedure Put_Fields (File_Handle : in Ada.Text_IO.File_Type; - Field_IDs : in Data_Vectors.Vector) + Field_IDs : in Datatypes.Field_ID_Vector) is Text : SU.Unbounded_String; begin Put_Line (File_Handle, (4 * ' ') & "<fields>"); for FID of Field_IDs loop - Text := Prep (To_Unbounded_String (FID)); + Text := Prep (SU.Unbounded_String (FID)); Put_Line (File_Handle, (8 * ' ') & "<field>" & (-Text) & "</field>"); end loop; Put_Line (File_Handle, (4 * ' ') & "</fields>"); @@ -66,21 +67,23 @@ package body FMD is procedure Put_Pack (File_Handle : in Ada.Text_IO.File_Type; - Q_Data : in Data_Vectors.Vector; - A_Data : in Data_Vectors.Vector) + Q_Data : in Datatypes.Field_ID_Vector; + A_Data : in Datatypes.Field_ID_Vector) is Text : SU.Unbounded_String; begin Put_Line (File_Handle, (8 * ' ') & "<pack>"); - Text := Prep (To_Unbounded_String (Q_Data.First_Element)); + Text := Prep (SU.Unbounded_String (Q_Data.First_Element)); Put_Line (File_Handle, (12 * ' ') & "<qst>" & (-Text) & "</qst>"); - for I in Vector_Index range Vector_Index'Succ (Q_Data.First_Index) .. Q_Data.Last_Index loop - Text := Prep (To_Unbounded_String (Q_Data.Element (I))); + for I in Datatypes.Field_Ordinal range + Datatypes.Field_Ordinal'Succ (Q_Data.First_Index) .. Q_Data.Last_Index + loop + Text := Prep (SU.Unbounded_String (Q_Data.Element (I))); -- Fresh Memory unfortunately cannot cope with multiple question fields Put_Line (File_Handle, (12 * ' ') & "<!--" & "<qst>" & (-Text) & "</qst>" & "-->"); end loop; for FID of A_Data loop - Text := Prep (To_Unbounded_String (FID)); + Text := Prep (SU.Unbounded_String (FID)); Put_Line (File_Handle, (12 * ' ') & "<ans>" & (-Text) & "</ans>"); end loop; Put_Line (File_Handle, (8 * ' ') & "</pack>"); @@ -105,22 +108,23 @@ package body FMD is procedure Put_Entry (File_Handle : in Ada.Text_IO.File_Type; - Data : in Data_Vectors.Vector; + Data : in Datatypes.Field_Vector; Quantity : in Positive) is + use type Datatypes.Field_Ordinal; Counter : Positive := 1; - Position : Vector_Index := Data.First_Index; + Position : Datatypes.Field_Ordinal := Data.First_Index; Text : SU.Unbounded_String; begin Put_Line (File_Handle, (8 * ' ') & "<e>"); while Counter <= Quantity loop if Position <= Data.Last_Index then - Text := Prep (To_Unbounded_String (Data.Element (Position))); + Text := Prep (SU.Unbounded_String (Data.Element (Position))); Put_Line (File_Handle, (12 * ' ') & "<f>" & (-Text) & "</f>"); else Put_Line (File_Handle, (12 * ' ') & "<f></f>"); end if; - Position := Vector_Index'Succ (Position); + Position := Datatypes.Field_Ordinal'Succ (Position); Counter := Counter + 1; end loop; Put_Line (File_Handle, (8 * ' ') & "</e>"); |