Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
CSE3150_Project/EditorMain.cpp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
53 lines (45 sloc)
979 Bytes
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
#include "ECTextViewImp.h" | |
#include "EditorObserver.h" | |
#include "EditorDataController.h" | |
#include "EditorTest.h" | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int myCounter = 0; | |
int test() { | |
return EditorTest(); | |
} | |
int main(int argc, char *argv[]) | |
{ | |
EditorDataController edc; | |
if (argc > 2) { | |
cout << "Usage: ./Editor (-test | {filename})" << endl; | |
return -1; | |
} | |
string fname; | |
bool saveFile = false; | |
for (int i = 1; i<argc; ++i) { | |
string command(argv[i]); | |
if (command == "-test") { | |
return test(); | |
} else { | |
fname = string(argv[i]); | |
edc.LoadFile(fname); | |
saveFile = true; | |
} | |
} | |
ECTextViewImp wndTest; | |
wndTest.AddRow(""); | |
wndTest.AddStatusRow("Editor By:","Jamey Calabrese",true); | |
EditorObserver eo(&wndTest, &edc); | |
wndTest.Attach(&eo); | |
try { | |
wndTest.Show(); | |
} catch (string e) { | |
cout << "Caught: " << e << endl; | |
} | |
if (saveFile) { | |
edc.SaveFile(fname); | |
} | |
return 0; | |
} |