aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2016-08-31 18:39:31 +0000
committerJan Tuomi <jans.tuomi@gmail.com>2016-08-31 18:39:31 +0000
commit4d076ce2d3023ea8174d88f390ebc63cf2645d49 (patch)
tree6e4ea966386f8e2b2452eba611e2a6ce203f838f
parent47568a1b661faa858658215e9cd8382e2b95c5c3 (diff)
Add parser
-rw-r--r--main.cpp1
-rw-r--r--parser.cpp12
-rw-r--r--parser.h7
3 files changed, 20 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index bcaa0b1..22d58b9 100644
--- a/main.cpp
+++ b/main.cpp
@@ -2,6 +2,7 @@
#include <fstream>
#include <streambuf>
#include <string>
+#include "parser.h"
std::string readFile(std::string& filename) {
std::ifstream t(filename);
diff --git a/parser.cpp b/parser.cpp
new file mode 100644
index 0000000..026e516
--- /dev/null
+++ b/parser.cpp
@@ -0,0 +1,12 @@
+#include "parser.h"
+#include <string>
+#include <vector>
+
+Parser::Parser(std::string& input) {
+ std::vector<std::string> result;
+
+ for (auto& c : input) {
+ std::string parsed(1, c);
+ result.push_back(parsed);
+ }
+}
diff --git a/parser.h b/parser.h
new file mode 100644
index 0000000..c29d8f1
--- /dev/null
+++ b/parser.h
@@ -0,0 +1,7 @@
+#pragma once
+#include <string>
+
+class Parser {
+ public:
+ Parser(std::string&);
+};