From c7072f949f340042f13e4e7a795ea733f9b3da1d Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Mon, 12 Feb 2018 20:00:59 +0100 Subject: [PATCH] Added getters/setters to Instruction. --- model/recipe/instruction.cpp | 17 ++++++++++++++--- model/recipe/instruction.h | 18 +++++++++++++++++- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/model/recipe/instruction.cpp b/model/recipe/instruction.cpp index 2914bd7..e77d872 100644 --- a/model/recipe/instruction.cpp +++ b/model/recipe/instruction.cpp @@ -1,6 +1,17 @@ #include "model/recipe/instruction.h" -Instruction::Instruction() -{ - +Instruction::Instruction(){ + setHTML(""); +} + +Instruction::Instruction(string text){ + setHTML(text); +} + +string Instruction::getHTML(){ + return this->htmlText; +} + +void Instruction::setHTML(string newText){ + this->htmlText = newText; } diff --git a/model/recipe/instruction.h b/model/recipe/instruction.h index 3698c64..1749a74 100644 --- a/model/recipe/instruction.h +++ b/model/recipe/instruction.h @@ -1,11 +1,27 @@ #ifndef INSTRUCTION_H #define INSTRUCTION_H +#include + +using namespace std; + +/** + * @brief The Instruction class is meant to hold an HTML document in string form, which holds formatted text as the instructions for the recipe. + */ class Instruction { public: Instruction(); + Instruction(string text); + + //Getters + string getHTML(); + + //Setters + void setHTML(string newText); +private: + string htmlText; }; -#endif // INSTRUCTION_H \ No newline at end of file +#endif // INSTRUCTION_H