| 35 | // helper functions |
| 36 | |
| 37 | inline void |
| 38 | packString(const char *str, int32_t str_len, string &buffer) |
| 39 | { |
| 40 | buffer.append(reinterpret_cast<const char *>(&str_len), sizeof(str_len)); |
| 41 | if (str_len) { |
| 42 | buffer.append(str, str_len); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | inline void |
| 47 | unpackString(const char *&packed_data, const char *&item, int32_t &item_len) |