| 82 | |
| 83 | template <class JsonStream> |
| 84 | void ComplexValueWriter<JsonStream>::WriteNull(bool map_key) { |
| 85 | // We don't use writer_->Null() because that does not work for map keys. Maps are |
| 86 | // modelled as JSON objects but JSON objects can only have string keys, not nulls. We |
| 87 | // circumvent this limitation by writing the string "null" with quotes if |
| 88 | // 'stringify_map_keys_' is true and a raw null value without quotes if it is false. |
| 89 | constexpr char const* null_str = RawValue::NullLiteral(/*top_level*/ false); |
| 90 | |
| 91 | if (map_key && stringify_map_keys_) { |
| 92 | writer_->String(null_str); |
| 93 | } else { |
| 94 | const int null_str_len = std::char_traits<char>::length(null_str); |
| 95 | writer_->RawValue(null_str, null_str_len, rapidjson::kStringType); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | // Structs in collections are not converted to StructVal but are left as they are in the |
| 100 | // tuple. |
nothing calls this directly
no test coverage detected