1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . S T R I N G S . F I X E D --
9 -- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
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. --
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. --
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. --
33 -- GNAT was originally developed by the GNAT team at New York University. --
34 -- Extensive contributions were provided by Ada Core Technologies Inc. --
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 --------------------------------------------------------------
51 Drop
: in Truncation
:= Error
;
52 Justify
: in Alignment
:= Left
;
53 Pad
: in Character := Space
);
55 ------------------------
56 -- Search Subprograms --
57 ------------------------
62 Going
: in Direction
:= Forward
;
63 Mapping
: in Maps
.Character_Mapping
:= Maps
.Identity
)
69 Going
: in Direction
:= Forward
;
70 Mapping
: in Maps
.Character_Mapping_Function
)
75 Set
: in Maps
.Character_Set
;
76 Test
: in Membership
:= Inside
;
77 Going
: in Direction
:= Forward
)
80 function Index_Non_Blank
82 Going
: in Direction
:= Forward
)
88 Mapping
: in Maps
.Character_Mapping
:= Maps
.Identity
)
94 Mapping
: in Maps
.Character_Mapping_Function
)
99 Set
: in Maps
.Character_Set
)
104 Set
: in Maps
.Character_Set
;
105 Test
: in Membership
;
106 First
: out Positive;
109 ------------------------------------
110 -- String Translation Subprograms --
111 ------------------------------------
115 Mapping
: in Maps
.Character_Mapping
)
119 (Source
: in out String;
120 Mapping
: in Maps
.Character_Mapping
);
124 Mapping
: in Maps
.Character_Mapping_Function
)
128 (Source
: in out String;
129 Mapping
: in Maps
.Character_Mapping_Function
);
131 ---------------------------------------
132 -- String Transformation Subprograms --
133 ---------------------------------------
135 function Replace_Slice
142 procedure Replace_Slice
143 (Source
: in out String;
147 Drop
: in Truncation
:= Error
;
148 Justify
: in Alignment
:= Left
;
149 Pad
: in Character := Space
);
153 Before
: in Positive;
154 New_Item
: in String)
158 (Source
: in out String;
159 Before
: in Positive;
160 New_Item
: in String;
161 Drop
: in Truncation
:= Error
);
165 Position
: in Positive;
166 New_Item
: in String)
170 (Source
: in out String;
171 Position
: in Positive;
172 New_Item
: in String;
173 Drop
: in Truncation
:= Right
);
178 Through
: in Natural)
182 (Source
: in out String;
184 Through
: in Natural;
185 Justify
: in Alignment
:= Left
;
186 Pad
: in Character := Space
);
188 ---------------------------------
189 -- String Selector Subprograms --
190 ---------------------------------
198 (Source
: in out String;
200 Justify
: in Alignment
:= Left
;
201 Pad
: in Character := Space
);
205 Left
: in Maps
.Character_Set
;
206 Right
: in Maps
.Character_Set
)
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
);
219 Pad
: in Character := Space
)
223 (Source
: in out String;
225 Justify
: in Alignment
:= Left
;
226 Pad
: in Character := Space
);
231 Pad
: in Character := Space
)
235 (Source
: in out String;
237 Justify
: in Alignment
:= Left
;
238 Pad
: in Character := Space
);
240 ----------------------------------
241 -- String Constructor Functions --
242 ----------------------------------
246 Right
: in Character)
254 end Ada
.Strings
.Fixed
;