]> ruin.nu Git - adress.git/blobdiff - file.cpp
Have fixed the saving..
[adress.git] / file.cpp
diff --git a/file.cpp b/file.cpp
deleted file mode 100644 (file)
index 86e57d1..0000000
--- a/file.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#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();
-}