| 1201 | |
| 1202 | template <typename Json, typename Sink> |
| 1203 | void encode_value(const Json& val, const toon_encode_options& options, Sink& sink, int depth) |
| 1204 | { |
| 1205 | char delimiter = static_cast<char>(options.delimiter()); |
| 1206 | |
| 1207 | int line{0}; |
| 1208 | if (is_json_array(val)) |
| 1209 | { |
| 1210 | encode_array(val, options, sink, depth, line, jsoncons::optional<jsoncons::string_view>{}); |
| 1211 | } |
| 1212 | else if (is_json_object(val)) |
| 1213 | { |
| 1214 | encode_object(val, options, sink, depth, line, jsoncons::optional<jsoncons::string_view>{}); |
| 1215 | } |
| 1216 | else |
| 1217 | { |
| 1218 | sink.append(depth*options.indent(), ' '); |
| 1219 | encode_primitive(val, delimiter, sink); |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | template <typename T, typename Alloc, typename TempAlloc, typename Sink> |
| 1224 | typename std::enable_if<ext_traits::is_basic_json<T>::value, write_result>::type |
no test coverage detected