Changeset 15077
- Timestamp:
- 2008-03-10T15:18:07+13:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/lib/text_t.cpp
r14909 r15077 311 311 text_t::iterator next_toreplace = findword(text_begin, text_end, toreplace); 312 312 313 // Grab the string up to it 314 temp_text = substr(text_begin, next_toreplace); 315 316 // Add the new string onto the end 317 if (new_text.empty()) 318 { 319 new_text.append(temp_text); 320 } 313 // We've found a match 314 if (next_toreplace != text_end) 315 { 316 new_text.append(substr(text_begin, next_toreplace)); 317 new_text.append(replacement); 318 count++; 319 text_begin = next_toreplace + toreplace.size(); 320 } 321 // We haven't found a match 321 322 else 322 323 { 323 new_text.append(replacement + temp_text); 324 } 325 326 // Finally, we need to move the current pointer up to the new position 327 text_begin = next_toreplace + 1; 328 count++; 324 new_text.append(substr(text_begin, text_end)); 325 text_begin = text_end; 326 } 329 327 } 330 328
Note:
See TracChangeset
for help on using the changeset viewer.