TIdFTPListItems
Collection that encapsulates an FTP directory listing.
TIdFTPListItems = class(TCollection)
Unit
Description
TIdFTPListItems is a TCollection descendant that encapsulates an FTP directory listing, and contains individual
TIdFTPListItem objects for each entry in the listing.
File system directory represented by entries in the collection.
property DirectoryName: string;
Description
DirectoryName is a public String property that indicates the name of the file system directory represented by the entries in the collection. Use
Items to access the entries in the directory listing. Changing the value in DirectoryName causes the collection to be cleared.
Provides indexed access to directory entries in the collection.
Parameters
AIndex
Integer position in the collection to be accessed.
Description
Items is an indexed
TIdFTPListItem property that provides access to
TIdFTPListItem objects contained in the collection using the index specified in AIndex. They are usually created by the TIdFTPList.
LoadList method.
Indicates the directory listing format used when parsing in TIdFTPList.
LoadList.
Description
ListFormat is a
TIdFTPListFormat property that indicates the type of directory listing format that should be used when loading the directory listing with the
LoadList method. ListFormat us ised in
Parse to determine the appropriate parsing mechanism for directory entries in the collection.
ListFormat normally contains the the value returned by the TIdFTPList.CheckListFormat method.
The default value for ListFormat is flfUnix, as assigned in the Create constructor.
Creates a new directory listing entry and adds it to the collection.
Return Value
Description
Add is a
TIdFTPListItem function that creates a new entry for a formatted directory listing, and adds the object instance to the
Items in the collection.
Determines the appropriate directory list type.
function CheckListFormat(Data: string; const ADetails: Boolean = False): TIdFTPListFormat; virtual;
Parameters
Data: string
Return Value
Description
CheckListFormat is a
TIdFTPListFormat function that determines the appropriate directory list type to be used in the
LoadList and
Parse methods. CheckListFormat is called when
TIdFTP needs to load and parses a directory listing returned from the FTP server. To use this with the
LoadList, you need to set the
ListFormat property to the return value.
Constructor for the object instance.
constructor Create; overload;
Description
Create is the constructor for the object instance. Create calls the inherited constructor using
TIdFTPListItem as the ItemClass for the collection. Create also sets the default value for the
ListFormat property to flfUnix.
Returns the position of a directory entry in the collection.
Parameters
AItem: TIdFTPListItem
Directory entry to be located in the collection.
Return Value
Integer - Position of the item in the collection.
Description
IndexOf is an Integer function that returns the integer position of the directory entry specified in AItem in the
Items for the collection. IndexOf will return a value in the range 0 to Count - 1, or -1 when
Items does not contain a directory entry item that matches AItem.
Loads the Directory listing from a TStrings and parses it based on the value of TIdFTPList.
ListFormat.
procedure LoadList(AData: TStrings);
Parameters
AData: TStrings
The directory listing data to be parsed into the TIdFTPList.
Description
LoadList is a procedure used to load the Directory listing from the TStrings variable AData, and parses directory entries based on the value in TIdFTPList.
ListFormat. LoadList will create individual
TIdFTPListItem objects, and call the TIdFTPList.
Parse method.
Parses data for a directory entry using the specified
ListFormat.
Parameters
ListFormat: TIdFTPListFormat
AItem: TIdFTPListItem
The item that is to be parsed.
Description
This parses the data located in the AItem.Data using the specified layout in in the
ListFormat parameter.
Parameters
AItem: TIdFTPListItem
The item that is to be parsed.
Description
Parameters
AItem: TIdFTPListItem
The item that is to be parsed.
Description
Gets the text representation of an item in a custom directory listing.
Description
OnGetCustomListFormat is a
TIdOnGetCustomListFormat property that represents the event handler signalled when a
TIdFTPListItems collection needs to access the text representation of a custom list format for the contents of an FTP listing. The application may assign a procedure to the event handler to allow creation of a custom directory listing when
TIdFTPListItems.ListFormat contains the value flfCustom.
Event triggered when custom FTP parsing is desired.
Parameters
AItem
The
TIdFTPListItem object that you parse. You parse the Data property and set the other properties as appropriately.
ASender
The object that triggered the event
Description
OnParseCustomListFormat is an event handler triggered by the TIdFTPList.
ParseCustom method, and is normally triggered when the TIdFTPList.
ListFormat property contains flfCustom.