Welcome to the new DelphiDabbler Code Library Documentation.

This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.

Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.

TPJResourceFileEnumerator

Project: Resource File Unit

Unit: PJResFile.

Applies to: ~>1.1

This class implements an enumerator for TPJResourceFile objects. It enumerates all the resources entries of the associated TPJResourceFile instance.

The main purpose of this class is to be used in conjunction with TPJResourceFile’s GetEnumerator method to enable TPJResourceFile instances to be enumerated in a for..in statement. In this case the class is instantiated and used behind the scenes by the compiler.

Therefore in compilers that support the for..in statement (i.e. Delphi 2005 and later) there is rarely a need to use this class directly.

Users of earlier compilers can use the class directly from code. If this is done then the class must be instantiated via a call to TPJResourceFile.GetEnumerator - the constructor must not be called directly. See the TPJResourceFile.GetEnumerator documentation for an example of how to use TPJResourceFileEnumerator.

Methods

Method Description
Create Constructor. This method should not be called directly. It is called internally by TPJResourceFile.GetEnumerator to create a new enumerator instance.
MoveNext Moves the enumerator to the next item if one exists. Returns True if such an item exists or False if the enumeration has ended. In a new enumeration MoveNext must be called to move to the first item.
GetCurrent Returns the current item in the enumeration. It is an error to call this method before MoveNext has been called or if MoveNext returns False.

Property

Property Description
Current Read only. Returns the current item in the enumeration. It is an error to read this property before MoveNext has been called or if MoveNext returns False.