1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- A D A . S T R I N G S . F I X E D --
9 -- This specification is derived 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. --
14 ------------------------------------------------------------------------------
16 with Ada
.Strings
.Maps
;
18 package Ada
.Strings
.Fixed
is
21 --------------------------------------------------------------
22 -- Copy Procedure for Strings of Possibly Different Lengths --
23 --------------------------------------------------------------
28 Drop
: Truncation
:= Error
;
29 Justify
: Alignment
:= Left
;
30 Pad
: Character := Space
);
32 ------------------------
33 -- Search Subprograms --
34 ------------------------
39 Going
: Direction
:= Forward
;
40 Mapping
: Maps
.Character_Mapping
:= Maps
.Identity
) return Natural;
45 Going
: Direction
:= Forward
;
46 Mapping
: Maps
.Character_Mapping_Function
) return Natural;
50 Set
: Maps
.Character_Set
;
51 Test
: Membership
:= Inside
;
52 Going
: Direction
:= Forward
) return Natural;
58 Going
: Direction
:= Forward
;
59 Mapping
: Maps
.Character_Mapping
:= Maps
.Identity
) return Natural;
60 pragma Ada_05
(Index
);
66 Going
: Direction
:= Forward
;
67 Mapping
: Maps
.Character_Mapping_Function
) return Natural;
68 pragma Ada_05
(Index
);
72 Set
: Maps
.Character_Set
;
74 Test
: Membership
:= Inside
;
75 Going
: Direction
:= Forward
) return Natural;
76 pragma Ada_05
(Index
);
78 function Index_Non_Blank
80 Going
: Direction
:= Forward
) return Natural;
82 function Index_Non_Blank
85 Going
: Direction
:= Forward
) return Natural;
86 pragma Ada_05
(Index_Non_Blank
);
91 Mapping
: Maps
.Character_Mapping
:= Maps
.Identity
) return Natural;
96 Mapping
: Maps
.Character_Mapping_Function
) return Natural;
100 Set
: Maps
.Character_Set
) return Natural;
104 Set
: Maps
.Character_Set
;
106 First
: out Positive;
109 ------------------------------------
110 -- String Translation Subprograms --
111 ------------------------------------
115 Mapping
: Maps
.Character_Mapping
) return String;
118 (Source
: in out String;
119 Mapping
: Maps
.Character_Mapping
);
123 Mapping
: Maps
.Character_Mapping_Function
) return String;
126 (Source
: in out String;
127 Mapping
: Maps
.Character_Mapping_Function
);
129 ---------------------------------------
130 -- String Transformation Subprograms --
131 ---------------------------------------
133 function Replace_Slice
137 By
: String) return String;
139 procedure Replace_Slice
140 (Source
: in out String;
144 Drop
: Truncation
:= Error
;
145 Justify
: Alignment
:= Left
;
146 Pad
: Character := Space
);
151 New_Item
: String) return String;
154 (Source
: in out String;
157 Drop
: Truncation
:= Error
);
162 New_Item
: String) return String;
165 (Source
: in out String;
168 Drop
: Truncation
:= Right
);
173 Through
: Natural) return String;
176 (Source
: in out String;
179 Justify
: Alignment
:= Left
;
180 Pad
: Character := Space
);
182 ---------------------------------
183 -- String Selector Subprograms --
184 ---------------------------------
188 Side
: Trim_End
) return String;
191 (Source
: in out String;
193 Justify
: Alignment
:= Left
;
194 Pad
: Character := Space
);
198 Left
: Maps
.Character_Set
;
199 Right
: Maps
.Character_Set
) return String;
202 (Source
: in out String;
203 Left
: Maps
.Character_Set
;
204 Right
: Maps
.Character_Set
;
205 Justify
: Alignment
:= Strings
.Left
;
206 Pad
: Character := Space
);
211 Pad
: Character := Space
) return String;
214 (Source
: in out String;
216 Justify
: Alignment
:= Left
;
217 Pad
: Character := Space
);
222 Pad
: Character := Space
) return String;
225 (Source
: in out String;
227 Justify
: Alignment
:= Left
;
228 Pad
: Character := Space
);
230 ----------------------------------
231 -- String Constructor Functions --
232 ----------------------------------
236 Right
: Character) return String;
240 Right
: String) return String;
242 end Ada
.Strings
.Fixed
;