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