#include <Dirent_Selector.h>
Public Member Functions | |
ACE_Dirent_Selector (void) | |
Constructor. | |
virtual | ~ACE_Dirent_Selector (void) |
Destructor. | |
int | length (void) const |
Return the length of the list of matching directory entries. | |
ACE_DIRENT * | operator[] (const int index) const |
Return the entry at index. | |
int | close (void) |
Free up resources. | |
int | open (const ACE_TCHAR *dir, ACE_SCANDIR_SELECTOR selector=0, ACE_SCANDIR_COMPARATOR comparator=0) |
Protected Attributes | |
ACE_DIRENT ** | namelist_ |
Ptr to the namelist array. | |
int | n_ |
Number of entries in the array. |
Definition at line 36 of file Dirent_Selector.h.
|
Constructor.
Definition at line 20 of file Dirent_Selector.cpp.
|
|
Destructor.
Definition at line 26 of file Dirent_Selector.cpp. References close().
00027 { 00028 // Free up any allocated resources. 00029 this->close(); 00030 } |
|
Free up resources.
Definition at line 42 of file Dirent_Selector.cpp. References ACE_OS::free(), n_, and namelist_. Referenced by ~ACE_Dirent_Selector().
00043 { 00044 for (--n_; n_ >= 0; --n_) 00045 { 00046 #if defined (ACE_LACKS_STRUCT_DIR) 00047 // Only the lacking-struct-dir emulation allocates this. Native 00048 // scandir includes d_name in the dirent struct itself. 00049 ACE_OS::free (this->namelist_[n_]->d_name); 00050 #endif 00051 ACE_OS::free (this->namelist_[n_]); 00052 } 00053 00054 ACE_OS::free (this->namelist_); 00055 this->namelist_ = 0; 00056 return 0; 00057 } |
|
Return the length of the list of matching directory entries.
Definition at line 8 of file Dirent_Selector.inl. References n_.
00009 { 00010 return n_; 00011 } |
|
Open the directory dir and populate the current list of names with directory entries that match the selector and comparator. Definition at line 33 of file Dirent_Selector.cpp. References ACE_SCANDIR_COMPARATOR, ACE_SCANDIR_SELECTOR, ACE_TCHAR, n_, and ACE_OS::scandir().
00036 { 00037 n_ = ACE_OS::scandir (dir, &this->namelist_, sel, cmp); 00038 return n_; 00039 } |
|
Return the entry at index.
Definition at line 14 of file Dirent_Selector.inl. References namelist_.
00015 { 00016 return this->namelist_[n]; 00017 } |
|
Number of entries in the array.
Definition at line 65 of file Dirent_Selector.h. |
|
Ptr to the namelist array.
Definition at line 62 of file Dirent_Selector.h. Referenced by close(), and operator[](). |