| 480 | } |
| 481 | |
| 482 | JSONCONS_VISITOR_RETURN_TYPE visit_key(const string_view_type& name, const ser_context&, std::error_code&) final |
| 483 | { |
| 484 | JSONCONS_ASSERT(!stack_.empty()); |
| 485 | if (stack_.back().count() > 0) |
| 486 | { |
| 487 | sink_.append(comma_str_.data(),comma_str_.length()); |
| 488 | column_ += comma_str_.length(); |
| 489 | } |
| 490 | |
| 491 | if (stack_.back().is_multi_line()) |
| 492 | { |
| 493 | stack_.back().new_line_after(true); |
| 494 | new_line(); |
| 495 | } |
| 496 | else if (stack_.back().count() > 0 && column_ >= options_.line_length_limit()) |
| 497 | { |
| 498 | //stack_.back().new_line_after(true); |
| 499 | new_line(stack_.back().data_pos()); |
| 500 | } |
| 501 | |
| 502 | if (stack_.back().count() == 0) |
| 503 | { |
| 504 | stack_.back().set_position(column_); |
| 505 | } |
| 506 | sink_.push_back('\"'); |
| 507 | std::size_t length = jsoncons::detail::escape_string(name.data(), name.length(),options_.escape_all_non_ascii(),options_.escape_solidus(),sink_); |
| 508 | sink_.push_back('\"'); |
| 509 | sink_.append(colon_str_.data(),colon_str_.length()); |
| 510 | column_ += (length+2+colon_str_.length()); |
| 511 | JSONCONS_VISITOR_RETURN; |
| 512 | } |
| 513 | |
| 514 | JSONCONS_VISITOR_RETURN_TYPE visit_null(semantic_tag, const ser_context&, std::error_code&) final |
| 515 | { |
no test coverage detected