-#include <fstream>
-#include <string>
-#include "functions.h"
-#include <iostream>
-
-void load()
-{
- ifstream in("/root/.adress");
-
- while (!in.eof())
- {
- string fname;
- string lname;
- string adr;
- string pn;
- getline(in, fname);
-// cout << "Skapar " << fname << "\n";
-// cin.get();
- getline(in, lname);
- getline(in, adr);
- getline(in, pn);
- if (fname == "" && lname == "" && lname == "" && pn == "")
- continue;
- (void) new CContact(fname, lname, adr, pn);
- }
-}
-
-void save()
-{
- ofstream out;
- out.open("/root/.adress");
-
- CContact* contact = CContact::getFirst();
-
- while ( contact != '\0')
- {
- out << contact->firstname() << "\n";
- out << contact->lastname() << "\n";
- out << contact->adress() << "\n";
- out << contact->phoneNumber() << "\n";
- contact=contact->getNext();
- }
- out.close();
-}