m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/parse.h
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-01-05 13:38:51 -0500
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-01-05 13:38:51 -0500
commitd29479e93370b577adeeb133116ced99dc4f81ff (patch)
tree985376882e1e3b08af24972156c49d740d70a022 /src/parse.h
parentc88e16d8be7457fd7211c31a5d91aa521fa829a1 (diff)
Refactor
- Reorder includes - Unify reference style - Improve whitespace
Diffstat (limited to 'src/parse.h')
-rw-r--r--src/parse.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parse.h b/src/parse.h
index 1d37083..31fa7c6 100644
--- a/src/parse.h
+++ b/src/parse.h
@@ -2,9 +2,9 @@
#define PARSE_H
#include <fstream>
-#include <set>
#include <sstream>
#include <string>
+
#include "graph.h"
class Parser {
@@ -17,7 +17,7 @@ public:
graph_.sort_vertices();
}
- const Graph & get_graph() {
+ const Graph& get_graph() {
return graph_;
}
private:
@@ -25,9 +25,11 @@ private:
std::ifstream input_file_;
void parse_edge_(std::string edge) {
- int from, to;
std::stringstream sstream(edge);
+
+ int from, to;
sstream >> from >> to;
+
graph_.add_edge(from, to);
}
};