MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / visit_bool

Function visit_bool

include/jsoncons/json_encoder.hpp:782–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

780 }
781
782 JSONCONS_VISITOR_RETURN_TYPE visit_bool(bool value, semantic_tag, const ser_context&, std::error_code&) final
783 {
784 if (!stack_.empty())
785 {
786 if (stack_.back().is_array())
787 {
788 begin_scalar_value();
789 }
790 if (!stack_.back().is_multi_line() && column_ >= options_.line_length_limit())
791 {
792 break_line();
793 }
794 }
795
796 if (value)
797 {
798 sink_.append(true_literal().data(), true_literal().size());
799 column_ += true_literal().size();
800 }
801 else
802 {
803 sink_.append(false_literal().data(), false_literal().size());
804 column_ += false_literal().size();
805 }
806
807 end_value();
808 JSONCONS_VISITOR_RETURN;
809 }
810
811 void begin_scalar_value()
812 {

Callers 2

bool_valueMethod · 0.70
bool_valueMethod · 0.70

Calls 14

begin_scalar_valueFunction · 0.85
break_lineFunction · 0.85
is_multi_lineMethod · 0.80
line_length_limitMethod · 0.80
end_valueFunction · 0.70
emptyMethod · 0.45
is_arrayMethod · 0.45
backMethod · 0.45
appendMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected