comparison data/model/Model.h @ 1833:21c792334c2e sensible-delimited-data-strings

Rewrite all the DelimitedDataString stuff so as to return vectors of individual cell strings rather than having the classes add the delimiters themselves. Rename accordingly to names based on StringExport. Take advantage of this in the CSV writer code so as to properly quote cells that contain delimiter characters.
author Chris Cannam
date Fri, 03 Apr 2020 17:11:05 +0100
parents c546429d4c2f
children
comparison
equal deleted inserted replaced
1832:7c92c644db20 1833:21c792334c2e
273 void toXml(QTextStream &stream, 273 void toXml(QTextStream &stream,
274 QString indent = "", 274 QString indent = "",
275 QString extraAttributes = "") const override; 275 QString extraAttributes = "") const override;
276 276
277 /** 277 /**
278 * Emit a label for each column that would be written by 278 * Return a label for each column that would be written by
279 * toDelimitedDataString, separated by the given delimiter. 279 * toStringExportRows.
280 */ 280 */
281 virtual QString getDelimitedDataHeaderLine(QString delimiter, 281 virtual QVector<QString>
282 DataExportOptions options) const = 0; 282 getStringExportHeaders(DataExportOptions options) const = 0;
283 283
284 /** 284 /**
285 * Emit the contents of the model within the given range to a 285 * Emit events starting within the given range as string rows
286 * delimited (e.g. comma-separated) data format. 286 * ready for conversion to an e.g. comma-separated data format.
287 */ 287 */
288 virtual QString toDelimitedDataString(QString delimiter, 288 virtual QVector<QVector<QString>>
289 DataExportOptions options, 289 toStringExportRows(DataExportOptions options,
290 sv_frame_t startFrame, 290 sv_frame_t startFrame,
291 sv_frame_t duration) const = 0; 291 sv_frame_t duration) const = 0;
292 292
293 signals: 293 signals:
294 /** 294 /**
295 * Emitted when a model has been edited (or more data retrieved 295 * Emitted when a model has been edited (or more data retrieved
296 * from cache, in the case of a cached model that generates slowly) 296 * from cache, in the case of a cached model that generates slowly)