Changeset 67645 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- Jun 27, 2017 4:36:58 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116419
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.