// PhoneBookList.cpp #include "PhoneBookList.h" #include using std::ifstream; using std::ofstream; #include using std::cout; using std::endl; #include using std::pair; #include using std::string; void PhoneBookList::read_file(const std::string & file_name) { ifstream ifs(file_name); if (!ifs) return; // no file; one will be created when // write_file is called int num_entries; ifs >> num_entries; ifs.get(); // \n for (int i = 0; i < num_entries; i++) { PhoneBookEntry new_entry; ifs >> new_entry; // m_entries[new_entry.name] = new_entry; m_entries.insert(m_entries.end(), {new_entry.name, new_entry}); } itr_current_entry = m_entries.begin(); } void PhoneBookList::write_file(const std::string & file_name) const { cout << "Saving not yet implemented\n"; }