From 414aec98b546d11698af7fdcb441e8080da6e46a Mon Sep 17 00:00:00 2001 From: Stoycho Kyosev <68247567+stoychoX@users.noreply.github.com> Date: Thu, 12 May 2022 22:21:57 +0300 Subject: Add files via upload --- Utills/Kindle/Book.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Utills/Kindle/Book.h (limited to 'Utills/Kindle/Book.h') diff --git a/Utills/Kindle/Book.h b/Utills/Kindle/Book.h new file mode 100644 index 0000000..29c4f13 --- /dev/null +++ b/Utills/Kindle/Book.h @@ -0,0 +1,34 @@ +#pragma once +#include"vector.hpp" +#include"Page.h" +#include"Pair.hpp" +#include"serialize.h" + +class Book { +private: + string author; + string title; + Vector> ratings; // User name + rate + Vector data; // Pages + Vector> comments; // commenter's name + comment + + void addRating(unsigned short r, const string& name); + + void write(unsigned pagesCount); + void displayBook() const; + + void showComments() const; + void showRates() const; + void print() const; + void displayHelpMenu() const; +public: + Book() {} + Book(const string& author, const string& title); + + void writeToFile(std::ofstream& outFile) const; + void readFromFile(std::ifstream& inFile); + double getAvarageRating() const; + + friend class Kindle; +}; + -- cgit v1.3.1-23-gd82d