#include <Dirent_Selector.h>
Collaboration diagram for ACE_Dirent_Selector:

Public Methods | |
| ACE_Dirent_Selector (void) | |
| Constructor. More... | |
| virtual | ~ACE_Dirent_Selector (void) |
| Destructor. More... | |
| int | length (void) const |
| Return the length of the list of matching directory entries. More... | |
| dirent * | operator[] (const int index) const |
| Return the entry at index. More... | |
| int | close (void) |
| Free up resources. More... | |
| int | open (const ACE_TCHAR *dir, int(*selector)(const dirent *d)=0, int(*comparator)(const dirent **d1, const dirent **d2)=0) |
| Open the directory dir and populate the <namelist_> array with directory entries that match the selector and comparator. More... | |
Protected Attributes | |
| dirent ** | namelist_ |
| Ptr to the namelist array. More... | |
| int | n_ |
| # of entries in the array. More... | |
Definition at line 31 of file Dirent_Selector.h.
|
|
Constructor.
Definition at line 17 of file Dirent_Selector.cpp.
|
|
|
Destructor.
Definition at line 23 of file Dirent_Selector.cpp.
00024 {
00025 }
|
|
|
Free up resources.
Definition at line 38 of file Dirent_Selector.cpp. References ACE_OS_Memory::free, and n_.
00039 {
00040 for (--n_; n_>=0; --n_)
00041 ACE_OS::free (this->namelist_[n_]);
00042
00043 ACE_OS::free (this->namelist_);
00044 return 0;
00045 }
|
|
|
Return the length of the list of matching directory entries.
Definition at line 6 of file Dirent_Selector.inl. References n_.
00007 {
00008 return n_;
00009 }
|
|
||||||||||||||||
|
Open the directory dir and populate the <namelist_> array with directory entries that match the selector and comparator.
Definition at line 28 of file Dirent_Selector.cpp. References ACE_TCHAR, n_, and ACE_OS_Dirent::scandir.
00032 {
00033 n_ = ACE_OS::scandir (dir, &this->namelist_, sel, cmp);
00034 return n_;
00035 }
|
|
|
Return the entry at index.
Definition at line 12 of file Dirent_Selector.inl. References namelist_.
00013 {
00014 return this->namelist_[n];
00015 }
|
|
|
# of entries in the array.
Definition at line 60 of file Dirent_Selector.h. |
|
|
Ptr to the namelist array.
Definition at line 57 of file Dirent_Selector.h. Referenced by operator[]. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002