diff options
author | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-19 17:43:55 +0000 |
---|---|---|
committer | tobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-19 17:43:55 +0000 |
commit | aecd412bef5a839a34617f11ba2fdf247d086584 (patch) | |
tree | 40fca0c677035de383688543727c5613c64934cb /src/base/UPath.pas | |
parent | 698dff10499ff6bd08a7a23da3c50903216a5384 (diff) | |
download | usdx-aecd412bef5a839a34617f11ba2fdf247d086584.tar.gz usdx-aecd412bef5a839a34617f11ba2fdf247d086584.tar.xz usdx-aecd412bef5a839a34617f11ba2fdf247d086584.zip |
changed THandle to TFileHandle in UPath/UFilesystem as THandle (cardinal in delphi) does not allow -1.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2251 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r-- | src/base/UPath.pas | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/base/UPath.pas b/src/base/UPath.pas index 3d4804d7..7c00e7b1 100644 --- a/src/base/UPath.pas +++ b/src/base/UPath.pas @@ -46,6 +46,12 @@ uses type
IPath = interface;
+ {$IFDEF FPC}
+ TFileHandle = THandle;
+ {$ELSE}
+ TFileHandle = Longint;
+ {$ENDIF}
+
{**
* TUnicodeMemoryStream
*}
@@ -219,7 +225,7 @@ type * Note: File must be closed with FileClose(Handle) after usage
* @seealso SysUtils.FileOpen()
*}
- function Open(Mode: longword): THandle;
+ function Open(Mode: longword): TFileHandle;
{** @seealso SysUtils.ExtractFileDrive() *}
function GetDrive(): IPath;
@@ -340,8 +346,10 @@ type *}
function FileSearch(const DirList: IPath): IPath;
- {** File must be closed with FileClose(Handle) after usage }
- function CreateFile(): THandle;
+ {**
+ * File must be closed with FileClose(Handle) after usage
+ *}
+ function CreateFile(): TFileHandle;
function DeleteFile(): boolean;
function CreateDirectory(Force: boolean = false): boolean;
function DeleteEmptyDir(): boolean;
@@ -493,7 +501,7 @@ type function ToWide(UseNativeDelim: boolean): WideString;
function ToNative(): RawByteString;
- function Open(Mode: longword): THandle;
+ function Open(Mode: longword): TFileHandle;
function GetDrive(): IPath;
function GetPath(): IPath;
@@ -541,7 +549,7 @@ type function FileSearch(const DirList: IPath): IPath;
- function CreateFile(): THandle;
+ function CreateFile(): TFileHandle;
function DeleteFile(): boolean;
function CreateDirectory(Force: boolean): boolean;
function DeleteEmptyDir(): boolean;
@@ -964,7 +972,7 @@ begin Result := FileSystem.ExcludeTrailingPathDelimiter(Self);
end;
-function TPathImpl.CreateFile(): THandle;
+function TPathImpl.CreateFile(): TFileHandle;
begin
Result := FileSystem.FileCreate(Self);
end;
@@ -977,7 +985,7 @@ begin Result := FileSystem.DirectoryCreate(Self);
end;
-function TPathImpl.Open(Mode: longword): THandle;
+function TPathImpl.Open(Mode: longword): TFileHandle;
begin
Result := FileSystem.FileOpen(Self, Mode);
end;
|