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< T >

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.
 
TShellItemIteratoroperator= (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 *iface)
 
 TComRef (const TComRef< IEnumIDList > &i)
 
TComRef< IEnumIDList > & operator= (IEnumIDList *iface)
 
TComRef< IEnumIDList > & operator= (const TComRef< IEnumIDList > &i)
 
IEnumIDListoperator-> ()
 
IEnumIDListoperator-> () const
 
- Public Member Functions inherited from owl::TComRefBase< T >
 operator T* ()
 
 operator T** ()
 
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< T >
 TComRefBase (const TComRefBase< T > &i)
 
 TComRefBase (T *i)
 
 TComRefBase ()
 
 ~TComRefBase ()
 
void Clear ()
 

Additional Inherited Members

- Protected Attributes inherited from owl::TComRefBase< T >
T * 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 565 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 571 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 1584 of file shellitm.cpp.

References 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 1603 of file shellitm.cpp.

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

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 1748 of file shellitm.cpp.

References _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 1889 of file shellitm.cpp.

References _T, CONST_CAST, owl::TComRefBase< T >::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 1870 of file shellitm.cpp.

References EnforceValidInterface().

◆ Next()

void owl::TShellItemIterator::Next ( )
protected

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

Definition at line 1762 of file shellitm.cpp.

References _T, owl::TXShell::Check(), CONST_CAST, EnforceValidInterface(), owl::TComRefBase< T >::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 1663 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 1678 of file shellitm.cpp.

References _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 1706 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 1725 of file shellitm.cpp.

References _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 1627 of file shellitm.cpp.

References _T, owl::TXShell::Check(), CONST_CAST, owl::TComRefBase< T >::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 1840 of file shellitm.cpp.

References _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 1815 of file shellitm.cpp.

References _T, owl::TXShell::Check(), CONST_CAST, EnforceValidInterface(), owl::TComRefBase< T >::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 1790 of file shellitm.cpp.

References _T, owl::TXShell::Check(), CONST_CAST, EnforceValidInterface(), owl::TComRefBase< T >::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 1171 of file shellitm.h.


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