2018-03-02 08:32:40 +00:00
|
|
|
#ifndef FILEUTILS_H
|
|
|
|
#define FILEUTILS_H
|
|
|
|
|
2018-03-02 09:11:26 +00:00
|
|
|
#include <QStandardPaths>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QTextStream>
|
2018-03-02 13:14:56 +00:00
|
|
|
#include <QImage>
|
2018-03-29 15:17:07 +00:00
|
|
|
#include <stdio.h>
|
2018-03-02 08:32:40 +00:00
|
|
|
|
2018-03-02 09:11:26 +00:00
|
|
|
#include "model/recipe/instruction.h"
|
2018-03-02 08:32:40 +00:00
|
|
|
|
2018-03-02 13:14:56 +00:00
|
|
|
namespace FileUtils{
|
2018-03-02 09:11:26 +00:00
|
|
|
|
2018-03-02 13:14:56 +00:00
|
|
|
const QString appDataPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+"/.recipeDB/";
|
|
|
|
|
|
|
|
void ensureAppDataFolderExists();
|
|
|
|
|
|
|
|
bool saveInstruction(int nr, Instruction instruction);
|
|
|
|
|
|
|
|
Instruction loadInstruction(int nr);
|
|
|
|
|
2018-03-29 15:17:07 +00:00
|
|
|
bool deleteInstruction(int nr);
|
|
|
|
|
2018-03-02 13:14:56 +00:00
|
|
|
bool saveImage(int nr, QImage image);
|
|
|
|
|
|
|
|
QImage loadImage(int nr);
|
2018-03-29 15:17:07 +00:00
|
|
|
|
|
|
|
bool deleteImage(int nr);
|
2018-03-02 09:11:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // FILEUTILS_H
|