adding cs142 code
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user