use getline in script parser
This commit is contained in:
parent
8211247e87
commit
5acc341171
@ -1,8 +1,7 @@
|
||||
#include <script_parser.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <script_parser.h>
|
||||
|
||||
using namespace boost::unit_test;
|
||||
using namespace std;
|
||||
@ -13,10 +12,11 @@ int parseScript(const char* path) {
|
||||
perror(path);
|
||||
return ENOENT;
|
||||
} else {
|
||||
std::stringstream strbuf;
|
||||
strbuf << script.rdbuf();
|
||||
std::string contents(strbuf.str());
|
||||
cout << contents << endl;
|
||||
string line;
|
||||
while(getline(script, line, '\n')) {
|
||||
cout << line <<endl;
|
||||
}
|
||||
script.close();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user