儲存庫 vbox 的更動 67645
圖例:
- 未更動
- 新增
- 刪除
-
trunk/include/iprt/cpp/ministring.h
r65811 r67645 694 694 * Find the given substring. 695 695 * 696 * Looks for pcszFind in "this" starting at "pos" and returns its position 697 * as a byte (not codepoint) offset, counting from the beginning of "this" at 0. 698 * 699 * @param pcszFind The substring to find. 700 * @param pos The (byte) offset into the string buffer to start 696 * Looks for @a pszNeedle in @a this starting at @a offStart and returns its 697 * position as a byte (not codepoint) offset, counting from the beginning of 698 * @a this as 0. 699 * 700 * @param pszNeedle The substring to find. 701 * @param offStart The (byte) offset into the string buffer to start 701 702 * searching. 702 703 * 703 * @returns 0 based position of pcszFind. npos if not found. 704 */ 705 size_t find(const char *pcszFind, size_t pos = 0) const; 704 * @returns 0 based position of pszNeedle. npos if not found. 705 */ 706 size_t find(const char *pszNeedle, size_t offStart = 0) const; 707 708 /** 709 * Find the given substring. 710 * 711 * Looks for @a pStrNeedle in @a this starting at @a offStart and returns its 712 * position as a byte (not codepoint) offset, counting from the beginning of 713 * @a this as 0. 714 * 715 * @param pStrNeedle The substring to find. 716 * @param offStart The (byte) offset into the string buffer to start 717 * searching. 718 * 719 * @returns 0 based position of pStrNeedle. npos if not found or pStrNeedle is 720 * NULL or an empty string. 721 */ 722 size_t find(const RTCString *pStrNeedle, size_t offStart = 0) const; 706 723 707 724 /** -
trunk/src/VBox/Runtime/common/string/ministring.cpp
r62477 r67645 200 200 } 201 201 202 size_t RTCString::find(const char *p cszFind, size_t pos/*= 0*/) const203 { 204 if ( pos< length())202 size_t RTCString::find(const char *pszNeedle, size_t offStart /*= 0*/) const 203 { 204 if (offStart < length()) 205 205 { 206 206 const char *pszThis = c_str(); 207 207 if (pszThis) 208 208 { 209 const char *pszHit = strstr(pszThis + pos, pcszFind); 210 if (pszHit) 211 return pszHit - pszThis; 209 if (pszNeedle && *pszNeedle != '\0') 210 { 211 const char *pszHit = strstr(pszThis + offStart, pszNeedle); 212 if (pszHit) 213 return pszHit - pszThis; 214 } 215 } 216 } 217 218 return npos; 219 } 220 221 size_t RTCString::find(const RTCString *pStrNeedle, size_t offStart /*= 0*/) const 222 { 223 if (offStart < length()) 224 { 225 const char *pszThis = c_str(); 226 if (pszThis) 227 { 228 if (pStrNeedle) 229 { 230 const char *pszNeedle = pStrNeedle->c_str(); 231 if (pszNeedle && *pszNeedle != '\0') 232 { 233 const char *pszHit = strstr(pszThis + offStart, pszNeedle); 234 if (pszHit) 235 return pszHit - pszThis; 236 } 237 } 212 238 } 213 239 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器