mirror of https://gitlab.com/basile.b/dexed.git
add the stripFileExt string helper
This commit is contained in:
parent
fc0bc94c60
commit
cbb108343f
|
@ -642,7 +642,7 @@ begin
|
||||||
begin
|
begin
|
||||||
// ideally, main() should be searched for, when project binaryKind is executable
|
// ideally, main() should be searched for, when project binaryKind is executable
|
||||||
fOutputFilename := Sources[0].extractFileName;
|
fOutputFilename := Sources[0].extractFileName;
|
||||||
fOutputFilename := stripFileExt(fOutputFilename);
|
fOutputFilename := fOutputFilename.stripFileExt;
|
||||||
if fileName.fileExists then
|
if fileName.fileExists then
|
||||||
fOutputFilename := fileName.extractFilePath + fOutputFilename
|
fOutputFilename := fileName.extractFilePath + fOutputFilename
|
||||||
else
|
else
|
||||||
|
@ -945,7 +945,7 @@ begin
|
||||||
for i := 0 to fSrcs.Count-1 do
|
for i := 0 to fSrcs.Count-1 do
|
||||||
begin
|
begin
|
||||||
src := sourceAbsolute(i);
|
src := sourceAbsolute(i);
|
||||||
obj := stripFileExt(src) + objExt;
|
obj := src.stripFileExt + objExt;
|
||||||
if obj.fileExists and src.fileExists then
|
if obj.fileExists and src.fileExists then
|
||||||
begin
|
begin
|
||||||
if FileAgeUTF8(src) > FileAgeUTF8(obj) then
|
if FileAgeUTF8(src) > FileAgeUTF8(obj) then
|
||||||
|
|
|
@ -76,6 +76,7 @@ type
|
||||||
function extractFileExt: string;
|
function extractFileExt: string;
|
||||||
function extractFilePath: string;
|
function extractFilePath: string;
|
||||||
function extractFileDir: string;
|
function extractFileDir: string;
|
||||||
|
function stripFileExt: string;
|
||||||
function fileExists: boolean;
|
function fileExists: boolean;
|
||||||
function dirExists: boolean;
|
function dirExists: boolean;
|
||||||
function upperCase: string;
|
function upperCase: string;
|
||||||
|
@ -414,6 +415,11 @@ begin
|
||||||
exit(sysutils.extractFileDir(self));
|
exit(sysutils.extractFileDir(self));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TStringHelper.stripFileExt: string;
|
||||||
|
begin
|
||||||
|
exit(ce_common.stripFileExt(self));
|
||||||
|
end;
|
||||||
|
|
||||||
function TStringHelper.fileExists: boolean;
|
function TStringHelper.fileExists: boolean;
|
||||||
begin
|
begin
|
||||||
exit(sysutils.FileExists(self));
|
exit(sysutils.FileExists(self));
|
||||||
|
|
|
@ -1334,7 +1334,7 @@ begin
|
||||||
if not fDbgRunnable then
|
if not fDbgRunnable then
|
||||||
fExe := fProj.outputFilename
|
fExe := fProj.outputFilename
|
||||||
else
|
else
|
||||||
fExe := stripFileExt(fDoc.fileName) + exeExt;
|
fExe := fDoc.fileName.stripFileExt + exeExt;
|
||||||
//
|
//
|
||||||
fOutputName := fExe + '.inferiorout';
|
fOutputName := fExe + '.inferiorout';
|
||||||
fInputName := fExe + '.inferiorin';
|
fInputName := fExe + '.inferiorin';
|
||||||
|
|
|
@ -2452,7 +2452,7 @@ begin
|
||||||
if fDoc.isNil then
|
if fDoc.isNil then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
result := stripFileExt(fDoc.fileName) + exeExt;
|
result := fDoc.fileName.stripFileExt + exeExt;
|
||||||
if fDoc.isTemporary then
|
if fDoc.isTemporary then
|
||||||
exit;
|
exit;
|
||||||
ofr := fRunnablesOptions.outputFolder;
|
ofr := fRunnablesOptions.outputFolder;
|
||||||
|
@ -2464,12 +2464,11 @@ begin
|
||||||
if FilenameIsAbsolute(ofr) then
|
if FilenameIsAbsolute(ofr) then
|
||||||
begin
|
begin
|
||||||
if ofr.dirExists then
|
if ofr.dirExists then
|
||||||
result := ofr + stripFileExt(fDoc.fileName.extractFileName)
|
result := ofr + fDoc.fileName.extractFileName.stripFileExt + exeExt;
|
||||||
+ exeExt;
|
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
result := fDoc.fileName.extractFilePath + ofr
|
result := fDoc.fileName.extractFilePath + ofr
|
||||||
+ stripFileExt(fDoc.fileName.extractFileName) + exeExt;
|
+ fDoc.fileName.extractFileName.stripFileExt + exeExt;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -2592,7 +2591,7 @@ begin
|
||||||
fDoc.save
|
fDoc.save
|
||||||
else
|
else
|
||||||
fDoc.saveTempFile;
|
fDoc.saveTempFile;
|
||||||
fname := stripFileExt(runnableExename);
|
fname := runnableExename.stripFileExt;
|
||||||
|
|
||||||
if fRunnablesOptions.staticSwitches.Count = 0 then
|
if fRunnablesOptions.staticSwitches.Count = 0 then
|
||||||
fRunnablesOptions.setDefaultSwitches;
|
fRunnablesOptions.setDefaultSwitches;
|
||||||
|
@ -2725,7 +2724,7 @@ begin
|
||||||
asyncprocTerminate(sender);
|
asyncprocTerminate(sender);
|
||||||
if fCovModUt and assigned(fRunProc) and (fRunProc.ExitStatus = 0) then
|
if fCovModUt and assigned(fRunProc) and (fRunProc.ExitStatus = 0) then
|
||||||
begin
|
begin
|
||||||
fname := stripFileExt(fDoc.fileName);
|
fname := fDoc.fileName.stripFileExt;
|
||||||
fullcov := true;
|
fullcov := true;
|
||||||
covname := ReplaceStr(fname + '.lst', DirectorySeparator, '-');
|
covname := ReplaceStr(fname + '.lst', DirectorySeparator, '-');
|
||||||
{$IFDEF WINDOWS}
|
{$IFDEF WINDOWS}
|
||||||
|
@ -3099,7 +3098,7 @@ begin
|
||||||
begin
|
begin
|
||||||
itm := TMenuItem.Create(self);
|
itm := TMenuItem.Create(self);
|
||||||
itm.Caption := lst[i].extractFileName;
|
itm.Caption := lst[i].extractFileName;
|
||||||
itm.Caption := stripFileExt(itm.Caption);
|
itm.Caption := itm.Caption.stripFileExt;
|
||||||
itm.OnClick := @layoutMnuItemClick;
|
itm.OnClick := @layoutMnuItemClick;
|
||||||
itm.ImageIndex := 32;
|
itm.ImageIndex := 32;
|
||||||
mnuLayout.Add(itm);
|
mnuLayout.Add(itm);
|
||||||
|
|
|
@ -206,7 +206,7 @@ begin
|
||||||
fname := fProjInterface.filename;
|
fname := fProjInterface.filename;
|
||||||
fSymbols[CPF] := fname;
|
fSymbols[CPF] := fname;
|
||||||
fSymbols[CPP] := fSymbols[CPF].extractFilePath;
|
fSymbols[CPP] := fSymbols[CPF].extractFilePath;
|
||||||
fSymbols[CPN] := stripFileExt(fSymbols[CPF].extractFileName);
|
fSymbols[CPN] := fSymbols[CPF].extractFileName.stripFileExt;
|
||||||
fSymbols[CPO] := fProjInterface.outputFilename;
|
fSymbols[CPO] := fProjInterface.outputFilename;
|
||||||
fSymbols[CPOP]:= fSymbols[CPO].extractFileDir;
|
fSymbols[CPOP]:= fSymbols[CPO].extractFileDir;
|
||||||
fSymbols[CPR] := fSymbols[CPP];
|
fSymbols[CPR] := fSymbols[CPP];
|
||||||
|
|
Loading…
Reference in New Issue