-- This source is licensed under the Sunset License v1.0
with
Ada.Characters.Handling;
package body Deckdata.Process is
package Charhand renames Ada.Characters.Handling;
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 :=
(+"", +"", +"", +"", +"", +"", +"", +"",
+"", +"", +"", +"", +"", +"",
+"", +"", +"", +"", +"", +"");
begin
for N of Notes loop
for S of Formatting loop
Strip (N, -S);
end loop;
end loop;
end Strip_Formatting;
end Deckdata.Process;