| 546 | } |
| 547 | |
| 548 | std::string s_transform(const std::string& source, Transform t) { |
| 549 | // Ask transformation function to approximate the destination size (returns upper bound) |
| 550 | size_t maxlen = t(NULL, 0, source.data(), source.length()); |
| 551 | char * buffer = STACK_ARRAY(char, maxlen); |
| 552 | size_t len = t(buffer, maxlen, source.data(), source.length()); |
| 553 | std::string result(buffer, len); |
| 554 | return result; |
| 555 | } |
| 556 | |
| 557 | size_t tokenize(const std::string& source, char delimiter, |
| 558 | std::vector<std::string>* fields) { |
no test coverage detected