OSDN Git Service

* config/vax/vax.h (target_flags, MASK_UNIX_ASM, MASK_VAXC_ALIGNMENT)
[pf3gnuchains/gcc-fork.git] / gcc / ada / a-strfix.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT RUN-TIME COMPONENTS                         --
4 --                                                                          --
5 --                    A D A . S T R I N G S . F I X E D                     --
6 --                                                                          --
7 --                                 S p e c                                  --
8 --                                                                          --
9 -- This specification is adapted from the Ada Reference Manual for use with --
10 -- GNAT.  In accordance with the copyright of that document, you can freely --
11 -- copy and modify this specification,  provided that if you redistribute a --
12 -- modified version,  any changes that you have made are clearly indicated. --
13 --                                                                          --
14 ------------------------------------------------------------------------------
15
16
17 with Ada.Strings.Maps;
18
19 package Ada.Strings.Fixed is
20 pragma Preelaborate (Fixed);
21
22    --------------------------------------------------------------
23    -- Copy Procedure for Strings of Possibly Different Lengths --
24    --------------------------------------------------------------
25
26    procedure Move
27      (Source  : String;
28       Target  : out String;
29       Drop    : Truncation := Error;
30       Justify : Alignment  := Left;
31       Pad     : Character  := Space);
32
33    ------------------------
34    -- Search Subprograms --
35    ------------------------
36
37    function Index
38      (Source  : String;
39       Pattern : String;
40       Going   : Direction := Forward;
41       Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
42
43    function Index
44      (Source  : String;
45       Pattern : String;
46       Going   : Direction := Forward;
47       Mapping : Maps.Character_Mapping_Function) return Natural;
48
49    function Index
50      (Source : String;
51       Set    : Maps.Character_Set;
52       Test   : Membership := Inside;
53       Going  : Direction  := Forward) return Natural;
54
55    function Index
56      (Source  : String;
57       Pattern : String;
58       From    : Positive;
59       Going   : Direction := Forward;
60       Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
61    pragma Ada_05 (Index);
62
63    function Index
64      (Source  : String;
65       Pattern : String;
66       From    : Positive;
67       Going   : Direction := Forward;
68       Mapping : Maps.Character_Mapping_Function) return Natural;
69    pragma Ada_05 (Index);
70
71    function Index
72      (Source  : String;
73       Set     : Maps.Character_Set;
74       From    : Positive;
75       Test    : Membership := Inside;
76       Going   : Direction := Forward) return Natural;
77    pragma Ada_05 (Index);
78
79    function Index_Non_Blank
80      (Source : String;
81       Going  : Direction := Forward) return Natural;
82
83    function Index_Non_Blank
84      (Source : String;
85       From   : Positive;
86       Going  : Direction := Forward) return Natural;
87    pragma Ada_05 (Index_Non_Blank);
88
89    function Count
90      (Source  : String;
91       Pattern : String;
92       Mapping : Maps.Character_Mapping := Maps.Identity) return Natural;
93
94    function Count
95      (Source  : String;
96       Pattern : String;
97       Mapping : Maps.Character_Mapping_Function) return Natural;
98
99    function Count
100      (Source : String;
101       Set    : Maps.Character_Set) return Natural;
102
103    procedure Find_Token
104      (Source : String;
105       Set    : Maps.Character_Set;
106       Test   : Membership;
107       First  : out Positive;
108       Last   : out Natural);
109
110    ------------------------------------
111    -- String Translation Subprograms --
112    ------------------------------------
113
114    function Translate
115      (Source  : String;
116       Mapping : Maps.Character_Mapping) return String;
117
118    procedure Translate
119      (Source  : in out String;
120       Mapping : Maps.Character_Mapping);
121
122    function Translate
123      (Source  : String;
124       Mapping : Maps.Character_Mapping_Function) return String;
125
126    procedure Translate
127      (Source  : in out String;
128       Mapping : Maps.Character_Mapping_Function);
129
130    ---------------------------------------
131    -- String Transformation Subprograms --
132    ---------------------------------------
133
134    function Replace_Slice
135      (Source : String;
136       Low    : Positive;
137       High   : Natural;
138       By     : String) return String;
139
140    procedure Replace_Slice
141      (Source  : in out String;
142       Low     : Positive;
143       High    : Natural;
144       By      : String;
145       Drop    : Truncation := Error;
146       Justify : Alignment  := Left;
147       Pad     : Character  := Space);
148
149    function Insert
150      (Source   : String;
151       Before   : Positive;
152       New_Item : String) return String;
153
154    procedure Insert
155      (Source   : in out String;
156       Before   : Positive;
157       New_Item : String;
158       Drop     : Truncation := Error);
159
160    function Overwrite
161      (Source   : String;
162       Position : Positive;
163       New_Item : String) return String;
164
165    procedure Overwrite
166      (Source   : in out String;
167       Position : Positive;
168       New_Item : String;
169       Drop     : Truncation := Right);
170
171    function Delete
172      (Source  : String;
173       From    : Positive;
174       Through : Natural) return String;
175
176    procedure Delete
177      (Source  : in out String;
178       From    : Positive;
179       Through : Natural;
180       Justify : Alignment := Left;
181       Pad     : Character := Space);
182
183    ---------------------------------
184    -- String Selector Subprograms --
185    ---------------------------------
186
187    function Trim
188      (Source : String;
189       Side   : Trim_End) return String;
190
191    procedure Trim
192      (Source  : in out String;
193       Side    : Trim_End;
194       Justify : Alignment := Left;
195       Pad     : Character := Space);
196
197    function Trim
198      (Source : String;
199       Left   : Maps.Character_Set;
200       Right  : Maps.Character_Set) return String;
201
202    procedure Trim
203      (Source  : in out String;
204       Left    : Maps.Character_Set;
205       Right   : Maps.Character_Set;
206       Justify : Alignment := Strings.Left;
207       Pad     : Character := Space);
208
209    function Head
210      (Source : String;
211       Count  : Natural;
212       Pad    : Character := Space) return String;
213
214    procedure Head
215      (Source  : in out String;
216       Count   : Natural;
217       Justify : Alignment := Left;
218       Pad     : Character := Space);
219
220    function Tail
221      (Source : String;
222       Count  : Natural;
223       Pad    : Character := Space) return String;
224
225    procedure Tail
226      (Source  : in out String;
227       Count   : Natural;
228       Justify : Alignment := Left;
229       Pad     : Character := Space);
230
231    ----------------------------------
232    -- String Constructor Functions --
233    ----------------------------------
234
235    function "*"
236      (Left  : Natural;
237       Right : Character) return String;
238
239    function "*"
240      (Left  : Natural;
241       Right : String) return String;
242
243 end Ada.Strings.Fixed;