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
;
107 First
: out Positive;
109 pragma Ada_2012
(Find_Token
);
113 Set
: Maps
.Character_Set
;
115 First
: out Positive;
118 ------------------------------------
119 -- String Translation Subprograms --
120 ------------------------------------
124 Mapping
: Maps
.Character_Mapping
) return String;
127 (Source
: in out String;
128 Mapping
: Maps
.Character_Mapping
);
132 Mapping
: Maps
.Character_Mapping_Function
) return String;
135 (Source
: in out String;
136 Mapping
: Maps
.Character_Mapping_Function
);
138 ---------------------------------------
139 -- String Transformation Subprograms --
140 ---------------------------------------
142 function Replace_Slice
146 By
: String) return String;
148 procedure Replace_Slice
149 (Source
: in out String;
153 Drop
: Truncation
:= Error
;
154 Justify
: Alignment
:= Left
;
155 Pad
: Character := Space
);
160 New_Item
: String) return String;
163 (Source
: in out String;
166 Drop
: Truncation
:= Error
);
171 New_Item
: String) return String;
174 (Source
: in out String;
177 Drop
: Truncation
:= Right
);
182 Through
: Natural) return String;
185 (Source
: in out String;
188 Justify
: Alignment
:= Left
;
189 Pad
: Character := Space
);
191 ---------------------------------
192 -- String Selector Subprograms --
193 ---------------------------------
197 Side
: Trim_End
) return String;
200 (Source
: in out String;
202 Justify
: Alignment
:= Left
;
203 Pad
: Character := Space
);
207 Left
: Maps
.Character_Set
;
208 Right
: Maps
.Character_Set
) return String;
211 (Source
: in out String;
212 Left
: Maps
.Character_Set
;
213 Right
: Maps
.Character_Set
;
214 Justify
: Alignment
:= Strings
.Left
;
215 Pad
: Character := Space
);
220 Pad
: Character := Space
) return String;
223 (Source
: in out String;
225 Justify
: Alignment
:= Left
;
226 Pad
: Character := Space
);
231 Pad
: Character := Space
) return String;
234 (Source
: in out String;
236 Justify
: Alignment
:= Left
;
237 Pad
: Character := Space
);
239 ----------------------------------
240 -- String Constructor Functions --
241 ----------------------------------
245 Right
: Character) return String;
249 Right
: String) return String;
251 end Ada
.Strings
.Fixed
;