mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-25 11:41:49 +02:00
iPro: Cleanup for iphtml.pas and other units.
git-svn-id: trunk@45710 -
This commit is contained in:
parent
74ad088fee
commit
a8b43fe3b5
@ -563,27 +563,27 @@ begin
|
|||||||
// GetDeviceCaps with the handle and verifying that there is something
|
// GetDeviceCaps with the handle and verifying that there is something
|
||||||
// there. If this is ok, we can then update the bitmap with the next
|
// there. If this is ok, we can then update the bitmap with the next
|
||||||
// frame.
|
// frame.
|
||||||
if GetDeviceCaps (FDrawingCanvas.Handle, HORZSIZE) <> 0 then begin {!!.dg}
|
if GetDeviceCaps (FDrawingCanvas.Handle, HORZSIZE) <> 0 then begin
|
||||||
if Animate and Transparent then {!!.dg}
|
if Animate and Transparent then
|
||||||
FDrawingCanvas.CopyRect (FDrawingRect, FBitmap.Canvas, {!!.dg}
|
FDrawingCanvas.CopyRect (FDrawingRect, FBitmap.Canvas,
|
||||||
Rect (0, 0, {!!.dg}
|
Rect (0, 0,
|
||||||
FBitmap.Width, {!!.dg}
|
FBitmap.Width,
|
||||||
FBitmap.Height)) {!!.dg}
|
FBitmap.Height))
|
||||||
else {!!.dg}
|
else
|
||||||
Draw (FDrawingCanvas, FDrawingRect); {!!.dg}
|
Draw (FDrawingCanvas, FDrawingRect);
|
||||||
end; {!!.dg}
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if assigned(FDestinationCanvas) then begin {!!.dg}
|
if assigned(FDestinationCanvas) then begin
|
||||||
if Animate and Transparent then {!!.dg}
|
if Animate and Transparent then
|
||||||
FDestinationCanvas.CopyRect (FDestinationRect, FBitmap.Canvas, {!!.dg}
|
FDestinationCanvas.CopyRect (FDestinationRect, FBitmap.Canvas,
|
||||||
Rect (0, 0, {!!.dg}
|
Rect (0, 0,
|
||||||
FBitmap.Width, {!!.dg}
|
FBitmap.Width,
|
||||||
FBitmap.Height)) {!!.dg}
|
FBitmap.Height))
|
||||||
else {!!.dg}
|
else
|
||||||
Draw (FDestinationCanvas, DestinationRect); {!!.dg}
|
Draw (FDestinationCanvas, DestinationRect);
|
||||||
end; {!!.dg}
|
end;
|
||||||
|
|
||||||
// An alternate way to cause the animation to occur is to use the OnChange
|
// An alternate way to cause the animation to occur is to use the OnChange
|
||||||
// event to notify the parent application that the image has changed. The
|
// event to notify the parent application that the image has changed. The
|
||||||
@ -668,7 +668,7 @@ begin
|
|||||||
// However, it gets the timing more accurate.
|
// However, it gets the timing more accurate.
|
||||||
|
|
||||||
if UseTransparentCopy then begin
|
if UseTransparentCopy then begin
|
||||||
if Images[FCurrentFrame].Bitmap <> nil then {!!.12}
|
if Images[FCurrentFrame].Bitmap <> nil then
|
||||||
for x := 0 to Images[FCurrentFrame].Bitmap.Width - 1 do
|
for x := 0 to Images[FCurrentFrame].Bitmap.Width - 1 do
|
||||||
for y := 0 to Images[FCurrentFrame].Bitmap.Height - 1 do
|
for y := 0 to Images[FCurrentFrame].Bitmap.Height - 1 do
|
||||||
if Images[FCurrentFrame].Bitmap.Canvas.Pixels[x, y] <>
|
if Images[FCurrentFrame].Bitmap.Canvas.Pixels[x, y] <>
|
||||||
|
|||||||
@ -39,7 +39,7 @@ const
|
|||||||
IpCRLF = #13#10;
|
IpCRLF = #13#10;
|
||||||
|
|
||||||
const
|
const
|
||||||
ReadLineErr = 8001; {!!.03}
|
ReadLineErr = 8001;
|
||||||
|
|
||||||
resourcestring
|
resourcestring
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ resourcestring
|
|||||||
SNoTimerErr = 'Not enough system timers available';
|
SNoTimerErr = 'Not enough system timers available';
|
||||||
SIndexErr = 'Index out of range';
|
SIndexErr = 'Index out of range';
|
||||||
SSocksErr = 'SOCKS request refused - %d';
|
SSocksErr = 'SOCKS request refused - %d';
|
||||||
SReadLineErr = 'Received line too long, exceeds MaxLineBuf'; {!!.03}
|
SReadLineErr = 'Received line too long, exceeds MaxLineBuf';
|
||||||
SNoMemoryStreamErr = 'No Memory Stream assigned';
|
SNoMemoryStreamErr = 'No Memory Stream assigned';
|
||||||
|
|
||||||
{ Event log }
|
{ Event log }
|
||||||
@ -175,10 +175,10 @@ resourcestring
|
|||||||
SHTMLDefSubmitCaption = 'Submit';
|
SHTMLDefSubmitCaption = 'Submit';
|
||||||
SHTMLDefResetCaption = 'Reset';
|
SHTMLDefResetCaption = 'Reset';
|
||||||
SHTMLDefBrowseCaption = 'Browse ...';
|
SHTMLDefBrowseCaption = 'Browse ...';
|
||||||
SHTMLInvPicture = 'Invalid picture returned'; {!!.02}
|
SHTMLInvPicture = 'Invalid picture returned';
|
||||||
SHTMLNoGraphic = 'Picture object contains no graphic object';{!!.02}
|
SHTMLNoGraphic = 'Picture object contains no graphic object';
|
||||||
SHTMLInvGraphic = 'Invalid graphic returned'; {!!.02}
|
SHTMLInvGraphic = 'Invalid graphic returned';
|
||||||
SHTMLNoGetImage = 'No OnGetImage event handler assigned'; {!!.02}
|
SHTMLNoGetImage = 'No OnGetImage event handler assigned';
|
||||||
|
|
||||||
{ RAS status messages }
|
{ RAS status messages }
|
||||||
SRasOpenPort = 'Open port';
|
SRasOpenPort = 'Open port';
|
||||||
@ -253,8 +253,8 @@ resourcestring
|
|||||||
SBinHexLengthErr = 'Invalid data length';
|
SBinHexLengthErr = 'Invalid data length';
|
||||||
SBinHexResourceForkErr = 'Resource fork present';
|
SBinHexResourceForkErr = 'Resource fork present';
|
||||||
SUUEncodeCountErr = 'Count <> Len or Count > 63';
|
SUUEncodeCountErr = 'Count <> Len or Count > 63';
|
||||||
SLineLengthErr = 'Invalid line length for encoded text'; {!!.01}
|
SLineLengthErr = 'Invalid line length for encoded text';
|
||||||
SUnsupportedEncoding = 'Encoding method not supported'; {!!.01}
|
SUnsupportedEncoding = 'Encoding method not supported';
|
||||||
|
|
||||||
{ ICMP errors and messages }
|
{ ICMP errors and messages }
|
||||||
SIpICMP_SUCCESS = 'Successful';
|
SIpICMP_SUCCESS = 'Successful';
|
||||||
@ -320,14 +320,14 @@ resourcestring
|
|||||||
SssSendEnvelope = 'Sending Envelope';
|
SssSendEnvelope = 'Sending Envelope';
|
||||||
SssSendMessage = 'Sending Message';
|
SssSendMessage = 'Sending Message';
|
||||||
SssSpecial = 'Sending special command';
|
SssSpecial = 'Sending special command';
|
||||||
SssAuthLogin = 'Requesting authentication'; {!!.12}
|
SssAuthLogin = 'Requesting authentication';
|
||||||
SssAuthUser = 'Authenticating username'; {!!.12}
|
SssAuthUser = 'Authenticating username';
|
||||||
SssAuthPass = 'Authenticating password'; {!!.12}
|
SssAuthPass = 'Authenticating password';
|
||||||
{ Task descriptions }
|
{ Task descriptions }
|
||||||
SstNoTask = 'None';
|
SstNoTask = 'None';
|
||||||
SstLogon = 'Logging on';
|
SstLogon = 'Logging on';
|
||||||
SstSendMail = 'Sending mail';
|
SstSendMail = 'Sending mail';
|
||||||
SstError = 'An error has occured during this task.'; {!!.11}
|
SstError = 'An error has occured during this task.';
|
||||||
{ SMTP response codes, used by the TIpSmtpClient.ResultMsg method }
|
{ SMTP response codes, used by the TIpSmtpClient.ResultMsg method }
|
||||||
SSmtpResponse02 = 'Success, ';
|
SSmtpResponse02 = 'Success, ';
|
||||||
SSmtpResponse04 = 'Transient, ';
|
SSmtpResponse04 = 'Transient, ';
|
||||||
@ -414,9 +414,9 @@ resourcestring
|
|||||||
SLogSendEnvelope = ' (ssSendEnvelope)';
|
SLogSendEnvelope = ' (ssSendEnvelope)';
|
||||||
SLogSendMessage = ' (ssSendMessage)';
|
SLogSendMessage = ' (ssSendMessage)';
|
||||||
SLogSpecial = ' (ssSpecial)';
|
SLogSpecial = ' (ssSpecial)';
|
||||||
SLogAuthLogin = ' (ssAuthLogin)'; {!!.12}
|
SLogAuthLogin = ' (ssAuthLogin)';
|
||||||
SLogAuthUser = ' (ssAuthUser)'; {!!.12}
|
SLogAuthUser = ' (ssAuthUser)';
|
||||||
SLogAuthPass = ' (ssAuthPass)'; {!!.12}
|
SLogAuthPass = ' (ssAuthPass)';
|
||||||
SLogstNoTask = ' (stNoTask)';
|
SLogstNoTask = ' (stNoTask)';
|
||||||
SLogstLogon = ' (stLogon)';
|
SLogstLogon = ' (stLogon)';
|
||||||
SLogstSendMail = ' (stSendMail)';
|
SLogstSendMail = ' (stSendMail)';
|
||||||
@ -457,7 +457,7 @@ resourcestring
|
|||||||
SptLogon = 'Logging on';
|
SptLogon = 'Logging on';
|
||||||
SptList = 'Retrieving mailbox list';
|
SptList = 'Retrieving mailbox list';
|
||||||
SptUIDL = 'Retrieving mailbox UID list';
|
SptUIDL = 'Retrieving mailbox UID list';
|
||||||
SptError = 'An error occured with the last task.'; {!!.11}
|
SptError = 'An error occured with the last task.';
|
||||||
SptUnknown = 'Unknown task';
|
SptUnknown = 'Unknown task';
|
||||||
SLogPop3Class = '[POP3] ';
|
SLogPop3Class = '[POP3] ';
|
||||||
SLogState = 'State change: ';
|
SLogState = 'State change: ';
|
||||||
@ -503,7 +503,7 @@ resourcestring
|
|||||||
SNntpCmdNewGroups = 'NEWGROUPS';
|
SNntpCmdNewGroups = 'NEWGROUPS';
|
||||||
SNntpCmdNewNews = 'NEWNEWS';
|
SNntpCmdNewNews = 'NEWNEWS';
|
||||||
SNntpCmdNext = 'NEXT';
|
SNntpCmdNext = 'NEXT';
|
||||||
SNntpCmdXOver = 'XOVER'; {!!.12}
|
SNntpCmdXOver = 'XOVER';
|
||||||
SNntpCmdPat = 'PAT';
|
SNntpCmdPat = 'PAT';
|
||||||
SNntpCmdPost = 'POST';
|
SNntpCmdPost = 'POST';
|
||||||
SNntpCmdQuit = 'QUIT';
|
SNntpCmdQuit = 'QUIT';
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -67,7 +67,7 @@ const
|
|||||||
CM_IPASYNCRESULT = IpMsgBase + 0;
|
CM_IPASYNCRESULT = IpMsgBase + 0;
|
||||||
CM_IPSOCKMESSAGE = IpMsgBase + 1;
|
CM_IPSOCKMESSAGE = IpMsgBase + 1;
|
||||||
CM_IPSOCKETSTATUS = IpMsgBase + 2;
|
CM_IPSOCKETSTATUS = IpMsgBase + 2;
|
||||||
CM_IPFREESOCKET = IpMsgBase + 3; {!!.02}
|
CM_IPFREESOCKET = IpMsgBase + 3;
|
||||||
CM_IPLINEMESSAGE = IpMsgBase + 4;
|
CM_IPLINEMESSAGE = IpMsgBase + 4;
|
||||||
CM_IPTERMDATA = IpMsgBase + 5;
|
CM_IPTERMDATA = IpMsgBase + 5;
|
||||||
CM_IPTERMRESIZE = IpMsgBase + 6;
|
CM_IPTERMRESIZE = IpMsgBase + 6;
|
||||||
@ -85,9 +85,9 @@ const
|
|||||||
CM_IPRASSTATUS = IpMsgBase + 18;
|
CM_IPRASSTATUS = IpMsgBase + 18;
|
||||||
CM_IPFINWHOSERVER = IpMsgBase + 19;
|
CM_IPFINWHOSERVER = IpMsgBase + 19;
|
||||||
CM_IPUTILITYSERVER = IpMsgBase + 20;
|
CM_IPUTILITYSERVER = IpMsgBase + 20;
|
||||||
CM_IPSMTPEVENT = IpMsgBase + 21; {!!.02}
|
CM_IPSMTPEVENT = IpMsgBase + 21;
|
||||||
CM_IPPOP3EVENT = IpMsgBase + 22; {!!.02}
|
CM_IPPOP3EVENT = IpMsgBase + 22;
|
||||||
CM_IPNNTPEVENT = IpMsgBase + 23; {!!.02}
|
CM_IPNNTPEVENT = IpMsgBase + 23;
|
||||||
{$IFDEF IP_LAZARUS}
|
{$IFDEF IP_LAZARUS}
|
||||||
CM_IPHOTINVOKE = IpMsgBase + 24;
|
CM_IPHOTINVOKE = IpMsgBase + 24;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -124,7 +124,7 @@ type
|
|||||||
EIpBaseException = class(Exception);
|
EIpBaseException = class(Exception);
|
||||||
|
|
||||||
EIpAccessException = class(EIpBaseException);
|
EIpAccessException = class(EIpBaseException);
|
||||||
EIpHtmlException = class(EIpBaseException); {!!.02}
|
EIpHtmlException = class(EIpBaseException);
|
||||||
|
|
||||||
TIpBaseAccess = class
|
TIpBaseAccess = class
|
||||||
private
|
private
|
||||||
@ -226,8 +226,8 @@ type
|
|||||||
|
|
||||||
TIpAddrRec = record
|
TIpAddrRec = record
|
||||||
Scheme : string;
|
Scheme : string;
|
||||||
UserName : string; {!!.03}
|
UserName : string;
|
||||||
Password : string; {!!.03}
|
Password : string;
|
||||||
Authority : string;
|
Authority : string;
|
||||||
Port : string;
|
Port : string;
|
||||||
Path : string;
|
Path : string;
|
||||||
@ -493,8 +493,8 @@ procedure Finalize(var AddrRec: TIpAddrRec);
|
|||||||
begin
|
begin
|
||||||
with AddrRec do begin
|
with AddrRec do begin
|
||||||
Scheme :='';
|
Scheme :='';
|
||||||
UserName :=''; {!!.03}
|
UserName :='';
|
||||||
Password :=''; {!!.03}
|
Password :='';
|
||||||
Authority :='';
|
Authority :='';
|
||||||
Port :='';
|
Port :='';
|
||||||
Path :='';
|
Path :='';
|
||||||
@ -1440,9 +1440,9 @@ begin
|
|||||||
if SchemeSeen then
|
if SchemeSeen then
|
||||||
Rslt.Authority := PotAuth
|
Rslt.Authority := PotAuth
|
||||||
else begin
|
else begin
|
||||||
if Pos('.', PotAuth) > 0 then {!!.12}
|
if Pos('.', PotAuth) > 0 then
|
||||||
Rslt.Authority := PotAuth {!!.12}
|
Rslt.Authority := PotAuth
|
||||||
else {!!.12}
|
else
|
||||||
PotPath := PotAuth;
|
PotPath := PotAuth;
|
||||||
end;
|
end;
|
||||||
PotAuth := '';
|
PotAuth := '';
|
||||||
@ -1517,10 +1517,10 @@ begin
|
|||||||
{$IFNDEF IP_LAZARUS}
|
{$IFNDEF IP_LAZARUS}
|
||||||
'/': { ignore };
|
'/': { ignore };
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
'.', '\'{$IFDEF IP_LAZARUS},'/'{$ENDIF}: begin { start of a local path } {!!.12} //JMN
|
'.', '\'{$IFDEF IP_LAZARUS},'/'{$ENDIF}: begin { start of a local path }
|
||||||
PotPath := PotPath + P^; {!!.12}
|
PotPath := PotPath + P^;
|
||||||
State := psLocalPath; {!!.12}
|
State := psLocalPath;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else begin
|
else begin
|
||||||
if CharPos('@', URL) > 0 then begin
|
if CharPos('@', URL) > 0 then begin
|
||||||
@ -1609,9 +1609,9 @@ begin
|
|||||||
State := psAuthority;
|
State := psAuthority;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
else begin {!!.12}
|
else begin
|
||||||
Rslt.Password := Rslt.Password + P^; {!!.12}
|
Rslt.Password := Rslt.Password + P^;
|
||||||
end; {!!.12}
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1780,8 +1780,8 @@ var
|
|||||||
RelPos : Integer;
|
RelPos : Integer;
|
||||||
ParentPos : Integer;
|
ParentPos : Integer;
|
||||||
Path : string;
|
Path : string;
|
||||||
Scheme : string; {!!.12}
|
Scheme : string;
|
||||||
Port : string; {!!.12}
|
Port : string;
|
||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
Path := '';
|
Path := '';
|
||||||
@ -1811,31 +1811,30 @@ begin
|
|||||||
IpParseURL(OldURL, OldAddrRec);
|
IpParseURL(OldURL, OldAddrRec);
|
||||||
IpParseURL(NewURL, NewAddrRec);
|
IpParseURL(NewURL, NewAddrRec);
|
||||||
|
|
||||||
if OldAddrRec.Scheme = '' then {!!.12}
|
if OldAddrRec.Scheme = '' then
|
||||||
Scheme := '' {!!.12}
|
Scheme := ''
|
||||||
else {!!.12}
|
else
|
||||||
Scheme := OldAddrRec.Scheme + '://'; {!!.12}
|
Scheme := OldAddrRec.Scheme + '://';
|
||||||
|
|
||||||
if OldAddrRec.Port = '' then {!!.12}
|
if OldAddrRec.Port = '' then
|
||||||
Port := '' {!!.12}
|
Port := ''
|
||||||
else {!!.12}
|
else
|
||||||
Port := ':' + OldAddrRec.Port; {!!.12}
|
Port := ':' + OldAddrRec.Port;
|
||||||
|
|
||||||
if UpperCase(NewAddrRec.Scheme) = 'FILE' then begin
|
if UpperCase(NewAddrRec.Scheme) = 'FILE' then begin
|
||||||
{ New is a local file }
|
{ New is a local file }
|
||||||
Result := NewAddrRec.Scheme + '://' + NewAddrRec.Path; {!!.14}
|
Result := NewAddrRec.Scheme + '://' + NewAddrRec.Path;
|
||||||
end else if NewAddrRec.Scheme <> '' then begin
|
end else if NewAddrRec.Scheme <> '' then begin
|
||||||
{ New is a full address in its own right }
|
{ New is a full address in its own right }
|
||||||
Result := NewURL; { so just return that }
|
Result := NewURL; { so just return that }
|
||||||
end else if (NewAddrRec.Scheme = '') and (NewURL[1] = '/') then begin
|
end else if (NewAddrRec.Scheme = '') and (NewURL[1] = '/') then begin
|
||||||
{ New is probably a direct path off the Root }
|
{ New is probably a direct path off the Root }
|
||||||
Result := Scheme + OldAddrRec.Authority + Port; { build Root } {!!.12}
|
Result := Scheme + OldAddrRec.Authority + Port; { build Root }
|
||||||
if (NewURL <> '') and (NewURL[1] <> '/') then
|
if (NewURL <> '') and (NewURL[1] <> '/') then
|
||||||
Result := Result + '/';
|
Result := Result + '/';
|
||||||
Result := Result + NewURL; { just append }
|
Result := Result + NewURL; { just append }
|
||||||
end else if (NewAddrRec.Scheme = '') and (NewURL[1] <> '.') then begin
|
end else if (NewAddrRec.Scheme = '') and (NewURL[1] <> '.') then begin
|
||||||
{ New is probably a direct path off the current path }
|
{ New is probably a direct path off the current path }
|
||||||
{Begin !!.14}
|
|
||||||
if UpperCase(OldAddrRec.Scheme) = 'FILE' then begin
|
if UpperCase(OldAddrRec.Scheme) = 'FILE' then begin
|
||||||
Path := ExtractFilePath(OldAddrRec.Path);
|
Path := ExtractFilePath(OldAddrRec.Path);
|
||||||
Result := Scheme + Path;
|
Result := Scheme + Path;
|
||||||
@ -1844,7 +1843,7 @@ begin
|
|||||||
Path := ExtractEntityPath(DosToNetPath(OldAddrRec.Path));
|
Path := ExtractEntityPath(DosToNetPath(OldAddrRec.Path));
|
||||||
if (Path <> '') and (Path[1] = '/') then
|
if (Path <> '') and (Path[1] = '/') then
|
||||||
Path := Copy(Path, 2, Length(Path) - 1);
|
Path := Copy(Path, 2, Length(Path) - 1);
|
||||||
Result := Scheme; {!!.12}
|
Result := Scheme;
|
||||||
|
|
||||||
if OldAddrRec.Authority <> '' then
|
if OldAddrRec.Authority <> '' then
|
||||||
Result := Result + OldAddrRec.Authority + Port + '/';
|
Result := Result + OldAddrRec.Authority + Port + '/';
|
||||||
@ -1852,7 +1851,6 @@ begin
|
|||||||
if Path <> '' then
|
if Path <> '' then
|
||||||
Result := Result + AppendSlash(Path);
|
Result := Result + AppendSlash(Path);
|
||||||
end;
|
end;
|
||||||
{End !!.14}
|
|
||||||
|
|
||||||
Result := Result + NewURL;
|
Result := Result + NewURL;
|
||||||
|
|
||||||
@ -1871,7 +1869,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
Path := AppendSlash(Copy(Path, 1, ParentPos));
|
Path := AppendSlash(Copy(Path, 1, ParentPos));
|
||||||
Result := Scheme + OldAddrRec.Authority + Path + {!!.12}
|
Result := Scheme + OldAddrRec.Authority + Path +
|
||||||
Copy(NewURL, RelPos, Length(NewURL) - RelPos + 1);
|
Copy(NewURL, RelPos, Length(NewURL) - RelPos + 1);
|
||||||
|
|
||||||
{ remove shorthand for current directory if it exists }
|
{ remove shorthand for current directory if it exists }
|
||||||
@ -2134,15 +2132,15 @@ function INetDateStrToDateTime(const DateStr: string): TDateTime;
|
|||||||
type
|
type
|
||||||
TINetDateState = (idStart, idStartSp, idDow, idDowSp, idDay1, idDay1Sp,
|
TINetDateState = (idStart, idStartSp, idDow, idDowSp, idDay1, idDay1Sp,
|
||||||
idMon1, idMon1Sp, idMon2, idMon2Sp, idDay2, idYr1,
|
idMon1, idMon1Sp, idMon2, idMon2Sp, idDay2, idYr1,
|
||||||
idPreTimeSp, idHrs, idMin, idSec, idPostTimeSp, {idGMT,} idYr2, {!!.12}
|
idPreTimeSp, idHrs, idMin, idSec, idPostTimeSp, {idGMT,} idYr2,
|
||||||
idEndSp, idAM, idPM, idDaySpace1, IdTimeZoneNum, IdTimeZoneAlpha, {!!.12}
|
idEndSp, idAM, idPM, idDaySpace1, IdTimeZoneNum, IdTimeZoneAlpha,
|
||||||
idError);
|
idError);
|
||||||
|
|
||||||
const
|
const
|
||||||
AcceptStates: set of TINetDateState = [{idGMT,} idYr2, idSec, {!!.12}
|
AcceptStates: set of TINetDateState = [{idGMT,} idYr2, idSec,
|
||||||
idPostTimeSp, idEndSp, {!!.12}
|
idPostTimeSp, idEndSp,
|
||||||
idTimeZoneAlpha, {!!.12}
|
idTimeZoneAlpha,
|
||||||
idTimeZoneNum]; {!!.12}
|
idTimeZoneNum];
|
||||||
var
|
var
|
||||||
Dow, Day, Mon, Year, Hrs, Min, Sec: string;
|
Dow, Day, Mon, Year, Hrs, Min, Sec: string;
|
||||||
Dy, Mo, Yr: Word;
|
Dy, Mo, Yr: Word;
|
||||||
@ -2152,7 +2150,7 @@ var
|
|||||||
i : Integer;
|
i : Integer;
|
||||||
AMPM : Boolean;
|
AMPM : Boolean;
|
||||||
PM : Boolean;
|
PM : Boolean;
|
||||||
TimeZone : string; {!!.12}
|
TimeZone : string;
|
||||||
|
|
||||||
procedure ParseDate;
|
procedure ParseDate;
|
||||||
begin
|
begin
|
||||||
@ -2166,10 +2164,10 @@ begin
|
|||||||
Dow := Dow + P^;
|
Dow := Dow + P^;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
'0'..'9': begin {!!.12}
|
'0'..'9': begin
|
||||||
State := idDay1; {!!.12}
|
State := idDay1;
|
||||||
Day := Day + P^; {!!.12}
|
Day := Day + P^;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else
|
else
|
||||||
State := idError;
|
State := idError;
|
||||||
@ -2323,9 +2321,9 @@ begin
|
|||||||
Day := Day + P^;
|
Day := Day + P^;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
',' : begin {!!.12}
|
',' : begin
|
||||||
State := idDaySpace1; {!!.12}
|
State := idDaySpace1;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
' ': begin
|
' ': begin
|
||||||
State := idPreTimeSp;
|
State := idPreTimeSp;
|
||||||
@ -2336,20 +2334,20 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
idDaySpace1 : begin {!!.12}
|
idDaySpace1 : begin
|
||||||
case P^ of {!!.12}
|
case P^ of
|
||||||
' ' : begin {!!.12}
|
' ' : begin
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
'0'..'9' : begin {!!.12}
|
'0'..'9' : begin
|
||||||
Year := Year + P^; {!!.12}
|
Year := Year + P^;
|
||||||
State := idYr1; {!!.12}
|
State := idYr1;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else {!!.12}
|
else
|
||||||
State := idError; {!!.12}
|
State := idError;
|
||||||
end; {!!.12}
|
end;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
idYr1: begin { RFC 822 and 850 year string }
|
idYr1: begin { RFC 822 and 850 year string }
|
||||||
case P^ of
|
case P^ of
|
||||||
@ -2405,10 +2403,10 @@ begin
|
|||||||
Min := Min + P^;
|
Min := Min + P^;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
' ' : begin {!!.12}
|
' ' : begin
|
||||||
State := idPostTimeSp; {!!.12}
|
State := idPostTimeSp;
|
||||||
Sec := '00';
|
Sec := '00';
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else
|
else
|
||||||
State := idError;
|
State := idError;
|
||||||
@ -2425,52 +2423,52 @@ begin
|
|||||||
Sec := Sec + P^;
|
Sec := Sec + P^;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
'A', 'a' : begin {!!.12}
|
'A', 'a' : begin
|
||||||
AMPM := True; {!!.12}
|
AMPM := True;
|
||||||
PM := False; {!!.12}
|
PM := False;
|
||||||
State := idAM; {!!.12}
|
State := idAM;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
'P', 'p' : begin {!!.12}
|
'P', 'p' : begin
|
||||||
AMPM := True; {!!.12}
|
AMPM := True;
|
||||||
PM := True; {!!.12}
|
PM := True;
|
||||||
State := idPM; {!!.12}
|
State := idPM;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else
|
else
|
||||||
State := idError;
|
State := idError;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
idAM : begin { AM string } {!!.12}
|
idAM : begin { AM string }
|
||||||
case P^ of {!!.12}
|
case P^ of
|
||||||
' ' : begin {!!.12}
|
' ' : begin
|
||||||
State := idPostTimeSp {!!.12}
|
State := idPostTimeSp
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
'M', 'm' : begin {!!.12}
|
'M', 'm' : begin
|
||||||
State := idPostTimeSp; {!!.12}
|
State := idPostTimeSp;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else {!!.12}
|
else
|
||||||
State := idError; {!!.12}
|
State := idError;
|
||||||
end; {!!.12}
|
end;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
idPM : begin { PM string } {!!.12}
|
idPM : begin { PM string }
|
||||||
case P^ of {!!.12}
|
case P^ of
|
||||||
' ' : begin {!!.12}
|
' ' : begin
|
||||||
State := idPostTimeSp {!!.12}
|
State := idPostTimeSp
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
'M', 'm' : begin {!!.12}
|
'M', 'm' : begin
|
||||||
State := idPostTimeSp; {!!.12}
|
State := idPostTimeSp;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else {!!.12}
|
else
|
||||||
State := idError; {!!.12}
|
State := idError;
|
||||||
end; {!!.12}
|
end;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
idPostTimeSp: begin { ignore spaces before after time string }
|
idPostTimeSp: begin { ignore spaces before after time string }
|
||||||
case P^ of
|
case P^ of
|
||||||
@ -2481,84 +2479,84 @@ begin
|
|||||||
Year := Year + P^;
|
Year := Year + P^;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{'G', 'g': begin } {!!.12}
|
{'G', 'g': begin }
|
||||||
{ State := idGMT; } {!!.12}
|
{ State := idGMT; }
|
||||||
{end; } {!!.12}
|
{end; }
|
||||||
|
|
||||||
'-' : begin {!!.12}
|
'-' : begin
|
||||||
TimeZone := TimeZone + P^; {!!.12}
|
TimeZone := TimeZone + P^;
|
||||||
State := IdTimeZoneNum; {!!.12}
|
State := IdTimeZoneNum;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
'+' : begin {!!.12}
|
'+' : begin
|
||||||
TimeZone := TimeZone + P^; {!!.12}
|
TimeZone := TimeZone + P^;
|
||||||
State := IdTimeZoneNum; {!!.12}
|
State := IdTimeZoneNum;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
'A'..'Z', 'a'..'z' : begin {!!.12}
|
'A'..'Z', 'a'..'z' : begin
|
||||||
TimeZone := TimeZone + P^; {!!.12}
|
TimeZone := TimeZone + P^;
|
||||||
State := IdTimeZoneAlpha; {!!.12}
|
State := IdTimeZoneAlpha;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else
|
else
|
||||||
State := idError;
|
State := idError;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
idTimeZoneNum : begin {!!.12}
|
idTimeZoneNum : begin
|
||||||
case P^ of {!!.12}
|
case P^ of
|
||||||
'0'..'9' : begin {!!.12}
|
'0'..'9' : begin
|
||||||
TimeZone := TimeZone + P^; {!!.12}
|
TimeZone := TimeZone + P^;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
' ' : begin {!!.12}
|
' ' : begin
|
||||||
State := idEndSp; {!!.12}
|
State := idEndSp;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else {!!.12}
|
else
|
||||||
State := idError; {!!.12}
|
State := idError;
|
||||||
end; {!!.12}
|
end;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
idTimeZoneAlpha : begin {!!.12}
|
idTimeZoneAlpha : begin
|
||||||
case P^ of {!!.12}
|
case P^ of
|
||||||
'A'..'Z', 'a'..'z' : begin {!!.12}
|
'A'..'Z', 'a'..'z' : begin
|
||||||
TimeZone := TimeZone + P^; {!!.12}
|
TimeZone := TimeZone + P^;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
' ' : begin {!!.12}
|
' ' : begin
|
||||||
if UpperCase (TimeZone) = 'AM' then begin {!!.12}
|
if UpperCase (TimeZone) = 'AM' then begin
|
||||||
AMPM := True; {!!.12}
|
AMPM := True;
|
||||||
PM := False; {!!.12}
|
PM := False;
|
||||||
State := IdTimeZoneAlpha; {!!.12}
|
State := IdTimeZoneAlpha;
|
||||||
TimeZone := ''; {!!.12}
|
TimeZone := '';
|
||||||
end else if UpperCase (TimeZone) = 'PM' then begin {!!.12}
|
end else if UpperCase (TimeZone) = 'PM' then begin
|
||||||
AMPM := True; {!!.12}
|
AMPM := True;
|
||||||
PM := True; {!!.12}
|
PM := True;
|
||||||
State := IdTimeZoneAlpha; {!!.12}
|
State := IdTimeZoneAlpha;
|
||||||
TimeZone := ''; {!!.12}
|
TimeZone := '';
|
||||||
end else {!!.12}
|
end else
|
||||||
State := idEndSp; {!!.12}
|
State := idEndSp;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
else {!!.12}
|
else
|
||||||
State := idError; {!!.12}
|
State := idError;
|
||||||
end; {!!.12}
|
end;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
{idGMT: begin } { RFC 822 and 850 should end with "GMT" } {!!.12}
|
{idGMT: begin } { RFC 822 and 850 should end with "GMT" }
|
||||||
{ case P^ of } {!!.12}
|
{ case P^ of }
|
||||||
{ 'M', 'T': begin } {!!.12}
|
{ 'M', 'T': begin }
|
||||||
{ end; } {!!.12}
|
{ end; }
|
||||||
{ } {!!.12}
|
{ }
|
||||||
{ ' ': begin } {!!.12}
|
{ ' ': begin }
|
||||||
{ State := idEndSp; } {!!.12}
|
{ State := idEndSp; }
|
||||||
{ end; } {!!.12}
|
{ end; }
|
||||||
{ } {!!.12}
|
{ }
|
||||||
{ else } {!!.12}
|
{ else }
|
||||||
{ State := idError; } {!!.12}
|
{ State := idError; }
|
||||||
{ end; } {!!.12}
|
{ end; }
|
||||||
{end; } {!!.12}
|
{end; }
|
||||||
|
|
||||||
idYr2: begin { ANSI C time ends with Year }
|
idYr2: begin { ANSI C time ends with Year }
|
||||||
case P^ of
|
case P^ of
|
||||||
@ -2601,9 +2599,9 @@ begin
|
|||||||
Hrs := '';
|
Hrs := '';
|
||||||
Min := '';
|
Min := '';
|
||||||
Sec := '';
|
Sec := '';
|
||||||
AMPM := False; {!!.12}
|
AMPM := False;
|
||||||
PM := False; {!!.12}
|
PM := False;
|
||||||
TimeZone := ''; {!!.12}
|
TimeZone := '';
|
||||||
|
|
||||||
{ start at first character }
|
{ start at first character }
|
||||||
P := @DateStr[1];
|
P := @DateStr[1];
|
||||||
@ -2617,22 +2615,22 @@ begin
|
|||||||
Inc(P);
|
Inc(P);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if State = idTimeZoneAlpha then begin {!!.12}
|
if State = idTimeZoneAlpha then begin
|
||||||
if UpperCase (TimeZone) = 'AM' then begin {!!.12}
|
if UpperCase (TimeZone) = 'AM' then begin
|
||||||
AMPM := True; {!!.12}
|
AMPM := True;
|
||||||
PM := False; {!!.12}
|
PM := False;
|
||||||
TimeZone := ''; {!!.12}
|
TimeZone := '';
|
||||||
end else if UpperCase (TimeZone) = 'PM' then begin {!!.12}
|
end else if UpperCase (TimeZone) = 'PM' then begin
|
||||||
AMPM := True; {!!.12}
|
AMPM := True;
|
||||||
PM := True; {!!.12}
|
PM := True;
|
||||||
TimeZone := ''; {!!.12}
|
TimeZone := '';
|
||||||
end; {!!.12}
|
end;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
if State = idMin then begin {!!.12}
|
if State = idMin then begin
|
||||||
Sec := '00'; {!!.12}
|
Sec := '00';
|
||||||
State := idSec; {!!.12}
|
State := idSec;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
{ date string terminated prematurely }
|
{ date string terminated prematurely }
|
||||||
if not (State in AcceptStates) then Exit;
|
if not (State in AcceptStates) then Exit;
|
||||||
@ -2658,12 +2656,12 @@ begin
|
|||||||
Mn := StrToIntDef(Min, -1);
|
Mn := StrToIntDef(Min, -1);
|
||||||
Sc := StrToIntDef(Sec, -1);
|
Sc := StrToIntDef(Sec, -1);
|
||||||
|
|
||||||
if AMPM then begin {!!.12}
|
if AMPM then begin
|
||||||
if (Hr < 12) and (PM) then {!!.12}
|
if (Hr < 12) and (PM) then
|
||||||
Hr := Hr + 12; {!!.12}
|
Hr := Hr + 12;
|
||||||
if (Hr = 12) and (not PM) then {!!.12}
|
if (Hr = 12) and (not PM) then
|
||||||
Hr := 0; {!!.12}
|
Hr := 0;
|
||||||
end; {!!.12}
|
end;
|
||||||
|
|
||||||
{ check for errors or out of range }
|
{ check for errors or out of range }
|
||||||
if (Hr = -1) or (Mn = -1) or (Sc = -1) then Exit;
|
if (Hr = -1) or (Mn = -1) or (Sc = -1) then Exit;
|
||||||
@ -2871,7 +2869,7 @@ end;
|
|||||||
|
|
||||||
{***********************************************}
|
{***********************************************}
|
||||||
|
|
||||||
{cookie support} {!!.02}
|
{cookie support}
|
||||||
|
|
||||||
const
|
const
|
||||||
CookieDefaults: array [1..5] of string[8] =
|
CookieDefaults: array [1..5] of string[8] =
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user