MCPcopy Create free account
hub / github.com/boostorg/json / to_string_test

Function to_string_test

test/test.hpp:843–956  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841namespace detail {
842
843inline
844void
845to_string_test(
846 string& dest,
847 json::value const& jv)
848{
849 switch(jv.kind())
850 {
851 case kind::object:
852 {
853 dest.push_back('{');
854 auto const& obj(
855 jv.get_object());
856 auto it = obj.begin();
857 if(it != obj.end())
858 {
859 goto obj_first;
860 while(it != obj.end())
861 {
862 dest.push_back(',');
863 obj_first:
864 dest.push_back('\"');
865 dest.append(it->key());
866 dest.push_back('\"');
867 dest.push_back(':');
868 to_string_test(
869 dest, it->value());
870 ++it;
871 }
872 }
873 dest.push_back('}');
874 break;
875 }
876
877 case kind::array:
878 {
879 dest.push_back('[');
880 auto const& arr(
881 jv.get_array());
882 auto it = arr.begin();
883 if(it != arr.end())
884 {
885 goto arr_first;
886 while(it != arr.end())
887 {
888 dest.push_back(',');
889 arr_first:
890 to_string_test(
891 dest, *it);
892 ++it;
893 }
894 }
895 dest.push_back(']');
896 break;
897 }
898
899 case kind::string:
900 #if 1

Callers

nothing calls this directly

Calls 10

serializeFunction · 0.85
string_viewClass · 0.85
kindMethod · 0.80
keyMethod · 0.80
valueMethod · 0.80
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
appendMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected