OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TShellItemIterator Class Reference

TShellItemIterator is an interator for walking through the contents of a folder. More...

#include <owl/shellitm.h>

Inheritance diagram for owl::TShellItemIterator:
owl::TComRef< IEnumIDList > owl::TComRefBase< IEnumIDList >

Public Types

enum  TIncludeKind { Folders = SHCONTF_FOLDERS , NonFolders = SHCONTF_NONFOLDERS , HiddenAndSystem = SHCONTF_INCLUDEHIDDEN }
 Used by TShellItemIterator::TShellItemIterator(const TShellItem& folder, HWND windowOwner = 0, const UINT kind = Folders | NonFolders) See MS doc for SHCONTF for more information, Programmer's Guide to MS Windows 95, MS Press, p. More...

Public Member Functions

 TShellItemIterator (const TShellItem &folder, HWND windowOwner=0, const int kind=Folders|NonFolders)
 TShellItemIterator constructor.
 TShellItemIterator (const TShellItemIterator &source)
 TShellItemIterator copy constructor.
TShellItemIterator & operator= (const TShellItemIterator &source)
 Assignment operator.
bool Valid () const
 True if iterator is still valid.
long GetCount () const
 Get number of TShellItems in the list.
TShellItem::TCreateStruct operator++ ()
 operator ++ increments the "cursor" in the iterator, then returns the item pointed to by the cursor
TShellItem::TCreateStruct operator++ (int)
 operator ++(int) returns the item pointed to by the "cursor," then increments the cursor.
TShellItem::TCreateStruct operator-- ()
 operator – decrements the "cursor" in the iterator, then returns the item pointed to by the cursor
TShellItem::TCreateStruct operator-- (int)
 operator –(int) returns the item pointed to by the "cursor," then decrements the cursor.
TShellItem::TCreateStruct operator[] (const long index)
 operator [] returns the item at the <index> location.
TShellItem::TCreateStruct Current ()
 operator Current returns the item pointed to by the "cursor"
void Skip (const ulong count)
 Skip count items.
void Reset ()
 Reset list.
Public Member Functions inherited from owl::TComRef< IEnumIDList >
 TComRef ()
TComRef< IEnumIDList > & operator= (IEnumIDList *iface)
IEnumIDList * operator-> ()
Public Member Functions inherited from owl::TComRefBase< IEnumIDList >
 operator IEnumIDList * ()
 operator IEnumIDList ** ()
int operator! () const
void operator delete (void *p)

Protected Member Functions

void Next ()
 Next is a protected function that increments the cursor. Equivalent to Skip(1).
void EnforceValidInterface () const
 EnforceValidInterface is a protected function that checks to see that this TShellItemIterator contains a valid IEnumIDList interface pointer.
Protected Member Functions inherited from owl::TComRefBase< IEnumIDList >
 TComRefBase (const TComRefBase< IEnumIDList > &i)
 ~TComRefBase ()
void Clear ()

Additional Inherited Members

Protected Attributes inherited from owl::TComRefBase< IEnumIDList >
IEnumIDList * I

Detailed Description

TShellItemIterator is an interator for walking through the contents of a folder.

A folder is a TShellItem whose IsFolder or ContainsSubFolder attributes are true.

Definition at line 570 of file shellitm.h.

Member Enumeration Documentation

◆ TIncludeKind

Used by TShellItemIterator::TShellItemIterator(const TShellItem& folder, HWND windowOwner = 0, const UINT kind = Folders | NonFolders) See MS doc for SHCONTF for more information, Programmer's Guide to MS Windows 95, MS Press, p.

Enumerator
Folders 

For shell browser.

NonFolders 

For default view.

HiddenAndSystem 

For hidden or system objects.

Definition at line 576 of file shellitm.h.

Constructor & Destructor Documentation

◆ TShellItemIterator() [1/2]

owl::TShellItemIterator::TShellItemIterator ( const TShellItem & folder,
HWND windowOwner = 0,
const int kind = Folders | NonFolders )

TShellItemIterator constructor.

Note
It is only meaningful to construct iterators on folders; therefore, if this constructor is passed a TShellItem that is not a folder, an exception will be thrown.

Additional Documentation: See MS doc on IEnumIDList for more info, Programmer's Guide to MS Windows 95, MS Press, pp. 199-201.

Definition at line 1621 of file shellitm.cpp.

References owl::TShellItem::EnumObjects(), and Next().

◆ TShellItemIterator() [2/2]

owl::TShellItemIterator::TShellItemIterator ( const TShellItemIterator & source)

TShellItemIterator copy constructor.

Note
This function does not work with the intial release of Win95 because Win95's IEnumIDList::Clone is broken (it returns E_FAIL (unspecified error))

Definition at line 1640 of file shellitm.cpp.

References TShellItemIterator(), owl::TComRefBase< T >::I, and owl::TComRefBase< IEnumIDList >::I.

Member Function Documentation

◆ Current()

TShellItem::TCreateStruct owl::TShellItemIterator::Current ( )

operator Current returns the item pointed to by the "cursor"

The item is returned as a TShellItem::TCreateStruct structure. For more information about TCreateStruct, see the comments in the TShellItem::TShellItem(const TCreateStruct& cs) constructor.

Definition at line 1785 of file shellitm.cpp.

References TShellItemIterator(), _T, CONST_CAST, EnforceValidInterface(), owl::TXShell::Raise(), STATIC_CAST, and WARNX.

◆ EnforceValidInterface()

void owl::TShellItemIterator::EnforceValidInterface ( ) const
protected

EnforceValidInterface is a protected function that checks to see that this TShellItemIterator contains a valid IEnumIDList interface pointer.

If it doesn't, it throws an exception.

Definition at line 1926 of file shellitm.cpp.

References TShellItemIterator(), _T, CONST_CAST, owl::TComRefBase< IEnumIDList >::I, owl::TXShell::Raise(), STATIC_CAST, and WARNX.

◆ GetCount()

long owl::TShellItemIterator::GetCount ( ) const

Get number of TShellItems in the list.

GetCount returns the number of items in the iterator's list.

Note
This function does not work with the intial release of Win95 because Clone and Reset are borken in the intitial Win95 release.

Definition at line 1907 of file shellitm.cpp.

References TShellItemIterator(), and EnforceValidInterface().

◆ Next()

void owl::TShellItemIterator::Next ( )
protected

Next is a protected function that increments the cursor. Equivalent to Skip(1).

Definition at line 1799 of file shellitm.cpp.

References TShellItemIterator(), _T, owl::TXShell::Check(), CONST_CAST, EnforceValidInterface(), owl::TComRefBase< IEnumIDList >::I, owl::TXShell::Raise(), STATIC_CAST, and WARNX.

◆ operator++() [1/2]

TShellItem::TCreateStruct owl::TShellItemIterator::operator++ ( )

operator ++ increments the "cursor" in the iterator, then returns the item pointed to by the cursor

The item is returned as a TShellItem::TCreateStruct structure. For more information about TCreateStruct, see the comments in the TShellItem::TShellItem(const TCreateStruct& cs) constructor.

Definition at line 1700 of file shellitm.cpp.

References EnforceValidInterface(), and operator[]().

◆ operator++() [2/2]

TShellItem::TCreateStruct owl::TShellItemIterator::operator++ ( int )

operator ++(int) returns the item pointed to by the "cursor," then increments the cursor.

The item is returned as a TShellItem::TCreateStruct structure. For more information about TCreateStruct, see the comments in the TShellItem::TShellItem(const TCreateStruct& cs) constructor.

Definition at line 1715 of file shellitm.cpp.

References TShellItemIterator(), _T, CONST_CAST, EnforceValidInterface(), Next(), owl::TXShell::Raise(), STATIC_CAST, and WARNX.

◆ operator--() [1/2]

TShellItem::TCreateStruct owl::TShellItemIterator::operator-- ( )

operator – decrements the "cursor" in the iterator, then returns the item pointed to by the cursor

The item is returned as a TShellItem::TCreateStruct structure. For more information about TCreateStruct, see the comments in the TShellItem::TShellItem(const TCreateStruct& cs) constructor.

Note
This function does not work with the intial release of Win95 because it requires IEnumIDList::Reset to be called and IEnumIDList::Reset returns E_NOTIMPL (not implemented) in the intitial Win95 release.

Definition at line 1743 of file shellitm.cpp.

References EnforceValidInterface(), and operator[]().

◆ operator--() [2/2]

TShellItem::TCreateStruct owl::TShellItemIterator::operator-- ( int )

operator –(int) returns the item pointed to by the "cursor," then decrements the cursor.

The item is returned as a TShellItem::TCreateStruct structure. For more information about TCreateStruct, see the comments in the TShellItem::TShellItem(const TCreateStruct& cs) constructor.

Note
This function does not work with the intial release of Win95 because it requires IEnumIDList::Reset to be called and IEnumIDList::Reset returns E_NOTIMPL (not implemented) in the intitial Win95 release.

Definition at line 1762 of file shellitm.cpp.

References TShellItemIterator(), _T, CONST_CAST, EnforceValidInterface(), Next(), owl::TXShell::Raise(), Reset(), Skip(), STATIC_CAST, and WARNX.

◆ operator=()

TShellItemIterator & owl::TShellItemIterator::operator= ( const TShellItemIterator & source)

Assignment operator.

TShellItemIterator assignment operator.

Note
This function does not work with the intial release of Win95 because Win95's IEnumIDList::Clone is broken (it returns E_FAIL (unspecified error))

Definition at line 1664 of file shellitm.cpp.

References TShellItemIterator(), _T, owl::TXShell::Check(), CONST_CAST, owl::TComRefBase< T >::I, owl::TComRefBase< IEnumIDList >::I, STATIC_CAST, and WARNX.

◆ operator[]()

TShellItem::TCreateStruct owl::TShellItemIterator::operator[] ( const long index)

operator [] returns the item at the <index> location.

index is zero based.

The item is returned as a TShellItem::TCreateStruct structure. For more information about TCreateStruct, see the comments in the TShellItem::TShellItem(const TCreateStruct& cs) constructor.

Note
operator[] doesn't work with the intial release of Win95 because it calls Skip and Reset wich are broken in the intial Win95 release. Both of these functions return E_NOTIMPL (not implemented). The only way operator[] will work is to call it sequentially, beginning at index 0 (i.e., to use it like operator ++().

Definition at line 1877 of file shellitm.cpp.

References TShellItemIterator(), _T, CONST_CAST, EnforceValidInterface(), Next(), owl::TXShell::Raise(), Reset(), Skip(), STATIC_CAST, and WARNX.

◆ Reset()

void owl::TShellItemIterator::Reset ( )

Reset list.

Reset resets the cursor to the beginning.

Note
This function does not work with the intial release of Win95 because IEnumIDList::Reset returns E_NOTIMPL (not implemented) in the intitial Win95 release.

Definition at line 1852 of file shellitm.cpp.

References TShellItemIterator(), _T, owl::TXShell::Check(), CONST_CAST, EnforceValidInterface(), owl::TComRefBase< IEnumIDList >::I, STATIC_CAST, and WARNX.

◆ Skip()

void owl::TShellItemIterator::Skip ( const ulong count)

Skip count items.

Skip advances the cursor <count> times.

Equivalent to calling Next <count> times.

Note
This function does not work with the intial release of Win95 because IEnumIDList::Skip returns E_NOTIMPL (not implemented) in the intitial Win95 release.

Definition at line 1827 of file shellitm.cpp.

References TShellItemIterator(), _T, owl::TXShell::Check(), CONST_CAST, EnforceValidInterface(), owl::TComRefBase< IEnumIDList >::I, STATIC_CAST, and WARNX.

◆ Valid()

bool owl::TShellItemIterator::Valid ( ) const
inline

True if iterator is still valid.

Return true if TShellItemIterator is valid and not at end of list of items.

Definition at line 1181 of file shellitm.h.


The documentation for this class was generated from the following files: