From 9f61b59ca6ceb76cd634240d118f5771c0534f3d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 20 Apr 2022 18:43:21 +0300 Subject: Added my work from todays exam --- .../Exam 1/ex2/BookList.h | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Year 1/Object-oriented Programming/Exam 1/ex2/BookList.h (limited to 'Year 1/Object-oriented Programming/Exam 1/ex2/BookList.h') diff --git a/Year 1/Object-oriented Programming/Exam 1/ex2/BookList.h b/Year 1/Object-oriented Programming/Exam 1/ex2/BookList.h new file mode 100644 index 0000000..0d1d415 --- /dev/null +++ b/Year 1/Object-oriented Programming/Exam 1/ex2/BookList.h @@ -0,0 +1,24 @@ +#include "Book.h" +#include + +class BookList { + Book* books; + unsigned bookCount; + unsigned bookLength; + + void resize(); + + void readFromFile(std::ifstream& inFile); + void writeToFile(std::ofstream& outFile) const; + void writePopularToFile(std::ofstream& outFile) const; + +public: + BookList(); + BookList(const Book* books); + + bool addBook(const Book& book); + + bool readFromFile(const char* filePath); + bool writeToFile(const char* filePath) const; + bool writePopularToFile(const char* filePath) const; +}; -- cgit v1.3.1-26-gb76a