NAME

TUI::StdDlg::FileCollection - sorted collection of file system entries

HIERARCHY

TObject
  TCollection
    TSortedCollection
      TFileCollection

SYNOPSIS

use TUI::StdDlg;

my $files = new_TFileCollection(
  50,   # limit
  10    # delta
);

DESCRIPTION

TFileCollection implements a sorted collection used by standard TUI::Vision dialogs to manage file and directory search results.

The collection stores file system entries and maintains them in sorted order according to a comparison strategy defined by the class. It is primarily used internally by file selection and directory browsing dialogs.

This class derives from TSortedCollection and specializes the comparison logic for file-related data.

STRUCTURES

TSearchRec

Represents a file search record.

This structure stores metadata for a file system entry and is populated during directory and file searches performed by file collections.

The structure contains the following fields:

attr

Attribute flags associated with the file entry (Int).

time

Timestamp of the file entry (Int).

size

Size of the file in bytes (Int).

name

Name of the file entry (Str).

CONSTRUCTOR

new

my $collection = TUI::StdDlg::FileCollection->new(
  limit => $limit,
  delta => $delta
);

Creates a new file collection.

limit

Initial capacity of the collection (Int).

delta

Growth increment used when the collection exceeds its current capacity (Int).

new_TFileCollection

my $collection = new_TFileCollection($limit | undef, $delta | undef);

Factory-style constructor using positional arguments.

METHODS

compare

my $cmp = $collection->compare($key1, $key2);

Compares two file collection keys.

This method defines the sort order of the collection and is invoked internally by the base sorted collection logic. It returns a negative, zero, or positive value depending on the ordering of the supplied keys.

USAGE NOTES

TFileCollection is typically not used directly by application code.

Instances of this class are created and managed by standard dialog components such as file selection dialogs. Application code interacts with the dialog rather than the underlying collection.

SEE ALSO

TUI::StdDlg::FileDialog, TUI::Objects::SortedCollection, TUI::StdDlg::Const

AUTHORS

  • Borland International (original Turbo Vision design)

  • J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)

COPYRIGHT AND LICENSE

Copyright (c) 1990-1994, 1997 by Borland International

Copyright (c) 2026 the "AUTHORS" as listed above.

This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).