| 34 | } |
| 35 | |
| 36 | void EncodeStringList(const tstring* strings, int64 n, string* out) { |
| 37 | out->clear(); |
| 38 | for (int i = 0; i < n; ++i) { |
| 39 | core::PutVarint32(out, strings[i].size()); |
| 40 | } |
| 41 | for (int i = 0; i < n; ++i) { |
| 42 | out->append(strings[i]); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | bool DecodeStringList(const string& src, tstring* strings, int64 n) { |
| 47 | std::vector<uint32> sizes(n); |