writes string "data" with quotation to ofstream "output" – all in UTF-8
| 1179 | // writes string "data" with quotation to ofstream "output" – all in UTF-8 |
| 1180 | // |
| 1181 | void CsvTable::quoteString(std::string &data, std::ostream &output, CsvDefinition definition) { |
| 1182 | int lineLen = data.size(); |
| 1183 | output << definition.quote; |
| 1184 | for( int i = 0; i < lineLen; i++ ) { |
| 1185 | if( data[i] == definition.quote ) { |
| 1186 | output << definition.quote; |
| 1187 | } |
| 1188 | output << data[i]; |
| 1189 | } |
| 1190 | output << definition.quote; |
| 1191 | } |
| 1192 | |
| 1193 | |
| 1194 | // |