Code Documentation 3.7
Social Network Visualizer
Loading...
Searching...
No Matches
table_export.cpp File Reference

Implements TableExport::toCSV() and TableExport::toJSON() (#226). More...

#include "table_export.h"
#include <QAbstractItemModel>
#include <QFile>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QString>
#include <QTextStream>
Include dependency graph for table_export.cpp:

Namespaces

namespace  TableExport
 Free functions that serialise any QAbstractItemModel to CSV or JSON.

Functions

QString TableExport::csvQuote (const QString &value)
 Returns a CSV-safe quoted field: wraps value in double-quotes if it contains a comma, double-quote, or newline; embedded double-quotes are escaped as "".
bool TableExport::toCSV (QAbstractItemModel *model, const QString &filePath)
 Writes model to an RFC 4180 CSV file at filePath.
bool TableExport::toJSON (QAbstractItemModel *model, const QString &filePath)
 Writes model to a JSON file at filePath.

Detailed Description

Implements TableExport::toCSV() and TableExport::toJSON() (#226).

Author
Dimitris B. Kalamaras
See also
https://socnetv.org