Add hppa-openbsd target
[official-gcc.git] / gcc / ada / a-strfix.ads
blobae5344c7f1b2fe510debab76f762bd6b496b58d6
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 -- --
10 -- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
11 -- --
12 -- This specification is derived from the Ada Reference Manual for use with --
13 -- GNAT. The copyright notice above, and the license provisions that follow --
14 -- apply solely to the contents of the part following the private keyword. --
15 -- --
16 -- GNAT is free software; you can redistribute it and/or modify it under --
17 -- terms of the GNU General Public License as published by the Free Soft- --
18 -- ware Foundation; either version 2, or (at your option) any later ver- --
19 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
20 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
21 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
22 -- for more details. You should have received a copy of the GNU General --
23 -- Public License distributed with GNAT; see file COPYING. If not, write --
24 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
25 -- MA 02111-1307, USA. --
26 -- --
27 -- As a special exception, if other files instantiate generics from this --
28 -- unit, or you link this unit with other files to produce an executable, --
29 -- this unit does not by itself cause the resulting executable to be --
30 -- covered by the GNU General Public License. This exception does not --
31 -- however invalidate any other reasons why the executable file might be --
32 -- covered by the GNU Public License. --
33 -- --
34 -- GNAT was originally developed by the GNAT team at New York University. --
35 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
36 -- --
37 ------------------------------------------------------------------------------
40 with Ada.Strings.Maps;
42 package Ada.Strings.Fixed is
43 pragma Preelaborate (Fixed);
45 --------------------------------------------------------------
46 -- Copy Procedure for Strings of Possibly Different Lengths --
47 --------------------------------------------------------------
49 procedure Move
50 (Source : in String;
51 Target : out String;
52 Drop : in Truncation := Error;
53 Justify : in Alignment := Left;
54 Pad : in Character := Space);
56 ------------------------
57 -- Search Subprograms --
58 ------------------------
60 function Index
61 (Source : in String;
62 Pattern : in String;
63 Going : in Direction := Forward;
64 Mapping : in Maps.Character_Mapping := Maps.Identity)
65 return Natural;
67 function Index
68 (Source : in String;
69 Pattern : in String;
70 Going : in Direction := Forward;
71 Mapping : in Maps.Character_Mapping_Function)
72 return Natural;
74 function Index
75 (Source : in String;
76 Set : in Maps.Character_Set;
77 Test : in Membership := Inside;
78 Going : in Direction := Forward)
79 return Natural;
81 function Index_Non_Blank
82 (Source : in String;
83 Going : in Direction := Forward)
84 return Natural;
86 function Count
87 (Source : in String;
88 Pattern : in String;
89 Mapping : in Maps.Character_Mapping := Maps.Identity)
90 return Natural;
92 function Count
93 (Source : in String;
94 Pattern : in String;
95 Mapping : in Maps.Character_Mapping_Function)
96 return Natural;
98 function Count
99 (Source : in String;
100 Set : in Maps.Character_Set)
101 return Natural;
103 procedure Find_Token
104 (Source : in String;
105 Set : in Maps.Character_Set;
106 Test : in Membership;
107 First : out Positive;
108 Last : out Natural);
110 ------------------------------------
111 -- String Translation Subprograms --
112 ------------------------------------
114 function Translate
115 (Source : in String;
116 Mapping : in Maps.Character_Mapping)
117 return String;
119 procedure Translate
120 (Source : in out String;
121 Mapping : in Maps.Character_Mapping);
123 function Translate
124 (Source : in String;
125 Mapping : in Maps.Character_Mapping_Function)
126 return String;
128 procedure Translate
129 (Source : in out String;
130 Mapping : in Maps.Character_Mapping_Function);
132 ---------------------------------------
133 -- String Transformation Subprograms --
134 ---------------------------------------
136 function Replace_Slice
137 (Source : in String;
138 Low : in Positive;
139 High : in Natural;
140 By : in String)
141 return String;
143 procedure Replace_Slice
144 (Source : in out String;
145 Low : in Positive;
146 High : in Natural;
147 By : in String;
148 Drop : in Truncation := Error;
149 Justify : in Alignment := Left;
150 Pad : in Character := Space);
152 function Insert
153 (Source : in String;
154 Before : in Positive;
155 New_Item : in String)
156 return String;
158 procedure Insert
159 (Source : in out String;
160 Before : in Positive;
161 New_Item : in String;
162 Drop : in Truncation := Error);
164 function Overwrite
165 (Source : in String;
166 Position : in Positive;
167 New_Item : in String)
168 return String;
170 procedure Overwrite
171 (Source : in out String;
172 Position : in Positive;
173 New_Item : in String;
174 Drop : in Truncation := Right);
176 function Delete
177 (Source : in String;
178 From : in Positive;
179 Through : in Natural)
180 return String;
182 procedure Delete
183 (Source : in out String;
184 From : in Positive;
185 Through : in Natural;
186 Justify : in Alignment := Left;
187 Pad : in Character := Space);
189 ---------------------------------
190 -- String Selector Subprograms --
191 ---------------------------------
193 function Trim
194 (Source : in String;
195 Side : in Trim_End)
196 return String;
198 procedure Trim
199 (Source : in out String;
200 Side : in Trim_End;
201 Justify : in Alignment := Left;
202 Pad : in Character := Space);
204 function Trim
205 (Source : in String;
206 Left : in Maps.Character_Set;
207 Right : in Maps.Character_Set)
208 return String;
210 procedure Trim
211 (Source : in out String;
212 Left : in Maps.Character_Set;
213 Right : in Maps.Character_Set;
214 Justify : in Alignment := Strings.Left;
215 Pad : in Character := Space);
217 function Head
218 (Source : in String;
219 Count : in Natural;
220 Pad : in Character := Space)
221 return String;
223 procedure Head
224 (Source : in out String;
225 Count : in Natural;
226 Justify : in Alignment := Left;
227 Pad : in Character := Space);
229 function Tail
230 (Source : in String;
231 Count : in Natural;
232 Pad : in Character := Space)
233 return String;
235 procedure Tail
236 (Source : in out String;
237 Count : in Natural;
238 Justify : in Alignment := Left;
239 Pad : in Character := Space);
241 ----------------------------------
242 -- String Constructor Functions --
243 ----------------------------------
245 function "*"
246 (Left : in Natural;
247 Right : in Character)
248 return String;
250 function "*"
251 (Left : in Natural;
252 Right : in String)
253 return String;
255 end Ada.Strings.Fixed;