//bool eString_PathInsideOf(char * path, char * of);
-static void ParseListValue(List<String> list, char * equal)
+/*static void ParseListValue(List<String> list, char * equal)
{
char * start, * comma;
char * string;
start = comma;
}
delete string;
-}
+}*/
enum OpenedFileState { unknown, opened, closed };
}
}
}
+ ~OpenedFileInfo()
+ {
+ delete path;
+ }
};
class Workspace
}
}
+ file.Printf("\n Execution Data\n");
+ if(commandLineArgs && commandLineArgs[0])
+ {
+ file.Printf("\n Command Line Arguments = ");
+ file.Puts(commandLineArgs);
+ file.Printf("\n");
+ }
+
+ if(environmentVars.count)
+ {
+ file.Printf("\n Environment Variables\n\n");
+ for(v : environmentVars)
+ file.Printf(" ~ %s = %s\n", v.name, v.string);
+ }
+
file.Printf("\n Debugger Data\n");
+ // This really belonged in Execution Data...
if(debugDir && debugDir[0])
file.Printf("\n Debug Working Directory = %s\n", debugDir);
if(sourceDirs.count)
project = p;
break;
}
+ // Handle symbol loader modules:
+ {
+ char moduleName[MAX_FILENAME];
+ char * sl;
+ GetLastDirectory(bp.absoluteFilePath, moduleName);
+ // Tweak for automatically resolving symbol loader modules
+ sl = strstr(moduleName, ".main.ec");
+ if(sl && (*sl = 0, !strcmpi(moduleName, p.name)))
+ {
+ project = p;
+ break;
+ }
+ }
}
if(!project)
{
~Workspace()
{
+ Save();
timer.Stop();
sourceDirs.Free();
bp.condition = wh;
}
}
+ else if(!strcmpi(section, "Execution Data") && !strcmpi(subSection, "Environment Variables"))
+ {
+ String value = strchr(equal, '=');
+ if(value)
+ {
+ *value = 0;
+ value++;
+ TrimRSpaces(equal, equal);
+ TrimLSpaces(value, value);
+ workspace.environmentVars.Add({ equal, value });
+ }
+ }
}
else if(buffer[0] == '*')
{
PathCatSlash(projectFilePath, equal);
newProject = LoadProject(projectFilePath);
if(newProject)
+ {
workspace.projects.Add(newProject);
+ newProject.StartMonitoring();
+ }
else if(workspace.projects.count == 0)
{
delete workspace;
strcpy(subSection, buffer);
else if(!strcmpi(buffer, "Watches"))
strcpy(subSection, buffer);
+ else if(!strcmpi(buffer, "Environment Variables"))
+ strcpy(subSection, buffer);
else if(!strcmpi(buffer, "Opened Files"))
strcpy(section, buffer);
else if(!strcmpi(buffer, "")) // | These two lines were commented out
TrimLSpaces(equal, equal);
if(!strcmpi(buffer, "Command Line Arguments"))
workspace.commandLineArgs = equal;
+
+ if(!strcmpi(buffer, "Environment Variables"))
+ {
+ delete workspace.environmentVars;
+ workspace.environmentVars = { };
+ }
+
}
else if(!strcmpi(section, "Debugger Data"))
{
}
if(project)
{
+ project.StartMonitoring();
workspace.projects.Add(project);
workspace.name = CopyString(project.name);
}
else
{
- MessageBox { type = ok, master = ide, contents = "Workspace load file failed", text = "Workspace Load File Error" }.Modal();
+ MessageBox { type = ok, master = ide, contents = $"Workspace load file failed", text = $"Workspace Load File Error" }.Modal();
delete workspace;
return null;
}
{
int c = 0;
char s[2] = "";
- char files[MAX_LOCATION * 16] = "\n";
+ String files = new char[MAX_LOCATION * 16];
char title[512];
- char msg[MAX_LOCATION * 16 + 2048];
-
+ String msg = new char[MAX_LOCATION * 16 + 2048];
NamedItem item;
+ strcpy(files,"\n");
item = openedFilesNotFound.first;
if(item.next)
strcat(files, item.name);
}
- sprintf(title, "File%s not found", s);
- sprintf(msg, "The following file%s could not be re-opened.%s", s, files);
+ sprintf(title, $"File%s not found", s);
+ sprintf(msg, $"The following file%s could not be re-opened.%s", s, files);
MessageBox { type = ok, master = ide, contents = msg, text = title }.Modal();
+
+ delete files;
+ delete msg;
}
openedFilesNotFound.Free(OldLink::Free);
}
if(newProject)
{
+ newProject.StartMonitoring();
workspace = Workspace { workspaceFile = filePath };
workspace.projects.Add(newProject);