Simple implementation of CSV file import. Successfully imported items are appended to the model.
This commit is contained in:
@ -1,17 +1,25 @@
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user