Class TFileList

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TFileList = class(TReferenceCounted)

Description

Provides a list of files and folders.
File lists usually contain a list of all files in a given folder, but can also contain a complete directory structure.

Hierarchy

Overview

Methods

Public function AddItem(const FullPath: StringType; Size: LongWord; IsDirectory: Boolean; ID: LongWord=0): LongWord; inline;
Public function FindFile(const FileName: StringType; IsFolder: Boolean=False): LongInt; inline;
Public function GetFileName(Index: LongWord): StringType; inline;
Public function GetFileSize(Index: LongWord): LongWord; inline;
Public function GetFullFileName(Index: LongWord): StringType; inline;
Public function GetID(Index: LongWord): LongWord; inline;
Public function IsDirectory(Index: LongWord): Boolean; inline;
Public procedure Sort; inline;

Properties

Public property Count: LongWord read GetFileCount;
Public property Path: StringType read GetPath;

Description

Methods

Public function AddItem(const FullPath: StringType; Size: LongWord; IsDirectory: Boolean; ID: LongWord=0): LongWord; inline;

Add as a file or folder to the list.

Parameters
FullPath
The file name including path, from the root of the file list.
Size
The size of the file in bytes.
IsDirectory
True if this is a directory rather than a file.
ID
The ID of the file in the archive which owns it.
Public function FindFile(const FileName: StringType; IsFolder: Boolean=False): LongInt; inline;

Searches for a file or folder in the list.

Parameters
FileName
The name of the file to search for.
IsFolder:
True if you are searching for a directory, false for a file.
Public function GetFileName(Index: LongWord): StringType; inline;

Gets the name of a file in the list, based on an index.
The path is not included in this name. Use GetFullFileName for this.

Parameters
Index
The zero based index of the file which name should be returned. The index must be less than than Count.
Returns

The file name, '' on error.

Public function GetFileSize(Index: LongWord): LongWord; inline;

Gets the size of a file in the list, based on an index.

Parameters
Index
The zero based index of the file which name should be returned. The index must be less than than Count.
Returns

The file size in bytes.

Public function GetFullFileName(Index: LongWord): StringType; inline;

Gets the full name of a file in the list, including the path, based on an index.

Parameters
Index
The zero based index of the file which name should be returned. The index must be less than than Count.
Returns

The file name, '' on error.

Public function GetID(Index: LongWord): LongWord; inline;

Returns the ID of a file in the file list, based on an index.
This optional ID can be used to link the file list entry to information held elsewhere. For example this could be an index in a TFileArchive, linking the entry to its data offset, uncompressed size and CRC.

Public function IsDirectory(Index: LongWord): Boolean; inline;

Returns whether an entry is a directory.

Public procedure Sort; inline;

Sorts the file list.
You should call this after adding any items to the file list.

Properties

Public property Count: LongWord read GetFileCount;

Amount of files and directories in the file list.

Public property Path: StringType read GetPath;

The base path of the file list.


Generated by PasDoc 0.12.1 on 2012-09-14 17:32:22