1 | #include "duckdb/common/serializer.hpp" |
---|---|
2 | |
3 | namespace duckdb { |
4 | |
5 | template <> |
6 | string 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 | |
16 | void 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 |