#ifndef BOOKSHELF_H #define BOOKSHELF_H #include "book.h" /* * Class Bookshelf - a (singleton, for now) object representing * an aggregate collection of books. The intention is one "master" * array of Book objects, with three "index" arrays, sorted three * different ways, on which we can do fast binary searches. */ class Bookshelf { private: int num; Book *books; Book **authorcatalog, **titlecatalog, **subjectcatalog; void add_book(string, string, string); void trim(string &s); public: Bookshelf() { num=0; books = NULL; authorcatalog = titlecatalog = subjectcatalog = NULL; } void read_books(string); Book *search_title(string); Book *search_author(string); Book *search_subject(string); void insert_book(string,string,string); void delete_book(string,string,string); void delete_title(string); void delete_author(string); void delete_subject(string); void save_books(string); }; #endif