{
no, summary, yes, full;
- property char *
+ property const char *
{
get { return OnGetString(null, null, null); }
}
- char * OnGetString(char * tempString, void * fieldData, bool * needClass)
+ const char * OnGetString(char * tempString, void * fieldData, bool * needClass)
{
if(this >= no && this <= full)
{
char * workspaceFile;
char * workspaceDir;
char * commandLineArgs;
- property char * commandLineArgs { set { delete commandLineArgs; if(value) commandLineArgs = CopyString(value); } }
+ property const char * commandLineArgs { set { delete commandLineArgs; if(value) commandLineArgs = CopyString(value); } }
char * debugDir;
- property char * debugDir { set { delete debugDir; if(value) debugDir = CopyString(value); } }
+ property const char * debugDir { set { delete debugDir; if(value) debugDir = CopyString(value); } }
int bpCount;
- property char * compiler
+ property const char * compiler
{
set { delete compiler; if(value && value[0]) compiler = CopyString(value); }
get { return compiler && compiler[0] ? compiler : null; }
}
};
- property char * workspaceFile
+ property const char * workspaceFile
{
set
{
get { return workspaceFile; }
}
- property char * projectDir
+ property const char * projectDir
{
get
{
}
}
- char * GetAbsolutePathFromRelative(char * relative)
+ char * CopyAbsolutePathFromRelative(const char * relative)
{
char name[MAX_LOCATION];
char absolute[MAX_LOCATION];
GetLastDirectory(relative, name);
for(p : projects)
{
- if(node = p.topNode.Find(name, false))
+ if((node = p.topNode.Find(name, false)))
{
prj = p;
break;
return null;
}
- char * GetPathWorkspaceRelativeOrAbsolute(char * path)
+ char * CopyUnixPathWorkspaceRelativeOrAbsolute(const char * path)
{
if(IsPathInsideOf(path, workspaceDir))
{
return CopyUnixPath(path);
}
- Array<ProjectNode> GetAllProjectNodes(char *fullPath, bool skipExcluded)
+ char * MakeRelativePath(char * buffer, const char * path)
+ {
+ char * result = null;
+ if(buffer && path)
+ {
+ MakePathRelative(path, workspaceDir, buffer);
+ MakeSlashPath(buffer);
+ result = buffer;
+ }
+ return result;
+ }
+
+ char * GetRelativePathForProject(char * buffer, Project project)
+ {
+ char * result = null;
+ if(buffer && project && project.topNode.path)
+ {
+ MakePathRelative(project.topNode.path, workspaceDir, buffer);
+ MakeSlashPath(buffer);
+ PathCatSlash(buffer, project.topNode.name);
+ result = buffer;
+ }
+ return result;
+ }
+
+ Array<ProjectNode> GetAllProjectNodes(const char *fullPath, bool skipExcluded)
{
Array<ProjectNode> nodes = null;
for(project : projects)
return nodes;
}
- OpenedFileInfo UpdateOpenedFileInfo(char * fileName, OpenedFileState state)
+ Project GetFileOwner(const char * absolutePath, const char * objectFileExt)
+ {
+ Project owner = null;
+ for(prj : projects)
+ {
+ if(prj.topNode.FindByFullPath(absolutePath, false))
+ {
+ owner = prj;
+ break;
+ }
+ }
+ if(!owner)
+ GetObjectFileNode(absolutePath, &owner, null, objectFileExt);
+ return owner;
+ }
+
+ void GetRelativePath(const char * absolutePath, char * relativePath, Project * owner, const char * objectFileExt)
+ {
+ Project prj = GetFileOwner(absolutePath, objectFileExt);
+ if(owner)
+ *owner = prj;
+ if(!prj)
+ prj = projects.firstIterator.data;
+ if(prj)
+ {
+ MakePathRelative(absolutePath, prj.topNode.path, relativePath);
+ MakeSlashPath(relativePath);
+ }
+ else
+ relativePath[0] = '\0';
+ }
+
+ ProjectNode GetObjectFileNode(const char * filePath, Project * project, char * fullPath, const char * objectFileExt)
+ {
+ ProjectNode node = null;
+ char ext[MAX_EXTENSION];
+ GetExtension(filePath, ext);
+ if(ext[0])
+ {
+ IntermediateFileType type = IntermediateFileType::FromExtension(ext);
+ if(type)
+ {
+ char fileName[MAX_FILENAME];
+ GetLastDirectory(filePath, fileName);
+ if(fileName[0])
+ {
+ DotMain dotMain = DotMain::FromFileName(fileName);
+ for(prj : ide.workspace.projects)
+ {
+ if((node = prj.FindNodeByObjectFileName(fileName, type, dotMain, null, objectFileExt)))
+ {
+ if(project)
+ *project = prj;
+ if(fullPath)
+ {
+ const char * cfgName = prj.config ? prj.config.name : "";
+ char name[MAX_FILENAME];
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(prj.lastBuildCompilerName);
+ DirExpression objDir = prj.GetObjDir(compiler, prj.config, bitDepth);
+ strcpy(fullPath, prj.topNode.path);
+ PathCatSlash(fullPath, objDir.dir);
+ node.GetObjectFileName(name, prj.configsNameCollisions[cfgName], type, dotMain, objectFileExt);
+ PathCatSlash(fullPath, name);
+ delete objDir;
+ delete compiler;
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ return node;
+ }
+
+ OpenedFileInfo UpdateOpenedFileInfo(const char * fileName, OpenedFileState state)
{
char filePath[MAX_LOCATION];
OpenedFileInfo ofi = null;
void UpdateSourceDirsArray(Array<String> dirs)
{
- byte * tokens[256];
- int c, numTokens;
-
sourceDirs.Free();
for(s : dirs)
delete project;
}
- void SelectActiveConfig(char * configName)
+ void SelectActiveConfig(const char * configName)
{
bool change = false;
for(prj : ide.workspace.projects)
ide.projectView.Update(null);
Save();
}
+ ide.AdjustDebugMenus();
}
- bool FindPath(ProjectNode node, char * path)
+ bool FindPath(ProjectNode node, const char * path)
{
if(node.type == file)
{
return false;
}
- void ChangeBreakpoint(DataRow row, char * location)
+ void ChangeBreakpoint(DataRow row, const char * location)
{
- Breakpoint bp = (Breakpoint)row.tag;
+ Breakpoint bp = (Breakpoint)(intptr)row.tag;
if(bp)
{
char * currentLoc = bp.CopyUserLocationString();
void ChangeBreakpointIgnore(DataRow row, int ignore)
{
- Breakpoint bp = (Breakpoint)row.tag;
+ Breakpoint bp = (Breakpoint)(intptr)row.tag;
if(bp)
{
bp.ignore = ignore;
void ChangeBreakpointLevel(DataRow row, int level)
{
- Breakpoint bp = (Breakpoint)row.tag;
+ Breakpoint bp = (Breakpoint)(intptr)row.tag;
if(bp)
{
bp.level = level;
}
}
- void ChangeBreakpointCondition(DataRow row, char * condition)
+ void ChangeBreakpointCondition(DataRow row, const char * condition)
{
- Breakpoint bp = (Breakpoint)row.tag;
+ Breakpoint bp = (Breakpoint)(intptr)row.tag;
if(bp && !(!bp.condition && !(condition && condition[0])))
{
if(!bp.condition)
Window document;
for(document = ide.firstChild; document; document = document.next)
{
- char * fileName = document.fileName;
+ const char * fileName = document.fileName;
if(document.isDocument && fileName && document.created)
{
char winFilePath[MAX_LOCATION];
- char * slashPath = GetSlashPathBuffer(winFilePath, fileName);
+ const char * slashPath = GetSlashPathBuffer(winFilePath, fileName);
if(!fstrcmp(slashPath, bp.absoluteFilePath))
{
Link bpLink, next;
for(bpLink = breakpoints.first; bpLink; bpLink = next)
{
- Breakpoint bp = (Breakpoint)bpLink.data;
+ Breakpoint bp = (Breakpoint)(intptr)bpLink.data;
next = bpLink.next;
if(bp.type == user)
}
-Workspace LoadWorkspace(char * filePath, char * fromProjectFile)
+Workspace LoadWorkspace(const char * filePath, const char * fromProjectFile)
{
File file;
Workspace workspace = null;
{
char buffer[65536];
char * equal;
- int len;
Watch wh;
- Breakpoint bp;
+ Breakpoint bp = null;
file.GetLine(buffer, 65536 - 1);
TrimLSpaces(buffer, buffer);
else if(fromProjectFile)
{
//MessageBox { type = Ok, master = ide, contents = "Worspace load file failed", text = "Worspace Load File Error" }.Modal();
-
- char projectFile[MAX_LOCATION];
+ //char projectFile[MAX_LOCATION];
Project newProject;
//strcpy(projectFile, filePath);