26 lines
547 B
C++
26 lines
547 B
C++
#ifndef FILEHANDLER_H
|
|
#define FILEHANDLER_H
|
|
|
|
#include <QVariant>
|
|
|
|
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<QHash<int, QVariant>> getItemValuesFromCSVFile(const QString& filePath);
|
|
|
|
private:
|
|
explicit FileHandler();
|
|
|
|
static QPair<QString, QByteArray> getFileContent(const QString& filePath);
|
|
};
|
|
|
|
#endif // FILEHANDLER_H
|