-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
30 lines (26 loc) · 844 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Main Function: Setup the single instances and start the text editor
Written by: Nate Fanning */
// #include "ECTextEditor.cpp"
#include <iostream>
#include "ECTextViewImp.h"
#include "ECTextEditor.h"
#include "ECTextDocument.h"
#include "ECCommand.h"
#include "ECFileIO.h"
int main(int argc, char *argv[])
{
string path;
// if(argc == 1) path = "None";
if(argc == 2) path = argv[1];
else {
cerr << "Useage: ./main <filename.txt>" << endl;
exit(EXIT_FAILURE);
}
// Initialize items
ECTextViewImp textView; // Singleton
ECFileIO *fileIO = new ECFileIO(path); // Singleton
ECTextDocument textDocument(&textView, fileIO);
ECTextDocumentCtrl textDocumentCtrl = textDocument.GetCtrl();
ECTextEditor textEditor(textView, textDocument, textDocumentCtrl);
return 0;
}