| 175 | } |
| 176 | |
| 177 | void writeStringByEscapingRule( |
| 178 | const String & value, WriteBuffer & out, FormatSettings::EscapingRule escaping_rule, const FormatSettings & format_settings) |
| 179 | { |
| 180 | switch (escaping_rule) |
| 181 | { |
| 182 | case FormatSettings::EscapingRule::Quoted: |
| 183 | writeQuotedString(value, out); |
| 184 | break; |
| 185 | case FormatSettings::EscapingRule::JSON: |
| 186 | writeJSONString(value, out, format_settings); |
| 187 | break; |
| 188 | case FormatSettings::EscapingRule::Raw: |
| 189 | writeString(value, out); |
| 190 | break; |
| 191 | case FormatSettings::EscapingRule::CSV: |
| 192 | writeCSVString(value, out); |
| 193 | break; |
| 194 | case FormatSettings::EscapingRule::Escaped: |
| 195 | writeEscapedString(value, out); |
| 196 | break; |
| 197 | case FormatSettings::EscapingRule::XML: |
| 198 | writeXMLStringForTextElement(value, out); |
| 199 | break; |
| 200 | case FormatSettings::EscapingRule::None: |
| 201 | throw Exception(ErrorCodes::BAD_ARGUMENTS, "Cannot serialize string with None escaping rule"); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | template <bool read_string> |
| 206 | String readByEscapingRule(ReadBuffer & buf, FormatSettings::EscapingRule escaping_rule, const FormatSettings & format_settings) |
no test coverage detected