1#include "duckdb/common/serializer.hpp"
2
3namespace duckdb {
4
5template <>
6string Deserializer::Read() {
7 uint32_t size = Read<uint32_t>();
8 if (size == 0) {
9 return string();
10 }
11 auto buffer = make_unsafe_uniq_array<data_t>(n: size);
12 ReadData(buffer: buffer.get(), read_size: size);
13 return string(const_char_ptr_cast(src: buffer.get()), size);
14}
15
16void Deserializer::ReadStringVector(vector<string> &list) {
17 uint32_t sz = Read<uint32_t>();
18 list.resize(new_size: sz);
19 for (idx_t i = 0; i < sz; i++) {
20 list[i] = Read<string>();
21 }
22}
23
24} // namespace duckdb
25