Copy subrange [pos:(pos + n)) from src to dst. If pos >= src.size() the result is empty. If pos + n > src.size() the subrange [pos, size()) is copied.
| 41 | // result is empty. If pos + n > src.size() the subrange [pos, size()) is |
| 42 | // copied. |
| 43 | inline void CopySubrangeToArray(const string& src, size_t pos, size_t n, |
| 44 | char* dst) { |
| 45 | if (pos >= src.size()) return; |
| 46 | memcpy(dst, src.data() + pos, std::min(n, src.size() - pos)); |
| 47 | } |
| 48 | |
| 49 | // Store encoding of strings[0..n-1] in *out. |
| 50 | void EncodeStringList(const tstring* strings, int64 n, string* out); |
no test coverage detected