adding cs142 code

This commit is contained in:
dm
2016-04-06 20:45:34 -07:00
parent 552d456d53
commit 8e52ce1982
174 changed files with 14064 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#include <iostream>
#include <vector>
#include <stdexcept>
using namespace std;
#include "io.h"
#include "restaurant.h"
const string usage = "usage: iotest <input json file>";
int main(int argc, char * argv[]) {
if (argc != 2) {
cerr << usage << endl;
return 1;
}
try {
vector<restaurant> v = parse_file(argv[1]);
for(auto r: v) {
cout << r << endl;
}
}
catch(runtime_error e) {
cerr << e.what() << endl;
}
return 0;
}