summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-10-12 20:57:26 +0100
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-10-12 20:57:26 +0100
commit0590d09ae24d89eece8a377293acc8a21d89bc7c (patch)
tree2b1a036c2d374d20a9a5bd28a6bcf9f9880b6eea
parent31742dfb2cb06089fe0e6e87ec1ed21a8d4d5dfb (diff)
downloadfpGUI-0590d09ae24d89eece8a377293acc8a21d89bc7c.tar.xz
Creates a fpGUI wrapper for RTL's RenameFile() function.
-rw-r--r--src/corelib/fpg_utils.pas6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/fpg_utils.pas b/src/corelib/fpg_utils.pas
index 2f20e1dc..dcc0cf71 100644
--- a/src/corelib/fpg_utils.pas
+++ b/src/corelib/fpg_utils.pas
@@ -68,6 +68,7 @@ function fpgChangeFileExt(const FileName, Extension: TfpgString): TfpgString;
function fpgGetAppConfigDir(const Global: Boolean): TfpgString;
function fpgGetAppConfigFile(const Global: Boolean; const SubDir: Boolean): TfpgString;
function fpgGetExecutableName: TfpgString;
+function fpgRenameFile(const OldName, NewName: TfpgString): Boolean;
implementation
@@ -188,6 +189,11 @@ begin
Result := fpgChangeFileExt(fpgExtractFileName(Paramstr(0)), '');
end;
+function fpgRenameFile(const OldName, NewName: TfpgString): Boolean;
+begin
+ Result := RenameFile(fpgToOSEncoding(OldName), fpgToOSEncoding(NewName));
+end;
+
function fpgAppendPathDelim(const Path: TfpgString): TfpgString;
begin
if (Path <> '') and (Path[length(Path)] <> PathDelim) then