Changeset 73908 in vbox for trunk/src/VBox/Runtime/common/string/ministring.cpp
- Timestamp:
- Aug 27, 2018 10:15:30 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/ministring.cpp
r73907 r73908 283 283 } 284 284 285 RTCString &RTCString::appendPrintfV(const char *pszFormat, va_list va) 286 { 287 RTStrFormatV(printfOutputCallback, this, NULL, NULL, pszFormat, va); 288 return *this; 289 } 290 285 291 struct RTCSTRINGOTHROW 286 292 { … … 338 344 } 339 345 346 int RTCString::appendPrintfVNoThrow(const char *pszFormat, va_list va) RT_NOEXCEPT 347 { 348 RTCSTRINGOTHROW Args = { this, VINF_SUCCESS }; 349 RTStrFormatV(printfOutputCallback, &Args, NULL, NULL, pszFormat, va); 350 return Args.rc; 351 } 352 353 RTCString &RTCString::appendPrintf(const char *pszFormat, ...) 354 { 355 va_list va; 356 va_start(va, pszFormat); 357 appendPrintfV(pszFormat, va); 358 va_end(va); 359 return *this; 360 } 361 362 int RTCString::appendPrintfNoThrow(const char *pszFormat, ...) RT_NOEXCEPT 363 { 364 va_list va; 365 va_start(va, pszFormat); 366 int rc = appendPrintfVNoThrow(pszFormat, va); 367 va_end(va); 368 return rc; 369 } 370 340 371 RTCString &RTCString::append(const RTCString &that) 341 372 { … … 538 569 } 539 570 540 541 RTCString &RTCString::erase(size_t offStart /*= 0*/, size_t cchLength /*= npos*/) 571 RTCString &RTCString::erase(size_t offStart /*= 0*/, size_t cchLength /*= npos*/) RT_NOEXCEPT 542 572 { 543 573 size_t cch = length(); … … 592 622 593 623 int RTCString::replaceNoThrow(size_t offStart, size_t cchLength, const RTCString &rStrReplacement, 594 size_t offReplacement, size_t cchReplacement) 624 size_t offReplacement, size_t cchReplacement) RT_NOEXCEPT 595 625 { 596 626 Assert(this != &rStrReplacement); … … 713 743 714 744 715 size_t RTCString::find(const char *pszNeedle, size_t offStart /*= 0*/) const 745 size_t RTCString::find(const char *pszNeedle, size_t offStart /*= 0*/) const RT_NOEXCEPT 716 746 { 717 747 if (offStart < length()) … … 732 762 } 733 763 734 size_t RTCString::find(const RTCString *pStrNeedle, size_t offStart /*= 0*/) const 764 size_t RTCString::find(const RTCString *pStrNeedle, size_t offStart /*= 0*/) const RT_NOEXCEPT 735 765 { 736 766 if (offStart < length()) … … 755 785 } 756 786 757 void RTCString::findReplace(char chFind, char chReplace) 787 void RTCString::findReplace(char chFind, char chReplace) RT_NOEXCEPT 758 788 { 759 789 Assert((unsigned int)chFind < 128U); … … 768 798 } 769 799 770 size_t RTCString::count(char ch) const 800 size_t RTCString::count(char ch) const RT_NOEXCEPT 771 801 { 772 802 Assert((unsigned int)ch < 128U); … … 785 815 786 816 #if 0 /** @todo implement these when needed. */ 787 size_t RTCString::count(const char *psz, CaseSensitivity cs = CaseSensitive) const 788 { 789 } 790 791 size_t RTCString::count(const RTCString *pStr, CaseSensitivity cs = CaseSensitive) const 817 size_t RTCString::count(const char *psz, CaseSensitivity cs = CaseSensitive) const RT_NOEXCEPT 818 { 819 } 820 821 size_t RTCString::count(const RTCString *pStr, CaseSensitivity cs = CaseSensitive) const RT_NOEXCEPT 792 822 { 793 823 … … 796 826 797 827 798 RTCString &RTCString::strip() 828 RTCString &RTCString::strip() RT_NOEXCEPT 799 829 { 800 830 stripRight(); … … 803 833 804 834 805 RTCString &RTCString::stripLeft() 835 RTCString &RTCString::stripLeft() RT_NOEXCEPT 806 836 { 807 837 char *psz = m_psz; … … 824 854 825 855 826 RTCString &RTCString::stripRight() 856 RTCString &RTCString::stripRight() RT_NOEXCEPT 827 857 { 828 858 char *psz = m_psz; … … 888 918 } 889 919 890 bool RTCString::endsWith(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const 920 bool RTCString::endsWith(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const RT_NOEXCEPT 891 921 { 892 922 size_t l1 = length(); … … 906 936 } 907 937 908 bool RTCString::startsWith(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const 938 bool RTCString::startsWith(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const RT_NOEXCEPT 909 939 { 910 940 size_t l1 = length(); … … 921 951 } 922 952 923 bool RTCString::startsWithWord(const char *pszWord, CaseSensitivity enmCase /*= CaseSensitive*/) const 953 bool RTCString::startsWithWord(const char *pszWord, CaseSensitivity enmCase /*= CaseSensitive*/) const RT_NOEXCEPT 924 954 { 925 955 const char *pszSrc = RTStrStripL(c_str()); /** @todo RTStrStripL doesn't use RTUniCpIsSpace (nbsp) */ … … 940 970 } 941 971 942 bool RTCString::startsWithWord(const RTCString &rThat, CaseSensitivity enmCase /*= CaseSensitive*/) const 972 bool RTCString::startsWithWord(const RTCString &rThat, CaseSensitivity enmCase /*= CaseSensitive*/) const RT_NOEXCEPT 943 973 { 944 974 return startsWithWord(rThat.c_str(), enmCase); 945 975 } 946 976 947 bool RTCString::contains(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const 977 bool RTCString::contains(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const RT_NOEXCEPT 948 978 { 949 979 /** @todo r-bird: Not checking for NULL strings like startsWith does (and … … 954 984 } 955 985 956 bool RTCString::contains(const char *pszNeedle, CaseSensitivity cs /*= CaseSensitive*/) const 986 bool RTCString::contains(const char *pszNeedle, CaseSensitivity cs /*= CaseSensitive*/) const RT_NOEXCEPT 957 987 { 958 988 /** @todo r-bird: Not checking for NULL strings like startsWith does (and … … 963 993 } 964 994 965 int RTCString::toInt(uint64_t &i) const 995 int RTCString::toInt(uint64_t &i) const RT_NOEXCEPT 966 996 { 967 997 if (!m_psz) … … 970 1000 } 971 1001 972 int RTCString::toInt(uint32_t &i) const 1002 int RTCString::toInt(uint32_t &i) const RT_NOEXCEPT 973 1003 { 974 1004 if (!m_psz)
Note:
See TracChangeset
for help on using the changeset viewer.