-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
5,162 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include "main.h" | ||
#include "processData.h" | ||
|
||
using namespace std; | ||
void usage(); | ||
|
||
|
||
int main(int argc, char** argv) { | ||
ifstream inFile; | ||
ofstream outFile; | ||
|
||
if (argc != 3){ | ||
usage(); | ||
return EXIT_FAILURE; | ||
} | ||
|
||
inFile.open(argv[1]); | ||
if (!inFile) { | ||
cout << "Unable to open file " << argv[1]; | ||
return EXIT_FAILURE; // terminate with error | ||
} | ||
|
||
outFile.open(argv[2]); | ||
if (!outFile) { | ||
cout << "Unable to open file " << argv[2]; | ||
return EXIT_FAILURE; // terminate with error | ||
} | ||
|
||
ProcessData * data = new ProcessData(); | ||
|
||
string line; | ||
while (getline(inFile, line)) { | ||
outFile << data->process(line) << endl; | ||
} | ||
|
||
inFile.close(); | ||
outFile.close(); | ||
delete data; | ||
|
||
return EXIT_SUCCESS; | ||
} | ||
void usage() { | ||
cout << "Usage: main <input file> <output file>" << endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <iostream> | ||
#include <string> | ||
#include <fstream> | ||
#include <map> | ||
#include <math.h> | ||
|
||
using namespace std; |
Oops, something went wrong.