---------------------------------------------------------------------- -- Title : StriAK -- Version : 1.0 -- Copyright : (C) 1994 David Wallace Croft. All rights reserved. -- Author : David Wallace Croft, CompuServe [76600,102] -- Compiler : standard Ada -- Description : String manipulation. ---------------------------------------------------------------------- with ErroAK; use ErroAK; -- for Status_Type in Value with Text_IO; package StriAK is ---------------------------------------------------------------------- ---------------------------------------------------------------------- -- type Base_Type is ( Base_2, Base_8, Base_10, Base_16 ); -- subtype Field is integer range 0..integer'last; -- Default_Fore : constant Field := 2; -- Default_Aft : constant Field := 2; -- float'digits - 1; -- Default_Exp : constant Field := 3; -- Default_Base : constant Base_Type := Base_10; -- Default_Width : constant Field := integer'width; type Character_Is_Valid_Type is array ( character'first..character'last ) of boolean; type Valid_Characters_Type is array ( positive range <> ) of Character_Is_Valid_Type; --------------------------------------------------------------------------- procedure Copy ( New_Str: out string; Copied_Str: in string; Start: in positive; Stop: in natural := 0 ); Procedure Define_Valid_Characters ( Valid_Characters: out Valid_Characters_Type; Definition_Str: in string := "" ); function Filtered ( In_Str: in string; Filter_Str: in string ) return string; function Image ( Item : in integer; Width : in Text_IO.Field := integer'width; Base : in Text_IO.Number_Base := 10; Signed : in boolean := true; Zeroed : in boolean := false ) return string; function Image ( Item : in long_integer; Width : in Text_IO.Field := long_integer'width; Base : in Text_IO.Number_Base := 10; Signed : in boolean := true; Zeroed : in boolean := false ) return string; function Is_Long_Integer ( Pos_Str : in string; Min : in long_integer := long_integer'first; Max : in long_integer := long_integer'last ) return boolean; function Locate ( Search_Char : in character; Search_Str : in string; Start_Position : in positive := 1 ) return natural; function Locate ( Hunted_Str : in string; Search_Str : in string; Start_Position : in positive := 1 ) return positive; function Merge ( Dominant : in string; Recessive : in string ) return string; procedure MultiChar ( InChar: in character; InStr : in out string ); procedure Parse_Between ( Parsed_Str : out string; Char : in character; After_Char_Num : in natural; In_Str : in string ); procedure Parse_Range ( InStr : in string; Position : in positive; Lo_Num : out natural; Hi_Num : out natural; New_Position : out positive ); function Shift ( Shifted : string; Left : integer := 1 ) return string; ---------------------------------------------------------------------- -- Does not rotate; open spaces filled with ASCII.Nul. ---------------------------------------------------------------------- procedure Show_Valid_Characters ( Valid_Characters : in Valid_Characters_Type ); procedure Split ( Left_Side, Right_Side : out string; Split_Str : in string; Position : in natural ); procedure Split ( Left_Side, Right_Side : out string; Split_Str : in string; Split_Char : in character; On_Count : in positive := 1); function Strip_White_Space ( InStr: in string ) return string; function Trim_White_Space ( Str : in string ) return string; function Upcase ( InStr : in string ) return string; procedure Value ( Status : out Status_Type; Value_Int : out integer; Str_In : in string ); function Value ( Str_Float : string ) return float; --------------------------------------------------------------------------- end StriAK;