Changeset 68094 in vbox for trunk/src/VBox/Runtime/common/string/ministring.cpp
- Timestamp:
- Jul 24, 2017 12:44:02 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/ministring.cpp
r67688 r68094 34 34 #include <iprt/cpp/ministring.h> 35 35 #include <iprt/ctype.h> 36 #include <iprt/uni.h> 36 37 37 38 … … 488 489 } 489 490 491 bool RTCString::startsWithWord(const char *pszWord, CaseSensitivity enmCase /*= CaseSensitive*/) const 492 { 493 const char *pszSrc = RTStrStripL(c_str()); /** @todo RTStrStripL doesn't use RTUniCpIsSpace (nbsp) */ 494 size_t cchWord = strlen(pszWord); 495 if ( enmCase == CaseSensitive 496 ? RTStrNCmp(pszSrc, pszWord, cchWord) == 0 497 : RTStrNICmp(pszSrc, pszWord, cchWord) == 0) 498 { 499 if ( pszSrc[cchWord] == '\0' 500 || RT_C_IS_SPACE(pszSrc[cchWord]) 501 || RT_C_IS_PUNCT(pszSrc[cchWord]) ) 502 return true; 503 RTUNICP uc = RTStrGetCp(&pszSrc[cchWord]); 504 if (RTUniCpIsSpace(uc)) 505 return true; 506 } 507 return false; 508 } 509 510 bool RTCString::startsWithWord(const RTCString &rThat, CaseSensitivity enmCase /*= CaseSensitive*/) const 511 { 512 return startsWithWord(rThat.c_str(), enmCase); 513 } 514 490 515 bool RTCString::contains(const RTCString &that, CaseSensitivity cs /*= CaseSensitive*/) const 491 516 {
Note:
See TracChangeset
for help on using the changeset viewer.