| 1 |
------------------------------------------------------------------------------ |
| 2 |
-- -- |
| 3 |
-- GNAT RUN-TIME COMPONENTS -- |
| 4 |
-- -- |
| 5 |
-- A D A . S T R I N G S . W I D E _ W I D E _ U N B O U N D E D -- |
| 6 |
-- -- |
| 7 |
-- S p e c -- |
| 8 |
-- -- |
| 9 |
-- Copyright (C) 1992-2025, Free Software Foundation, Inc. -- |
| 10 |
-- -- |
| 11 |
-- This specification is derived from the Ada Reference Manual for use with -- |
| 12 |
-- GNAT. The copyright notice above, and the license provisions that follow -- |
| 13 |
-- apply solely to the contents of the part following the private keyword. -- |
| 14 |
-- -- |
| 15 |
-- GNAT is free software; you can redistribute it and/or modify it under -- |
| 16 |
-- terms of the GNU General Public License as published by the Free Soft- -- |
| 17 |
-- ware Foundation; either version 3, or (at your option) any later ver- -- |
| 18 |
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- |
| 19 |
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- |
| 20 |
-- or FITNESS FOR A PARTICULAR PURPOSE. -- |
| 21 |
-- -- |
| 22 |
-- As a special exception under Section 7 of GPL version 3, you are granted -- |
| 23 |
-- additional permissions described in the GCC Runtime Library Exception, -- |
| 24 |
-- version 3.1, as published by the Free Software Foundation. -- |
| 25 |
-- -- |
| 26 |
-- You should have received a copy of the GNU General Public License and -- |
| 27 |
-- a copy of the GCC Runtime Library Exception along with this program; -- |
| 28 |
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- |
| 29 |
-- <http://www.gnu.org/licenses/>. -- |
| 30 |
-- -- |
| 31 |
-- GNAT was originally developed by the GNAT team at New York University. -- |
| 32 |
-- Extensive contributions were provided by Ada Core Technologies Inc. -- |
| 33 |
-- -- |
| 34 |
------------------------------------------------------------------------------ |
| 35 |
|
| 36 |
-- This version is supported on: |
| 37 |
-- - all Alpha platforms |
| 38 |
-- - all ia64 platforms |
| 39 |
-- - all PowerPC platforms |
| 40 |
-- - all SPARC V9 platforms |
| 41 |
-- - all x86 platforms |
| 42 |
-- - all x86_64 platforms |
| 43 |
|
| 44 |
with Ada.Strings.Wide_Wide_Maps; |
| 45 |
private with Ada.Finalization; |
| 46 |
private with System.Atomic_Counters; |
| 47 |
|
| 48 |
package Ada.Strings.Wide_Wide_Unbounded is |
| 49 |
pragma Preelaborate; |
| 50 |
|
| 51 |
type Unbounded_Wide_Wide_String is private; |
| 52 |
pragma Preelaborable_Initialization (Unbounded_Wide_Wide_String); |
| 53 |
|
| 54 |
Null_Unbounded_Wide_Wide_String : constant Unbounded_Wide_Wide_String; |
| 55 |
|
| 56 |
function Length (Source : Unbounded_Wide_Wide_String) return Natural; |
| 57 |
|
| 58 |
type Wide_Wide_String_Access is access all Wide_Wide_String; |
| 59 |
|
| 60 |
procedure Free (X : in out Wide_Wide_String_Access); |
| 61 |
|
| 62 |
-------------------------------------------------------- |
| 63 |
-- Conversion, Concatenation, and Selection Functions -- |
| 64 |
-------------------------------------------------------- |
| 65 |
|
| 66 |
function To_Unbounded_Wide_Wide_String |
| 67 |
(Source : Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 68 |
|
| 69 |
function To_Unbounded_Wide_Wide_String |
| 70 |
(Length : Natural) return Unbounded_Wide_Wide_String; |
| 71 |
|
| 72 |
function To_Wide_Wide_String |
| 73 |
(Source : Unbounded_Wide_Wide_String) return Wide_Wide_String; |
| 74 |
|
| 75 |
procedure Set_Unbounded_Wide_Wide_String |
| 76 |
(Target : out Unbounded_Wide_Wide_String; |
| 77 |
Source : Wide_Wide_String); |
| 78 |
pragma Ada_05 (Set_Unbounded_Wide_Wide_String); |
| 79 |
|
| 80 |
procedure Append |
| 81 |
(Source : in out Unbounded_Wide_Wide_String; |
| 82 |
New_Item : Unbounded_Wide_Wide_String) |
| 83 |
with Inline => True; |
| 84 |
|
| 85 |
procedure Append |
| 86 |
(Source : in out Unbounded_Wide_Wide_String; |
| 87 |
New_Item : Wide_Wide_String) |
| 88 |
with Inline => True; |
| 89 |
|
| 90 |
procedure Append |
| 91 |
(Source : in out Unbounded_Wide_Wide_String; |
| 92 |
New_Item : Wide_Wide_Character) |
| 93 |
with Inline => True; |
| 94 |
|
| 95 |
function "&" |
| 96 |
(Left : Unbounded_Wide_Wide_String; |
| 97 |
Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 98 |
|
| 99 |
function "&" |
| 100 |
(Left : Unbounded_Wide_Wide_String; |
| 101 |
Right : Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 102 |
|
| 103 |
function "&" |
| 104 |
(Left : Wide_Wide_String; |
| 105 |
Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 106 |
|
| 107 |
function "&" |
| 108 |
(Left : Unbounded_Wide_Wide_String; |
| 109 |
Right : Wide_Wide_Character) return Unbounded_Wide_Wide_String; |
| 110 |
|
| 111 |
function "&" |
| 112 |
(Left : Wide_Wide_Character; |
| 113 |
Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 114 |
|
| 115 |
function Element |
| 116 |
(Source : Unbounded_Wide_Wide_String; |
| 117 |
Index : Positive) return Wide_Wide_Character |
| 118 |
with Inline => True; |
| 119 |
|
| 120 |
procedure Replace_Element |
| 121 |
(Source : in out Unbounded_Wide_Wide_String; |
| 122 |
Index : Positive; |
| 123 |
By : Wide_Wide_Character); |
| 124 |
|
| 125 |
function Slice |
| 126 |
(Source : Unbounded_Wide_Wide_String; |
| 127 |
Low : Positive; |
| 128 |
High : Natural) return Wide_Wide_String; |
| 129 |
|
| 130 |
function Unbounded_Slice |
| 131 |
(Source : Unbounded_Wide_Wide_String; |
| 132 |
Low : Positive; |
| 133 |
High : Natural) return Unbounded_Wide_Wide_String; |
| 134 |
pragma Ada_05 (Unbounded_Slice); |
| 135 |
|
| 136 |
procedure Unbounded_Slice |
| 137 |
(Source : Unbounded_Wide_Wide_String; |
| 138 |
Target : out Unbounded_Wide_Wide_String; |
| 139 |
Low : Positive; |
| 140 |
High : Natural); |
| 141 |
pragma Ada_05 (Unbounded_Slice); |
| 142 |
|
| 143 |
function "=" |
| 144 |
(Left : Unbounded_Wide_Wide_String; |
| 145 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 146 |
|
| 147 |
function "=" |
| 148 |
(Left : Unbounded_Wide_Wide_String; |
| 149 |
Right : Wide_Wide_String) return Boolean; |
| 150 |
|
| 151 |
function "=" |
| 152 |
(Left : Wide_Wide_String; |
| 153 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 154 |
|
| 155 |
function "<" |
| 156 |
(Left : Unbounded_Wide_Wide_String; |
| 157 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 158 |
|
| 159 |
function "<" |
| 160 |
(Left : Unbounded_Wide_Wide_String; |
| 161 |
Right : Wide_Wide_String) return Boolean; |
| 162 |
|
| 163 |
function "<" |
| 164 |
(Left : Wide_Wide_String; |
| 165 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 166 |
|
| 167 |
function "<=" |
| 168 |
(Left : Unbounded_Wide_Wide_String; |
| 169 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 170 |
|
| 171 |
function "<=" |
| 172 |
(Left : Unbounded_Wide_Wide_String; |
| 173 |
Right : Wide_Wide_String) return Boolean; |
| 174 |
|
| 175 |
function "<=" |
| 176 |
(Left : Wide_Wide_String; |
| 177 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 178 |
|
| 179 |
function ">" |
| 180 |
(Left : Unbounded_Wide_Wide_String; |
| 181 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 182 |
|
| 183 |
function ">" |
| 184 |
(Left : Unbounded_Wide_Wide_String; |
| 185 |
Right : Wide_Wide_String) return Boolean; |
| 186 |
|
| 187 |
function ">" |
| 188 |
(Left : Wide_Wide_String; |
| 189 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 190 |
|
| 191 |
function ">=" |
| 192 |
(Left : Unbounded_Wide_Wide_String; |
| 193 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 194 |
|
| 195 |
function ">=" |
| 196 |
(Left : Unbounded_Wide_Wide_String; |
| 197 |
Right : Wide_Wide_String) return Boolean; |
| 198 |
|
| 199 |
function ">=" |
| 200 |
(Left : Wide_Wide_String; |
| 201 |
Right : Unbounded_Wide_Wide_String) return Boolean; |
| 202 |
|
| 203 |
------------------------ |
| 204 |
-- Search Subprograms -- |
| 205 |
------------------------ |
| 206 |
|
| 207 |
function Index |
| 208 |
(Source : Unbounded_Wide_Wide_String; |
| 209 |
Pattern : Wide_Wide_String; |
| 210 |
Going : Direction := Forward; |
| 211 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := |
| 212 |
Wide_Wide_Maps.Identity) |
| 213 |
return Natural; |
| 214 |
|
| 215 |
function Index |
| 216 |
(Source : Unbounded_Wide_Wide_String; |
| 217 |
Pattern : Wide_Wide_String; |
| 218 |
Going : Direction := Forward; |
| 219 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) |
| 220 |
return Natural; |
| 221 |
|
| 222 |
function Index |
| 223 |
(Source : Unbounded_Wide_Wide_String; |
| 224 |
Set : Wide_Wide_Maps.Wide_Wide_Character_Set; |
| 225 |
Test : Membership := Inside; |
| 226 |
Going : Direction := Forward) return Natural; |
| 227 |
|
| 228 |
function Index |
| 229 |
(Source : Unbounded_Wide_Wide_String; |
| 230 |
Pattern : Wide_Wide_String; |
| 231 |
From : Positive; |
| 232 |
Going : Direction := Forward; |
| 233 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := |
| 234 |
Wide_Wide_Maps.Identity) |
| 235 |
return Natural; |
| 236 |
pragma Ada_05 (Index); |
| 237 |
|
| 238 |
function Index |
| 239 |
(Source : Unbounded_Wide_Wide_String; |
| 240 |
Pattern : Wide_Wide_String; |
| 241 |
From : Positive; |
| 242 |
Going : Direction := Forward; |
| 243 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) |
| 244 |
return Natural; |
| 245 |
pragma Ada_05 (Index); |
| 246 |
|
| 247 |
function Index |
| 248 |
(Source : Unbounded_Wide_Wide_String; |
| 249 |
Set : Wide_Wide_Maps.Wide_Wide_Character_Set; |
| 250 |
From : Positive; |
| 251 |
Test : Membership := Inside; |
| 252 |
Going : Direction := Forward) return Natural; |
| 253 |
pragma Ada_05 (Index); |
| 254 |
|
| 255 |
function Index_Non_Blank |
| 256 |
(Source : Unbounded_Wide_Wide_String; |
| 257 |
Going : Direction := Forward) return Natural; |
| 258 |
|
| 259 |
function Index_Non_Blank |
| 260 |
(Source : Unbounded_Wide_Wide_String; |
| 261 |
From : Positive; |
| 262 |
Going : Direction := Forward) return Natural; |
| 263 |
pragma Ada_05 (Index_Non_Blank); |
| 264 |
|
| 265 |
function Count |
| 266 |
(Source : Unbounded_Wide_Wide_String; |
| 267 |
Pattern : Wide_Wide_String; |
| 268 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping := |
| 269 |
Wide_Wide_Maps.Identity) |
| 270 |
return Natural; |
| 271 |
|
| 272 |
function Count |
| 273 |
(Source : Unbounded_Wide_Wide_String; |
| 274 |
Pattern : Wide_Wide_String; |
| 275 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) |
| 276 |
return Natural; |
| 277 |
|
| 278 |
function Count |
| 279 |
(Source : Unbounded_Wide_Wide_String; |
| 280 |
Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural; |
| 281 |
|
| 282 |
procedure Find_Token |
| 283 |
(Source : Unbounded_Wide_Wide_String; |
| 284 |
Set : Wide_Wide_Maps.Wide_Wide_Character_Set; |
| 285 |
From : Positive; |
| 286 |
Test : Membership; |
| 287 |
First : out Positive; |
| 288 |
Last : out Natural); |
| 289 |
pragma Ada_2012 (Find_Token); |
| 290 |
|
| 291 |
procedure Find_Token |
| 292 |
(Source : Unbounded_Wide_Wide_String; |
| 293 |
Set : Wide_Wide_Maps.Wide_Wide_Character_Set; |
| 294 |
Test : Membership; |
| 295 |
First : out Positive; |
| 296 |
Last : out Natural); |
| 297 |
|
| 298 |
------------------------------------ |
| 299 |
-- String Translation Subprograms -- |
| 300 |
------------------------------------ |
| 301 |
|
| 302 |
function Translate |
| 303 |
(Source : Unbounded_Wide_Wide_String; |
| 304 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping) |
| 305 |
return Unbounded_Wide_Wide_String; |
| 306 |
|
| 307 |
procedure Translate |
| 308 |
(Source : in out Unbounded_Wide_Wide_String; |
| 309 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping); |
| 310 |
|
| 311 |
function Translate |
| 312 |
(Source : Unbounded_Wide_Wide_String; |
| 313 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function) |
| 314 |
return Unbounded_Wide_Wide_String; |
| 315 |
|
| 316 |
procedure Translate |
| 317 |
(Source : in out Unbounded_Wide_Wide_String; |
| 318 |
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function); |
| 319 |
|
| 320 |
--------------------------------------- |
| 321 |
-- String Transformation Subprograms -- |
| 322 |
--------------------------------------- |
| 323 |
|
| 324 |
function Replace_Slice |
| 325 |
(Source : Unbounded_Wide_Wide_String; |
| 326 |
Low : Positive; |
| 327 |
High : Natural; |
| 328 |
By : Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 329 |
|
| 330 |
procedure Replace_Slice |
| 331 |
(Source : in out Unbounded_Wide_Wide_String; |
| 332 |
Low : Positive; |
| 333 |
High : Natural; |
| 334 |
By : Wide_Wide_String); |
| 335 |
|
| 336 |
function Insert |
| 337 |
(Source : Unbounded_Wide_Wide_String; |
| 338 |
Before : Positive; |
| 339 |
New_Item : Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 340 |
|
| 341 |
procedure Insert |
| 342 |
(Source : in out Unbounded_Wide_Wide_String; |
| 343 |
Before : Positive; |
| 344 |
New_Item : Wide_Wide_String); |
| 345 |
|
| 346 |
function Overwrite |
| 347 |
(Source : Unbounded_Wide_Wide_String; |
| 348 |
Position : Positive; |
| 349 |
New_Item : Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 350 |
|
| 351 |
procedure Overwrite |
| 352 |
(Source : in out Unbounded_Wide_Wide_String; |
| 353 |
Position : Positive; |
| 354 |
New_Item : Wide_Wide_String); |
| 355 |
|
| 356 |
function Delete |
| 357 |
(Source : Unbounded_Wide_Wide_String; |
| 358 |
From : Positive; |
| 359 |
Through : Natural) return Unbounded_Wide_Wide_String; |
| 360 |
|
| 361 |
procedure Delete |
| 362 |
(Source : in out Unbounded_Wide_Wide_String; |
| 363 |
From : Positive; |
| 364 |
Through : Natural); |
| 365 |
|
| 366 |
function Trim |
| 367 |
(Source : Unbounded_Wide_Wide_String; |
| 368 |
Side : Trim_End) return Unbounded_Wide_Wide_String; |
| 369 |
|
| 370 |
procedure Trim |
| 371 |
(Source : in out Unbounded_Wide_Wide_String; |
| 372 |
Side : Trim_End); |
| 373 |
|
| 374 |
function Trim |
| 375 |
(Source : Unbounded_Wide_Wide_String; |
| 376 |
Left : Wide_Wide_Maps.Wide_Wide_Character_Set; |
| 377 |
Right : Wide_Wide_Maps.Wide_Wide_Character_Set) |
| 378 |
return Unbounded_Wide_Wide_String; |
| 379 |
|
| 380 |
procedure Trim |
| 381 |
(Source : in out Unbounded_Wide_Wide_String; |
| 382 |
Left : Wide_Wide_Maps.Wide_Wide_Character_Set; |
| 383 |
Right : Wide_Wide_Maps.Wide_Wide_Character_Set); |
| 384 |
|
| 385 |
function Head |
| 386 |
(Source : Unbounded_Wide_Wide_String; |
| 387 |
Count : Natural; |
| 388 |
Pad : Wide_Wide_Character := Wide_Wide_Space) |
| 389 |
return Unbounded_Wide_Wide_String; |
| 390 |
|
| 391 |
procedure Head |
| 392 |
(Source : in out Unbounded_Wide_Wide_String; |
| 393 |
Count : Natural; |
| 394 |
Pad : Wide_Wide_Character := Wide_Wide_Space); |
| 395 |
|
| 396 |
function Tail |
| 397 |
(Source : Unbounded_Wide_Wide_String; |
| 398 |
Count : Natural; |
| 399 |
Pad : Wide_Wide_Character := Wide_Wide_Space) |
| 400 |
return Unbounded_Wide_Wide_String; |
| 401 |
|
| 402 |
procedure Tail |
| 403 |
(Source : in out Unbounded_Wide_Wide_String; |
| 404 |
Count : Natural; |
| 405 |
Pad : Wide_Wide_Character := Wide_Wide_Space); |
| 406 |
|
| 407 |
function "*" |
| 408 |
(Left : Natural; |
| 409 |
Right : Wide_Wide_Character) return Unbounded_Wide_Wide_String; |
| 410 |
|
| 411 |
function "*" |
| 412 |
(Left : Natural; |
| 413 |
Right : Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 414 |
|
| 415 |
function "*" |
| 416 |
(Left : Natural; |
| 417 |
Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String; |
| 418 |
|
| 419 |
private |
| 420 |
pragma Inline (Length); |
| 421 |
|
| 422 |
package AF renames Ada.Finalization; |
| 423 |
|
| 424 |
type Shared_Wide_Wide_String (Max_Length : Natural) is limited record |
| 425 |
Counter : System.Atomic_Counters.Atomic_Counter; |
| 426 |
-- Reference counter |
| 427 |
|
| 428 |
Last : Natural := 0; |
| 429 |
Data : Wide_Wide_String (1 .. Max_Length); |
| 430 |
-- Last is the index of last significant element of the Data. All |
| 431 |
-- elements with larger indexes are just extra room for expansion. |
| 432 |
end record; |
| 433 |
|
| 434 |
type Shared_Wide_Wide_String_Access is access all Shared_Wide_Wide_String; |
| 435 |
|
| 436 |
procedure Reference (Item : not null Shared_Wide_Wide_String_Access); |
| 437 |
-- Increment reference counter. |
| 438 |
|
| 439 |
procedure Unreference (Item : not null Shared_Wide_Wide_String_Access); |
| 440 |
-- Decrement reference counter. Deallocate Item when reference counter is |
| 441 |
-- zero. |
| 442 |
|
| 443 |
function Can_Be_Reused |
| 444 |
(Item : Shared_Wide_Wide_String_Access; |
| 445 |
Length : Natural) return Boolean; |
| 446 |
-- Returns True if Shared_Wide_Wide_String can be reused. There are two |
| 447 |
-- criteria when Shared_Wide_Wide_String can be reused: its reference |
| 448 |
-- counter must be one (thus Shared_Wide_Wide_String is owned exclusively) |
| 449 |
-- and its size is sufficient to store string with specified length |
| 450 |
-- effectively. |
| 451 |
|
| 452 |
function Allocate |
| 453 |
(Max_Length : Natural) return Shared_Wide_Wide_String_Access; |
| 454 |
-- Allocates new Shared_Wide_Wide_String with at least specified maximum |
| 455 |
-- length. Actual maximum length of the allocated Shared_Wide_Wide_String |
| 456 |
-- can be slightly greater. Returns reference to |
| 457 |
-- Empty_Shared_Wide_Wide_String when requested length is zero. |
| 458 |
|
| 459 |
Empty_Shared_Wide_Wide_String : aliased Shared_Wide_Wide_String (0); |
| 460 |
|
| 461 |
function To_Unbounded |
| 462 |
(S : Wide_Wide_String) return Unbounded_Wide_Wide_String |
| 463 |
renames To_Unbounded_Wide_Wide_String; |
| 464 |
-- This renames are here only to be used in the pragma Stream_Convert. |
| 465 |
|
| 466 |
type Unbounded_Wide_Wide_String is new AF.Controlled with record |
| 467 |
Reference : Shared_Wide_Wide_String_Access := |
| 468 |
Empty_Shared_Wide_Wide_String'Access; |
| 469 |
end record; |
| 470 |
|
| 471 |
-- The Unbounded_Wide_Wide_String uses several techniques to increase speed |
| 472 |
-- of the application: |
| 473 |
|
| 474 |
-- - implicit sharing or copy-on-write. Unbounded_Wide_Wide_String |
| 475 |
-- contains only the reference to the data which is shared between |
| 476 |
-- several instances. The shared data is reallocated only when its value |
| 477 |
-- is changed and the object mutation can't be used or it is inefficient |
| 478 |
-- to use it; |
| 479 |
|
| 480 |
-- - object mutation. Shared data object can be reused without memory |
| 481 |
-- reallocation when all of the following requirements are meat: |
| 482 |
-- - shared data object don't used anywhere longer; |
| 483 |
-- - its size is sufficient to store new value; |
| 484 |
-- - the gap after reuse is less than some threshold. |
| 485 |
|
| 486 |
-- - memory preallocation. Most of used memory allocation algorithms |
| 487 |
-- aligns allocated segment on the some boundary, thus some amount of |
| 488 |
-- additional memory can be preallocated without any impact. Such |
| 489 |
-- preallocated memory can used later by Append/Insert operations |
| 490 |
-- without reallocation. |
| 491 |
|
| 492 |
-- Reference counting uses GCC builtin atomic operations, which allows safe |
| 493 |
-- sharing of internal data between Ada tasks. Nevertheless, this does not |
| 494 |
-- make objects of Unbounded_String thread-safe: an instance cannot be |
| 495 |
-- accessed by several tasks simultaneously. |
| 496 |
|
| 497 |
pragma Stream_Convert |
| 498 |
(Unbounded_Wide_Wide_String, To_Unbounded, To_Wide_Wide_String); |
| 499 |
-- Provide stream routines without dragging in Ada.Streams |
| 500 |
|
| 501 |
pragma Finalize_Storage_Only (Unbounded_Wide_Wide_String); |
| 502 |
-- Finalization is required only for freeing storage |
| 503 |
|
| 504 |
overriding procedure Initialize |
| 505 |
(Object : in out Unbounded_Wide_Wide_String); |
| 506 |
overriding procedure Adjust |
| 507 |
(Object : in out Unbounded_Wide_Wide_String); |
| 508 |
overriding procedure Finalize |
| 509 |
(Object : in out Unbounded_Wide_Wide_String); |
| 510 |
pragma Inline (Initialize, Adjust); |
| 511 |
|
| 512 |
Null_Unbounded_Wide_Wide_String : constant Unbounded_Wide_Wide_String := |
| 513 |
(AF.Controlled with |
| 514 |
Reference => |
| 515 |
Empty_Shared_Wide_Wide_String' |
| 516 |
Access); |
| 517 |
|
| 518 |
end Ada.Strings.Wide_Wide_Unbounded; |