1 ------------------------------------------------------------------------------
3 -- GNAT RUNTIME COMPONENTS --
5 -- A D A . S T R I N G S . W I D E _ F I X E D --
9 -- This specification is adapted 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 ------------------------------------------------------------------------------
17 with Ada
.Strings
.Wide_Maps
;
19 package Ada
.Strings
.Wide_Fixed
is
20 pragma Preelaborate
(Wide_Fixed
);
22 -------------------------------------------------------------------
23 -- Copy Procedure for Wide_Strings of Possibly Different Lengths --
24 -------------------------------------------------------------------
27 (Source
: Wide_String;
28 Target
: out Wide_String;
29 Drop
: Truncation
:= Error
;
30 Justify
: Alignment
:= Left
;
31 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
33 ------------------------
34 -- Search Subprograms --
35 ------------------------
38 (Source
: Wide_String;
39 Pattern
: Wide_String;
40 Going
: Direction
:= Forward
;
41 Mapping
: Wide_Maps
.Wide_Character_Mapping
:= Wide_Maps
.Identity
)
45 (Source
: Wide_String;
46 Pattern
: Wide_String;
47 Going
: Direction
:= Forward
;
48 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
51 (Source
: Wide_String;
52 Set
: Wide_Maps
.Wide_Character_Set
;
53 Test
: Membership
:= Inside
;
54 Going
: Direction
:= Forward
) return Natural;
57 (Source
: Wide_String;
58 Pattern
: Wide_String;
60 Going
: Direction
:= Forward
;
61 Mapping
: Wide_Maps
.Wide_Character_Mapping
:= Wide_Maps
.Identity
)
63 pragma Ada_05
(Index
);
66 (Source
: Wide_String;
67 Pattern
: Wide_String;
69 Going
: Direction
:= Forward
;
70 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
71 pragma Ada_05
(Index
);
74 (Source
: Wide_String;
75 Set
: Wide_Maps
.Wide_Character_Set
;
77 Test
: Membership
:= Inside
;
78 Going
: Direction
:= Forward
) return Natural;
79 pragma Ada_05
(Index
);
81 function Index_Non_Blank
82 (Source
: Wide_String;
83 Going
: Direction
:= Forward
) return Natural;
85 function Index_Non_Blank
86 (Source
: Wide_String;
88 Going
: Direction
:= Forward
) return Natural;
89 pragma Ada_05
(Index_Non_Blank
);
92 (Source
: Wide_String;
93 Pattern
: Wide_String;
94 Mapping
: Wide_Maps
.Wide_Character_Mapping
:= Wide_Maps
.Identity
)
98 (Source
: Wide_String;
99 Pattern
: Wide_String;
100 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
103 (Source
: Wide_String;
104 Set
: Wide_Maps
.Wide_Character_Set
) return Natural;
107 (Source
: Wide_String;
108 Set
: Wide_Maps
.Wide_Character_Set
;
110 First
: out Positive;
113 -----------------------------------------
114 -- Wide_String Translation Subprograms --
115 -----------------------------------------
118 (Source
: Wide_String;
119 Mapping
: Wide_Maps
.Wide_Character_Mapping
) return Wide_String;
122 (Source
: in out Wide_String;
123 Mapping
: Wide_Maps
.Wide_Character_Mapping
);
126 (Source
: Wide_String;
127 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Wide_String;
130 (Source
: in out Wide_String;
131 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
);
133 --------------------------------------------
134 -- Wide_String Transformation Subprograms --
135 --------------------------------------------
137 function Replace_Slice
138 (Source
: Wide_String;
141 By
: Wide_String) return Wide_String;
143 procedure Replace_Slice
144 (Source
: in out Wide_String;
148 Drop
: Truncation
:= Error
;
149 Justify
: Alignment
:= Left
;
150 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
153 (Source
: Wide_String;
155 New_Item
: Wide_String) return Wide_String;
158 (Source
: in out Wide_String;
160 New_Item
: Wide_String;
161 Drop
: Truncation
:= Error
);
164 (Source
: Wide_String;
166 New_Item
: Wide_String) return Wide_String;
169 (Source
: in out Wide_String;
171 New_Item
: Wide_String;
172 Drop
: Truncation
:= Right
);
175 (Source
: Wide_String;
177 Through
: Natural) return Wide_String;
180 (Source
: in out Wide_String;
183 Justify
: Alignment
:= Left
;
184 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
186 --------------------------------------
187 -- Wide_String Selector Subprograms --
188 --------------------------------------
191 (Source
: Wide_String;
192 Side
: Trim_End
) return Wide_String;
195 (Source
: in out Wide_String;
197 Justify
: Alignment
:= Left
;
198 Pad
: Wide_Character := Wide_Space
);
201 (Source
: Wide_String;
202 Left
: Wide_Maps
.Wide_Character_Set
;
203 Right
: Wide_Maps
.Wide_Character_Set
) return Wide_String;
206 (Source
: in out Wide_String;
207 Left
: Wide_Maps
.Wide_Character_Set
;
208 Right
: Wide_Maps
.Wide_Character_Set
;
209 Justify
: Alignment
:= Ada
.Strings
.Left
;
210 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
213 (Source
: Wide_String;
215 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
) return Wide_String;
218 (Source
: in out Wide_String;
220 Justify
: Alignment
:= Left
;
221 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
224 (Source
: Wide_String;
226 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
) return Wide_String;
229 (Source
: in out Wide_String;
231 Justify
: Alignment
:= Left
;
232 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
234 ---------------------------------------
235 -- Wide_String Constructor Functions --
236 ---------------------------------------
240 Right
: Wide_Character) return Wide_String;
244 Right
: Wide_String) return Wide_String;
246 end Ada
.Strings
.Wide_Fixed
;