Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Jan 9, 2025
1 parent 6169758 commit f7a90f5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1,185 deletions.
55 changes: 15 additions & 40 deletions include/jsoncons_ext/csv/csv_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,23 +243,6 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
}
sink_.append(options_.line_delimiter().data(), options_.line_delimiter().length());
}
<<<<<<< HEAD
=======
for (std::size_t i = 0; i < strings_buffer_.size(); ++i)
{
if (i > 0)
{
sink_.push_back(options_.field_delimiter());
}
auto it = buffered_line_.find(strings_buffer_[i]);
if (it != buffered_line_.end())
{
sink_.append((*it).second.data(),(*it).second.length());
(*it).second.clear();
}
}
sink_.append(options_.line_delimiter().data(), options_.line_delimiter().length());
>>>>>>> eee098be8f774f64527281d5beb9e90aa9b73e06
break;
case stack_item_kind::column_mapping:
{
Expand Down Expand Up @@ -448,11 +431,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
jsoncons::string_sink<std::basic_string<CharT>> bo(s);
write_null_value(bo);
bo.flush();
if (!(*it).second.empty() && options_.subfield_delimiter() != char_type())
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
(*it).second.push_back(options_.subfield_delimiter());
it->second.push_back(options_.subfield_delimiter());
}
(*it).second.append(s);
it->second.append(s);
}
break;
}
Expand Down Expand Up @@ -522,15 +505,7 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
jsoncons::string_sink<std::basic_string<CharT>> bo(s);
write_string_value(sv,bo);
bo.flush();
<<<<<<< HEAD
cname_value_map_[stack_.back().pathname_] = s;
=======
if (!(*it).second.empty() && options_.subfield_delimiter() != char_type())
{
(*it).second.push_back(options_.subfield_delimiter());
}
(*it).second.append(s);
>>>>>>> eee098be8f774f64527281d5beb9e90aa9b73e06
}
break;
}
Expand Down Expand Up @@ -656,11 +631,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
jsoncons::string_sink<std::basic_string<CharT>> bo(s);
write_double_value(val, context, bo, ec);
bo.flush();
if (!(*it).second.empty() && options_.subfield_delimiter() != char_type())
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
(*it).second.push_back(options_.subfield_delimiter());
it->second.push_back(options_.subfield_delimiter());
}
(*it).second.append(s);
it->second.append(s);
}
break;
}
Expand Down Expand Up @@ -733,11 +708,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
jsoncons::string_sink<std::basic_string<CharT>> bo(s);
write_int64_value(val,bo);
bo.flush();
if (!(*it).second.empty() && options_.subfield_delimiter() != char_type())
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
(*it).second.push_back(options_.subfield_delimiter());
it->second.push_back(options_.subfield_delimiter());
}
(*it).second.append(s);
it->second.append(s);
}
break;
}
Expand Down Expand Up @@ -810,11 +785,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
jsoncons::string_sink<std::basic_string<CharT>> bo(s);
write_uint64_value(val, bo);
bo.flush();
if (!(*it).second.empty() && options_.subfield_delimiter() != char_type())
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
(*it).second.push_back(options_.subfield_delimiter());
it->second.push_back(options_.subfield_delimiter());
}
(*it).second.append(s);
it->second.append(s);
}
break;
}
Expand Down Expand Up @@ -884,11 +859,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
jsoncons::string_sink<std::basic_string<CharT>> bo(s);
write_bool_value(val,bo);
bo.flush();
if (!(*it).second.empty() && options_.subfield_delimiter() != char_type())
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
(*it).second.push_back(options_.subfield_delimiter());
it->second.push_back(options_.subfield_delimiter());
}
(*it).second.append(s);
it->second.append(s);
}
break;
}
Expand Down
Loading

0 comments on commit f7a90f5

Please sign in to comment.