MorePfsEnumeration.mesa
Copyright Ó 1990 by Xerox Corporation. All rights reserved.
Last tweaked by Mike Spreitzer on March 30, 1992 2:56 pm PST
DIRECTORY PFS;
MorePfsEnumeration: CEDAR DEFINITIONS
Offers an enumeration style where double-star (**) matches across directory boundaries.
= {OPEN PFS;
EnumerateForNames: Enumerator;
EnumerateForInfo: PROC [pattern: PATH, proc: InfoProc, lbound: PATHNIL, hbound: PATHNIL ];
Enumerator: TYPE ~ PROC [pattern: PATH, proc: NameProc, lbound: PATHNIL, hbound: PATHNIL];
Caser: TYPE ~ PROC [PATH] RETURNS [sensitive: BOOL];
ETester: TYPE ~ PROC [PATH] RETURNS [BOOL];
TransformEnumerator: PROC [base: Enumerator, caser: Caser, exists: ETester, pattern: PATH, proc: NameProc, lbound: PATHNIL, hbound: PATHNIL ];
Implements our kind of enumeration(for names) in terms of an old, stupid one (which cannot handle double-star, and can handle star only in the last component), passed in base. The caser reveals which names are case-sensitive. The ETester is a special case of the base enumerator that just tests whether one literal name would be enumerated.
PfsCaser: Caser;
PfsETester: ETester;
}.