Changes between Version 4 and Version 5 of Reference/League/Universal_String


Ignore:
Timestamp:
Apr 7, 2011, 7:29:40 PM (10 years ago)
Author:
vadim.godunko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Reference/League/Universal_String

    v4 v5  
    4848Several optimization techniques are used to optimize both space and performance characteristics, see [#OptimizationTechniques Optimization Techniques] section for more information.
    4949
    50 === "&" === #concatenation
     50Universal_String is declared in package of category remote types and can be used in distributed application to interchange string data between partitions.
     51
     52=== Initializing of objects of Universal_String ===
     53
     54Objects of Universal_String is empty by default. Initialized objects can be constructed from wide wide string objects by [#To_Universal_String To_Universal_String] function.
     55
     56{{{
     57   Hello : Universal_String := To_Universal_String ("Hello");
     58}}}
     59
     60Another way to construct objects of Universal_String is to use text decoder to decode external representation of text data in form of sequence of stream elements.
     61
     62{{{
     63function From_ISO_8859_1 (Item : Stream_Element_Array) return Universal_String is
     64   Codec : Text_Codec := Codec (To_Universal_String ("iso-8859-1"));
     65
     66begin
     67   return Codec.Decode (Item);
     68end From_ISO_8859_1;
     69}}}
     70
     71For more information about conversion of text data from/into external representation see [wiki:League/Text_Codec Text_Codec].
     72
     73=== Subprograms ===
     74
     75==== "&" ==== #concatenation
    5176
    5277{{{
     
    84109"&" functions with parameters of Wide_Wide_Character/Wide_Wide_String/Universal_Character types raises Constraint_Error when character is not valid Unicode character.
    85110
    86 === "<" === #less
     111==== "<" ==== #less
    87112
    88113{{{
     
    95120The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the [#Collation Collation] function.
    96121
    97 === "<=" === #lessequal
     122==== "<=" ==== #lessequal
    98123
    99124{{{
     
    106131The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the [#Collation Collation] function.
    107132
    108 === "=" === #equal
     133==== "=" ==== #equal
    109134
    110135{{{
     
    117142The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the [#Collation Collation] function.
    118143
    119 === ">" === #greater
     144==== ">" ==== #greater
    120145
    121146{{{
     
    128153The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the [#Collation Collation] function.
    129154
    130 === ">=" === #greaterequal
     155==== ">=" ==== #greaterequal
    131156
    132157{{{
     
    139164The comparison is based exclusively on the numeric Unicode values of the characters and is very fast, but is not what a human would expect. Consider sorting user-interface strings using the [#Collation Collation] function.
    140165
    141 === Append ===
     166==== Append ====
    142167
    143168{{{
     
    165190The Append functions for characters, as well as for small strings are typically very fast (constant time), because Universal_String preallocates extra space at the end of the string data so it can grow without reallocating the entire string each time.
    166191
    167 === Clear ===
     192==== Clear ====
    168193
    169194{{{
     
    173198Clears the contents of the string and makes it empty.
    174199
    175 === Collation ===
     200==== Collation ====
    176201
    177202{{{
     
    179204}}}
    180205
    181 === Element ===
     206==== Element ====
    182207
    183208{{{
     
    187212}}}
    188213
    189 === Hash ===
     214==== Hash ====
    190215
    191216{{{
     
    193218}}}
    194219
    195 === Index ===
     220==== Index ====
    196221
    197222{{{
     
    205230}}}
    206231
    207 === Is_Empty ===
     232==== Is_Empty ====
    208233
    209234{{{
     
    211236}}}
    212237
    213 === Length ===
     238==== Length ====
    214239
    215240{{{
     
    217242}}}
    218243
    219 === Prepend ===
     244==== Prepend ====
    220245
    221246{{{
     
    237262}}}
    238263
    239 === Replace ===
     264==== Replace ====
    240265
    241266{{{
     
    253278}}}
    254279
    255 === Slice ===
     280==== Slice ====
    256281
    257282{{{
     
    262287}}}
    263288
    264 === Split ===
     289==== Split ====
    265290
    266291{{{
     
    276301}}}
    277302
    278 === To_Casefold ===
     303==== To_Casefold ====
    279304
    280305{{{
     
    283308}}}
    284309
    285 === To_Lowercase ===
     310==== To_Lowercase ====
    286311
    287312{{{
     
    290315}}}
    291316
    292 === To_NFC ===
     317==== To_NFC ====
    293318
    294319{{{
     
    296321}}}
    297322
    298 === To_NFD ===
     323==== To_NFD ====
    299324
    300325{{{
     
    302327}}}
    303328
    304 === To_NFKC ===
     329==== To_NFKC ====
    305330
    306331{{{
     
    308333}}}
    309334
    310 === To_NFKD ===
     335==== To_NFKD ====
    311336
    312337{{{
     
    314339}}}
    315340
    316 === To_Universal_String ===
     341==== To_Universal_String ====
    317342
    318343{{{
     
    321346}}}
    322347
    323 === To_Uppercase ===
     348==== To_Uppercase ====
    324349
    325350{{{
     
    328353}}}
    329354
    330 === To_Wide_Wide_String ===
     355==== To_Wide_Wide_String ====
    331356
    332357{{{