+/// Book::open() opens a book file with a given file name
+
+void Book::open(const string& fName) {
+
+ // Close old file before opening the new
+ close();
+
+ fileName = fName;
+ ifstream::open(fileName.c_str(), ifstream::in | ifstream::binary);
+
+ if (is_open())
+ {
+ // Get the book size in number of entries
+ seekg(0, ios::end);
+ bookSize = long(tellg()) / EntrySize;
+ seekg(0, ios::beg);
+
+ if (good())
+ return;
+ }
+ cerr << "Failed to open book file " << fileName << endl;
+ Application::exit_with_failure();
+}
+
+