1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . S T R I N G S . F I X E D --
10 -- Copyright (C) 1992-1997 Free Software Foundation, Inc. --
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. --
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. --
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. --
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). --
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 --------------------------------------------------------------
52 Drop
: in Truncation
:= Error
;
53 Justify
: in Alignment
:= Left
;
54 Pad
: in Character := Space
);
56 ------------------------
57 -- Search Subprograms --
58 ------------------------
63 Going
: in Direction
:= Forward
;
64 Mapping
: in Maps
.Character_Mapping
:= Maps
.Identity
)
70 Going
: in Direction
:= Forward
;
71 Mapping
: in Maps
.Character_Mapping_Function
)
76 Set
: in Maps
.Character_Set
;
77 Test
: in Membership
:= Inside
;
78 Going
: in Direction
:= Forward
)
81 function Index_Non_Blank
83 Going
: in Direction
:= Forward
)
89 Mapping
: in Maps
.Character_Mapping
:= Maps
.Identity
)
95 Mapping
: in Maps
.Character_Mapping_Function
)
100 Set
: in Maps
.Character_Set
)
105 Set
: in Maps
.Character_Set
;
106 Test
: in Membership
;
107 First
: out Positive;
110 ------------------------------------
111 -- String Translation Subprograms --
112 ------------------------------------
116 Mapping
: in Maps
.Character_Mapping
)
120 (Source
: in out String;
121 Mapping
: in Maps
.Character_Mapping
);
125 Mapping
: in Maps
.Character_Mapping_Function
)
129 (Source
: in out String;
130 Mapping
: in Maps
.Character_Mapping_Function
);
132 ---------------------------------------
133 -- String Transformation Subprograms --
134 ---------------------------------------
136 function Replace_Slice
143 procedure Replace_Slice
144 (Source
: in out String;
148 Drop
: in Truncation
:= Error
;
149 Justify
: in Alignment
:= Left
;
150 Pad
: in Character := Space
);
154 Before
: in Positive;
155 New_Item
: in String)
159 (Source
: in out String;
160 Before
: in Positive;
161 New_Item
: in String;
162 Drop
: in Truncation
:= Error
);
166 Position
: in Positive;
167 New_Item
: in String)
171 (Source
: in out String;
172 Position
: in Positive;
173 New_Item
: in String;
174 Drop
: in Truncation
:= Right
);
179 Through
: in Natural)
183 (Source
: in out String;
185 Through
: in Natural;
186 Justify
: in Alignment
:= Left
;
187 Pad
: in Character := Space
);
189 ---------------------------------
190 -- String Selector Subprograms --
191 ---------------------------------
199 (Source
: in out String;
201 Justify
: in Alignment
:= Left
;
202 Pad
: in Character := Space
);
206 Left
: in Maps
.Character_Set
;
207 Right
: in Maps
.Character_Set
)
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
);
220 Pad
: in Character := Space
)
224 (Source
: in out String;
226 Justify
: in Alignment
:= Left
;
227 Pad
: in Character := Space
);
232 Pad
: in Character := Space
)
236 (Source
: in out String;
238 Justify
: in Alignment
:= Left
;
239 Pad
: in Character := Space
);
241 ----------------------------------
242 -- String Constructor Functions --
243 ----------------------------------
247 Right
: in Character)
255 end Ada
.Strings
.Fixed
;