2021-03-05 09:38:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Common/StringUtils/StringUtils.h>
|
|
|
|
#include <Core/Block.h>
|
2021-06-15 19:55:21 +00:00
|
|
|
#include <common/bit_cast.h>
|
|
|
|
#include <common/range.h>
|
2021-03-05 09:38:00 +00:00
|
|
|
|
2021-04-13 19:53:36 +00:00
|
|
|
#include "LibraryInterface.h"
|
|
|
|
|
2021-03-05 09:38:00 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class CStringsHolder
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
using Container = std::vector<std::string>;
|
|
|
|
|
|
|
|
explicit CStringsHolder(const Container & strings_pass)
|
|
|
|
{
|
|
|
|
strings_holder = strings_pass;
|
|
|
|
strings.size = strings_holder.size();
|
|
|
|
|
|
|
|
ptr_holder = std::make_unique<ClickHouseLibrary::CString[]>(strings.size);
|
|
|
|
strings.data = ptr_holder.get();
|
|
|
|
|
|
|
|
size_t i = 0;
|
|
|
|
for (auto & str : strings_holder)
|
|
|
|
{
|
|
|
|
strings.data[i] = str.c_str();
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ClickHouseLibrary::CStrings strings; // will pass pointer to lib
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<ClickHouseLibrary::CString[]> ptr_holder = nullptr;
|
|
|
|
Container strings_holder;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|