* config/c4x/c4x.h (INITIALIZE_TRAMPOLINE): Replace 'tramp' with 'TRAMP' in
[official-gcc.git] / gcc / ada / a-strfix.ads
blob6b0c147e1edc698e4ffd7f625abee191f41a63c4
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 -- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
10 -- --
11 -- This specification is derived from the Ada Reference Manual for use with --
12 -- GNAT. The copyright notice above, and the license provisions that follow --
13 -- apply solely to the contents of the part following the private keyword. --
14 -- --
15 -- GNAT is free software; you can redistribute it and/or modify it under --
16 -- terms of the GNU General Public License as published by the Free Soft- --
17 -- ware Foundation; either version 2, or (at your option) any later ver- --
18 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
19 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
20 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
21 -- for more details. You should have received a copy of the GNU General --
22 -- Public License distributed with GNAT; see file COPYING. If not, write --
23 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
24 -- MA 02111-1307, USA. --
25 -- --
26 -- As a special exception, if other files instantiate generics from this --
27 -- unit, or you link this unit with other files to produce an executable, --
28 -- this unit does not by itself cause the resulting executable to be --
29 -- covered by the GNU General Public License. This exception does not --
30 -- however invalidate any other reasons why the executable file might be --
31 -- covered by the GNU Public License. --
32 -- --
33 -- GNAT was originally developed by the GNAT team at New York University. --
34 -- Extensive contributions were provided by Ada Core Technologies Inc. --
35 -- --
36 ------------------------------------------------------------------------------
39 with Ada.Strings.Maps;
41 package Ada.Strings.Fixed is
42 pragma Preelaborate (Fixed);
44 --------------------------------------------------------------
45 -- Copy Procedure for Strings of Possibly Different Lengths --
46 --------------------------------------------------------------
48 procedure Move
49 (Source : in String;
50 Target : out String;
51 Drop : in Truncation := Error;
52 Justify : in Alignment := Left;
53 Pad : in Character := Space);
55 ------------------------
56 -- Search Subprograms --
57 ------------------------
59 function Index
60 (Source : in String;
61 Pattern : in String;
62 Going : in Direction := Forward;
63 Mapping : in Maps.Character_Mapping := Maps.Identity)
64 return Natural;
66 function Index
67 (Source : in String;
68 Pattern : in String;
69 Going : in Direction := Forward;
70 Mapping : in Maps.Character_Mapping_Function)
71 return Natural;
73 function Index
74 (Source : in String;
75 Set : in Maps.Character_Set;
76 Test : in Membership := Inside;
77 Going : in Direction := Forward)
78 return Natural;
80 function Index_Non_Blank
81 (Source : in String;
82 Going : in Direction := Forward)
83 return Natural;
85 function Count
86 (Source : in String;
87 Pattern : in String;
88 Mapping : in Maps.Character_Mapping := Maps.Identity)
89 return Natural;
91 function Count
92 (Source : in String;
93 Pattern : in String;
94 Mapping : in Maps.Character_Mapping_Function)
95 return Natural;
97 function Count
98 (Source : in String;
99 Set : in Maps.Character_Set)
100 return Natural;
102 procedure Find_Token
103 (Source : in String;
104 Set : in Maps.Character_Set;
105 Test : in Membership;
106 First : out Positive;
107 Last : out Natural);
109 ------------------------------------
110 -- String Translation Subprograms --
111 ------------------------------------
113 function Translate
114 (Source : in String;
115 Mapping : in Maps.Character_Mapping)
116 return String;
118 procedure Translate
119 (Source : in out String;
120 Mapping : in Maps.Character_Mapping);
122 function Translate
123 (Source : in String;
124 Mapping : in Maps.Character_Mapping_Function)
125 return String;
127 procedure Translate
128 (Source : in out String;
129 Mapping : in Maps.Character_Mapping_Function);
131 ---------------------------------------
132 -- String Transformation Subprograms --
133 ---------------------------------------
135 function Replace_Slice
136 (Source : in String;
137 Low : in Positive;
138 High : in Natural;
139 By : in String)
140 return String;
142 procedure Replace_Slice
143 (Source : in out String;
144 Low : in Positive;
145 High : in Natural;
146 By : in String;
147 Drop : in Truncation := Error;
148 Justify : in Alignment := Left;
149 Pad : in Character := Space);
151 function Insert
152 (Source : in String;
153 Before : in Positive;
154 New_Item : in String)
155 return String;
157 procedure Insert
158 (Source : in out String;
159 Before : in Positive;
160 New_Item : in String;
161 Drop : in Truncation := Error);
163 function Overwrite
164 (Source : in String;
165 Position : in Positive;
166 New_Item : in String)
167 return String;
169 procedure Overwrite
170 (Source : in out String;
171 Position : in Positive;
172 New_Item : in String;
173 Drop : in Truncation := Right);
175 function Delete
176 (Source : in String;
177 From : in Positive;
178 Through : in Natural)
179 return String;
181 procedure Delete
182 (Source : in out String;
183 From : in Positive;
184 Through : in Natural;
185 Justify : in Alignment := Left;
186 Pad : in Character := Space);
188 ---------------------------------
189 -- String Selector Subprograms --
190 ---------------------------------
192 function Trim
193 (Source : in String;
194 Side : in Trim_End)
195 return String;
197 procedure Trim
198 (Source : in out String;
199 Side : in Trim_End;
200 Justify : in Alignment := Left;
201 Pad : in Character := Space);
203 function Trim
204 (Source : in String;
205 Left : in Maps.Character_Set;
206 Right : in Maps.Character_Set)
207 return String;
209 procedure Trim
210 (Source : in out String;
211 Left : in Maps.Character_Set;
212 Right : in Maps.Character_Set;
213 Justify : in Alignment := Strings.Left;
214 Pad : in Character := Space);
216 function Head
217 (Source : in String;
218 Count : in Natural;
219 Pad : in Character := Space)
220 return String;
222 procedure Head
223 (Source : in out String;
224 Count : in Natural;
225 Justify : in Alignment := Left;
226 Pad : in Character := Space);
228 function Tail
229 (Source : in String;
230 Count : in Natural;
231 Pad : in Character := Space)
232 return String;
234 procedure Tail
235 (Source : in out String;
236 Count : in Natural;
237 Justify : in Alignment := Left;
238 Pad : in Character := Space);
240 ----------------------------------
241 -- String Constructor Functions --
242 ----------------------------------
244 function "*"
245 (Left : in Natural;
246 Right : in Character)
247 return String;
249 function "*"
250 (Left : in Natural;
251 Right : in String)
252 return String;
254 end Ada.Strings.Fixed;