Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
#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;
}