1------------------------------------------------------------------------------
2--                                                                          --
3--                         GNAT RUN-TIME COMPONENTS                         --
4--                                                                          --
5--               A D A . S T R I N G S . W I D E _ F I X E D                --
6--                                                                          --
7--                                 S p e c                                  --
8--                                                                          --
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. --
13--                                                                          --
14------------------------------------------------------------------------------
15
16with Ada.Strings.Wide_Maps;
17
18package Ada.Strings.Wide_Fixed is
19   pragma Preelaborate;
20
21   -------------------------------------------------------------------
22   -- Copy Procedure for Wide_Strings of Possibly Different Lengths --
23   -------------------------------------------------------------------
24
25   procedure Move
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);
31
32   ------------------------
33   -- Search Subprograms --
34   ------------------------
35
36   function Index
37     (Source  : Wide_String;
38      Pattern : Wide_String;
39      Going   : Direction := Forward;
40      Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
41      return Natural;
42
43   function Index
44     (Source  : Wide_String;
45      Pattern : Wide_String;
46      Going   : Direction := Forward;
47      Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
48
49   function Index
50     (Source : Wide_String;
51      Set    : Wide_Maps.Wide_Character_Set;
52      Test   : Membership := Inside;
53      Going  : Direction  := Forward) return Natural;
54
55   function Index
56     (Source  : Wide_String;
57      Pattern : Wide_String;
58      From    : Positive;
59      Going   : Direction := Forward;
60      Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
61      return Natural;
62   pragma Ada_05 (Index);
63
64   function Index
65     (Source  : Wide_String;
66      Pattern : Wide_String;
67      From    : Positive;
68      Going   : Direction := Forward;
69      Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
70   pragma Ada_05 (Index);
71
72   function Index
73     (Source  : Wide_String;
74      Set     : Wide_Maps.Wide_Character_Set;
75      From    : Positive;
76      Test    : Membership := Inside;
77      Going   : Direction := Forward) return Natural;
78   pragma Ada_05 (Index);
79
80   function Index_Non_Blank
81     (Source : Wide_String;
82      Going  : Direction := Forward) return Natural;
83
84   function Index_Non_Blank
85     (Source : Wide_String;
86      From   : Positive;
87      Going  : Direction := Forward) return Natural;
88   pragma Ada_05 (Index_Non_Blank);
89
90   function Count
91     (Source  : Wide_String;
92      Pattern : Wide_String;
93      Mapping : Wide_Maps.Wide_Character_Mapping := Wide_Maps.Identity)
94      return Natural;
95
96   function Count
97     (Source  : Wide_String;
98      Pattern : Wide_String;
99      Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Natural;
100
101   function Count
102     (Source : Wide_String;
103      Set    : Wide_Maps.Wide_Character_Set) return Natural;
104
105   procedure Find_Token
106     (Source : Wide_String;
107      Set    : Wide_Maps.Wide_Character_Set;
108      From   : Positive;
109      Test   : Membership;
110      First  : out Positive;
111      Last   : out Natural);
112   pragma Ada_2012 (Find_Token);
113
114   procedure Find_Token
115     (Source : Wide_String;
116      Set    : Wide_Maps.Wide_Character_Set;
117      Test   : Membership;
118      First  : out Positive;
119      Last   : out Natural);
120
121   -----------------------------------------
122   -- Wide_String Translation Subprograms --
123   -----------------------------------------
124
125   function Translate
126     (Source  : Wide_String;
127      Mapping : Wide_Maps.Wide_Character_Mapping) return Wide_String;
128
129   procedure Translate
130     (Source  : in out Wide_String;
131      Mapping : Wide_Maps.Wide_Character_Mapping);
132
133   function Translate
134     (Source  : Wide_String;
135      Mapping : Wide_Maps.Wide_Character_Mapping_Function) return Wide_String;
136
137   procedure Translate
138     (Source  : in out Wide_String;
139      Mapping : Wide_Maps.Wide_Character_Mapping_Function);
140
141   --------------------------------------------
142   -- Wide_String Transformation Subprograms --
143   --------------------------------------------
144
145   function Replace_Slice
146     (Source : Wide_String;
147      Low    : Positive;
148      High   : Natural;
149      By     : Wide_String) return Wide_String;
150
151   procedure Replace_Slice
152     (Source  : in out Wide_String;
153      Low     : Positive;
154      High    : Natural;
155      By      : Wide_String;
156      Drop    : Truncation := Error;
157      Justify : Alignment  := Left;
158      Pad     : Wide_Character  := Ada.Strings.Wide_Space);
159
160   function Insert
161     (Source   : Wide_String;
162      Before   : Positive;
163      New_Item : Wide_String) return Wide_String;
164
165   procedure Insert
166     (Source   : in out Wide_String;
167      Before   : Positive;
168      New_Item : Wide_String;
169      Drop     : Truncation := Error);
170
171   function Overwrite
172     (Source   : Wide_String;
173      Position : Positive;
174      New_Item : Wide_String) return Wide_String;
175
176   procedure Overwrite
177     (Source   : in out Wide_String;
178      Position : Positive;
179      New_Item : Wide_String;
180      Drop     : Truncation := Right);
181
182   function Delete
183     (Source  : Wide_String;
184      From    : Positive;
185      Through : Natural) return Wide_String;
186
187   procedure Delete
188     (Source  : in out Wide_String;
189      From    : Positive;
190      Through : Natural;
191      Justify : Alignment := Left;
192      Pad     : Wide_Character := Ada.Strings.Wide_Space);
193
194   --------------------------------------
195   -- Wide_String Selector Subprograms --
196   --------------------------------------
197
198   function Trim
199     (Source : Wide_String;
200      Side   : Trim_End) return Wide_String;
201
202   procedure Trim
203     (Source  : in out Wide_String;
204      Side    : Trim_End;
205      Justify : Alignment      := Left;
206      Pad     : Wide_Character := Wide_Space);
207
208   function Trim
209     (Source : Wide_String;
210      Left   : Wide_Maps.Wide_Character_Set;
211      Right  : Wide_Maps.Wide_Character_Set) return Wide_String;
212
213   procedure Trim
214     (Source  : in out Wide_String;
215      Left    : Wide_Maps.Wide_Character_Set;
216      Right   : Wide_Maps.Wide_Character_Set;
217      Justify : Alignment := Ada.Strings.Left;
218      Pad     : Wide_Character := Ada.Strings.Wide_Space);
219
220   function Head
221     (Source : Wide_String;
222      Count  : Natural;
223      Pad    : Wide_Character := Ada.Strings.Wide_Space) return Wide_String;
224
225   procedure Head
226     (Source  : in out Wide_String;
227      Count   : Natural;
228      Justify : Alignment := Left;
229      Pad     : Wide_Character := Ada.Strings.Wide_Space);
230
231   function Tail
232     (Source : Wide_String;
233      Count  : Natural;
234      Pad    : Wide_Character := Ada.Strings.Wide_Space) return Wide_String;
235
236   procedure Tail
237     (Source  : in out Wide_String;
238      Count   : Natural;
239      Justify : Alignment := Left;
240      Pad     : Wide_Character := Ada.Strings.Wide_Space);
241
242   ---------------------------------------
243   -- Wide_String Constructor Functions --
244   ---------------------------------------
245
246   function "*"
247     (Left  : Natural;
248      Right : Wide_Character) return Wide_String;
249
250   function "*"
251     (Left  : Natural;
252      Right : Wide_String) return Wide_String;
253
254end Ada.Strings.Wide_Fixed;
255