| 527 | } |
| 528 | |
| 529 | void ofStringReplace(std::string& input, std::string searchStr, std::string replaceStr, bool firstOnly /*= false*/) |
| 530 | { |
| 531 | size_t uPos = 0; |
| 532 | size_t uFindLen = searchStr.length(); |
| 533 | size_t uReplaceLen = replaceStr.length(); |
| 534 | |
| 535 | if (uFindLen == 0) |
| 536 | { |
| 537 | return; |
| 538 | } |
| 539 | |
| 540 | for (; (uPos = input.find(searchStr, uPos)) != std::string::npos;) |
| 541 | { |
| 542 | input.replace(uPos, uFindLen, replaceStr); |
| 543 | uPos += uReplaceLen; |
| 544 | |
| 545 | if (firstOnly) |
| 546 | break; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | //%Y-%m-%d-%H-%M-%S-%i |
| 551 | std::string ofGetTimestampString(std::string in) |
no test coverage detected