adacl-eastrings-ucs_2.ads

1-----------------------------------------------------------------------------
2--
3-- Copyright 2004, 2006 Björn Persson.
4--
5-- This library is free software; you can redistribute it and/or modify it
6-- under the terms of the GNU General Public License, version 2, as published
7-- by the Free Software Foundation.
8--
9-- As a special exception, if other files instantiate generics from this
10-- unit, or you link this unit with other files to produce an executable,
11-- this unit does not by itself cause the resulting executable to be covered
12-- by the General Public License. This exception does not however invalidate
13-- any other reasons why the executable file might be covered by the General
14-- Public License.
15--
16----------------------------------------------------------------------------
17
18pragma License (Modified_Gpl);
19pragma Ada_2022;
20
21with Ada.Strings.Wide_Unbounded; use Ada.Strings.Wide_Unbounded;
22
23package AdaCL.EAstrings.UCS_2 is
24 pragma Elaborate_Body;
25
26 ----------------------------------------------------------
27 -- Conversion, Concatenation, and Selection Subprograms --
28 ----------------------------------------------------------
29
30 function To_EAstring (Source : in Wide_String) return EAstring;
31
32 function To_EAstring
33 (Source : in Unbounded_Wide_String)
34 return EAstring;
35
36 function To_Wide_String (Source : in EAstring) return Wide_String;
37
38 function To_Unbounded_Wide_String
39 (Source : in EAstring)
40 return Unbounded_Wide_String;
41
42 function "+" (Source : in Wide_String) return EAstring renames To_EAstring;
43
44 function "+" (Source : in Unbounded_Wide_String) return EAstring renames
45 To_EAstring;
46
47 function "+" (Source : in EAstring) return Wide_String renames
48 To_Wide_String;
49
50 function "+" (Source : in EAstring) return Unbounded_Wide_String renames
51 To_Unbounded_Wide_String;
52
53 procedure Append (Source : in out EAstring; New_Item : in Wide_String);
54
55 procedure Append
56 (Source : in out EAstring;
57 New_Item : in Unbounded_Wide_String);
58
59 procedure Append
60 (Source : in out EAstring;
61 New_Item : in Wide_Character);
62
63 function "&"
64 (Left : in EAstring;
65 Right : in Wide_String)
66 return EAstring;
67
68 function "&"
69 (Left : in Wide_String;
70 Right : in EAstring)
71 return EAstring;
72
73 function "&"
74 (Left : in EAstring;
75 Right : in Unbounded_Wide_String)
76 return EAstring;
77
78 function "&"
79 (Left : in Unbounded_Wide_String;
80 Right : in EAstring)
81 return EAstring;
82
83 function "&"
84 (Left : in EAstring;
85 Right : in Wide_Character)
86 return EAstring;
87
88 function "&"
89 (Left : in Wide_Character;
90 Right : in EAstring)
91 return EAstring;
92
93 function Element
94 (Source : in EAstring;
95 Index : in Positive)
96 return Wide_Character;
97
98 procedure Replace_Element
99 (Source : in out EAstring;
100 Index : in Positive;
101 By : Wide_Character);
102
103 function Slice
104 (Source : in EAstring;
105 Low : in Positive;
106 High : in Natural)
107 return Wide_String;
108
109 function "="
110 (Left : in EAstring;
111 Right : in Wide_String)
112 return Boolean;
113
114 function "="
115 (Left : in Wide_String;
116 Right : in EAstring)
117 return Boolean;
118
119 ------------------------
120 -- Search Subprograms --
121 ------------------------
122
123 function Index
124 (Source : in EAstring;
125 Pattern : in Wide_String;
126 Going : in Direction := Forward)
127 -- Mapping : in Wide_Character_Mapping := Identity) to be added later
128 return Natural;
129
130 function Index
131 (Source : in EAstring;
132 Pattern : in Unbounded_Wide_String;
133 Going : in Direction := Forward)
134 -- Mapping : in Wide_Character_Mapping := Identity) to be added later
135 return Natural;
136
137 function Count
138 (Source : in EAstring;
139 Pattern : in Wide_String)
140 -- Mapping : in Wide_Character_Mapping := Identity) to be added later
141 return Natural;
142
143 function Count
144 (Source : in EAstring;
145 Pattern : in Unbounded_Wide_String)
146 -- Mapping : in Wide_Character_Mapping := Identity) to be added later
147 return Natural;
148
149 ---------------------------------------
150 -- String Transformation Subprograms --
151 ---------------------------------------
152
153 function Replace_Slice
154 (Source : in EAstring;
155 Low : in Positive;
156 High : in Natural;
157 By : in Wide_String)
158 return EAstring;
159
160 function Replace_Slice
161 (Source : in EAstring;
162 Low : in Positive;
163 High : in Natural;
164 By : in Unbounded_Wide_String)
165 return EAstring;
166
167 procedure Replace_Slice
168 (Source : in out EAstring;
169 Low : in Positive;
170 High : in Natural;
171 By : in Wide_String);
172
173 procedure Replace_Slice
174 (Source : in out EAstring;
175 Low : in Positive;
176 High : in Natural;
177 By : in Unbounded_Wide_String);
178
179 function Insert
180 (Source : in EAstring;
181 Before : in Positive;
182 New_Item : in Wide_String)
183 return EAstring;
184
185 function Insert
186 (Source : in EAstring;
187 Before : in Positive;
188 New_Item : in Unbounded_Wide_String)
189 return EAstring;
190
191 procedure Insert
192 (Source : in out EAstring;
193 Before : in Positive;
194 New_Item : in Wide_String);
195
196 procedure Insert
197 (Source : in out EAstring;
198 Before : in Positive;
199 New_Item : in Unbounded_Wide_String);
200
201 function Overwrite
202 (Source : in EAstring;
203 Position : in Positive;
204 New_Item : in Wide_String)
205 return EAstring;
206
207 function Overwrite
208 (Source : in EAstring;
209 Position : in Positive;
210 New_Item : in Unbounded_Wide_String)
211 return EAstring;
212
213 procedure Overwrite
214 (Source : in out EAstring;
215 Position : in Positive;
216 New_Item : in Wide_String);
217
218 procedure Overwrite
219 (Source : in out EAstring;
220 Position : in Positive;
221 New_Item : in Unbounded_Wide_String);
222
223 function "*"
224 (Left : in Natural;
225 Right : in Wide_String)
226 return EAstring;
227
228 function "*"
229 (Left : in Natural;
230 Right : in Unbounded_Wide_String)
231 return EAstring;
232
233 function "*"
234 (Left : in Natural;
235 Right : in Wide_Character)
236 return EAstring;
237
238end AdaCL.EAstrings.UCS_2;