uni

University stuff
git clone git://git.christosmarg.xyz/uni-assignments.git
Log | Files | Refs | README | LICENSE

review.cpp (489B)


      1 #include "review.hpp"
      2 
      3 Review::Review()
      4     :stars(0), username(""), comment("") {}
      5 
      6 Review::Review(const int stars, const std::string& username,
      7         const std::string& comment)
      8     :stars(stars), username(username), comment(comment)
      9 {
     10     if (username.empty())
     11         errlog.write("Missing username");
     12     if (comment.empty())
     13         errlog.write("Missing comment");
     14     if (stars < 0 || stars > 5)
     15         errlog.write("Review from: " + username + ": Star value out of bounds");
     16 }