Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data-mining
- Header Files
- Book.h
- FileIOBooks.h
- Resource Files
- books.txt
- Source Files
- Book.cpp
- FileIOBooks.cpp
- #include <string>
- using namespace std;
- enum Genre {
- Horror,
- Romance,
- Fantasy,
- Thriller,
- Novel,
- Comedy
- };
- class Book
- {
- private:
- string _author;
- string _title;
- unsigned int _bookId;
- unsigned int _price;
- Genre _genre;
- public:
- Book(string author, string title, unsigned int Id, unsigned int price, Genre genre);
- ~Book();
- };
- #include "Book.h"
- Book::Book(string author, string title, unsigned int Id, unsigned int price, Genre genre) :
- _author(author),
- _title(title),
- _bookId(Id),
- _price(price),
- _genre(genre)
- {}
- Book::~Book()
- {
- }
- #include <sstream>
- #include <string>
- #include <fstream>
- #include "Book.h"
- #include <vector>
- #include <iostream>
- using namespace std;
- class FileIOBooks
- {
- private :
- vector<Book> library;
- public:
- FileIOBooks();
- ~FileIOBooks();
- void booksProvider(const char* file);
- };
- #include "FileIOBooks.h"
- FileIOBooks::FileIOBooks()
- {
- }
- FileIOBooks::~FileIOBooks()
- {
- }
- void FileIOBooks::booksProvider(const char* file)
- {
- string line;
- ifstream input(file);
- while (getline(input, line))
- {
- cout << "Parsing is not implemented yet!" << endl;
- }
- }
- int main()
- {
- FileIOBooks provider;
- provider.booksProvider("books.txt");
- getchar();
- }
- Mark Twain, Roughing It, 1, 10, Comedic
- Mark Twain, Eve's Diary, 2, 6, Romance
- Mark Twain, The Mysterious Stranger, 3, 6, Novel
- Mark Twain, The Gilded Age, 4, 12, Novel
- Charles Dickens, A Christmas Carol, 5, 5, Fantasy
- Charles Dickens, Oliver Twist, 6, 10, Novel
- Charles Dickens, Hard Times, 7, 3, Novel
- Charles Dickens, The Mystery of Edwin Drood, 8, 9, Novel
- William Shakespeare, King Lear, 9, 9, Thriller
- William Shakespeare, Macbeth, 8, 5, Horror
- William Shakespeare, Hamelt, 11, 11, Horror
- William Shakespeare, Romeo and Juliet, 12, 2, Romance
- William Shakespeare, The Tempest, 13, 15, Romance
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement