boosttest/src/script_parser.cpp

23 lines
487 B
C++
Raw Normal View History

2022-01-13 19:04:38 +08:00
#include <script_parser.h>
#include <boost/test/unit_test.hpp>
#include <fstream>
#include <iostream>
using namespace boost::unit_test;
using namespace std;
int parseScript(const char* path) {
ifstream script(path, ios::in);
if (!script.is_open()) {
perror(path);
return ENOENT;
} else {
std::stringstream strbuf;
strbuf << script.rdbuf();
std::string contents(strbuf.str());
cout << contents << endl;
}
return 0;
}