| 201 | } |
| 202 | |
| 203 | size_t copyString(const string& source, char* dest, size_t length) |
| 204 | { |
| 205 | const char* c_src = source.c_str(); |
| 206 | size_t N = std::min(length, source.length()+1); |
| 207 | size_t ret = (length >= source.length() + 1) ? 0 : source.length() + 1; |
| 208 | std::copy(c_src, c_src + N, dest); |
| 209 | if (length != 0) { |
| 210 | dest[length-1] = '\0'; |
| 211 | } |
| 212 | return ret; |
| 213 | } |
| 214 | |
| 215 | string trimCopy(const string &input) { |
| 216 | return ba::trim_copy(input); |
no outgoing calls
no test coverage detected