Files
GenericQtClientCore/data/filehandler.h

29 lines
676 B
C
Raw Permalink Normal View History

#ifndef FILEHANDLER_H
#define FILEHANDLER_H
#include <QVariant>
typedef QMap<int, QVariant> ModelItemValues;
class QJsonDocument;
class QString;
class QByteArray;
class FileHandler {
public:
/// JSON
static bool saveToFile(const QJsonDocument& doc, const QString& fileName);
static QByteArray loadJSONDataFromFile(const QString fileName);
/// CSV
static QList<ModelItemValues> getItemValuesFromCSVFile(const QString& filePath);
2026-01-06 10:04:26 +01:00
static bool exportToCSVFile(const QList<QStringList>& rows, const QString& filePath);
private:
explicit FileHandler();
static QPair<QString, QByteArray> getFileContent(const QString& filePath);
};
#endif // FILEHANDLER_H