-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
51 lines (45 loc) · 1.52 KB
/
main.cpp
File metadata and controls
51 lines (45 loc) · 1.52 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "all_inlcudes.h"
#include "ConfigInfo.h"
int main()
{
string path;
string command;
//Does the config file exist?
if (!doesFileExist(CONFIG_FILE_NAME))
{
//Create new config
cout << "Pleas enter the path of the workspace: ";
cin >> path;
if(!createConfig(path))
{
cout << "An error has prevented the creation of a config file" << endl;
}
}
else
{
ConfigInfo reader;
//Read
if(reader.getRawPath().empty() || !doesPathExist(reader.buildFullPath()))
{
cout << "No valid path could be found in the config" << endl;
}
else
{
if (doesPathExist(ECLIPSE_EXE_PATH))
{
cout << "Could not find Eclipse.exe in default path " << ECLIPSE_EXE_PATH << endl;
}
else {
command = ECLIPSE_EXE_PATH + " -data " + reader.buildFullPath();
cout << "The state of existance is: " << doesPathExist(reader.buildFullPath()) << endl;
cout << "can execute here is the command: " << command << endl;
// system(command.c_str());
//LPSTR s = const_cast<char *>(command.c_str());
//CreateProcess(NULL, s,NULL,NULL,false,0,NULL,NULL,NULL,NULL);
system("exit");
//ShellExecute(0,"open","cmd.exe", command.c_str(), 0, SW_HIDE);
}
}
}
return 0;
}