{ $Project$ $Workfile$ $Revision$ $DateUTC$ $Id$ This file is part of the Indy (Internet Direct) project, and is offered under the dual-licensing agreement described on the Indy website. (http://www.indyproject.org/) Copyright: (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved. } { $Log$ } { Rev 1.6 12/5/2004 5:06:30 PM JPMugaas Tightened the detection for NCSA Telnet FTP Server for DOS. The parser was causing problems with SuperTCP because the formats are similar. By preventing SuperTCP from being detected, LongFilenames were not parsed in SuperTCP running on Windows 2000. Rev 1.5 10/26/2004 9:51:14 PM JPMugaas Updated refs. Rev 1.4 6/5/2004 4:45:22 PM JPMugaas Reports SizeAvail=False for directories in a list. As per the dir format. Rev 1.3 4/19/2004 5:05:58 PM JPMugaas Class rework Kudzu wanted. Rev 1.2 2004.02.03 5:45:32 PM czhower Name changes Rev 1.1 10/19/2003 3:36:04 PM DSiders Added localization comments. Rev 1.0 2/19/2003 10:13:38 PM JPMugaas Moved parsers to their own classes. } unit IdFTPListParseNCSAForDOS; interface {$i IdCompilerDefines.inc} uses Classes, IdFTPList, IdFTPListParseBase; type TIdNCSAforDOSFTPListItem = class(TIdFTPListItem); TIdFTPLPNCSAforDOS = class(TIdFTPListBaseHeader) protected class function MakeNewItem(AOwner : TIdFTPListItems) : TIdFTPListItem; override; class function IsHeader(const AData: String): Boolean; override; class function IsFooter(const AData : String): Boolean; override; class function ParseLine(const AItem : TIdFTPListItem; const APath : String = ''): Boolean; override; public class function CheckListing(AListing : TStrings; const ASysDescript : String = ''; const ADetails : Boolean = True): Boolean; override; class function GetIdent : String; override; end; // RLebeau 2/14/09: this forces C++Builder to link to this unit so // RegisterFTPListParser can be called correctly at program startup... {$IFDEF HAS_DIRECTIVE_HPPEMIT_LINKUNIT} {$HPPEMIT LINKUNIT} {$ELSE} {$HPPEMIT '#pragma link "IdFTPListParseNCSAForDOS"'} {$ENDIF} implementation uses IdGlobal, IdFTPCommon, IdGlobalProtocols, SysUtils; { TIdFTPLPNCSAforDOS } class function TIdFTPLPNCSAforDOS.CheckListing(AListing: TStrings; const ASysDescript: String; const ADetails: Boolean): Boolean; var s : TStrings; LData : String; i : Integer; begin Result := False; if AListing.Count > 0 then begin //we have to loop through because there is a similar format //in SuperTCP but that one has an additional field with spaces //for long filenames. for i := 0 to AListing.Count-2 do begin LData := AListing[i]; s := TStringList.Create; try SplitDelimitedString(LData, s, True); if s.Count = 4 then begin Result := ((s[1] = '