1
0
mirror of synced 2024-09-19 09:46:09 +00:00

Added: GetTempFile implementation

Changed: updated Delphi 7 package
This commit is contained in:
Mark van Renswoude 2008-03-17 09:33:24 +00:00
parent 6d5d37bdf8
commit 263c324676
6 changed files with 55 additions and 22 deletions

View File

@ -31,7 +31,7 @@
-M
-$M16384,1048576
-K$00400000
-N"..\..\Lib\D7"
-N"P:\Algemeen\lib"
-LE"c:\program files\borland\delphi7\Projects\Bpl"
-LN"c:\program files\borland\delphi7\Projects\Bpl"
-w-SYMBOL_PLATFORM

View File

@ -91,7 +91,7 @@ ImageBase=4194304
ExeDescription=X2Utils
[Directories]
OutputDir=
UnitOutputDir=..\..\Lib\D7
UnitOutputDir=P:\Algemeen\lib
PackageDLLOutputDir=
PackageDCPOutputDir=
SearchPath=
@ -105,6 +105,10 @@ HostApplication=
Launcher=
UseLauncher=0
DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=
[Version Info]
IncludeVerInfo=1
AutoIncBuild=0
@ -130,6 +134,8 @@ OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[Excluded Packages]
C:\Program Files\Borland\Indy\D7\dclIndy70.bpl=Internet Direct (Indy) for D7 Property and Component Editors
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
@ -138,11 +144,12 @@ Count=2
Item0=..\..
Item1=F:\Development\VDarts\Packages
[HistoryLists\hlUnitOutputDirectory]
Count=4
Item0=..\..\Lib\D7
Item1=..\..\Dcu
Item2=..\..\..\Dcu
Item3=Dcu
Count=5
Item0=P:\Algemeen\lib
Item1=..\..\Lib\D7
Item2=..\..\Dcu
Item3=..\..\..\Dcu
Item4=Dcu
[HistoryLists\hlBPLOutput]
Count=3
Item0=..\..\Lib\D7

View File

@ -30,13 +30,10 @@ package X2Utils;
requires
rtl,
vcl,
VirtualTreesD7,
vclx,
indy,
xmlrtl;
VirtualTreesD7;
contains
X2UtVirtualTree in '..\..\X2UtVirtualTree.pas',
X2UtApp in '..\..\X2UtApp.pas',
X2UtBits in '..\..\X2UtBits.pas',
X2UtGraphics in '..\..\X2UtGraphics.pas',
@ -45,8 +42,17 @@ contains
X2UtHashesVariants in '..\..\X2UtHashesVariants.pas',
X2UtMisc in '..\..\X2UtMisc.pas',
X2UtOS in '..\..\X2UtOS.pas',
X2UtSingleInstance in '..\..\X2UtSingleInstance.pas',
X2UtStrings in '..\..\X2UtStrings.pas',
X2UtInetVersion in '..\..\X2UtInetVersion.pas';
X2UtImageInfo in '..\..\X2UtImageInfo.pas',
X2UtTempFile in '..\..\X2UtTempFile.pas',
X2UtIniParser in '..\..\X2UtIniParser.pas',
X2UtProcess in '..\..\X2UtProcess.pas',
X2UtSingleInstance in '..\..\X2UtSingleInstance.pas',
X2UtStreams in '..\..\X2UtStreams.pas',
X2UtNamedFormat in '..\..\X2UtNamedFormat.pas',
X2UtPersist in '..\..\X2UtPersist.pas',
X2UtPersistForm in '..\..\X2UtPersistForm.pas',
X2UtPersistIntf in '..\..\X2UtPersistIntf.pas',
X2UtPersistRegistry in '..\..\X2UtPersistRegistry.pas';
end.

View File

@ -113,9 +113,8 @@ type
FFiler: IX2PersistFiler;
FSectionCount: Integer;
protected
property SectionCount: Integer read FSectionCount;
property Filer: IX2PersistFiler read FFiler;
property SectionCount: Integer read FSectionCount;
{ IInterface }

View File

@ -1,5 +1,5 @@
{
:: X2UtPersistRegistry implements persistency to the Windows Registry.
:: X2UtPersistRegistry implements persistency to the Windows Registry.
::
:: Last changed: $Date$
:: Revision: $Rev$

View File

@ -44,6 +44,22 @@ begin
end;
function GetTempFile(const APrefix: String): String; overload;
var
tempPath: array[0..MAX_PATH] of Char;
tempFile: array[0..MAX_PATH] of Char;
begin
FillChar(tempPath, SizeOf(tempPath), #0);
FillChar(tempFile, SizeOf(tempFile), #0);
Windows.GetTempPath(SizeOf(tempPath), @tempPath);
Windows.GetTempFileName(@tempPath, PChar(APrefix), 0, @tempFile);
Result := String(tempFile);
end;
function GetTempFile(const APath, AFileName, AExtension: String): String; overload;
var
iCounter: Integer;
@ -74,6 +90,7 @@ begin
end;
end;
function GetTempFile(const APath, AFileName: String): String; overload;
var
sExt: String;
@ -84,19 +101,22 @@ begin
sExt);
end;
function GetTempAppDataFile(const APath, AFileName, AExtension: String): String; overload;
function GetTempAppDataFile(const ASubPath, AFileName, AExtension: String): String; overload;
begin
Result := GetTempFile(GetAppDataPath + APath, AFileName, AExtension);
Result := GetTempFile(GetAppDataPath + ASubPath, AFileName, AExtension);
end;
function GetTempAppDataFile(const APath, AFileName: String): String; overload;
function GetTempAppDataFile(const ASubPath, AFileName: String): String; overload;
var
sExt: String;
begin
sExt := ExtractFileExt(AFileName);
Result := GetTempAppDataFile(APath, Copy(AFileName, 1, Length(AFileName) - Length(sExt)),
sExt);
Result := GetTempAppDataFile(ASubPath, Copy(AFileName, 1,
Length(AFileName) - Length(sExt)),
sExt);
end;
@ -105,6 +125,7 @@ begin
Result := not (AChar in ['\', '/', ':', '*', '?', '"', '<', '>', '|']);
end;
function CheckValidFileName(var AFileName: String; const AReplacement: Char): Boolean;
var
iPos: Integer;