1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _RTL_USTRBUF_HXX_ 29 #define _RTL_USTRBUF_HXX_ 30 31 #include <osl/diagnose.h> 32 #include <rtl/ustrbuf.h> 33 #ifndef _RTL_USTRING_HXX 34 #include <rtl/ustring.hxx> 35 #endif 36 37 #ifdef __cplusplus 38 39 namespace rtl 40 { 41 42 /** @HTML 43 A string buffer implements a mutable sequence of characters. 44 <p> 45 String buffers are safe for use by multiple threads. The methods 46 are synchronized where necessary so that all the operations on any 47 particular instance behave as if they occur in some serial order. 48 <p> 49 String buffers are used by the compiler to implement the binary 50 string concatenation operator <code>+</code>. For example, the code: 51 <p><blockquote><pre> 52 x = "a" + 4 + "c" 53 </pre></blockquote><p> 54 is compiled to the equivalent of: 55 <p><blockquote><pre> 56 x = new OUStringBuffer().append("a").append(4).append("c") 57 .toString() 58 </pre></blockquote><p> 59 The principal operations on a <code>OUStringBuffer</code> are the 60 <code>append</code> and <code>insert</code> methods, which are 61 overloaded so as to accept data of any type. Each effectively 62 converts a given datum to a string and then appends or inserts the 63 characters of that string to the string buffer. The 64 <code>append</code> method always adds these characters at the end 65 of the buffer; the <code>insert</code> method adds the characters at 66 a specified point. 67 <p> 68 For example, if <code>z</code> refers to a string buffer object 69 whose current contents are "<code>start</code>", then 70 the method call <code>z.append("le")</code> would cause the string 71 buffer to contain "<code>startle</code>", whereas 72 <code>z.insert(4, "le")</code> would alter the string buffer to 73 contain "<code>starlet</code>". 74 <p> 75 Every string buffer has a capacity. As long as the length of the 76 character sequence contained in the string buffer does not exceed 77 the capacity, it is not necessary to allocate a new internal 78 buffer array. If the internal buffer overflows, it is 79 automatically made larger. 80 */ 81 class OUStringBuffer 82 { 83 public: 84 /** 85 Constructs a string buffer with no characters in it and an 86 initial capacity of 16 characters. 87 */ 88 OUStringBuffer() 89 : pData(NULL) 90 , nCapacity( 16 ) 91 { 92 rtl_uString_new_WithLength( &pData, nCapacity ); 93 } 94 95 /** 96 Allocates a new string buffer that contains the same sequence of 97 characters as the string buffer argument. 98 99 @param value a <code>OStringBuffer</code>. 100 */ 101 OUStringBuffer( const OUStringBuffer & value ) 102 : pData(NULL) 103 , nCapacity( value.nCapacity ) 104 { 105 rtl_uStringbuffer_newFromStringBuffer( &pData, value.nCapacity, value.pData ); 106 } 107 108 /** 109 Constructs a string buffer with no characters in it and an 110 initial capacity specified by the <code>length</code> argument. 111 112 @param length the initial capacity. 113 */ 114 OUStringBuffer(sal_Int32 length) 115 : pData(NULL) 116 , nCapacity( length ) 117 { 118 rtl_uString_new_WithLength( &pData, length ); 119 } 120 121 /** 122 Constructs a string buffer so that it represents the same 123 sequence of characters as the string argument. 124 125 The initial 126 capacity of the string buffer is <code>16</code> plus the length 127 of the string argument. 128 129 @param str the initial contents of the buffer. 130 */ 131 OUStringBuffer(OUString value) 132 : pData(NULL) 133 , nCapacity( value.getLength() + 16 ) 134 { 135 rtl_uStringbuffer_newFromStr_WithLength( &pData, value.getStr(), value.getLength() ); 136 } 137 138 /** Assign to this a copy of value. 139 */ 140 OUStringBuffer& operator = ( const OUStringBuffer& value ) 141 { 142 if (this != &value) 143 { 144 rtl_uStringbuffer_newFromStringBuffer(&pData, 145 value.nCapacity, 146 value.pData); 147 nCapacity = value.nCapacity; 148 } 149 return *this; 150 } 151 152 /** 153 Release the string data. 154 */ 155 ~OUStringBuffer() 156 { 157 rtl_uString_release( pData ); 158 } 159 160 /** 161 Fill the string data in the new string and clear the buffer. 162 163 This method is more efficient than the contructor of the string. It does 164 not copy the buffer. 165 166 @return the string previously contained in the buffer. 167 */ 168 OUString makeStringAndClear() 169 { 170 OUString aRet( pData ); 171 rtl_uString_new(&pData); 172 nCapacity = 0; 173 return aRet; 174 } 175 176 /** 177 Returns the length (character count) of this string buffer. 178 179 @return the number of characters in this string buffer. 180 */ 181 sal_Int32 getLength() const 182 { 183 return pData->length; 184 } 185 186 /** 187 Returns the current capacity of the String buffer. 188 189 The capacity 190 is the amount of storage available for newly inserted 191 characters. The real buffer size is 2 bytes longer, because 192 all strings are 0 terminated. 193 194 @return the current capacity of this string buffer. 195 */ 196 sal_Int32 getCapacity() const 197 { 198 return nCapacity; 199 } 200 201 /** 202 Ensures that the capacity of the buffer is at least equal to the 203 specified minimum. 204 205 The new capacity will be at least as large as the maximum of the current 206 length (so that no contents of the buffer is destroyed) and the given 207 minimumCapacity. If the given minimumCapacity is negative, nothing is 208 changed. 209 210 @param minimumCapacity the minimum desired capacity. 211 */ 212 void ensureCapacity(sal_Int32 minimumCapacity) 213 { 214 rtl_uStringbuffer_ensureCapacity( &pData, &nCapacity, minimumCapacity ); 215 } 216 217 /** 218 Sets the length of this String buffer. 219 220 If the <code>newLength</code> argument is less than the current 221 length of the string buffer, the string buffer is truncated to 222 contain exactly the number of characters given by the 223 <code>newLength</code> argument. 224 <p> 225 If the <code>newLength</code> argument is greater than or equal 226 to the current length, sufficient null characters 227 (<code>'\u0000'</code>) are appended to the string buffer so that 228 length becomes the <code>newLength</code> argument. 229 <p> 230 The <code>newLength</code> argument must be greater than or equal 231 to <code>0</code>. 232 233 @param newLength the new length of the buffer. 234 */ 235 void setLength(sal_Int32 newLength) 236 { 237 OSL_ASSERT(newLength >= 0); 238 // Avoid modifications if pData points to const empty string: 239 if( newLength != pData->length ) 240 { 241 if( newLength > nCapacity ) 242 rtl_uStringbuffer_ensureCapacity(&pData, &nCapacity, newLength); 243 else 244 pData->buffer[newLength] = 0; 245 pData->length = newLength; 246 } 247 } 248 249 /** 250 Returns the character at a specific index in this string buffer. 251 252 The first character of a string buffer is at index 253 <code>0</code>, the next at index <code>1</code>, and so on, for 254 array indexing. 255 <p> 256 The index argument must be greater than or equal to 257 <code>0</code>, and less than the length of this string buffer. 258 259 @param index the index of the desired character. 260 @return the character at the specified index of this string buffer. 261 */ 262 sal_Unicode charAt( sal_Int32 index ) const 263 { 264 OSL_ASSERT(index >= 0 && index < pData->length); 265 return pData->buffer[ index ]; 266 } 267 268 /** 269 Return a null terminated unicode character array. 270 */ 271 operator const sal_Unicode *() const { return pData->buffer; } 272 273 /** 274 Return a null terminated unicode character array. 275 */ 276 const sal_Unicode* getStr() const { return pData->buffer; } 277 278 279 /** 280 The character at the specified index of this string buffer is set 281 to <code>ch</code>. 282 283 The index argument must be greater than or equal to 284 <code>0</code>, and less than the length of this string buffer. 285 286 @param index the index of the character to modify. 287 @param ch the new character. 288 */ 289 OUStringBuffer & setCharAt(sal_Int32 index, sal_Unicode ch) 290 { 291 OSL_ASSERT(index >= 0 && index < pData->length); 292 pData->buffer[ index ] = ch; 293 return *this; 294 } 295 296 /** 297 Appends the string to this string buffer. 298 299 The characters of the <code>String</code> argument are appended, in 300 order, to the contents of this string buffer, increasing the 301 length of this string buffer by the length of the argument. 302 303 @param str a string. 304 @return this string buffer. 305 */ 306 OUStringBuffer & append(const OUString &str) 307 { 308 return append( str.getStr(), str.getLength() ); 309 } 310 311 /** 312 Appends the string representation of the <code>char</code> array 313 argument to this string buffer. 314 315 The characters of the array argument are appended, in order, to 316 the contents of this string buffer. The length of this string 317 buffer increases by the length of the argument. 318 319 @param str the characters to be appended. 320 @return this string buffer. 321 */ 322 OUStringBuffer & append( const sal_Unicode * str ) 323 { 324 return append( str, rtl_ustr_getLength( str ) ); 325 } 326 327 /** 328 Appends the string representation of the <code>char</code> array 329 argument to this string buffer. 330 331 Characters of the character array <code>str</code> are appended, 332 in order, to the contents of this string buffer. The length of this 333 string buffer increases by the value of <code>len</code>. 334 335 @param str the characters to be appended; must be non-null, and must 336 point to at least len characters 337 @param len the number of characters to append; must be non-negative 338 @return this string buffer. 339 */ 340 OUStringBuffer & append( const sal_Unicode * str, sal_Int32 len) 341 { 342 // insert behind the last character 343 rtl_uStringbuffer_insert( &pData, &nCapacity, getLength(), str, len ); 344 return *this; 345 } 346 347 /** 348 Appends a 8-Bit ASCII character string to this string buffer. 349 350 Since this method is optimized for performance. the ASCII 351 character values are not converted in any way. The caller 352 has to make sure that all ASCII characters are in the 353 allowed range between 0 and 127. The ASCII string must be 354 NULL-terminated. 355 <p> 356 The characters of the array argument are appended, in order, to 357 the contents of this string buffer. The length of this string 358 buffer increases by the length of the argument. 359 360 @param str the 8-Bit ASCII characters to be appended. 361 @return this string buffer. 362 */ 363 OUStringBuffer & appendAscii( const sal_Char * str ) 364 { 365 return appendAscii( str, rtl_str_getLength( str ) ); 366 } 367 368 /** 369 Appends a 8-Bit ASCII character string to this string buffer. 370 371 Since this method is optimized for performance. the ASCII 372 character values are not converted in any way. The caller 373 has to make sure that all ASCII characters are in the 374 allowed range between 0 and 127. The ASCII string must be 375 NULL-terminated. 376 <p> 377 Characters of the character array <code>str</code> are appended, 378 in order, to the contents of this string buffer. The length of this 379 string buffer increases by the value of <code>len</code>. 380 381 @param str the 8-Bit ASCII characters to be appended; must be non-null, 382 and must point to at least len characters 383 @param len the number of characters to append; must be non-negative 384 @return this string buffer. 385 */ 386 OUStringBuffer & appendAscii( const sal_Char * str, sal_Int32 len) 387 { 388 rtl_uStringbuffer_insert_ascii( &pData, &nCapacity, getLength(), str, len ); 389 return *this; 390 } 391 392 393 /** 394 Appends the string representation of the <code>sal_Bool</code> 395 argument to the string buffer. 396 397 The argument is converted to a string as if by the method 398 <code>String.valueOf</code>, and the characters of that 399 string are then appended to this string buffer. 400 401 @param b a <code>sal_Bool</code>. 402 @return this string buffer. 403 */ 404 OUStringBuffer & append(sal_Bool b) 405 { 406 sal_Unicode sz[RTL_USTR_MAX_VALUEOFBOOLEAN]; 407 return append( sz, rtl_ustr_valueOfBoolean( sz, b ) ); 408 } 409 410 /** 411 Appends the string representation of the <code>char</code> 412 argument to this string buffer. 413 414 The argument is appended to the contents of this string buffer. 415 The length of this string buffer increases by <code>1</code>. 416 417 @param ch a <code>char</code>. 418 @return this string buffer. 419 */ 420 OUStringBuffer & append(sal_Unicode c) 421 { 422 return append( &c, 1 ); 423 } 424 425 /** 426 Appends the string representation of the <code>sal_Int32</code> 427 argument to this string buffer. 428 429 The argument is converted to a string as if by the method 430 <code>String.valueOf</code>, and the characters of that 431 string are then appended to this string buffer. 432 433 @param i an <code>sal_Int32</code>. 434 @return this string buffer. 435 */ 436 OUStringBuffer & append(sal_Int32 i, sal_Int16 radix = 10 ) 437 { 438 sal_Unicode sz[RTL_USTR_MAX_VALUEOFINT32]; 439 return append( sz, rtl_ustr_valueOfInt32( sz, i, radix ) ); 440 } 441 442 /** 443 Appends the string representation of the <code>long</code> 444 argument to this string buffer. 445 446 The argument is converted to a string as if by the method 447 <code>String.valueOf</code>, and the characters of that 448 string are then appended to this string buffer. 449 450 @param l a <code>long</code>. 451 @return this string buffer. 452 */ 453 OUStringBuffer & append(sal_Int64 l, sal_Int16 radix = 10 ) 454 { 455 sal_Unicode sz[RTL_USTR_MAX_VALUEOFINT64]; 456 return append( sz, rtl_ustr_valueOfInt64( sz, l, radix ) ); 457 } 458 459 /** 460 Appends the string representation of the <code>float</code> 461 argument to this string buffer. 462 463 The argument is converted to a string as if by the method 464 <code>String.valueOf</code>, and the characters of that 465 string are then appended to this string buffer. 466 467 @param f a <code>float</code>. 468 @return this string buffer. 469 */ 470 OUStringBuffer & append(float f) 471 { 472 sal_Unicode sz[RTL_USTR_MAX_VALUEOFFLOAT]; 473 return append( sz, rtl_ustr_valueOfFloat( sz, f ) ); 474 } 475 476 /** 477 Appends the string representation of the <code>double</code> 478 argument to this string buffer. 479 480 The argument is converted to a string as if by the method 481 <code>String.valueOf</code>, and the characters of that 482 string are then appended to this string buffer. 483 484 @param d a <code>double</code>. 485 @return this string buffer. 486 */ 487 OUStringBuffer & append(double d) 488 { 489 sal_Unicode sz[RTL_USTR_MAX_VALUEOFDOUBLE]; 490 return append( sz, rtl_ustr_valueOfDouble( sz, d ) ); 491 } 492 493 /** 494 Appends a single UTF-32 character to this string buffer. 495 496 <p>The single UTF-32 character will be represented within the string 497 buffer as either one or two UTF-16 code units.</p> 498 499 @param c a well-formed UTF-32 code unit (that is, a value in the range 500 <code>0</code>–<code>0x10FFFF</code>, but excluding 501 <code>0xD800</code>–<code>0xDFFF</code>) 502 503 @return 504 this string buffer 505 */ 506 OUStringBuffer & appendUtf32(sal_uInt32 c) { 507 return insertUtf32(getLength(), c); 508 } 509 510 /** 511 Inserts the string into this string buffer. 512 513 The characters of the <code>String</code> argument are inserted, in 514 order, into this string buffer at the indicated offset. The length 515 of this string buffer is increased by the length of the argument. 516 <p> 517 The offset argument must be greater than or equal to 518 <code>0</code>, and less than or equal to the length of this 519 string buffer. 520 521 @param offset the offset. 522 @param str a string. 523 @return this string buffer. 524 */ 525 OUStringBuffer & insert(sal_Int32 offset, const OUString & str) 526 { 527 return insert( offset, str.getStr(), str.getLength() ); 528 } 529 530 /** 531 Inserts the string representation of the <code>char</code> array 532 argument into this string buffer. 533 534 The characters of the array argument are inserted into the 535 contents of this string buffer at the position indicated by 536 <code>offset</code>. The length of this string buffer increases by 537 the length of the argument. 538 <p> 539 The offset argument must be greater than or equal to 540 <code>0</code>, and less than or equal to the length of this 541 string buffer. 542 543 @param offset the offset. 544 @param ch a character array. 545 @return this string buffer. 546 */ 547 OUStringBuffer & insert( sal_Int32 offset, const sal_Unicode * str ) 548 { 549 return insert( offset, str, rtl_ustr_getLength( str ) ); 550 } 551 552 /** 553 Inserts the string representation of the <code>char</code> array 554 argument into this string buffer. 555 556 The characters of the array argument are inserted into the 557 contents of this string buffer at the position indicated by 558 <code>offset</code>. The length of this string buffer increases by 559 the length of the argument. 560 <p> 561 The offset argument must be greater than or equal to 562 <code>0</code>, and less than or equal to the length of this 563 string buffer. 564 565 @param offset the offset. 566 @param ch a character array. 567 @param len the number of characters to append. 568 @return this string buffer. 569 */ 570 OUStringBuffer & insert( sal_Int32 offset, const sal_Unicode * str, sal_Int32 len) 571 { 572 // insert behind the last character 573 rtl_uStringbuffer_insert( &pData, &nCapacity, offset, str, len ); 574 return *this; 575 } 576 577 /** 578 Inserts the string representation of the <code>sal_Bool</code> 579 argument into this string buffer. 580 581 The second argument is converted to a string as if by the method 582 <code>String.valueOf</code>, and the characters of that 583 string are then inserted into this string buffer at the indicated 584 offset. 585 <p> 586 The offset argument must be greater than or equal to 587 <code>0</code>, and less than or equal to the length of this 588 string buffer. 589 590 @param offset the offset. 591 @param b a <code>sal_Bool</code>. 592 @return this string buffer. 593 */ 594 OUStringBuffer & insert(sal_Int32 offset, sal_Bool b) 595 { 596 sal_Unicode sz[RTL_USTR_MAX_VALUEOFBOOLEAN]; 597 return insert( offset, sz, rtl_ustr_valueOfBoolean( sz, b ) ); 598 } 599 600 /** 601 Inserts the string representation of the <code>char</code> 602 argument into this string buffer. 603 604 The second argument is inserted into the contents of this string 605 buffer at the position indicated by <code>offset</code>. The length 606 of this string buffer increases by one. 607 <p> 608 The offset argument must be greater than or equal to 609 <code>0</code>, and less than or equal to the length of this 610 string buffer. 611 612 @param offset the offset. 613 @param ch a <code>char</code>. 614 @return this string buffer. 615 */ 616 OUStringBuffer & insert(sal_Int32 offset, sal_Unicode c) 617 { 618 return insert( offset, &c, 1 ); 619 } 620 621 /** 622 Inserts the string representation of the second <code>sal_Int32</code> 623 argument into this string buffer. 624 625 The second argument is converted to a string as if by the method 626 <code>String.valueOf</code>, and the characters of that 627 string are then inserted into this string buffer at the indicated 628 offset. 629 <p> 630 The offset argument must be greater than or equal to 631 <code>0</code>, and less than or equal to the length of this 632 string buffer. 633 634 @param offset the offset. 635 @param b an <code>sal_Int32</code>. 636 @return this string buffer. 637 @exception StringIndexOutOfBoundsException if the offset is invalid. 638 */ 639 OUStringBuffer & insert(sal_Int32 offset, sal_Int32 i, sal_Int16 radix = 10 ) 640 { 641 sal_Unicode sz[RTL_USTR_MAX_VALUEOFINT32]; 642 return insert( offset, sz, rtl_ustr_valueOfInt32( sz, i, radix ) ); 643 } 644 645 /** 646 Inserts the string representation of the <code>long</code> 647 argument into this string buffer. 648 649 The second argument is converted to a string as if by the method 650 <code>String.valueOf</code>, and the characters of that 651 string are then inserted into this string buffer at the indicated 652 offset. 653 <p> 654 The offset argument must be greater than or equal to 655 <code>0</code>, and less than or equal to the length of this 656 string buffer. 657 658 @param offset the offset. 659 @param b a <code>long</code>. 660 @return this string buffer. 661 @exception StringIndexOutOfBoundsException if the offset is invalid. 662 */ 663 OUStringBuffer & insert(sal_Int32 offset, sal_Int64 l, sal_Int16 radix = 10 ) 664 { 665 sal_Unicode sz[RTL_USTR_MAX_VALUEOFINT64]; 666 return insert( offset, sz, rtl_ustr_valueOfInt64( sz, l, radix ) ); 667 } 668 669 /** 670 Inserts the string representation of the <code>float</code> 671 argument into this string buffer. 672 673 The second argument is converted to a string as if by the method 674 <code>String.valueOf</code>, and the characters of that 675 string are then inserted into this string buffer at the indicated 676 offset. 677 <p> 678 The offset argument must be greater than or equal to 679 <code>0</code>, and less than or equal to the length of this 680 string buffer. 681 682 @param offset the offset. 683 @param b a <code>float</code>. 684 @return this string buffer. 685 @exception StringIndexOutOfBoundsException if the offset is invalid. 686 */ 687 OUStringBuffer insert(sal_Int32 offset, float f) 688 { 689 sal_Unicode sz[RTL_USTR_MAX_VALUEOFFLOAT]; 690 return insert( offset, sz, rtl_ustr_valueOfFloat( sz, f ) ); 691 } 692 693 /** 694 Inserts the string representation of the <code>double</code> 695 argument into this string buffer. 696 697 The second argument is converted to a string as if by the method 698 <code>String.valueOf</code>, and the characters of that 699 string are then inserted into this string buffer at the indicated 700 offset. 701 <p> 702 The offset argument must be greater than or equal to 703 <code>0</code>, and less than or equal to the length of this 704 string buffer. 705 706 @param offset the offset. 707 @param b a <code>double</code>. 708 @return this string buffer. 709 @exception StringIndexOutOfBoundsException if the offset is invalid. 710 */ 711 OUStringBuffer & insert(sal_Int32 offset, double d) 712 { 713 sal_Unicode sz[RTL_USTR_MAX_VALUEOFDOUBLE]; 714 return insert( offset, sz, rtl_ustr_valueOfDouble( sz, d ) ); 715 } 716 717 /** 718 Inserts a single UTF-32 character into this string buffer. 719 720 <p>The single UTF-32 character will be represented within the string 721 buffer as either one or two UTF-16 code units.</p> 722 723 @param offset the offset into this string buffer (from zero to the length 724 of this string buffer, inclusive) 725 726 @param c a well-formed UTF-32 code unit (that is, a value in the range 727 <code>0</code>–<code>0x10FFFF</code>, but excluding 728 <code>0xD800</code>–<code>0xDFFF</code>) 729 730 @return this string buffer 731 */ 732 OUStringBuffer & insertUtf32(sal_Int32 offset, sal_uInt32 c) { 733 rtl_uStringbuffer_insertUtf32(&pData, &nCapacity, offset, c); 734 return *this; 735 } 736 737 /** Allows access to the internal data of this OUStringBuffer, for effective 738 manipulation. 739 740 This method should be used with care. After you have called this 741 method, you may use the returned pInternalData or pInternalCapacity only 742 as long as you make no other method call on this OUStringBuffer. 743 744 @param pInternalData 745 This output parameter receives a pointer to the internal data 746 (rtl_uString pointer). pInternalData itself must not be null. 747 748 @param pInternalCapacity 749 This output parameter receives a pointer to the internal capacity. 750 pInternalCapacity itself must not be null. 751 */ 752 inline void accessInternals(rtl_uString *** pInternalData, 753 sal_Int32 ** pInternalCapacity) 754 { 755 *pInternalData = &pData; 756 *pInternalCapacity = &nCapacity; 757 } 758 759 private: 760 /** 761 A pointer to the data structur which contains the data. 762 */ 763 rtl_uString * pData; 764 765 /** 766 The len of the pData->buffer. 767 */ 768 sal_Int32 nCapacity; 769 }; 770 771 } 772 773 #endif /* __cplusplus */ 774 #endif /* _RTL_USTRBUF_HXX_ */ 775