diff --git a/meal.hpp b/meal.hpp index b7c178d..0ad8cd3 100644 --- a/meal.hpp +++ b/meal.hpp @@ -28,6 +28,7 @@ public: } void setName(const std::string &name) { _name = name; + replaceStr(_name, "\"", "\\\""); } void setPrice(int price) { _price = price; @@ -37,6 +38,7 @@ public: } void setDesc(const std::string &desc) { _desc = desc; + replaceStr(_desc, "\"", "\\\""); } std::string jsonify() const; private: