Move the response_content_to_sstring utility function from vector_store_client.cc to utils.hh to enable reuse across multiple files. This refactoring prepares for the upcoming `client.cc` implementation that will also need this functionality.
26 lines
548 B
C++
26 lines
548 B
C++
/*
|
|
* Copyright (C) 2025-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <seastar/core/sstring.hh>
|
|
#include <seastar/core/temporary_buffer.hh>
|
|
#include <vector>
|
|
|
|
namespace vector_search {
|
|
|
|
inline seastar::sstring response_content_to_sstring(const std::vector<seastar::temporary_buffer<char>>& buffers) {
|
|
seastar::sstring result;
|
|
for (const auto& buf : buffers) {
|
|
result.append(buf.get(), buf.size());
|
|
}
|
|
return result;
|
|
}
|
|
|
|
} // namespace vector_search
|