mirror of
https://github.com/red0124/ssp.git
synced 2025-01-23 13:05:20 +01:00
[skip ci] Enable header usage functionality
This commit is contained in:
parent
397cf21d18
commit
99d445bafe
@ -148,6 +148,7 @@ public:
|
|||||||
|
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
void use_fields(const Ts&... fields_args) {
|
void use_fields(const Ts&... fields_args) {
|
||||||
|
// TODO make static assert
|
||||||
if constexpr (ignore_header) {
|
if constexpr (ignore_header) {
|
||||||
handle_error_header_ignored();
|
handle_error_header_ignored();
|
||||||
return;
|
return;
|
||||||
@ -187,10 +188,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
reader_.converter_.set_column_mapping(column_mappings, header_.size());
|
reader_.converter_.set_column_mapping(column_mappings, header_.size());
|
||||||
|
|
||||||
if (line() == 1) {
|
|
||||||
ignore_next();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////
|
////////////////
|
||||||
@ -458,10 +455,8 @@ private:
|
|||||||
////////////////
|
////////////////
|
||||||
|
|
||||||
void split_header_data() {
|
void split_header_data() {
|
||||||
ss::splitter<Options...> splitter;
|
read_line();
|
||||||
std::string raw_header_copy = raw_header_;
|
for (const auto& [begin, end] : reader_.split_data_) {
|
||||||
splitter.split(raw_header_copy.data(), reader_.delim_);
|
|
||||||
for (const auto& [begin, end] : splitter.split_data_) {
|
|
||||||
std::string field{begin, end};
|
std::string field{begin, end};
|
||||||
if (std::find(header_.begin(), header_.end(), field) !=
|
if (std::find(header_.begin(), header_.end(), field) !=
|
||||||
header_.end()) {
|
header_.end()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user