diff options
Diffstat (limited to 'src/deck_convert.adb')
-rw-r--r-- | src/deck_convert.adb | 57 |
1 files changed, 12 insertions, 45 deletions
diff --git a/src/deck_convert.adb b/src/deck_convert.adb index 665fa5e..9eed9c7 100644 --- a/src/deck_convert.adb +++ b/src/deck_convert.adb @@ -14,13 +14,13 @@ with Ada.Directories, Ada.Strings.Unbounded, Ada.Text_IO, - Datatypes, - Deck_IO; + Deckdata.IO, + Deckdata.Process; use Ada.Text_IO, - Datatypes; + Deckdata; procedure Deck_Convert is @@ -50,39 +50,6 @@ procedure Deck_Convert is renames SU.To_String; - procedure Strip_Formatting - (Notes : in out Note_Vector) - is - procedure Strip - (Text : in out Note; - Item : in String) - is - Position : Natural; - begin - for F of Text.Fields loop - loop - Position := SU.Index - (Source => SU.Unbounded_String (F), - Pattern => Item, - Going => Ada.Strings.Forward, - Mapping => Charhand.To_Lower'Access); - exit when Position = 0; - SU.Delete (SU.Unbounded_String (F), Position, Position + Item'Length - 1); - end loop; - end loop; - end Strip; - - Formatting : array (Positive range <>) of SU.Unbounded_String := - (+"<b>", +"</b>", +"<strong>", +"</strong>", +"<i>", +"</i>", +"<em>", +"</em>", - +"<mark>", +"</mark>", +"<small>", +"</small>", +"<del>", +"</del>", - +"<ins>", +"</ins>", +"<sub>", +"</sub>", +"<sup>", +"</sup>"); - begin - for N of Notes loop - for S of Formatting loop - Strip (N, -S); - end loop; - end loop; - end Strip_Formatting; Config : GCom.Command_Line_Configuration; @@ -105,7 +72,7 @@ procedure Deck_Convert is Output_Name : SU.Unbounded_String; - Deck : Deck_IO.Deck_Handle; + Deck : Deckdata.IO.Deck_Handle; Models : Model_Map; Notes : Note_Vector; Media : Media_Collection; @@ -226,22 +193,22 @@ begin if Verbose then Put (Standard_Error, "Opening input deck database..."); end if; - Deck_IO.Open_Database (-Input_Name, Deck); + Deckdata.IO.Open_Database (-Input_Name, Deck); if Verbose then Put_Line (Standard_Error, " Done"); Put (Standard_Error, "Querying models..."); end if; - Deck_IO.Query_Models (Deck, Models); + Deckdata.IO.Query_Models (Deck, Models); if Verbose then Put_Line (Standard_Error, " Done"); Put (Standard_Error, "Querying notes..."); end if; - Deck_IO.Query_Notes (Deck, Notes); + Deckdata.IO.Query_Notes (Deck, Notes); if Verbose then Put_Line (Standard_Error, " Done"); Put (Standard_Error, "Closing database..."); end if; - Deck_IO.Close_Database (Deck); + Deckdata.IO.Close_Database (Deck); if Verbose then Put_Line (Standard_Error, " Done"); New_Line (Standard_Error); @@ -251,7 +218,7 @@ begin if Verbose then Put (Standard_Error, "Stripping formatting from deck notes..."); end if; - Strip_Formatting (Notes); + Deckdata.Process.Strip_Formatting (Notes); if Verbose then Put_Line (Standard_Error, " Done"); New_Line (Standard_Error); @@ -266,7 +233,7 @@ begin if Verbose then Put (Standard_Error, "Writing output to CSV..."); end if; - Deck_IO.Write_CSV (Contain_Dir, Simple_Name, Models, Notes, Overwrite); + Deckdata.IO.Write_CSV (Contain_Dir, Simple_Name, Models, Notes, Overwrite); if Verbose then Put_Line (Standard_Error, " Done"); end if; @@ -274,12 +241,12 @@ begin if Verbose then Put (Standard_Error, "Reading media..."); end if; - Deck_IO.Read_Media_Collection (-Input_Name, Media); + Deckdata.IO.Read_Media_Collection (-Input_Name, Media); if Verbose then Put_Line (Standard_Error, " Done"); Put (Standard_Error, "Writing output to Fresh Memory Dictionary..."); end if; - Deck_IO.Write_FMD (Contain_Dir, Simple_Name, Models, Notes, Media, Overwrite); + Deckdata.IO.Write_FMD (Contain_Dir, Simple_Name, Models, Notes, Media, Overwrite); if Verbose then Put_Line (Standard_Error, " Done"); end if; |