Changes between Version 4 and Version 5 of Reference/League/Universal_String
- Timestamp:
- Apr 7, 2011, 7:29:40 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Reference/League/Universal_String
v4 v5 48 48 Several optimization techniques are used to optimize both space and performance characteristics, see [#OptimizationTechniques Optimization Techniques] section for more information. 49 49 50 === "&" === #concatenation 50 Universal_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 54 Objects 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 60 Another 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 {{{ 63 function From_ISO_8859_1 (Item : Stream_Element_Array) return Universal_String is 64 Codec : Text_Codec := Codec (To_Universal_String ("iso-8859-1")); 65 66 begin 67 return Codec.Decode (Item); 68 end From_ISO_8859_1; 69 }}} 70 71 For more information about conversion of text data from/into external representation see [wiki:League/Text_Codec Text_Codec]. 72 73 === Subprograms === 74 75 ==== "&" ==== #concatenation 51 76 52 77 {{{ … … 84 109 "&" functions with parameters of Wide_Wide_Character/Wide_Wide_String/Universal_Character types raises Constraint_Error when character is not valid Unicode character. 85 110 86 === "<"=== #less111 ==== "<" ==== #less 87 112 88 113 {{{ … … 95 120 The 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. 96 121 97 === "<="=== #lessequal122 ==== "<=" ==== #lessequal 98 123 99 124 {{{ … … 106 131 The 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. 107 132 108 === "="=== #equal133 ==== "=" ==== #equal 109 134 110 135 {{{ … … 117 142 The 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. 118 143 119 === ">"=== #greater144 ==== ">" ==== #greater 120 145 121 146 {{{ … … 128 153 The 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. 129 154 130 === ">="=== #greaterequal155 ==== ">=" ==== #greaterequal 131 156 132 157 {{{ … … 139 164 The 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. 140 165 141 === Append===166 ==== Append ==== 142 167 143 168 {{{ … … 165 190 The 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. 166 191 167 === Clear===192 ==== Clear ==== 168 193 169 194 {{{ … … 173 198 Clears the contents of the string and makes it empty. 174 199 175 === Collation===200 ==== Collation ==== 176 201 177 202 {{{ … … 179 204 }}} 180 205 181 === Element===206 ==== Element ==== 182 207 183 208 {{{ … … 187 212 }}} 188 213 189 === Hash===214 ==== Hash ==== 190 215 191 216 {{{ … … 193 218 }}} 194 219 195 === Index===220 ==== Index ==== 196 221 197 222 {{{ … … 205 230 }}} 206 231 207 === Is_Empty===232 ==== Is_Empty ==== 208 233 209 234 {{{ … … 211 236 }}} 212 237 213 === Length===238 ==== Length ==== 214 239 215 240 {{{ … … 217 242 }}} 218 243 219 === Prepend===244 ==== Prepend ==== 220 245 221 246 {{{ … … 237 262 }}} 238 263 239 === Replace===264 ==== Replace ==== 240 265 241 266 {{{ … … 253 278 }}} 254 279 255 === Slice===280 ==== Slice ==== 256 281 257 282 {{{ … … 262 287 }}} 263 288 264 === Split===289 ==== Split ==== 265 290 266 291 {{{ … … 276 301 }}} 277 302 278 === To_Casefold===303 ==== To_Casefold ==== 279 304 280 305 {{{ … … 283 308 }}} 284 309 285 === To_Lowercase===310 ==== To_Lowercase ==== 286 311 287 312 {{{ … … 290 315 }}} 291 316 292 === To_NFC===317 ==== To_NFC ==== 293 318 294 319 {{{ … … 296 321 }}} 297 322 298 === To_NFD===323 ==== To_NFD ==== 299 324 300 325 {{{ … … 302 327 }}} 303 328 304 === To_NFKC===329 ==== To_NFKC ==== 305 330 306 331 {{{ … … 308 333 }}} 309 334 310 === To_NFKD===335 ==== To_NFKD ==== 311 336 312 337 {{{ … … 314 339 }}} 315 340 316 === To_Universal_String===341 ==== To_Universal_String ==== 317 342 318 343 {{{ … … 321 346 }}} 322 347 323 === To_Uppercase===348 ==== To_Uppercase ==== 324 349 325 350 {{{ … … 328 353 }}} 329 354 330 === To_Wide_Wide_String===355 ==== To_Wide_Wide_String ==== 331 356 332 357 {{{