rtl: clean up

This commit is contained in:
mattias 2018-10-28 18:29:27 +00:00
parent 8744cbe84f
commit da901ab750
3 changed files with 58 additions and 2 deletions

View File

@ -20,9 +20,34 @@ interface
uses
JS, SysUtils;
var
DirectorySeparator: char = '/';
DriveSeparator: string = '';
ExtensionSeparator: char = '.';
PathSeparator: char = ':';
AllowDirectorySeparators: set of char = ['\','/'];
AllowDriveSeparators: set of char = [];
AllFilesMask: string = '*';
//MaxPathLen: integer = 4096;
PathDelim: char = '/'; // = DirectorySeparator;
DriveDelim: string = ''; // = DriveSeparator;
PathSep: char = ':'; // = PathSeparator;
//MAX_PATH: integer = 4096; // = MaxPathLen;
const
//faReadOnly = 1;
//faHidden = 2;
//faSystem = 4;
//faReserve = 8;
faDirectory = 16;
//faArchive = 32;
function FileExists(Filename: string): boolean;
function DirectoryExists(Filename: string): boolean;
function ExtractFilePath(Filename: string): string;
function ExtractFileName(Filename: string): string;
function ExtractFileExt(Filename: string): string;
function SetDirSeparators(Filename: string): string;
function ExpandFileName(Filename: string): string;
function IncludeTrailingPathDelimiter(Filename: string): string;
@ -32,45 +57,75 @@ implementation
function FileExists(Filename: string): boolean;
begin
writeln('FileExists TODO ',Filename);
Result:=false; // ToDo
if Filename='' then ;
raise Exception.Create('FileExists TODO');
end;
function DirectoryExists(Filename: string): boolean;
begin
writeln('DirectoryExists TODO ',Filename);
Result:=false; // ToDo
if Filename='' then ;
raise Exception.Create('DirectoryExists TODO');
end;
function ExtractFilePath(Filename: string): string;
begin
writeln('ExtractFilePath TODO ',Filename);
Result:=''; // ToDo
if Filename='' then ;
raise Exception.Create('ExtractFilePath TODO');
end;
function ExtractFileName(Filename: string): string;
begin
writeln('ExtractFileName TODO ',Filename);
Result:=''; // ToDo
if Filename='' then ;
raise Exception.Create('ExtractFileName TODO');
end;
function ExtractFileExt(Filename: string): string;
begin
writeln('ExtractFileExt TODO ',Filename);
Result:=''; // ToDo
if Filename='' then ;
raise Exception.Create('ExtractFileExt TODO');
end;
function SetDirSeparators(Filename: string): string;
begin
writeln('SetDirSeparators TODO ',Filename);
Result:=''; // ToDo
if Filename='' then ;
raise Exception.Create('SetDirSeparators TODO');
end;
function ExpandFileName(Filename: string): string;
begin
writeln('ExpandFileName TODO ',Filename);
Result:=''; // ToDo
if Filename='' then ;
raise Exception.Create('ExpandFileName TODO');
end;
function IncludeTrailingPathDelimiter(Filename: string): string;
begin
writeln('IncludeTrailingPathDelimiter TODO ',Filename);
Result:=''; // ToDo
if Filename='' then ;
raise Exception.Create('IncludeTrailingPathDelimiter TODO');
end;
function ChangeFileExt(Filename, NewExt: string): string;
begin
writeln('ChangeFileExt TODO ',Filename,' NewExt=',NewExt);
Result:=''; // ToDo
if Filename='' then ;
if NewExt='' then ;
raise Exception.Create('ChangeFileExt TODO');
end;
end.

View File

@ -28,6 +28,7 @@ type
EListError = class(Exception);
EStringListError = class(EListError);
EParserError = class(Exception);
EComponentError = class(Exception);
TListAssignOp = (laCopy, laAnd, laOr, laXor, laSrcUnique, laDestUnique);

View File

@ -678,7 +678,7 @@ Const
var
Buffer: String; //Though str func returns only 25 chars, this might change in the future
InfNan: string;
OutPos,Error, N, L, Start, C: Integer;
OutPos,Error, N, L, C: Integer;
GotNonZeroBeforeDot, BeforeDot : boolean;
begin
@ -714,7 +714,7 @@ begin
exit
end;
end;
Start := N; //Start of digits
//Start := N; //Start of digits
Outpos:=0;
Result.Exponent := 0; BeforeDot := true;
GotNonZeroBeforeDot := false;