1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME 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 ------------------------------------------------------------------------------
16 with Ada
.Strings
.Wide_Maps
;
18 package Ada
.Strings
.Wide_Fixed
is
19 pragma Preelaborate
(Wide_Fixed
);
21 -------------------------------------------------------------------
22 -- Copy Procedure for Wide_Strings of Possibly Different Lengths --
23 -------------------------------------------------------------------
26 (Source
: Wide_String;
27 Target
: out Wide_String;
28 Drop
: Truncation
:= Error
;
29 Justify
: Alignment
:= Left
;
30 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
32 ------------------------
33 -- Search Subprograms --
34 ------------------------
37 (Source
: Wide_String;
38 Pattern
: Wide_String;
39 Going
: Direction
:= Forward
;
40 Mapping
: Wide_Maps
.Wide_Character_Mapping
:= Wide_Maps
.Identity
)
44 (Source
: Wide_String;
45 Pattern
: Wide_String;
46 Going
: Direction
:= Forward
;
47 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
50 (Source
: Wide_String;
51 Set
: Wide_Maps
.Wide_Character_Set
;
52 Test
: Membership
:= Inside
;
53 Going
: Direction
:= Forward
) return Natural;
56 (Source
: Wide_String;
57 Pattern
: Wide_String;
59 Going
: Direction
:= Forward
;
60 Mapping
: Wide_Maps
.Wide_Character_Mapping
:= Wide_Maps
.Identity
)
62 pragma Ada_05
(Index
);
65 (Source
: Wide_String;
66 Pattern
: Wide_String;
68 Going
: Direction
:= Forward
;
69 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
70 pragma Ada_05
(Index
);
73 (Source
: Wide_String;
74 Set
: Wide_Maps
.Wide_Character_Set
;
76 Test
: Membership
:= Inside
;
77 Going
: Direction
:= Forward
) return Natural;
78 pragma Ada_05
(Index
);
80 function Index_Non_Blank
81 (Source
: Wide_String;
82 Going
: Direction
:= Forward
) return Natural;
84 function Index_Non_Blank
85 (Source
: Wide_String;
87 Going
: Direction
:= Forward
) return Natural;
88 pragma Ada_05
(Index_Non_Blank
);
91 (Source
: Wide_String;
92 Pattern
: Wide_String;
93 Mapping
: Wide_Maps
.Wide_Character_Mapping
:= Wide_Maps
.Identity
)
97 (Source
: Wide_String;
98 Pattern
: Wide_String;
99 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Natural;
102 (Source
: Wide_String;
103 Set
: Wide_Maps
.Wide_Character_Set
) return Natural;
106 (Source
: Wide_String;
107 Set
: Wide_Maps
.Wide_Character_Set
;
109 First
: out Positive;
112 -----------------------------------------
113 -- Wide_String Translation Subprograms --
114 -----------------------------------------
117 (Source
: Wide_String;
118 Mapping
: Wide_Maps
.Wide_Character_Mapping
) return Wide_String;
121 (Source
: in out Wide_String;
122 Mapping
: Wide_Maps
.Wide_Character_Mapping
);
125 (Source
: Wide_String;
126 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
) return Wide_String;
129 (Source
: in out Wide_String;
130 Mapping
: Wide_Maps
.Wide_Character_Mapping_Function
);
132 --------------------------------------------
133 -- Wide_String Transformation Subprograms --
134 --------------------------------------------
136 function Replace_Slice
137 (Source
: Wide_String;
140 By
: Wide_String) return Wide_String;
142 procedure Replace_Slice
143 (Source
: in out Wide_String;
147 Drop
: Truncation
:= Error
;
148 Justify
: Alignment
:= Left
;
149 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
152 (Source
: Wide_String;
154 New_Item
: Wide_String) return Wide_String;
157 (Source
: in out Wide_String;
159 New_Item
: Wide_String;
160 Drop
: Truncation
:= Error
);
163 (Source
: Wide_String;
165 New_Item
: Wide_String) return Wide_String;
168 (Source
: in out Wide_String;
170 New_Item
: Wide_String;
171 Drop
: Truncation
:= Right
);
174 (Source
: Wide_String;
176 Through
: Natural) return Wide_String;
179 (Source
: in out Wide_String;
182 Justify
: Alignment
:= Left
;
183 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
185 --------------------------------------
186 -- Wide_String Selector Subprograms --
187 --------------------------------------
190 (Source
: Wide_String;
191 Side
: Trim_End
) return Wide_String;
194 (Source
: in out Wide_String;
196 Justify
: Alignment
:= Left
;
197 Pad
: Wide_Character := Wide_Space
);
200 (Source
: Wide_String;
201 Left
: Wide_Maps
.Wide_Character_Set
;
202 Right
: Wide_Maps
.Wide_Character_Set
) return Wide_String;
205 (Source
: in out Wide_String;
206 Left
: Wide_Maps
.Wide_Character_Set
;
207 Right
: Wide_Maps
.Wide_Character_Set
;
208 Justify
: Alignment
:= Ada
.Strings
.Left
;
209 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
212 (Source
: Wide_String;
214 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
) return Wide_String;
217 (Source
: in out Wide_String;
219 Justify
: Alignment
:= Left
;
220 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
223 (Source
: Wide_String;
225 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
) return Wide_String;
228 (Source
: in out Wide_String;
230 Justify
: Alignment
:= Left
;
231 Pad
: Wide_Character := Ada
.Strings
.Wide_Space
);
233 ---------------------------------------
234 -- Wide_String Constructor Functions --
235 ---------------------------------------
239 Right
: Wide_Character) return Wide_String;
243 Right
: Wide_String) return Wide_String;
245 end Ada
.Strings
.Wide_Fixed
;