#ifndef FILEUTILS_H #define FILEUTILS_H #include #include #include #include #include "model/recipe/instruction.h" namespace FileUtils { QString appDataPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)+"/.recipeDB/"; void ensureAppDataFolderExists(){ QDir folder(appDataPath); if (!folder.exists()){ folder.mkpath("."); } } void saveInstruction(int nr, Instruction instruction){ ensureAppDataFolderExists(); QString filename = appDataPath + QString::fromStdString(std::to_string(nr)) +".html"; QFile file(filename); if (file.open(QIODevice::WriteOnly)){ QTextStream stream(&file); stream<