Skip to content
Snippets Groups Projects
Commit 5fd5935c authored by Sondre Sand's avatar Sondre Sand
Browse files

små endringer

parent e626bbe2
No related branches found
No related tags found
No related merge requests found
10
aa
bb
cc
dd
ff
ee
gg
hh
ii
jj
\ No newline at end of file
......@@ -7,6 +7,7 @@
#include <iomanip>
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include "stoppested.h"
using namespace std;
......@@ -22,6 +23,17 @@ Stoppested::Stoppested(const string nvn) {
navn = nvn;
}
/**
* Constructor for å lese data dra fil
*
* @param - samme som index for å vite hva som leses inn
*/
Stoppested::Stoppested(std::string nvn, ifstream & inn) {
navn = nvn;
}
/**
* Returnerer et Stoppesteds unike navn
*
......
......@@ -9,6 +9,7 @@
#include <string>
#include <vector>
#include <fstream>
/**
* Stoppested (med navn, oversikt over alle nabostopp og
......@@ -21,9 +22,12 @@ class Stoppested {
std::vector <int> tidtilnabo;
public:
Stoppested();
Stoppested(std::string nvn, std::ifstream & inn);
Stoppested(const std::string nvn);
std::string hentStoppestedNavn();
void skrivData();
void lesData();
};
#endif
\ No newline at end of file
......@@ -7,6 +7,7 @@
#include <iomanip>
#include <iostream>
#include <vector>
#include <fstream>
#include "LesData3.h"
#include "stoppested.h"
#include "stoppesteder.h"
......@@ -62,7 +63,20 @@ void Stoppesteder::handling() {
* Leser inn informasjon om stoppesteder fra fil
*/
void Stoppesteder::lesFraFil() {
ifstream innfilS("Stoppesteder.dta");
string navn;
int antStopp;
if (innfilS) {
innfilS >> antStopp; innfilS.ignore();
getline(innfilS, navn);
while (!innfilS.eof()) {
stopper.push_back(new Stoppested(navn, innfilS));
getline(innfilS, navn);
}
cout << "test";
innfilS.close();
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment