| 538 | } |
| 539 | |
| 540 | size_t transform(std::string& value, size_t maxlen, const std::string& source, |
| 541 | Transform t) { |
| 542 | char* buffer = STACK_ARRAY(char, maxlen + 1); |
| 543 | size_t length = t(buffer, maxlen + 1, source.data(), source.length()); |
| 544 | value.assign(buffer, length); |
| 545 | return length; |
| 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) |