diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-10 13:51:40 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-10 13:51:40 +0000 |
commit | 8ee79a8446354ac1a9e20fd284e879a3d55860ba (patch) | |
tree | 63cfc97375650994bb335d260cabbdfd63f70efd /gcc/ada/a-stwifi.adb | |
parent | 7189d17fd684291638652f906a2c14487fe77419 (diff) | |
download | gcc-8ee79a8446354ac1a9e20fd284e879a3d55860ba.tar.gz |
2005-02-09 Robert Dewar <dewar@adacore.com>
* a-strunb.ads, a-strunb.adb: Add missing pragma Ada_05 statements
Fix name of Set routine
* a-strfix.ads, a-strfix.adb: Add new index functions from AI-301 to
fixed packages.
* a-stwise.ads, a-stwise.adb, a-stwifi.ads, a-stwifi.adb,
a-strsea.ads, a-strsea.adb: Add new index functions from AI-301 to
fixed packages
* a-witeio.ads, a-witeio.adb, a-textio.ads, a-textio.adb: New function
forms of Get_Line subprograms for AI-301.
* a-wtcoau.adb, a-wtcoau.ads, a-wtcoio.adb, a-wtcoio.ads,
a-wtedit.adb, a-wtedit.adb, a-wtedit.ads, a-wttest.adb,
a-wttest.ads, a-strmap.ads, a-strmap.adb, a-stwima.adb,
a-stwima.ads: Minor reformatting.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94810 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-stwifi.adb')
-rw-r--r-- | gcc/ada/a-stwifi.adb | 238 |
1 files changed, 126 insertions, 112 deletions
diff --git a/gcc/ada/a-stwifi.adb b/gcc/ada/a-stwifi.adb index 100fb8019e6..f7d64c9af3c 100644 --- a/gcc/ada/a-stwifi.adb +++ b/gcc/ada/a-stwifi.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -41,59 +41,85 @@ package body Ada.Strings.Wide_Fixed is ------------------------ function Index - (Source : in Wide_String; - Pattern : in Wide_String; - Going : in Direction := Forward; - Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) - return Natural + (Source : Wide_String; + Pattern : Wide_String; + Going : Direction := Forward; + Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) + return Natural renames Ada.Strings.Wide_Search.Index; function Index - (Source : in Wide_String; - Pattern : in Wide_String; - Going : in Direction := Forward; - Mapping : in Wide_Maps.Wide_Character_Mapping_Function) - return Natural + (Source : Wide_String; + Pattern : Wide_String; + Going : Direction := Forward; + Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural renames Ada.Strings.Wide_Search.Index; function Index - (Source : in Wide_String; - Set : in Wide_Maps.Wide_Character_Set; - Test : in Membership := Inside; - Going : in Direction := Forward) - return Natural + (Source : Wide_String; + Set : Wide_Maps.Wide_Character_Set; + Test : Membership := Inside; + Going : Direction := Forward) return Natural renames Ada.Strings.Wide_Search.Index; + function Index + (Source : Wide_String; + Pattern : Wide_String; + From : Positive; + Going : Direction := Forward; + Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) + return Natural + renames Ada.Strings.Wide_Search.Index; + + function Index + (Source : Wide_String; + Pattern : Wide_String; + From : Positive; + Going : Direction := Forward; + Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural + renames Ada.Strings.Wide_Search.Index; + + function Index + (Source : Wide_String; + Set : Wide_Maps.Wide_Character_Set; + From : Positive; + Test : Membership := Inside; + Going : Direction := Forward) return Natural + renames Ada.Strings.Wide_Search.Index; + + function Index_Non_Blank + (Source : Wide_String; + Going : Direction := Forward) return Natural + renames Ada.Strings.Wide_Search.Index_Non_Blank; + function Index_Non_Blank - (Source : in Wide_String; - Going : in Direction := Forward) - return Natural + (Source : Wide_String; + From : Positive; + Going : Direction := Forward) return Natural renames Ada.Strings.Wide_Search.Index_Non_Blank; function Count - (Source : in Wide_String; - Pattern : in Wide_String; - Mapping : in Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) - return Natural + (Source : Wide_String; + Pattern : Wide_String; + Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity) + return Natural renames Ada.Strings.Wide_Search.Count; function Count - (Source : in Wide_String; - Pattern : in Wide_String; - Mapping : in Wide_Maps.Wide_Character_Mapping_Function) - return Natural + (Source : Wide_String; + Pattern : Wide_String; + Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural renames Ada.Strings.Wide_Search.Count; function Count - (Source : in Wide_String; - Set : in Wide_Maps.Wide_Character_Set) - return Natural + (Source : Wide_String; + Set : Wide_Maps.Wide_Character_Set) return Natural renames Ada.Strings.Wide_Search.Count; procedure Find_Token - (Source : in Wide_String; - Set : in Wide_Maps.Wide_Character_Set; - Test : in Membership; + (Source : Wide_String; + Set : Wide_Maps.Wide_Character_Set; + Test : Membership; First : out Positive; Last : out Natural) renames Ada.Strings.Wide_Search.Find_Token; @@ -103,9 +129,8 @@ package body Ada.Strings.Wide_Fixed is --------- function "*" - (Left : in Natural; - Right : in Wide_Character) - return Wide_String + (Left : Natural; + Right : Wide_Character) return Wide_String is Result : Wide_String (1 .. Left); @@ -118,9 +143,8 @@ package body Ada.Strings.Wide_Fixed is end "*"; function "*" - (Left : in Natural; - Right : in Wide_String) - return Wide_String + (Left : Natural; + Right : Wide_String) return Wide_String is Result : Wide_String (1 .. Left * Right'Length); Ptr : Integer := 1; @@ -139,10 +163,9 @@ package body Ada.Strings.Wide_Fixed is ------------ function Delete - (Source : in Wide_String; - From : in Positive; - Through : in Natural) - return Wide_String + (Source : Wide_String; + From : Positive; + Through : Natural) return Wide_String is begin if From not in Source'Range @@ -168,10 +191,10 @@ package body Ada.Strings.Wide_Fixed is procedure Delete (Source : in out Wide_String; - From : in Positive; - Through : in Natural; - Justify : in Alignment := Left; - Pad : in Wide_Character := Wide_Space) + From : Positive; + Through : Natural; + Justify : Alignment := Left; + Pad : Wide_Character := Wide_Space) is begin Move (Source => Delete (Source, From, Through), @@ -185,10 +208,9 @@ package body Ada.Strings.Wide_Fixed is ---------- function Head - (Source : in Wide_String; - Count : in Natural; - Pad : in Wide_Character := Wide_Space) - return Wide_String + (Source : Wide_String; + Count : Natural; + Pad : Wide_Character := Wide_Space) return Wide_String is Result : Wide_String (1 .. Count); @@ -209,9 +231,9 @@ package body Ada.Strings.Wide_Fixed is procedure Head (Source : in out Wide_String; - Count : in Natural; - Justify : in Alignment := Left; - Pad : in Wide_Character := Ada.Strings.Wide_Space) + Count : Natural; + Justify : Alignment := Left; + Pad : Wide_Character := Ada.Strings.Wide_Space) is begin Move (Source => Head (Source, Count, Pad), @@ -226,10 +248,9 @@ package body Ada.Strings.Wide_Fixed is ------------ function Insert - (Source : in Wide_String; - Before : in Positive; - New_Item : in Wide_String) - return Wide_String + (Source : Wide_String; + Before : Positive; + New_Item : Wide_String) return Wide_String is Result : Wide_String (1 .. Source'Length + New_Item'Length); @@ -245,9 +266,9 @@ package body Ada.Strings.Wide_Fixed is procedure Insert (Source : in out Wide_String; - Before : in Positive; - New_Item : in Wide_String; - Drop : in Truncation := Error) + Before : Positive; + New_Item : Wide_String; + Drop : Truncation := Error) is begin Move (Source => Insert (Source, Before, New_Item), @@ -260,11 +281,11 @@ package body Ada.Strings.Wide_Fixed is ---------- procedure Move - (Source : in Wide_String; + (Source : Wide_String; Target : out Wide_String; - Drop : in Truncation := Error; - Justify : in Alignment := Left; - Pad : in Wide_Character := Wide_Space) + Drop : Truncation := Error; + Justify : Alignment := Left; + Pad : Wide_Character := Wide_Space) is Sfirst : constant Integer := Source'First; Slast : constant Integer := Source'Last; @@ -369,10 +390,9 @@ package body Ada.Strings.Wide_Fixed is --------------- function Overwrite - (Source : in Wide_String; - Position : in Positive; - New_Item : in Wide_String) - return Wide_String + (Source : Wide_String; + Position : Positive; + New_Item : Wide_String) return Wide_String is begin if Position not in Source'First .. Source'Last + 1 then @@ -396,9 +416,9 @@ package body Ada.Strings.Wide_Fixed is procedure Overwrite (Source : in out Wide_String; - Position : in Positive; - New_Item : in Wide_String; - Drop : in Truncation := Right) + Position : Positive; + New_Item : Wide_String; + Drop : Truncation := Right) is begin Move (Source => Overwrite (Source, Position, New_Item), @@ -411,11 +431,10 @@ package body Ada.Strings.Wide_Fixed is ------------------- function Replace_Slice - (Source : in Wide_String; - Low : in Positive; - High : in Natural; - By : in Wide_String) - return Wide_String + (Source : Wide_String; + Low : Positive; + High : Natural; + By : Wide_String) return Wide_String is Result_Length : Natural; @@ -446,12 +465,12 @@ package body Ada.Strings.Wide_Fixed is procedure Replace_Slice (Source : in out Wide_String; - Low : in Positive; - High : in Natural; - By : in Wide_String; - Drop : in Truncation := Error; - Justify : in Alignment := Left; - Pad : in Wide_Character := Wide_Space) + Low : Positive; + High : Natural; + By : Wide_String; + Drop : Truncation := Error; + Justify : Alignment := Left; + Pad : Wide_Character := Wide_Space) is begin Move (Replace_Slice (Source, Low, High, By), Source, Drop, Justify, Pad); @@ -462,10 +481,9 @@ package body Ada.Strings.Wide_Fixed is ---------- function Tail - (Source : in Wide_String; - Count : in Natural; - Pad : in Wide_Character := Wide_Space) - return Wide_String + (Source : Wide_String; + Count : Natural; + Pad : Wide_Character := Wide_Space) return Wide_String is Result : Wide_String (1 .. Count); @@ -488,9 +506,9 @@ package body Ada.Strings.Wide_Fixed is procedure Tail (Source : in out Wide_String; - Count : in Natural; - Justify : in Alignment := Left; - Pad : in Wide_Character := Ada.Strings.Wide_Space) + Count : Natural; + Justify : Alignment := Left; + Pad : Wide_Character := Ada.Strings.Wide_Space) is begin Move (Source => Tail (Source, Count, Pad), @@ -505,9 +523,8 @@ package body Ada.Strings.Wide_Fixed is --------------- function Translate - (Source : in Wide_String; - Mapping : in Wide_Maps.Wide_Character_Mapping) - return Wide_String + (Source : Wide_String; + Mapping : Wide_Maps.Wide_Character_Mapping) return Wide_String is Result : Wide_String (1 .. Source'Length); @@ -521,7 +538,7 @@ package body Ada.Strings.Wide_Fixed is procedure Translate (Source : in out Wide_String; - Mapping : in Wide_Maps.Wide_Character_Mapping) + Mapping : Wide_Maps.Wide_Character_Mapping) is begin for J in Source'Range loop @@ -530,9 +547,8 @@ package body Ada.Strings.Wide_Fixed is end Translate; function Translate - (Source : in Wide_String; - Mapping : in Wide_Maps.Wide_Character_Mapping_Function) - return Wide_String + (Source : Wide_String; + Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Wide_String is Result : Wide_String (1 .. Source'Length); @@ -546,7 +562,7 @@ package body Ada.Strings.Wide_Fixed is procedure Translate (Source : in out Wide_String; - Mapping : in Wide_Maps.Wide_Character_Mapping_Function) + Mapping : Wide_Maps.Wide_Character_Mapping_Function) is begin for J in Source'Range loop @@ -559,9 +575,8 @@ package body Ada.Strings.Wide_Fixed is ---------- function Trim - (Source : in Wide_String; - Side : in Trim_End) - return Wide_String + (Source : Wide_String; + Side : Trim_End) return Wide_String is Low : Natural := Source'First; High : Natural := Source'Last; @@ -599,9 +614,9 @@ package body Ada.Strings.Wide_Fixed is procedure Trim (Source : in out Wide_String; - Side : in Trim_End; - Justify : in Alignment := Left; - Pad : in Wide_Character := Wide_Space) + Side : Trim_End; + Justify : Alignment := Left; + Pad : Wide_Character := Wide_Space) is begin Move (Source => Trim (Source, Side), @@ -611,10 +626,9 @@ package body Ada.Strings.Wide_Fixed is end Trim; function Trim - (Source : in Wide_String; - Left : in Wide_Maps.Wide_Character_Set; - Right : in Wide_Maps.Wide_Character_Set) - return Wide_String + (Source : Wide_String; + Left : Wide_Maps.Wide_Character_Set; + Right : Wide_Maps.Wide_Character_Set) return Wide_String is Low : Natural := Source'First; High : Natural := Source'Last; @@ -644,10 +658,10 @@ package body Ada.Strings.Wide_Fixed is procedure Trim (Source : in out Wide_String; - Left : in Wide_Maps.Wide_Character_Set; - Right : in Wide_Maps.Wide_Character_Set; - Justify : in Alignment := Strings.Left; - Pad : in Wide_Character := Wide_Space) + Left : Wide_Maps.Wide_Character_Set; + Right : Wide_Maps.Wide_Character_Set; + Justify : Alignment := Strings.Left; + Pad : Wide_Character := Wide_Space) is begin Move (Source => Trim (Source, Left, Right), |