| 1308 | } |
| 1309 | |
| 1310 | void write_string_value(const string_view_type& value, string_type& str) |
| 1311 | { |
| 1312 | const char* s = value.data(); |
| 1313 | const std::size_t length = value.length(); |
| 1314 | |
| 1315 | bool quote = false; |
| 1316 | if (quote_style_ == quote_style_kind::all || quote_style_ == quote_style_kind::nonnumeric || |
| 1317 | (quote_style_ == quote_style_kind::minimal && |
| 1318 | (std::char_traits<CharT>::find(s, length, field_delimiter_) != nullptr || std::char_traits<CharT>::find(s, length, quote_char_) != nullptr))) |
| 1319 | { |
| 1320 | quote = true; |
| 1321 | str.push_back(quote_char_); |
| 1322 | } |
| 1323 | escape_string(s, length, quote_char_, quote_escape_char_, str); |
| 1324 | if (quote) |
| 1325 | { |
| 1326 | str.push_back(quote_char_); |
| 1327 | } |
| 1328 | } |
| 1329 | |
| 1330 | void write_double_value(double val, const ser_context& context, string_type& str, std::error_code& ec) |
| 1331 | { |
no test coverage detected