2018-03-01 16:19:13 +00:00
|
|
|
#ifndef RECIPEDATABASE_H
|
|
|
|
#define RECIPEDATABASE_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "database.h"
|
2018-03-01 16:28:18 +00:00
|
|
|
#include "model/recipe/recipe.h"
|
2018-03-01 16:19:13 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The RecipeDatabase class represents the precise database used for the recipe storage, and is specialized.
|
|
|
|
*/
|
|
|
|
|
|
|
|
class RecipeDatabase : public Database
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
RecipeDatabase(string filename);
|
2018-03-01 16:28:18 +00:00
|
|
|
|
|
|
|
//Stores a full recipe in the database.
|
|
|
|
void storeRecipe(Recipe recipe);
|
2018-03-02 08:32:40 +00:00
|
|
|
|
|
|
|
//SQL Helper methods.
|
|
|
|
void storeInstruction(Instruction instruction);
|
|
|
|
void storeImage(QImage image);
|
|
|
|
void storeIngredient(Ingredient ingredient);
|
2018-03-01 16:19:13 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
//Utility methods.
|
|
|
|
void ensureTablesExist();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RECIPEDATABASE_H
|