Skip to content

Commit

Permalink
csv_encoder sink->str
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Jan 18, 2025
1 parent 2db5fb7 commit a44ddec
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions include/jsoncons_ext/csv/csv_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_null_value(s);
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
it->second.push_back(options_.subfield_delimiter());
}
it->second.append(s);
write_null_value(it->second);
}
break;
}
Expand All @@ -623,9 +621,7 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_null_value(s);
it->second.append(s);
write_null_value(it->second);
}
break;
}
Expand Down Expand Up @@ -693,9 +689,7 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_string_value(sv, s);
it->second.append(s);
write_string_value(sv, it->second);
}
break;
}
Expand Down Expand Up @@ -806,13 +800,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_double_value(val, context, s, ec);
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
it->second.push_back(options_.subfield_delimiter());
}
it->second.append(s);
write_double_value(val, context, it->second, ec);
}
break;
}
Expand All @@ -827,9 +819,7 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_double_value(val, context, s, ec);
it->second.append(s);
write_double_value(val, context, it->second, ec);
}
break;
}
Expand Down Expand Up @@ -885,13 +875,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_int64_value(val, s);
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
it->second.push_back(options_.subfield_delimiter());
}
it->second.append(s);
write_int64_value(val, it->second);
}
break;
}
Expand All @@ -906,9 +894,7 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_int64_value(val, s);
it->second.append(s);
write_int64_value(val, it->second);
}
break;
}
Expand Down Expand Up @@ -964,13 +950,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_uint64_value(val, s);
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
it->second.push_back(options_.subfield_delimiter());
}
it->second.append(s);
write_uint64_value(val, it->second);
}
break;
}
Expand All @@ -985,9 +969,7 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_uint64_value(val, s);
it->second.append(s);
write_uint64_value(val, it->second);
}
break;
}
Expand Down Expand Up @@ -1040,13 +1022,11 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_bool_value(val, s);
if (!it->second.empty() && options_.subfield_delimiter() != char_type())
{
it->second.push_back(options_.subfield_delimiter());
}
it->second.append(s);
write_bool_value(val, it->second);
}
break;
}
Expand All @@ -1061,9 +1041,7 @@ class basic_csv_encoder final : public basic_json_visitor<CharT>
auto it = column_pointer_value_map_.find(stack_.back().pointer_);
if (it != column_pointer_value_map_.end())
{
std::basic_string<CharT> s;
write_bool_value(val, s);
it->second.append(s);
write_bool_value(val, it->second);
}
break;
}
Expand Down

0 comments on commit a44ddec

Please sign in to comment.