Changeset 39897 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- Jan 27, 2012 3:25:44 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/ministring.cpp
r39873 r39897 216 216 } 217 217 218 void RTCString::findReplace(char cFind, char cReplace) 219 { 218 void RTCString::findReplace(char chFind, char chReplace) 219 { 220 Assert((unsigned int)chFind < 128U); 221 Assert((unsigned int)chReplace < 128U); 222 220 223 for (size_t i = 0; i < length(); ++i) 221 224 { 222 225 char *p = &m_psz[i]; 223 if (*p == cFind) 224 *p = cReplace; 225 } 226 } 226 if (*p == chFind) 227 *p = chReplace; 228 } 229 } 230 231 size_t RTCString::count(char ch) const 232 { 233 Assert((unsigned int)ch < 128U); 234 235 size_t c = 0; 236 const char *psz = m_psz; 237 char chCur; 238 while ((chCur = *psz++) != '\0') 239 if (chCur == ch) 240 c++; 241 return c; 242 } 243 244 #if 0 /** @todo implement these when needed. */ 245 size_t RTCString::count(const char *psz, CaseSensitivity cs = CaseSensitive) const 246 { 247 } 248 249 size_t RTCString::count(const RTCString *pStr, CaseSensitivity cs = CaseSensitive) const 250 { 251 252 } 253 #endif 227 254 228 255 RTCString RTCString::substrCP(size_t pos /*= 0*/, size_t n /*= npos*/) const
Note:
See TracChangeset
for help on using the changeset viewer.