Changeset 73907 in vbox for trunk/include/iprt/cpp
- Timestamp:
- Aug 27, 2018 9:54:04 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 124626
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/cpp/ministring.h
r69105 r73907 264 264 * @param cb New minimum size (in bytes) of member memory buffer. 265 265 */ 266 int reserveNoThrow(size_t cb) 266 int reserveNoThrow(size_t cb) RT_NOEXCEPT 267 267 { 268 268 if ( cb != m_cbAllocated … … 338 338 339 339 /** 340 * Assigns a copy of another RTCString. 341 * 342 * @param a_rSrc Reference to the source string. 343 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 344 */ 345 int assignNoThrow(const RTCString &a_rSrc) RT_NOEXCEPT; 346 347 /** 340 348 * Assigns a copy of a C-style string. 341 349 * … … 345 353 */ 346 354 RTCString &assign(const char *a_pszSrc); 355 356 /** 357 * Assigns a copy of a C-style string. 358 * 359 * @param a_pszSrc Pointer to the C-style source string. 360 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 361 * @remarks ASSUMES valid 362 */ 363 int assignNoThrow(const char *a_pszSrc) RT_NOEXCEPT; 347 364 348 365 /** … … 353 370 * @param a_cchSrc The max number of chars (encoded UTF-8 bytes) 354 371 * to copy from the source string. 372 * @throws std::bad_alloc On allocation error. The object is left unchanged. 355 373 */ 356 374 RTCString &assign(const RTCString &a_rSrc, size_t a_offSrc, size_t a_cchSrc = npos); 375 376 /** 377 * Assigns a partial copy of another RTCString. 378 * 379 * @param a_rSrc The source string. 380 * @param a_offSrc The byte offset into the source string. 381 * @param a_cchSrc The max number of chars (encoded UTF-8 bytes) 382 * to copy from the source string. 383 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 384 */ 385 int assignNoThrow(const RTCString &a_rSrc, size_t a_offSrc, size_t a_cchSrc = npos) RT_NOEXCEPT; 357 386 358 387 /** … … 362 391 * @param a_cchSrc The max number of chars (encoded UTF-8 bytes) 363 392 * to copy from the source string. 393 * @throws std::bad_alloc On allocation error. The object is left unchanged. 364 394 */ 365 395 RTCString &assign(const char *a_pszSrc, size_t a_cchSrc); 396 397 /** 398 * Assigns a partial copy of a C-style string. 399 * 400 * @param a_pszSrc The source string (UTF-8). 401 * @param a_cchSrc The max number of chars (encoded UTF-8 bytes) 402 * to copy from the source string. 403 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 404 */ 405 int assignNoThrow(const char *a_pszSrc, size_t a_cchSrc) RT_NOEXCEPT; 366 406 367 407 /** … … 370 410 * @param a_cTimes The number of times the character is repeated. 371 411 * @param a_ch The character to fill the string with. 412 * @throws std::bad_alloc On allocation error. The object is left unchanged. 372 413 */ 373 414 RTCString &assign(size_t a_cTimes, char a_ch); 415 416 /** 417 * Assigs a string containing @a a_cTimes repetitions of the character @a a_ch. 418 * 419 * @param a_cTimes The number of times the character is repeated. 420 * @param a_ch The character to fill the string with. 421 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 422 */ 423 int assignNoThrow(size_t a_cTimes, char a_ch) RT_NOEXCEPT; 374 424 375 425 /** … … 388 438 389 439 /** 440 * Assigns the output of the string format operation (RTStrPrintf). 441 * 442 * @param pszFormat Pointer to the format string, 443 * @see pg_rt_str_format. 444 * @param ... Ellipsis containing the arguments specified by 445 * the format string. 446 * 447 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 448 */ 449 int printfNoThrow(const char *pszFormat, ...) RT_NOEXCEPT RT_IPRT_FORMAT_ATTR(1, 2); 450 451 /** 390 452 * Assigns the output of the string format operation (RTStrPrintfV). 391 453 * … … 402 464 403 465 /** 466 * Assigns the output of the string format operation (RTStrPrintfV). 467 * 468 * @param pszFormat Pointer to the format string, 469 * @see pg_rt_str_format. 470 * @param va Argument vector containing the arguments 471 * specified by the format string. 472 * 473 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 474 */ 475 int printfVNoThrow(const char *pszFormat, va_list va) RT_NOEXCEPT RT_IPRT_FORMAT_ATTR(1, 0); 476 477 /** 404 478 * Appends the string @a that to @a rThat. 405 479 * … … 411 485 412 486 /** 487 * Appends the string @a that to @a rThat. 488 * 489 * @param rThat The string to append. 490 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 491 */ 492 int appendNoThrow(const RTCString &rThat) RT_NOEXCEPT; 493 494 /** 413 495 * Appends the string @a pszSrc to @a this. 414 496 * … … 418 500 */ 419 501 RTCString &append(const char *pszSrc); 502 503 /** 504 * Appends the string @a pszSrc to @a this. 505 * 506 * @param pszSrc The C-style string to append. 507 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 508 */ 509 int appendNoThrow(const char *pszSrc) RT_NOEXCEPT; 420 510 421 511 /** … … 432 522 433 523 /** 524 * Appends the a substring from @a rThat to @a this. 525 * 526 * @param rThat The string to append a substring from. 527 * @param offStart The start of the substring to append (byte offset, 528 * not codepoint). 529 * @param cchMax The maximum number of bytes to append. 530 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 531 */ 532 int appendNoThrow(const RTCString &rThat, size_t offStart, size_t cchMax = RTSTR_MAX) RT_NOEXCEPT; 533 534 /** 434 535 * Appends the first @a cchMax chars from string @a pszThat to @a this. 435 536 * … … 442 543 443 544 /** 545 * Appends the first @a cchMax chars from string @a pszThat to @a this. 546 * 547 * @param pszThat The C-style string to append. 548 * @param cchMax The maximum number of bytes to append. 549 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 550 */ 551 int appendNoThrow(const char *pszThat, size_t cchMax) RT_NOEXCEPT; 552 553 /** 444 554 * Appends the given character to @a this. 445 555 * … … 451 561 452 562 /** 563 * Appends the given character to @a this. 564 * 565 * @param ch The character to append. 566 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 567 */ 568 int appendNoThrow(char ch) RT_NOEXCEPT; 569 570 /** 453 571 * Appends the given unicode code point to @a this. 454 572 * … … 458 576 */ 459 577 RTCString &appendCodePoint(RTUNICP uc); 578 579 /** 580 * Appends the given unicode code point to @a this. 581 * 582 * @param uc The unicode code point to append. 583 * @returns VINF_SUCCESS, VERR_INVALID_UTF8_ENCODING or VERR_NO_STRING_MEMORY. 584 */ 585 int appendCodePointNoThrow(RTUNICP uc) RT_NOEXCEPT; 460 586 461 587 /** … … 557 683 558 684 /** 685 * Replaces a span of @a this string with a replacement string. 686 * 687 * @returns VINF_SUCCESS, VERR_OUT_OF_RANGE or VERR_NO_STRING_MEMORY. 688 * @param offStart Where in @a this string to start replacing. 689 * @param cchLength How much following @a offStart to replace. npos is 690 * accepted. 691 * @param rStrReplacement The replacement string. 692 */ 693 int replaceNoThrow(size_t offStart, size_t cchLength, const RTCString &rStrReplacement) RT_NOEXCEPT; 694 695 /** 559 696 * Replaces a span of @a this string with a replacement substring. 560 697 * … … 579 716 580 717 /** 718 * Replaces a span of @a this string with a replacement substring. 719 * 720 * @returns VINF_SUCCESS, VERR_OUT_OF_RANGE or VERR_NO_STRING_MEMORY. 721 * @param offStart Where in @a this string to start replacing. 722 * @param cchLength How much following @a offStart to replace. npos is 723 * accepted. 724 * @param rStrReplacement The string from which a substring is taken. 725 * @param offReplacement The offset into @a rStrReplacement where the 726 * replacement substring starts. 727 * @param cchReplacement The maximum length of the replacement substring. 728 */ 729 int replaceNoThrow(size_t offStart, size_t cchLength, const RTCString &rStrReplacement, 730 size_t offReplacement, size_t cchReplacement) RT_NOEXCEPT; 731 732 /** 581 733 * Replaces a span of @a this string with the replacement string. 582 734 * … … 593 745 */ 594 746 RTCString &replace(size_t offStart, size_t cchLength, const char *pszReplacement); 747 748 /** 749 * Replaces a span of @a this string with the replacement string. 750 * 751 * @returns VINF_SUCCESS, VERR_OUT_OF_RANGE or VERR_NO_STRING_MEMORY. 752 * @param offStart Where in @a this string to start replacing. 753 * @param cchLength How much following @a offStart to replace. npos is 754 * accepted. 755 * @param pszReplacement The replacement string. 756 */ 757 int replaceNoThrow(size_t offStart, size_t cchLength, const char *pszReplacement) RT_NOEXCEPT; 595 758 596 759 /** … … 612 775 */ 613 776 RTCString &replace(size_t offStart, size_t cchLength, const char *pszReplacement, size_t cchReplacement); 777 778 /** 779 * Replaces a span of @a this string with the replacement string. 780 * 781 * @returns VINF_SUCCESS, VERR_OUT_OF_RANGE or VERR_NO_STRING_MEMORY. 782 * @param offStart Where in @a this string to start replacing. 783 * @param cchLength How much following @a offStart to replace. npos is 784 * accepted. 785 * @param pszReplacement The replacement string. 786 * @param cchReplacement How much of @a pszReplacement to use at most. If a 787 * zero terminator is found before reaching this value, 788 * we'll stop there. 789 */ 790 int replaceNoThrow(size_t offStart, size_t cchLength, const char *pszReplacement, size_t cchReplacement) RT_NOEXCEPT; 614 791 615 792 /** … … 1208 1385 1209 1386 /** 1387 * Appends exactly @a cchSrc chars from @a pszSrc to @a this. 1388 * 1389 * This is an internal worker for the appendNoThrow() methods. 1390 * 1391 * @returns VINF_SUCCESS or VERR_NO_STRING_MEMORY. 1392 * @param pszSrc The source string. 1393 * @param cchSrc The source string length (exact). 1394 */ 1395 int appendWorkerNoThrow(const char *pszSrc, size_t cchSrc) RT_NOEXCEPT; 1396 1397 /** 1210 1398 * Replaces exatly @a cchLength chars at @a offStart with @a cchSrc from @a 1211 1399 * pszSrc. … … 1222 1410 RTCString &replaceWorker(size_t offStart, size_t cchLength, const char *pszSrc, size_t cchSrc); 1223 1411 1412 /** 1413 * Replaces exatly @a cchLength chars at @a offStart with @a cchSrc from @a 1414 * pszSrc. 1415 * 1416 * @returns VINF_SUCCESS, VERR_OUT_OF_RANGE or VERR_NO_STRING_MEMORY. 1417 * @param offStart Where in @a this string to start replacing. 1418 * @param cchLength How much following @a offStart to replace. npos is 1419 * accepted. 1420 * @param pszSrc The replacement string. 1421 * @param cchSrc The exactly length of the replacement string. 1422 */ 1423 int replaceWorkerNoThrow(size_t offStart, size_t cchLength, const char *pszSrc, size_t cchSrc) RT_NOEXCEPT; 1424 1224 1425 static DECLCALLBACK(size_t) printfOutputCallback(void *pvArg, const char *pachChars, size_t cbChars); 1426 static DECLCALLBACK(size_t) printfOutputCallbackNoThrow(void *pvArg, const char *pachChars, size_t cbChars) RT_NOEXCEPT; 1225 1427 1226 1428 char *m_psz; /**< The string buffer. */
Note:
See TracChangeset
for help on using the changeset viewer.