adacl-eastrings-latin_1.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.Unbounded; use Ada.Strings.Unbounded;
22
23package AdaCL.EAstrings.Latin_1 is
24 pragma Elaborate_Body;
25
26 ----------------------------------------------------------
27 -- Conversion, Concatenation, and Selection Subprograms --
28 ----------------------------------------------------------
29
30 function To_EAstring (Source : in String) return EAstring;
31
32 function To_EAstring (Source : in Unbounded_String) return EAstring;
33
34 function To_String (Source : in EAstring) return String;
35
36 function To_Unbounded_String
37 (Source : in EAstring)
38 return Unbounded_String;
39
40 function "+" (Source : in String) return EAstring renames To_EAstring;
41
42 function "+" (Source : in Unbounded_String) return EAstring renames
43 To_EAstring;
44
45 function "+" (Source : in EAstring) return String renames To_String;
46
47 function "+" (Source : in EAstring) return Unbounded_String renames
48 To_Unbounded_String;
49
50 procedure Append (Source : in out EAstring; New_Item : in String);
51
52 procedure Append
53 (Source : in out EAstring;
54 New_Item : in Unbounded_String);
55
56 procedure Append (Source : in out EAstring; New_Item : in Character);
57
58 function "&" (Left : in EAstring; Right : in String) return EAstring;
59
60 function "&" (Left : in String; Right : in EAstring) return EAstring;
61
62 function "&"
63 (Left : in EAstring;
64 Right : in Unbounded_String)
65 return EAstring;
66
67 function "&"
68 (Left : in Unbounded_String;
69 Right : in EAstring)
70 return EAstring;
71
72 function "&" (Left : in EAstring; Right : in Character) return EAstring;
73
74 function "&" (Left : in Character; Right : in EAstring) return EAstring;
75
76 function Element
77 (Source : in EAstring;
78 Index : in Positive)
79 return Character;
80 -- Element returns the character at position Index in Source. It
81 -- propagates Index_Error if Index > Length(Source).
82
83 procedure Replace_Element
84 (Source : in out EAstring;
85 Index : in Positive;
86 By : Character);
87 -- Replace_Element updates Source such that the character at position
88 -- Index in Source is By. It propagates Index_Error if Index >
89 -- Length(Source).
90
91 function Slice
92 (Source : in EAstring;
93 Low : in Positive;
94 High : in Natural)
95 return String;
96
97 function "=" (Left : in EAstring; Right : in String) return Boolean;
98
99 function "=" (Left : in String; Right : in EAstring) return Boolean;
100
101 ------------------------
102 -- Search Subprograms --
103 ------------------------
104
105 function Index
106 (Source : in EAstring;
107 Pattern : in String;
108 Going : in Direction := Forward)
109 -- Mapping : in Maps.Character_Mapping := Maps.Identity) to be added
110 -- later
111 return Natural;
112
113 function Index
114 (Source : in EAstring;
115 Pattern : in Unbounded_String;
116 Going : in Direction := Forward)
117 -- Mapping : in Maps.Character_Mapping := Maps.Identity) to be added
118 -- later
119 return Natural;
120
121 function Count
122 (Source : in EAstring;
123 Pattern : in String)
124 -- Mapping : in Maps.Character_Mapping := Maps.Identity) to be added
125 -- later
126 return Natural;
127
128 function Count
129 (Source : in EAstring;
130 Pattern : in Unbounded_String)
131 -- Mapping : in Maps.Character_Mapping := Maps.Identity) to be added
132 -- later
133 return Natural;
134
135 ---------------------------------------
136 -- String Transformation Subprograms --
137 ---------------------------------------
138
139 function Replace_Slice
140 (Source : in EAstring;
141 Low : in Positive;
142 High : in Natural;
143 By : in String)
144 return EAstring;
145
146 function Replace_Slice
147 (Source : in EAstring;
148 Low : in Positive;
149 High : in Natural;
150 By : in Unbounded_String)
151 return EAstring;
152
153 procedure Replace_Slice
154 (Source : in out EAstring;
155 Low : in Positive;
156 High : in Natural;
157 By : in String);
158
159 procedure Replace_Slice
160 (Source : in out EAstring;
161 Low : in Positive;
162 High : in Natural;
163 By : in Unbounded_String);
164
165 function Insert
166 (Source : in EAstring;
167 Before : in Positive;
168 New_Item : in String)
169 return EAstring;
170
171 function Insert
172 (Source : in EAstring;
173 Before : in Positive;
174 New_Item : in Unbounded_String)
175 return EAstring;
176
177 procedure Insert
178 (Source : in out EAstring;
179 Before : in Positive;
180 New_Item : in String);
181
182 procedure Insert
183 (Source : in out EAstring;
184 Before : in Positive;
185 New_Item : in Unbounded_String);
186
187 function Overwrite
188 (Source : in EAstring;
189 Position : in Positive;
190 New_Item : in String)
191 return EAstring;
192
193 function Overwrite
194 (Source : in EAstring;
195 Position : in Positive;
196 New_Item : in Unbounded_String)
197 return EAstring;
198
199 procedure Overwrite
200 (Source : in out EAstring;
201 Position : in Positive;
202 New_Item : in String);
203
204 procedure Overwrite
205 (Source : in out EAstring;
206 Position : in Positive;
207 New_Item : in Unbounded_String);
208
209 function "*" (Left : in Natural; Right : in String) return EAstring;
210
211 function "*"
212 (Left : in Natural;
213 Right : in Unbounded_String)
214 return EAstring;
215
216 function "*" (Left : in Natural; Right : in Character) return EAstring;
217
218end AdaCL.EAstrings.Latin_1;