class FileIterator

This class allows to iterate over files and folders in the local file system.

It's working principle is that of any iterator. After you have created a valid iterator on a folder, you can step through the folder's contents and examine each file or subfolder.

Constructors

FileIterator (const Path, const int, const string)Constructs a new fileIterator object.

Methods

int Continue ()The iterator jumps to the next entry in the directory.
int HasAttribute (const int)Checks if the current iterator item has the specified file attribute.
int Rewind ()The iterator jumps back to the first entry in the directory.

Properties

DateTime CreationTime ()Returns the creation time of the current item.
int IsFolder ()Returns true if the current item is a directory.
int IsHidden ()Returns true if the current item is a hidden file.
int IsReadOnly ()Returns true if the current item is a read-only file.
int IsSystem ()Returns true if the current item is a system file.
DateTime LastAccessTime ()Returns the last access time of the current item.
int Length ()Returns the file length in bytes of the current iterator item.
DateTime ModificationTime ()Returns the last modification time of the current item.
string Name ()Returns only the name part of the current iterator item.
Path Path ()Returns the path of the current iterator item.
string ShortName ()Returns the short name (DOS 8+3) of the current iterator item.
int Valid ()Returns true if the iterator points to a valid entry in the directory.

Reference

method FileIterator (const Path path, const int mode, const string typeList)

Constructs a new fileIterator object.

Valid 'mode' constants are kFindFolders, kFindFiles, kFindReadOnly, kFindHidden, kFindSystem, kDefault (combines kFindFolder and kFindFiles), kAll (combines all flags). The 'typeList' can contain a comma-seperated list of file extensions to look for. To find files regardless of extension, pass an empty string.


method int Continue ()

The iterator jumps to the next entry in the directory.


method int HasAttribute (const int attribute)

Checks if the current iterator item has the specified file attribute.


method int Rewind ()

The iterator jumps back to the first entry in the directory.


accessor DateTime CreationTime ()

Returns the creation time of the current item.


accessor int IsFolder ()

Returns true if the current item is a directory.


accessor int IsHidden ()

Returns true if the current item is a hidden file.


accessor int IsReadOnly ()

Returns true if the current item is a read-only file.


accessor int IsSystem ()

Returns true if the current item is a system file.


accessor DateTime LastAccessTime ()

Returns the last access time of the current item.


accessor int Length ()

Returns the file length in bytes of the current iterator item.

Returns 0 if the current item is a subfolder.


accessor DateTime ModificationTime ()

Returns the last modification time of the current item.


accessor string Name ()

Returns only the name part of the current iterator item.


accessor Path Path ()

Returns the path of the current iterator item.


accessor string ShortName ()

Returns the short name (DOS 8+3) of the current iterator item.


accessor int Valid ()

Returns true if the iterator points to a valid entry in the directory.

If this returns false, the iterator has passed the last item in the directory.