1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-22 09:12:19 -05:00

Added & fixed GetFiles/GetDirectories.

This commit is contained in:
Raymond 2010-05-12 22:55:36 +02:00
parent d794c5e420
commit 6bbdc985ba
3 changed files with 21 additions and 1 deletions

View File

@ -81,6 +81,21 @@ begin
result := CreateDir(directoryName);
end;
function ps_ForeDirectores(const dir : string) : boolean; extdecl;
begin
result := ForceDirectories(dir);
end;
function ps_GetFiles(const Path, Ext : string) : TStringArray;extdecl;
begin
result := GetFiles(path,ext);
end;
function ps_GetDirectories(const path : string) : TStringArray;extdecl;
begin
result := GetDirectories(path);
end;
procedure ps_WriteINI(const Section, KeyName, NewString, FileName: string);extdecl;
var
tempini : TIniFile;

View File

@ -111,6 +111,9 @@ AddFunction(@ps_FilePointerPos, 'function FilePointerPos(FileNum: Integer): Inte
AddFunction(@ps_DirectoryExists,'function DirectoryExists(const DirectoryName : string ) : Boolean;');
AddFunction(@ps_CreateDirectory,'function CreateDirectory(const DirectoryName : string) : boolean;');
AddFunction(@ps_FileExists,'function FileExists (const FileName : string ) : Boolean;');
AddFunction(@ps_ForeDirectores,'function ForeDirectores(const dir : string) : boolean;');
AddFunction(@ps_GetFiles,'function GetFiles(const Path, Ext : string) : TStringArray;');
AddFunction(@ps_GetDirectories,'function GetDirectories(const path : string) : TStringArray;');
AddFunction(@ps_WriteINI,'procedure WriteINI(const Section, KeyName, NewString, FileName: string);');
AddFunction(@ps_ReadINI,'function ReadINI(const Section, KeyName, FileName: string): string;');
AddFunction(@ps_DeleteINI,'procedure DeleteINI(const Section, KeyName, FileName: string);');

View File

@ -82,6 +82,8 @@ begin
if FindFirst(Path + '*.' + ext, faAnyFile, SearchRec) = 0 then
begin
repeat
if (SearchRec.Attr and faDirectory) = faDirectory then
Continue;
inc(c);
SetLength(Result,c);
Result[c-1] := SearchRec.Name;
@ -99,7 +101,7 @@ begin
if FindFirst(Path + '*', faDirectory, SearchRec) = 0 then
begin
repeat
if SearchRec.Name[1] = '.' then
if (SearchRec.Name[1] = '.') or ((SearchRec.Attr and faDirectory) <> faDirectory) then
continue;
inc(c);
SetLength(Result,c);